material-components-web.js 1.0 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142
  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. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  1272. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFloatingLabel", function() { return MDCFloatingLabel; });
  1273. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  1274. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(41);
  1275. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(87);
  1276. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFloatingLabelFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  1277. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1278. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1279. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1280. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  1281. /**
  1282. * @license
  1283. * Copyright 2016 Google Inc.
  1284. *
  1285. * Permission is hereby granted, free of charge, to any person obtaining a copy
  1286. * of this software and associated documentation files (the "Software"), to deal
  1287. * in the Software without restriction, including without limitation the rights
  1288. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  1289. * copies of the Software, and to permit persons to whom the Software is
  1290. * furnished to do so, subject to the following conditions:
  1291. *
  1292. * The above copyright notice and this permission notice shall be included in
  1293. * all copies or substantial portions of the Software.
  1294. *
  1295. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1296. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1297. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  1298. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1299. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  1300. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  1301. * THE SOFTWARE.
  1302. */
  1303. /**
  1304. * @extends {MDCComponent<!MDCFloatingLabelFoundation>}
  1305. * @final
  1306. */
  1307. var MDCFloatingLabel = function (_MDCComponent) {
  1308. _inherits(MDCFloatingLabel, _MDCComponent);
  1309. function MDCFloatingLabel() {
  1310. _classCallCheck(this, MDCFloatingLabel);
  1311. return _possibleConstructorReturn(this, (MDCFloatingLabel.__proto__ || Object.getPrototypeOf(MDCFloatingLabel)).apply(this, arguments));
  1312. }
  1313. _createClass(MDCFloatingLabel, [{
  1314. key: 'shake',
  1315. /**
  1316. * Styles the label to produce the label shake for errors.
  1317. * @param {boolean} shouldShake styles the label to shake by adding shake class
  1318. * if true, otherwise will stop shaking by removing shake class.
  1319. */
  1320. value: function shake(shouldShake) {
  1321. this.foundation_.shake(shouldShake);
  1322. }
  1323. /**
  1324. * Styles label to float/dock.
  1325. * @param {boolean} shouldFloat styles the label to float by adding float class
  1326. * if true, otherwise docks the label by removing the float class.
  1327. */
  1328. }, {
  1329. key: 'float',
  1330. value: function float(shouldFloat) {
  1331. this.foundation_.float(shouldFloat);
  1332. }
  1333. /**
  1334. * @return {number}
  1335. */
  1336. }, {
  1337. key: 'getWidth',
  1338. value: function getWidth() {
  1339. return this.foundation_.getWidth();
  1340. }
  1341. /**
  1342. * @return {!MDCFloatingLabelFoundation}
  1343. */
  1344. }, {
  1345. key: 'getDefaultFoundation',
  1346. value: function getDefaultFoundation() {
  1347. var _this2 = this;
  1348. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]({
  1349. addClass: function addClass(className) {
  1350. return _this2.root_.classList.add(className);
  1351. },
  1352. removeClass: function removeClass(className) {
  1353. return _this2.root_.classList.remove(className);
  1354. },
  1355. getWidth: function getWidth() {
  1356. return _this2.root_.offsetWidth;
  1357. },
  1358. registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
  1359. return _this2.root_.addEventListener(evtType, handler);
  1360. },
  1361. deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
  1362. return _this2.root_.removeEventListener(evtType, handler);
  1363. }
  1364. });
  1365. }
  1366. }], [{
  1367. key: 'attachTo',
  1368. /**
  1369. * @param {!Element} root
  1370. * @return {!MDCFloatingLabel}
  1371. */
  1372. value: function attachTo(root) {
  1373. return new MDCFloatingLabel(root);
  1374. }
  1375. }]);
  1376. return MDCFloatingLabel;
  1377. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  1378. /***/ }),
  1379. /* 11 */
  1380. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1381. "use strict";
  1382. /* unused harmony export MDCTabDimensions */
  1383. /* unused harmony export MDCTabAdapter */
  1384. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1385. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1386. /**
  1387. * @license
  1388. * Copyright 2018 Google Inc.
  1389. *
  1390. * Permission is hereby granted, free of charge, to any person obtaining a copy
  1391. * of this software and associated documentation files (the "Software"), to deal
  1392. * in the Software without restriction, including without limitation the rights
  1393. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  1394. * copies of the Software, and to permit persons to whom the Software is
  1395. * furnished to do so, subject to the following conditions:
  1396. *
  1397. * The above copyright notice and this permission notice shall be included in
  1398. * all copies or substantial portions of the Software.
  1399. *
  1400. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1401. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1402. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  1403. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1404. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  1405. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  1406. * THE SOFTWARE.
  1407. */
  1408. /* eslint no-unused-vars: [2, {"args": "none"}] */
  1409. /**
  1410. * MDCTabDimensions provides details about the left and right edges of the Tab
  1411. * root element and the Tab content element. These values are used to determine
  1412. * the visual position of the Tab with respect it's parent container.
  1413. * @typedef {{rootLeft: number, rootRight: number, contentLeft: number, contentRight: number}}
  1414. */
  1415. var MDCTabDimensions = void 0;
  1416. /**
  1417. * Adapter for MDC Tab.
  1418. *
  1419. * Defines the shape of the adapter expected by the foundation. Implement this
  1420. * adapter to integrate the Tab into your framework. See
  1421. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  1422. * for more information.
  1423. *
  1424. * @record
  1425. */
  1426. var MDCTabAdapter = function () {
  1427. function MDCTabAdapter() {
  1428. _classCallCheck(this, MDCTabAdapter);
  1429. }
  1430. _createClass(MDCTabAdapter, [{
  1431. key: "addClass",
  1432. /**
  1433. * Adds the given className to the root element.
  1434. * @param {string} className The className to add
  1435. */
  1436. value: function addClass(className) {}
  1437. /**
  1438. * Removes the given className from the root element.
  1439. * @param {string} className The className to remove
  1440. */
  1441. }, {
  1442. key: "removeClass",
  1443. value: function removeClass(className) {}
  1444. /**
  1445. * Returns whether the root element has the given className.
  1446. * @param {string} className The className to remove
  1447. * @return {boolean}
  1448. */
  1449. }, {
  1450. key: "hasClass",
  1451. value: function hasClass(className) {}
  1452. /**
  1453. * Sets the given attrName of the root element to the given value.
  1454. * @param {string} attr The attribute name to set
  1455. * @param {string} value The value so give the attribute
  1456. */
  1457. }, {
  1458. key: "setAttr",
  1459. value: function setAttr(attr, value) {}
  1460. /**
  1461. * Activates the indicator element.
  1462. * @param {!ClientRect=} previousIndicatorClientRect The client rect of the previously activated indicator
  1463. */
  1464. }, {
  1465. key: "activateIndicator",
  1466. value: function activateIndicator(previousIndicatorClientRect) {}
  1467. /** Deactivates the indicator. */
  1468. }, {
  1469. key: "deactivateIndicator",
  1470. value: function deactivateIndicator() {}
  1471. /**
  1472. * Emits the MDCTab:interacted event for use by parent components
  1473. */
  1474. }, {
  1475. key: "notifyInteracted",
  1476. value: function notifyInteracted() {}
  1477. /**
  1478. * Returns the offsetLeft value of the root element.
  1479. * @return {number}
  1480. */
  1481. }, {
  1482. key: "getOffsetLeft",
  1483. value: function getOffsetLeft() {}
  1484. /**
  1485. * Returns the offsetWidth value of the root element.
  1486. * @return {number}
  1487. */
  1488. }, {
  1489. key: "getOffsetWidth",
  1490. value: function getOffsetWidth() {}
  1491. /**
  1492. * Returns the offsetLeft of the content element.
  1493. * @return {number}
  1494. */
  1495. }, {
  1496. key: "getContentOffsetLeft",
  1497. value: function getContentOffsetLeft() {}
  1498. /**
  1499. * Returns the offsetWidth of the content element.
  1500. * @return {number}
  1501. */
  1502. }, {
  1503. key: "getContentOffsetWidth",
  1504. value: function getContentOffsetWidth() {}
  1505. /**
  1506. * Applies focus to the root element
  1507. */
  1508. }, {
  1509. key: "focus",
  1510. value: function focus() {}
  1511. }]);
  1512. return MDCTabAdapter;
  1513. }();
  1514. /***/ }),
  1515. /* 12 */
  1516. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1517. "use strict";
  1518. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__adapter__ = __webpack_require__(5);
  1519. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1520. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1521. /**
  1522. * @license
  1523. * Copyright 2018 Google Inc.
  1524. *
  1525. * Permission is hereby granted, free of charge, to any person obtaining a copy
  1526. * of this software and associated documentation files (the "Software"), to deal
  1527. * in the Software without restriction, including without limitation the rights
  1528. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  1529. * copies of the Software, and to permit persons to whom the Software is
  1530. * furnished to do so, subject to the following conditions:
  1531. *
  1532. * The above copyright notice and this permission notice shall be included in
  1533. * all copies or substantial portions of the Software.
  1534. *
  1535. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1536. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1537. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  1538. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1539. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  1540. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  1541. * THE SOFTWARE.
  1542. */
  1543. /* eslint no-unused-vars: [2, {"args": "none"}] */
  1544. /* eslint-disable no-unused-vars */
  1545. /* eslint-enable no-unused-vars */
  1546. /**
  1547. * @abstract
  1548. */
  1549. var MDCTabScrollerRTL = function () {
  1550. /** @param {!MDCTabScrollerAdapter} adapter */
  1551. function MDCTabScrollerRTL(adapter) {
  1552. _classCallCheck(this, MDCTabScrollerRTL);
  1553. /** @private */
  1554. this.adapter_ = adapter;
  1555. }
  1556. /**
  1557. * @param {number} translateX The current translateX position
  1558. * @return {number}
  1559. * @abstract
  1560. */
  1561. _createClass(MDCTabScrollerRTL, [{
  1562. key: 'getScrollPositionRTL',
  1563. value: function getScrollPositionRTL(translateX) {}
  1564. /**
  1565. * @param {number} scrollX
  1566. * @return {!MDCTabScrollerAnimation}
  1567. * @abstract
  1568. */
  1569. }, {
  1570. key: 'scrollToRTL',
  1571. value: function scrollToRTL(scrollX) {}
  1572. /**
  1573. * @param {number} scrollX
  1574. * @return {!MDCTabScrollerAnimation}
  1575. * @abstract
  1576. */
  1577. }, {
  1578. key: 'incrementScrollRTL',
  1579. value: function incrementScrollRTL(scrollX) {}
  1580. /**
  1581. * @param {number} scrollX The current scrollX position
  1582. * @param {number} translateX The current translateX position
  1583. * @return {number}
  1584. * @abstract
  1585. */
  1586. }, {
  1587. key: 'getAnimatingScrollPosition',
  1588. value: function getAnimatingScrollPosition(scrollX, translateX) {}
  1589. }]);
  1590. return MDCTabScrollerRTL;
  1591. }();
  1592. /* harmony default export */ __webpack_exports__["a"] = (MDCTabScrollerRTL);
  1593. /***/ }),
  1594. /* 13 */
  1595. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1596. "use strict";
  1597. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__constants__ = __webpack_require__(8);
  1598. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(7);
  1599. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_base_foundation__ = __webpack_require__(0);
  1600. 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; };
  1601. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1602. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1603. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1604. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  1605. /**
  1606. * @license
  1607. * Copyright 2018 Google Inc.
  1608. *
  1609. * Permission is hereby granted, free of charge, to any person obtaining a copy
  1610. * of this software and associated documentation files (the "Software"), to deal
  1611. * in the Software without restriction, including without limitation the rights
  1612. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  1613. * copies of the Software, and to permit persons to whom the Software is
  1614. * furnished to do so, subject to the following conditions:
  1615. *
  1616. * The above copyright notice and this permission notice shall be included in
  1617. * all copies or substantial portions of the Software.
  1618. *
  1619. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1620. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1621. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  1622. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1623. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  1624. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  1625. * THE SOFTWARE.
  1626. */
  1627. /**
  1628. * @extends {MDCFoundation<!MDCTopAppBarAdapter>}
  1629. */
  1630. var MDCTopAppBarBaseFoundation = function (_MDCFoundation) {
  1631. _inherits(MDCTopAppBarBaseFoundation, _MDCFoundation);
  1632. _createClass(MDCTopAppBarBaseFoundation, null, [{
  1633. key: 'strings',
  1634. /** @return enum {string} */
  1635. get: function get() {
  1636. return __WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */];
  1637. }
  1638. /** @return enum {string} */
  1639. }, {
  1640. key: 'cssClasses',
  1641. get: function get() {
  1642. return __WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */];
  1643. }
  1644. /** @return enum {number} */
  1645. }, {
  1646. key: 'numbers',
  1647. get: function get() {
  1648. return __WEBPACK_IMPORTED_MODULE_0__constants__["b" /* numbers */];
  1649. }
  1650. /**
  1651. * {@see MDCTopAppBarAdapter} for typing information on parameters and return
  1652. * types.
  1653. * @return {!MDCTopAppBarAdapter}
  1654. */
  1655. }, {
  1656. key: 'defaultAdapter',
  1657. get: function get() {
  1658. return (/** @type {!MDCTopAppBarAdapter} */{
  1659. hasClass: function hasClass() /* className: string */{},
  1660. addClass: function addClass() /* className: string */{},
  1661. removeClass: function removeClass() /* className: string */{},
  1662. setStyle: function setStyle() /* property: string, value: string */{},
  1663. getTopAppBarHeight: function getTopAppBarHeight() {},
  1664. registerNavigationIconInteractionHandler: function registerNavigationIconInteractionHandler() /* type: string, handler: EventListener */{},
  1665. deregisterNavigationIconInteractionHandler: function deregisterNavigationIconInteractionHandler() /* type: string, handler: EventListener */{},
  1666. notifyNavigationIconClicked: function notifyNavigationIconClicked() {},
  1667. registerScrollHandler: function registerScrollHandler() /* handler: EventListener */{},
  1668. deregisterScrollHandler: function deregisterScrollHandler() /* handler: EventListener */{},
  1669. registerResizeHandler: function registerResizeHandler() /* handler: EventListener */{},
  1670. deregisterResizeHandler: function deregisterResizeHandler() /* handler: EventListener */{},
  1671. getViewportScrollY: function getViewportScrollY() {
  1672. return (/* number */0
  1673. );
  1674. },
  1675. getTotalActionItems: function getTotalActionItems() {
  1676. return (/* number */0
  1677. );
  1678. }
  1679. }
  1680. );
  1681. }
  1682. /**
  1683. * @param {!MDCTopAppBarAdapter} adapter
  1684. */
  1685. }]);
  1686. function MDCTopAppBarBaseFoundation( /** @type {!MDCTopAppBarAdapter} */adapter) {
  1687. _classCallCheck(this, MDCTopAppBarBaseFoundation);
  1688. var _this = _possibleConstructorReturn(this, (MDCTopAppBarBaseFoundation.__proto__ || Object.getPrototypeOf(MDCTopAppBarBaseFoundation)).call(this, _extends(MDCTopAppBarBaseFoundation.defaultAdapter, adapter)));
  1689. _this.navClickHandler_ = function () {
  1690. return _this.adapter_.notifyNavigationIconClicked();
  1691. };
  1692. _this.scrollHandler_ = function () {};
  1693. return _this;
  1694. }
  1695. _createClass(MDCTopAppBarBaseFoundation, [{
  1696. key: 'init',
  1697. value: function init() {
  1698. this.adapter_.registerNavigationIconInteractionHandler('click', this.navClickHandler_);
  1699. }
  1700. }, {
  1701. key: 'destroy',
  1702. value: function destroy() {
  1703. this.adapter_.deregisterNavigationIconInteractionHandler('click', this.navClickHandler_);
  1704. }
  1705. }, {
  1706. key: 'initScrollHandler',
  1707. value: function initScrollHandler() {
  1708. this.adapter_.registerScrollHandler(this.scrollHandler_);
  1709. }
  1710. }, {
  1711. key: 'destroyScrollHandler',
  1712. value: function destroyScrollHandler() {
  1713. this.adapter_.deregisterScrollHandler(this.scrollHandler_);
  1714. }
  1715. }]);
  1716. return MDCTopAppBarBaseFoundation;
  1717. }(__WEBPACK_IMPORTED_MODULE_2__material_base_foundation__["a" /* default */]);
  1718. /* harmony default export */ __webpack_exports__["a"] = (MDCTopAppBarBaseFoundation);
  1719. /***/ }),
  1720. /* 14 */
  1721. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1722. "use strict";
  1723. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  1724. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "closest", function() { return closest; });
  1725. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "matches", function() { return matches; });
  1726. /**
  1727. * @license
  1728. * Copyright 2018 Google Inc.
  1729. *
  1730. * Permission is hereby granted, free of charge, to any person obtaining a copy
  1731. * of this software and associated documentation files (the "Software"), to deal
  1732. * in the Software without restriction, including without limitation the rights
  1733. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  1734. * copies of the Software, and to permit persons to whom the Software is
  1735. * furnished to do so, subject to the following conditions:
  1736. *
  1737. * The above copyright notice and this permission notice shall be included in
  1738. * all copies or substantial portions of the Software.
  1739. *
  1740. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1741. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1742. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  1743. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1744. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  1745. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  1746. * THE SOFTWARE.
  1747. */
  1748. /**
  1749. * @fileoverview A "ponyfill" is a polyfill that doesn't modify the global prototype chain.
  1750. * This makes ponyfills safer than traditional polyfills, especially for libraries like MDC.
  1751. */
  1752. /**
  1753. * @param {!Element} element
  1754. * @param {string} selector
  1755. * @return {?Element}
  1756. */
  1757. function closest(element, selector) {
  1758. if (element.closest) {
  1759. return element.closest(selector);
  1760. }
  1761. var el = element;
  1762. while (el) {
  1763. if (matches(el, selector)) {
  1764. return el;
  1765. }
  1766. el = el.parentElement;
  1767. }
  1768. return null;
  1769. }
  1770. /**
  1771. * @param {!Element} element
  1772. * @param {string} selector
  1773. * @return {boolean}
  1774. */
  1775. function matches(element, selector) {
  1776. var nativeMatches = element.matches || element.webkitMatchesSelector || element.msMatchesSelector;
  1777. return nativeMatches.call(element, selector);
  1778. }
  1779. /***/ }),
  1780. /* 15 */
  1781. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1782. "use strict";
  1783. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1784. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1785. /**
  1786. * @license
  1787. * Copyright 2018 Google Inc.
  1788. *
  1789. * Permission is hereby granted, free of charge, to any person obtaining a copy
  1790. * of this software and associated documentation files (the "Software"), to deal
  1791. * in the Software without restriction, including without limitation the rights
  1792. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  1793. * copies of the Software, and to permit persons to whom the Software is
  1794. * furnished to do so, subject to the following conditions:
  1795. *
  1796. * The above copyright notice and this permission notice shall be included in
  1797. * all copies or substantial portions of the Software.
  1798. *
  1799. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1800. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1801. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  1802. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1803. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  1804. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  1805. * THE SOFTWARE.
  1806. */
  1807. /* eslint no-unused-vars: [2, {"args": "none"}] */
  1808. /**
  1809. * Adapter for MDC Drawer
  1810. *
  1811. * Defines the shape of the adapter expected by the foundation. Implement this
  1812. * adapter to integrate the Drawer into your framework. See
  1813. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  1814. * for more information.
  1815. *
  1816. * @record
  1817. */
  1818. var MDCDrawerAdapter = function () {
  1819. function MDCDrawerAdapter() {
  1820. _classCallCheck(this, MDCDrawerAdapter);
  1821. }
  1822. _createClass(MDCDrawerAdapter, [{
  1823. key: "addClass",
  1824. /**
  1825. * Adds a class to the root Element.
  1826. * @param {string} className
  1827. */
  1828. value: function addClass(className) {}
  1829. /**
  1830. * Removes a class from the root Element.
  1831. * @param {string} className
  1832. */
  1833. }, {
  1834. key: "removeClass",
  1835. value: function removeClass(className) {}
  1836. /**
  1837. * Returns true if the root Element contains the given class.
  1838. * @param {string} className
  1839. * @return {boolean}
  1840. */
  1841. }, {
  1842. key: "hasClass",
  1843. value: function hasClass(className) {}
  1844. /**
  1845. * @param {!Element} element target element to verify class name
  1846. * @param {string} className class name
  1847. */
  1848. }, {
  1849. key: "elementHasClass",
  1850. value: function elementHasClass(element, className) {}
  1851. /**
  1852. * Saves the focus of currently active element.
  1853. */
  1854. }, {
  1855. key: "saveFocus",
  1856. value: function saveFocus() {}
  1857. /**
  1858. * Restores focus to element previously saved with 'saveFocus'.
  1859. */
  1860. }, {
  1861. key: "restoreFocus",
  1862. value: function restoreFocus() {}
  1863. /**
  1864. * Focuses the active / selected navigation item.
  1865. */
  1866. }, {
  1867. key: "focusActiveNavigationItem",
  1868. value: function focusActiveNavigationItem() {}
  1869. /**
  1870. * Emits a custom event "MDCDrawer:closed" denoting the drawer has closed.
  1871. */
  1872. }, {
  1873. key: "notifyClose",
  1874. value: function notifyClose() {}
  1875. /**
  1876. * Emits a custom event "MDCDrawer:opened" denoting the drawer has opened.
  1877. */
  1878. }, {
  1879. key: "notifyOpen",
  1880. value: function notifyOpen() {}
  1881. /**
  1882. * Traps focus on root element and focuses the active navigation element.
  1883. */
  1884. }, {
  1885. key: "trapFocus",
  1886. value: function trapFocus() {}
  1887. /**
  1888. * Releases focus trap from root element which was set by `trapFocus`
  1889. * and restores focus to where it was prior to calling `trapFocus`.
  1890. */
  1891. }, {
  1892. key: "releaseFocus",
  1893. value: function releaseFocus() {}
  1894. }]);
  1895. return MDCDrawerAdapter;
  1896. }();
  1897. /* unused harmony default export */ var _unused_webpack_default_export = (MDCDrawerAdapter);
  1898. /***/ }),
  1899. /* 16 */
  1900. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1901. "use strict";
  1902. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  1903. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCList", function() { return MDCList; });
  1904. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  1905. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(17);
  1906. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__adapter__ = __webpack_require__(38);
  1907. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_dom_ponyfill__ = __webpack_require__(14);
  1908. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__constants__ = __webpack_require__(39);
  1909. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCListFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  1910. 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; };
  1911. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1912. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1913. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1914. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  1915. /**
  1916. * @license
  1917. * Copyright 2018 Google Inc.
  1918. *
  1919. * Permission is hereby granted, free of charge, to any person obtaining a copy
  1920. * of this software and associated documentation files (the "Software"), to deal
  1921. * in the Software without restriction, including without limitation the rights
  1922. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  1923. * copies of the Software, and to permit persons to whom the Software is
  1924. * furnished to do so, subject to the following conditions:
  1925. *
  1926. * The above copyright notice and this permission notice shall be included in
  1927. * all copies or substantial portions of the Software.
  1928. *
  1929. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1930. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1931. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  1932. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1933. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  1934. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  1935. * THE SOFTWARE.
  1936. */
  1937. /**
  1938. * @extends MDCComponent<!MDCListFoundation>
  1939. */
  1940. var MDCList = function (_MDCComponent) {
  1941. _inherits(MDCList, _MDCComponent);
  1942. /** @param {...?} args */
  1943. function MDCList() {
  1944. var _ref;
  1945. _classCallCheck(this, MDCList);
  1946. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  1947. args[_key] = arguments[_key];
  1948. }
  1949. /** @private {!Function} */
  1950. var _this = _possibleConstructorReturn(this, (_ref = MDCList.__proto__ || Object.getPrototypeOf(MDCList)).call.apply(_ref, [this].concat(args)));
  1951. _this.handleKeydown_;
  1952. /** @private {!Function} */
  1953. _this.handleClick_;
  1954. /** @private {!Function} */
  1955. _this.focusInEventListener_;
  1956. /** @private {!Function} */
  1957. _this.focusOutEventListener_;
  1958. return _this;
  1959. }
  1960. /**
  1961. * @param {!Element} root
  1962. * @return {!MDCList}
  1963. */
  1964. _createClass(MDCList, [{
  1965. key: 'destroy',
  1966. value: function destroy() {
  1967. this.root_.removeEventListener('keydown', this.handleKeydown_);
  1968. this.root_.removeEventListener('click', this.handleClick_);
  1969. this.root_.removeEventListener('focusin', this.focusInEventListener_);
  1970. this.root_.removeEventListener('focusout', this.focusOutEventListener_);
  1971. }
  1972. }, {
  1973. key: 'initialSyncWithDOM',
  1974. value: function initialSyncWithDOM() {
  1975. this.handleClick_ = this.handleClickEvent_.bind(this);
  1976. this.handleKeydown_ = this.handleKeydownEvent_.bind(this);
  1977. this.focusInEventListener_ = this.handleFocusInEvent_.bind(this);
  1978. this.focusOutEventListener_ = this.handleFocusOutEvent_.bind(this);
  1979. this.root_.addEventListener('keydown', this.handleKeydown_);
  1980. this.root_.addEventListener('focusin', this.focusInEventListener_);
  1981. this.root_.addEventListener('focusout', this.focusOutEventListener_);
  1982. this.root_.addEventListener('click', this.handleClick_);
  1983. this.layout();
  1984. this.initializeListType();
  1985. }
  1986. }, {
  1987. key: 'layout',
  1988. value: function layout() {
  1989. var direction = this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].ARIA_ORIENTATION);
  1990. this.vertical = direction !== __WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].ARIA_ORIENTATION_HORIZONTAL;
  1991. // List items need to have at least tabindex=-1 to be focusable.
  1992. [].slice.call(this.root_.querySelectorAll('.mdc-list-item:not([tabindex])')).forEach(function (ele) {
  1993. ele.setAttribute('tabindex', -1);
  1994. });
  1995. // Child button/a elements are not tabbable until the list item is focused.
  1996. [].slice.call(this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].FOCUSABLE_CHILD_ELEMENTS)).forEach(function (ele) {
  1997. return ele.setAttribute('tabindex', -1);
  1998. });
  1999. }
  2000. /**
  2001. * Used to figure out which list item this event is targetting. Or returns -1 if
  2002. * there is no list item
  2003. * @param {Event} evt
  2004. * @private
  2005. */
  2006. }, {
  2007. key: 'getListItemIndex_',
  2008. value: function getListItemIndex_(evt) {
  2009. var eventTarget = /** @type {HTMLElement} */evt.target;
  2010. var index = -1;
  2011. // Find the first ancestor that is a list item or the list.
  2012. 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)) {
  2013. eventTarget = eventTarget.parentElement;
  2014. }
  2015. // Get the index of the element if it is a list item.
  2016. if (eventTarget.classList.contains(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].LIST_ITEM_CLASS)) {
  2017. index = this.listElements.indexOf(eventTarget);
  2018. }
  2019. return index;
  2020. }
  2021. /**
  2022. * Used to figure out which element was clicked before sending the event to the foundation.
  2023. * @param {Event} evt
  2024. * @private
  2025. */
  2026. }, {
  2027. key: 'handleFocusInEvent_',
  2028. value: function handleFocusInEvent_(evt) {
  2029. var index = this.getListItemIndex_(evt);
  2030. this.foundation_.handleFocusIn(evt, index);
  2031. }
  2032. /**
  2033. * Used to figure out which element was clicked before sending the event to the foundation.
  2034. * @param {Event} evt
  2035. * @private
  2036. */
  2037. }, {
  2038. key: 'handleFocusOutEvent_',
  2039. value: function handleFocusOutEvent_(evt) {
  2040. var index = this.getListItemIndex_(evt);
  2041. this.foundation_.handleFocusOut(evt, index);
  2042. }
  2043. /**
  2044. * Used to figure out which element was focused when keydown event occurred before sending the event to the
  2045. * foundation.
  2046. * @param {Event} evt
  2047. * @private
  2048. */
  2049. }, {
  2050. key: 'handleKeydownEvent_',
  2051. value: function handleKeydownEvent_(evt) {
  2052. var index = this.getListItemIndex_(evt);
  2053. if (index >= 0) {
  2054. this.foundation_.handleKeydown(evt, evt.target.classList.contains(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].LIST_ITEM_CLASS), index);
  2055. }
  2056. }
  2057. /**
  2058. * Used to figure out which element was clicked before sending the event to the foundation.
  2059. * @param {Event} evt
  2060. * @private
  2061. */
  2062. }, {
  2063. key: 'handleClickEvent_',
  2064. value: function handleClickEvent_(evt) {
  2065. var index = this.getListItemIndex_(evt);
  2066. // Toggle the checkbox only if it's not the target of the event, or the checkbox will have 2 change events.
  2067. 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);
  2068. this.foundation_.handleClick(index, toggleCheckbox);
  2069. }
  2070. }, {
  2071. key: 'initializeListType',
  2072. value: function initializeListType() {
  2073. // Pre-selected list item in single selected list or checked list item if list with radio input.
  2074. var preselectedElement = this.root_.querySelector('.' + __WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].LIST_ITEM_ACTIVATED_CLASS + ',\n .' + __WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].LIST_ITEM_SELECTED_CLASS + ',\n ' + __WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].ARIA_CHECKED_RADIO_SELECTOR);
  2075. if (preselectedElement) {
  2076. if (preselectedElement.classList.contains(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].LIST_ITEM_ACTIVATED_CLASS)) {
  2077. this.foundation_.setUseActivatedClass(true);
  2078. }
  2079. this.singleSelection = true;
  2080. // Automatically set selected index if single select list type or list with radio inputs.
  2081. this.selectedIndex = this.listElements.indexOf(preselectedElement);
  2082. }
  2083. }
  2084. /** @param {boolean} value */
  2085. }, {
  2086. key: 'getDefaultFoundation',
  2087. /** @return {!MDCListFoundation} */
  2088. value: function getDefaultFoundation() {
  2089. var _this2 = this;
  2090. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]( /** @type {!MDCListAdapter} */_extends({
  2091. getListItemCount: function getListItemCount() {
  2092. return _this2.listElements.length;
  2093. },
  2094. getFocusedElementIndex: function getFocusedElementIndex() {
  2095. return _this2.listElements.indexOf(document.activeElement);
  2096. },
  2097. setAttributeForElementIndex: function setAttributeForElementIndex(index, attr, value) {
  2098. var element = _this2.listElements[index];
  2099. if (element) {
  2100. element.setAttribute(attr, value);
  2101. }
  2102. },
  2103. removeAttributeForElementIndex: function removeAttributeForElementIndex(index, attr) {
  2104. var element = _this2.listElements[index];
  2105. if (element) {
  2106. element.removeAttribute(attr);
  2107. }
  2108. },
  2109. addClassForElementIndex: function addClassForElementIndex(index, className) {
  2110. var element = _this2.listElements[index];
  2111. if (element) {
  2112. element.classList.add(className);
  2113. }
  2114. },
  2115. removeClassForElementIndex: function removeClassForElementIndex(index, className) {
  2116. var element = _this2.listElements[index];
  2117. if (element) {
  2118. element.classList.remove(className);
  2119. }
  2120. },
  2121. focusItemAtIndex: function focusItemAtIndex(index) {
  2122. var element = _this2.listElements[index];
  2123. if (element) {
  2124. element.focus();
  2125. }
  2126. },
  2127. setTabIndexForListItemChildren: function setTabIndexForListItemChildren(listItemIndex, tabIndexValue) {
  2128. var element = _this2.listElements[listItemIndex];
  2129. var listItemChildren = [].slice.call(element.querySelectorAll(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].CHILD_ELEMENTS_TO_TOGGLE_TABINDEX));
  2130. listItemChildren.forEach(function (ele) {
  2131. return ele.setAttribute('tabindex', tabIndexValue);
  2132. });
  2133. },
  2134. followHref: function followHref(index) {
  2135. var listItem = _this2.listElements[index];
  2136. if (listItem && listItem.href) {
  2137. listItem.click();
  2138. }
  2139. },
  2140. hasCheckboxAtIndex: function hasCheckboxAtIndex(index) {
  2141. var listItem = _this2.listElements[index];
  2142. return !!listItem.querySelector(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].CHECKBOX_SELECTOR);
  2143. },
  2144. hasRadioAtIndex: function hasRadioAtIndex(index) {
  2145. var listItem = _this2.listElements[index];
  2146. return !!listItem.querySelector(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].RADIO_SELECTOR);
  2147. },
  2148. isCheckboxCheckedAtIndex: function isCheckboxCheckedAtIndex(index) {
  2149. var listItem = _this2.listElements[index];
  2150. var toggleEl = listItem.querySelector(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].CHECKBOX_SELECTOR);
  2151. return toggleEl.checked;
  2152. },
  2153. setCheckedCheckboxOrRadioAtIndex: function setCheckedCheckboxOrRadioAtIndex(index, isChecked) {
  2154. var listItem = _this2.listElements[index];
  2155. var toggleEl = listItem.querySelector(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].CHECKBOX_RADIO_SELECTOR);
  2156. toggleEl.checked = isChecked;
  2157. var event = document.createEvent('Event');
  2158. event.initEvent('change', true, true);
  2159. toggleEl.dispatchEvent(event);
  2160. }
  2161. }));
  2162. }
  2163. }, {
  2164. key: 'vertical',
  2165. set: function set(value) {
  2166. this.foundation_.setVerticalOrientation(value);
  2167. }
  2168. /** @return Array<!Element>*/
  2169. }, {
  2170. key: 'listElements',
  2171. get: function get() {
  2172. return [].slice.call(this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].ENABLED_ITEMS_SELECTOR));
  2173. }
  2174. /** @param {boolean} value */
  2175. }, {
  2176. key: 'wrapFocus',
  2177. set: function set(value) {
  2178. this.foundation_.setWrapFocus(value);
  2179. }
  2180. /** @param {boolean} isSingleSelectionList */
  2181. }, {
  2182. key: 'singleSelection',
  2183. set: function set(isSingleSelectionList) {
  2184. this.foundation_.setSingleSelection(isSingleSelectionList);
  2185. }
  2186. /** @param {number} index */
  2187. }, {
  2188. key: 'selectedIndex',
  2189. set: function set(index) {
  2190. this.foundation_.setSelectedIndex(index);
  2191. }
  2192. }], [{
  2193. key: 'attachTo',
  2194. value: function attachTo(root) {
  2195. return new MDCList(root);
  2196. }
  2197. }]);
  2198. return MDCList;
  2199. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  2200. /***/ }),
  2201. /* 17 */
  2202. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2203. "use strict";
  2204. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  2205. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(38);
  2206. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(39);
  2207. 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; };
  2208. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  2209. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2210. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  2211. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  2212. /**
  2213. * @license
  2214. * Copyright 2018 Google Inc.
  2215. *
  2216. * Permission is hereby granted, free of charge, to any person obtaining a copy
  2217. * of this software and associated documentation files (the "Software"), to deal
  2218. * in the Software without restriction, including without limitation the rights
  2219. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  2220. * copies of the Software, and to permit persons to whom the Software is
  2221. * furnished to do so, subject to the following conditions:
  2222. *
  2223. * The above copyright notice and this permission notice shall be included in
  2224. * all copies or substantial portions of the Software.
  2225. *
  2226. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  2227. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  2228. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  2229. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  2230. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  2231. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  2232. * THE SOFTWARE.
  2233. */
  2234. var ELEMENTS_KEY_ALLOWED_IN = ['input', 'button', 'textarea', 'select'];
  2235. var MDCListFoundation = function (_MDCFoundation) {
  2236. _inherits(MDCListFoundation, _MDCFoundation);
  2237. _createClass(MDCListFoundation, null, [{
  2238. key: 'strings',
  2239. /** @return enum {string} */
  2240. get: function get() {
  2241. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  2242. }
  2243. /** @return enum {string} */
  2244. }, {
  2245. key: 'cssClasses',
  2246. get: function get() {
  2247. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  2248. }
  2249. /**
  2250. * {@see MDCListAdapter} for typing information on parameters and return
  2251. * types.
  2252. * @return {!MDCListAdapter}
  2253. */
  2254. }, {
  2255. key: 'defaultAdapter',
  2256. get: function get() {
  2257. return (/** @type {!MDCListAdapter} */{
  2258. getListItemCount: function getListItemCount() {},
  2259. getFocusedElementIndex: function getFocusedElementIndex() {},
  2260. setAttributeForElementIndex: function setAttributeForElementIndex() {},
  2261. removeAttributeForElementIndex: function removeAttributeForElementIndex() {},
  2262. addClassForElementIndex: function addClassForElementIndex() {},
  2263. removeClassForElementIndex: function removeClassForElementIndex() {},
  2264. focusItemAtIndex: function focusItemAtIndex() {},
  2265. setTabIndexForListItemChildren: function setTabIndexForListItemChildren() {},
  2266. followHref: function followHref() {},
  2267. hasRadioAtIndex: function hasRadioAtIndex() {},
  2268. hasCheckboxAtIndex: function hasCheckboxAtIndex() {},
  2269. isCheckboxCheckedAtIndex: function isCheckboxCheckedAtIndex() {},
  2270. setCheckedCheckboxOrRadioAtIndex: function setCheckedCheckboxOrRadioAtIndex() {}
  2271. }
  2272. );
  2273. }
  2274. /**
  2275. * @param {!MDCListAdapter=} adapter
  2276. */
  2277. }]);
  2278. function MDCListFoundation(adapter) {
  2279. _classCallCheck(this, MDCListFoundation);
  2280. /** {boolean} */
  2281. var _this = _possibleConstructorReturn(this, (MDCListFoundation.__proto__ || Object.getPrototypeOf(MDCListFoundation)).call(this, _extends(MDCListFoundation.defaultAdapter, adapter)));
  2282. _this.wrapFocus_ = false;
  2283. /** {boolean} */
  2284. _this.isVertical_ = true;
  2285. /** {boolean} */
  2286. _this.isSingleSelectionList_ = false;
  2287. /** {number} */
  2288. _this.selectedIndex_ = -1;
  2289. /** {boolean} */
  2290. _this.useActivatedClass_ = false;
  2291. return _this;
  2292. }
  2293. /**
  2294. * Sets the private wrapFocus_ variable.
  2295. * @param {boolean} value
  2296. */
  2297. _createClass(MDCListFoundation, [{
  2298. key: 'setWrapFocus',
  2299. value: function setWrapFocus(value) {
  2300. this.wrapFocus_ = value;
  2301. }
  2302. /**
  2303. * Sets the isVertical_ private variable.
  2304. * @param {boolean} value
  2305. */
  2306. }, {
  2307. key: 'setVerticalOrientation',
  2308. value: function setVerticalOrientation(value) {
  2309. this.isVertical_ = value;
  2310. }
  2311. /**
  2312. * Sets the isSingleSelectionList_ private variable.
  2313. * @param {boolean} value
  2314. */
  2315. }, {
  2316. key: 'setSingleSelection',
  2317. value: function setSingleSelection(value) {
  2318. this.isSingleSelectionList_ = value;
  2319. }
  2320. /**
  2321. * Sets the useActivatedClass_ private variable.
  2322. * @param {boolean} useActivated
  2323. */
  2324. }, {
  2325. key: 'setUseActivatedClass',
  2326. value: function setUseActivatedClass(useActivated) {
  2327. this.useActivatedClass_ = useActivated;
  2328. }
  2329. /** @param {number} index */
  2330. }, {
  2331. key: 'setSelectedIndex',
  2332. value: function setSelectedIndex(index) {
  2333. if (index < 0 || index >= this.adapter_.getListItemCount()) return;
  2334. if (this.adapter_.hasCheckboxAtIndex(index)) {
  2335. this.setAriaAttributesForCheckbox_(index);
  2336. } else if (this.adapter_.hasRadioAtIndex(index)) {
  2337. this.setAriaAttributesForRadio_(index);
  2338. } else {
  2339. this.setAriaAttributesForSingleSelect_(index);
  2340. this.setClassNamesForSingleSelect_(index);
  2341. }
  2342. if (this.selectedIndex_ >= 0 && this.selectedIndex_ !== index) {
  2343. this.adapter_.setAttributeForElementIndex(this.selectedIndex_, 'tabindex', -1);
  2344. } else if (this.selectedIndex_ === -1 && index !== 0) {
  2345. // If no list item was selected set first list item's tabindex to -1.
  2346. // Generally, tabindex is set to 0 on first list item of list that has no preselected items.
  2347. this.adapter_.setAttributeForElementIndex(0, 'tabindex', -1);
  2348. }
  2349. this.adapter_.setAttributeForElementIndex(index, 'tabindex', 0);
  2350. this.selectedIndex_ = index;
  2351. }
  2352. /**
  2353. * @param {number} index
  2354. * @private
  2355. */
  2356. }, {
  2357. key: 'setAriaAttributesForCheckbox_',
  2358. value: function setAriaAttributesForCheckbox_(index) {
  2359. var ariaAttributeValue = this.adapter_.isCheckboxCheckedAtIndex(index) ? 'true' : 'false';
  2360. this.adapter_.setAttributeForElementIndex(index, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_CHECKED, ariaAttributeValue);
  2361. }
  2362. /**
  2363. * @param {number} index
  2364. * @private
  2365. */
  2366. }, {
  2367. key: 'setAriaAttributesForRadio_',
  2368. value: function setAriaAttributesForRadio_(index) {
  2369. if (this.selectedIndex_ >= 0) {
  2370. this.adapter_.setAttributeForElementIndex(this.selectedIndex_, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_CHECKED, 'false');
  2371. }
  2372. this.adapter_.setAttributeForElementIndex(index, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_CHECKED, 'true');
  2373. }
  2374. /**
  2375. * @param {number} index
  2376. * @private
  2377. */
  2378. }, {
  2379. key: 'setAriaAttributesForSingleSelect_',
  2380. value: function setAriaAttributesForSingleSelect_(index) {
  2381. if (this.selectedIndex_ >= 0 && this.selectedIndex_ !== index) {
  2382. this.adapter_.setAttributeForElementIndex(this.selectedIndex_, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_SELECTED, 'false');
  2383. }
  2384. this.adapter_.setAttributeForElementIndex(index, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_SELECTED, 'true');
  2385. }
  2386. /**
  2387. * @param {number} index
  2388. * @private
  2389. */
  2390. }, {
  2391. key: 'setClassNamesForSingleSelect_',
  2392. value: function setClassNamesForSingleSelect_(index) {
  2393. var selectedClassName = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LIST_ITEM_SELECTED_CLASS;
  2394. if (this.useActivatedClass_) {
  2395. selectedClassName = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LIST_ITEM_ACTIVATED_CLASS;
  2396. }
  2397. if (this.selectedIndex_ >= 0) {
  2398. this.adapter_.removeClassForElementIndex(this.selectedIndex_, selectedClassName);
  2399. }
  2400. this.adapter_.addClassForElementIndex(index, selectedClassName);
  2401. }
  2402. /**
  2403. * Focus in handler for the list items.
  2404. * @param evt
  2405. * @param {number} listItemIndex
  2406. */
  2407. }, {
  2408. key: 'handleFocusIn',
  2409. value: function handleFocusIn(evt, listItemIndex) {
  2410. if (listItemIndex >= 0) {
  2411. this.adapter_.setTabIndexForListItemChildren(listItemIndex, 0);
  2412. }
  2413. }
  2414. /**
  2415. * Focus out handler for the list items.
  2416. * @param {Event} evt
  2417. * @param {number} listItemIndex
  2418. */
  2419. }, {
  2420. key: 'handleFocusOut',
  2421. value: function handleFocusOut(evt, listItemIndex) {
  2422. if (listItemIndex >= 0) {
  2423. this.adapter_.setTabIndexForListItemChildren(listItemIndex, -1);
  2424. }
  2425. }
  2426. /**
  2427. * Key handler for the list.
  2428. * @param {Event} evt
  2429. * @param {boolean} isRootListItem
  2430. * @param {number} listItemIndex
  2431. */
  2432. }, {
  2433. key: 'handleKeydown',
  2434. value: function handleKeydown(evt, isRootListItem, listItemIndex) {
  2435. var arrowLeft = evt.key === 'ArrowLeft' || evt.keyCode === 37;
  2436. var arrowUp = evt.key === 'ArrowUp' || evt.keyCode === 38;
  2437. var arrowRight = evt.key === 'ArrowRight' || evt.keyCode === 39;
  2438. var arrowDown = evt.key === 'ArrowDown' || evt.keyCode === 40;
  2439. var isHome = evt.key === 'Home' || evt.keyCode === 36;
  2440. var isEnd = evt.key === 'End' || evt.keyCode === 35;
  2441. var isEnter = evt.key === 'Enter' || evt.keyCode === 13;
  2442. var isSpace = evt.key === 'Space' || evt.keyCode === 32;
  2443. var currentIndex = this.adapter_.getFocusedElementIndex();
  2444. if (currentIndex === -1) {
  2445. currentIndex = listItemIndex;
  2446. if (currentIndex < 0) {
  2447. // If this event doesn't have a mdc-list-item ancestor from the
  2448. // current list (not from a sublist), return early.
  2449. return;
  2450. }
  2451. }
  2452. if (this.isVertical_ && arrowDown || !this.isVertical_ && arrowRight) {
  2453. this.preventDefaultEvent_(evt);
  2454. this.focusNextElement(currentIndex);
  2455. } else if (this.isVertical_ && arrowUp || !this.isVertical_ && arrowLeft) {
  2456. this.preventDefaultEvent_(evt);
  2457. this.focusPrevElement(currentIndex);
  2458. } else if (isHome) {
  2459. this.preventDefaultEvent_(evt);
  2460. this.focusFirstElement();
  2461. } else if (isEnd) {
  2462. this.preventDefaultEvent_(evt);
  2463. this.focusLastElement();
  2464. } else if (isEnter || isSpace) {
  2465. if (isRootListItem) {
  2466. if (this.isSingleSelectionList_) {
  2467. // Check if the space key was pressed on the list item or a child element.
  2468. this.preventDefaultEvent_(evt);
  2469. }
  2470. var hasCheckboxOrRadio = this.hasCheckboxOrRadioAtIndex_(listItemIndex);
  2471. if (hasCheckboxOrRadio) {
  2472. this.toggleCheckboxOrRadioAtIndex_(listItemIndex);
  2473. this.preventDefaultEvent_(evt);
  2474. }
  2475. if (this.isSingleSelectionList_ || hasCheckboxOrRadio) {
  2476. this.setSelectedIndex(currentIndex);
  2477. }
  2478. // Explicitly activate links, since we're preventing default on Enter, and Space doesn't activate them.
  2479. this.adapter_.followHref(currentIndex);
  2480. }
  2481. }
  2482. }
  2483. /**
  2484. * Click handler for the list.
  2485. * @param {number} index
  2486. * @param {boolean} toggleCheckbox
  2487. */
  2488. }, {
  2489. key: 'handleClick',
  2490. value: function handleClick(index, toggleCheckbox) {
  2491. if (index === -1) return;
  2492. if (toggleCheckbox) {
  2493. this.toggleCheckboxOrRadioAtIndex_(index);
  2494. }
  2495. if (this.isSingleSelectionList_ || this.hasCheckboxOrRadioAtIndex_(index)) {
  2496. this.setSelectedIndex(index);
  2497. }
  2498. }
  2499. /**
  2500. * Ensures that preventDefault is only called if the containing element doesn't
  2501. * consume the event, and it will cause an unintended scroll.
  2502. * @param {Event} evt
  2503. * @private
  2504. */
  2505. }, {
  2506. key: 'preventDefaultEvent_',
  2507. value: function preventDefaultEvent_(evt) {
  2508. var tagName = ('' + evt.target.tagName).toLowerCase();
  2509. if (ELEMENTS_KEY_ALLOWED_IN.indexOf(tagName) === -1) {
  2510. evt.preventDefault();
  2511. }
  2512. }
  2513. /**
  2514. * Focuses the next element on the list.
  2515. * @param {number} index
  2516. */
  2517. }, {
  2518. key: 'focusNextElement',
  2519. value: function focusNextElement(index) {
  2520. var count = this.adapter_.getListItemCount();
  2521. var nextIndex = index + 1;
  2522. if (nextIndex >= count) {
  2523. if (this.wrapFocus_) {
  2524. nextIndex = 0;
  2525. } else {
  2526. // Return early because last item is already focused.
  2527. return;
  2528. }
  2529. }
  2530. this.adapter_.focusItemAtIndex(nextIndex);
  2531. }
  2532. /**
  2533. * Focuses the previous element on the list.
  2534. * @param {number} index
  2535. */
  2536. }, {
  2537. key: 'focusPrevElement',
  2538. value: function focusPrevElement(index) {
  2539. var prevIndex = index - 1;
  2540. if (prevIndex < 0) {
  2541. if (this.wrapFocus_) {
  2542. prevIndex = this.adapter_.getListItemCount() - 1;
  2543. } else {
  2544. // Return early because first item is already focused.
  2545. return;
  2546. }
  2547. }
  2548. this.adapter_.focusItemAtIndex(prevIndex);
  2549. }
  2550. }, {
  2551. key: 'focusFirstElement',
  2552. value: function focusFirstElement() {
  2553. if (this.adapter_.getListItemCount() > 0) {
  2554. this.adapter_.focusItemAtIndex(0);
  2555. }
  2556. }
  2557. }, {
  2558. key: 'focusLastElement',
  2559. value: function focusLastElement() {
  2560. var lastIndex = this.adapter_.getListItemCount() - 1;
  2561. if (lastIndex >= 0) {
  2562. this.adapter_.focusItemAtIndex(lastIndex);
  2563. }
  2564. }
  2565. /**
  2566. * Toggles checkbox or radio at give index. Radio doesn't change the checked state if it is already checked.
  2567. * @param {number} index
  2568. * @private
  2569. */
  2570. }, {
  2571. key: 'toggleCheckboxOrRadioAtIndex_',
  2572. value: function toggleCheckboxOrRadioAtIndex_(index) {
  2573. if (!this.hasCheckboxOrRadioAtIndex_(index)) return;
  2574. var isChecked = true;
  2575. if (this.adapter_.hasCheckboxAtIndex(index)) {
  2576. isChecked = !this.adapter_.isCheckboxCheckedAtIndex(index);
  2577. }
  2578. this.adapter_.setCheckedCheckboxOrRadioAtIndex(index, isChecked);
  2579. }
  2580. /**
  2581. * @param {number} index
  2582. * @return {boolean} Return true if list item contains checkbox or radio input at given index.
  2583. */
  2584. }, {
  2585. key: 'hasCheckboxOrRadioAtIndex_',
  2586. value: function hasCheckboxOrRadioAtIndex_(index) {
  2587. return this.adapter_.hasCheckboxAtIndex(index) || this.adapter_.hasRadioAtIndex(index);
  2588. }
  2589. }]);
  2590. return MDCListFoundation;
  2591. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  2592. /* harmony default export */ __webpack_exports__["a"] = (MDCListFoundation);
  2593. /***/ }),
  2594. /* 18 */
  2595. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2596. "use strict";
  2597. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  2598. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCLineRipple", function() { return MDCLineRipple; });
  2599. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  2600. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(42);
  2601. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(107);
  2602. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCLineRippleFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  2603. 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; };
  2604. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  2605. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2606. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  2607. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  2608. /**
  2609. * @license
  2610. * Copyright 2018 Google Inc.
  2611. *
  2612. * Permission is hereby granted, free of charge, to any person obtaining a copy
  2613. * of this software and associated documentation files (the "Software"), to deal
  2614. * in the Software without restriction, including without limitation the rights
  2615. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  2616. * copies of the Software, and to permit persons to whom the Software is
  2617. * furnished to do so, subject to the following conditions:
  2618. *
  2619. * The above copyright notice and this permission notice shall be included in
  2620. * all copies or substantial portions of the Software.
  2621. *
  2622. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  2623. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  2624. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  2625. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  2626. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  2627. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  2628. * THE SOFTWARE.
  2629. */
  2630. /**
  2631. * @extends {MDCComponent<!MDCLineRippleFoundation>}
  2632. * @final
  2633. */
  2634. var MDCLineRipple = function (_MDCComponent) {
  2635. _inherits(MDCLineRipple, _MDCComponent);
  2636. function MDCLineRipple() {
  2637. _classCallCheck(this, MDCLineRipple);
  2638. return _possibleConstructorReturn(this, (MDCLineRipple.__proto__ || Object.getPrototypeOf(MDCLineRipple)).apply(this, arguments));
  2639. }
  2640. _createClass(MDCLineRipple, [{
  2641. key: 'activate',
  2642. /**
  2643. * Activates the line ripple
  2644. */
  2645. value: function activate() {
  2646. this.foundation_.activate();
  2647. }
  2648. /**
  2649. * Deactivates the line ripple
  2650. */
  2651. }, {
  2652. key: 'deactivate',
  2653. value: function deactivate() {
  2654. this.foundation_.deactivate();
  2655. }
  2656. /**
  2657. * Sets the transform origin given a user's click location. The `rippleCenter` is the
  2658. * x-coordinate of the middle of the ripple.
  2659. * @param {number} xCoordinate
  2660. */
  2661. }, {
  2662. key: 'setRippleCenter',
  2663. value: function setRippleCenter(xCoordinate) {
  2664. this.foundation_.setRippleCenter(xCoordinate);
  2665. }
  2666. /**
  2667. * @return {!MDCLineRippleFoundation}
  2668. */
  2669. }, {
  2670. key: 'getDefaultFoundation',
  2671. value: function getDefaultFoundation() {
  2672. var _this2 = this;
  2673. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]( /** @type {!MDCLineRippleAdapter} */_extends({
  2674. addClass: function addClass(className) {
  2675. return _this2.root_.classList.add(className);
  2676. },
  2677. removeClass: function removeClass(className) {
  2678. return _this2.root_.classList.remove(className);
  2679. },
  2680. hasClass: function hasClass(className) {
  2681. return _this2.root_.classList.contains(className);
  2682. },
  2683. setStyle: function setStyle(propertyName, value) {
  2684. return _this2.root_.style[propertyName] = value;
  2685. },
  2686. registerEventHandler: function registerEventHandler(evtType, handler) {
  2687. return _this2.root_.addEventListener(evtType, handler);
  2688. },
  2689. deregisterEventHandler: function deregisterEventHandler(evtType, handler) {
  2690. return _this2.root_.removeEventListener(evtType, handler);
  2691. }
  2692. }));
  2693. }
  2694. }], [{
  2695. key: 'attachTo',
  2696. /**
  2697. * @param {!Element} root
  2698. * @return {!MDCLineRipple}
  2699. */
  2700. value: function attachTo(root) {
  2701. return new MDCLineRipple(root);
  2702. }
  2703. }]);
  2704. return MDCLineRipple;
  2705. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  2706. /***/ }),
  2707. /* 19 */
  2708. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2709. "use strict";
  2710. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  2711. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  2712. /**
  2713. * @license
  2714. * Copyright 2018 Google Inc.
  2715. *
  2716. * Permission is hereby granted, free of charge, to any person obtaining a copy
  2717. * of this software and associated documentation files (the "Software"), to deal
  2718. * in the Software without restriction, including without limitation the rights
  2719. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  2720. * copies of the Software, and to permit persons to whom the Software is
  2721. * furnished to do so, subject to the following conditions:
  2722. *
  2723. * The above copyright notice and this permission notice shall be included in
  2724. * all copies or substantial portions of the Software.
  2725. *
  2726. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  2727. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  2728. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  2729. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  2730. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  2731. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  2732. * THE SOFTWARE.
  2733. */
  2734. /** @enum {string} */
  2735. var cssClasses = {
  2736. ROOT: 'mdc-menu',
  2737. MENU_SELECTED_LIST_ITEM: 'mdc-menu-item--selected',
  2738. MENU_SELECTION_GROUP: 'mdc-menu__selection-group'
  2739. };
  2740. /** @enum {string} */
  2741. var strings = {
  2742. SELECTED_EVENT: 'MDCMenu:selected',
  2743. ARIA_SELECTED_ATTR: 'aria-selected',
  2744. LIST_SELECTOR: '.mdc-list',
  2745. CHECKBOX_SELECTOR: 'input[type="checkbox"]'
  2746. };
  2747. /***/ }),
  2748. /* 20 */
  2749. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2750. "use strict";
  2751. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return MDCMenuSurfaceFoundation; });
  2752. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AnchorMargin; });
  2753. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  2754. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(44);
  2755. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(21);
  2756. 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; };
  2757. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  2758. 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; }
  2759. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2760. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  2761. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  2762. /**
  2763. * @license
  2764. * Copyright 2018 Google Inc.
  2765. *
  2766. * Permission is hereby granted, free of charge, to any person obtaining a copy
  2767. * of this software and associated documentation files (the "Software"), to deal
  2768. * in the Software without restriction, including without limitation the rights
  2769. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  2770. * copies of the Software, and to permit persons to whom the Software is
  2771. * furnished to do so, subject to the following conditions:
  2772. *
  2773. * The above copyright notice and this permission notice shall be included in
  2774. * all copies or substantial portions of the Software.
  2775. *
  2776. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  2777. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  2778. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  2779. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  2780. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  2781. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  2782. * THE SOFTWARE.
  2783. */
  2784. /**
  2785. * @typedef {{
  2786. * top: number,
  2787. * right: number,
  2788. * bottom: number,
  2789. * left: number
  2790. * }}
  2791. */
  2792. var AnchorMargin = void 0;
  2793. /* eslint-disable no-unused-vars */
  2794. /**
  2795. * @typedef {{
  2796. * viewport: { width: number, height: number },
  2797. * viewportDistance: {top: number, right: number, bottom: number, left: number},
  2798. * anchorHeight: number,
  2799. * anchorWidth: number,
  2800. * surfaceHeight: number,
  2801. * surfaceWidth: number,
  2802. * bodyDimensions,
  2803. * windowScroll,
  2804. * }}
  2805. */
  2806. var AutoLayoutMeasurements = void 0;
  2807. /* eslint-enable no-unused-vars */
  2808. /**
  2809. * @extends {MDCFoundation<!MDCMenuSurfaceAdapter>}
  2810. */
  2811. var MDCMenuSurfaceFoundation = function (_MDCFoundation) {
  2812. _inherits(MDCMenuSurfaceFoundation, _MDCFoundation);
  2813. _createClass(MDCMenuSurfaceFoundation, null, [{
  2814. key: 'cssClasses',
  2815. /** @return enum{cssClasses} */
  2816. get: function get() {
  2817. return __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* cssClasses */];
  2818. }
  2819. /** @return enum{string} */
  2820. }, {
  2821. key: 'strings',
  2822. get: function get() {
  2823. return __WEBPACK_IMPORTED_MODULE_2__constants__["e" /* strings */];
  2824. }
  2825. /** @return enum {number} */
  2826. }, {
  2827. key: 'numbers',
  2828. get: function get() {
  2829. return __WEBPACK_IMPORTED_MODULE_2__constants__["d" /* numbers */];
  2830. }
  2831. /** @return enum{number} */
  2832. }, {
  2833. key: 'Corner',
  2834. get: function get() {
  2835. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* Corner */];
  2836. }
  2837. /**
  2838. * {@see MDCMenuSurfaceAdapter} for typing information on parameters and return
  2839. * types.
  2840. * @return {!MDCMenuSurfaceAdapter}
  2841. */
  2842. }, {
  2843. key: 'defaultAdapter',
  2844. get: function get() {
  2845. return (/** @type {!MDCMenuSurfaceAdapter} */{
  2846. addClass: function addClass() {},
  2847. removeClass: function removeClass() {},
  2848. hasClass: function hasClass() {
  2849. return false;
  2850. },
  2851. hasAnchor: function hasAnchor() {
  2852. return false;
  2853. },
  2854. notifyClose: function notifyClose() {},
  2855. notifyOpen: function notifyOpen() {},
  2856. isElementInContainer: function isElementInContainer() {
  2857. return false;
  2858. },
  2859. isRtl: function isRtl() {
  2860. return false;
  2861. },
  2862. setTransformOrigin: function setTransformOrigin() {},
  2863. isFocused: function isFocused() {
  2864. return false;
  2865. },
  2866. saveFocus: function saveFocus() {},
  2867. restoreFocus: function restoreFocus() {},
  2868. isFirstElementFocused: function isFirstElementFocused() {},
  2869. isLastElementFocused: function isLastElementFocused() {},
  2870. focusFirstElement: function focusFirstElement() {},
  2871. focusLastElement: function focusLastElement() {},
  2872. getInnerDimensions: function getInnerDimensions() {
  2873. return {};
  2874. },
  2875. getAnchorDimensions: function getAnchorDimensions() {
  2876. return {};
  2877. },
  2878. getWindowDimensions: function getWindowDimensions() {
  2879. return {};
  2880. },
  2881. getBodyDimensions: function getBodyDimensions() {
  2882. return {};
  2883. },
  2884. getWindowScroll: function getWindowScroll() {
  2885. return {};
  2886. },
  2887. setPosition: function setPosition() {},
  2888. setMaxHeight: function setMaxHeight() {}
  2889. }
  2890. );
  2891. }
  2892. /** @param {!MDCMenuSurfaceAdapter} adapter */
  2893. }]);
  2894. function MDCMenuSurfaceFoundation(adapter) {
  2895. _classCallCheck(this, MDCMenuSurfaceFoundation);
  2896. /** @private {boolean} */
  2897. var _this = _possibleConstructorReturn(this, (MDCMenuSurfaceFoundation.__proto__ || Object.getPrototypeOf(MDCMenuSurfaceFoundation)).call(this, _extends(MDCMenuSurfaceFoundation.defaultAdapter, adapter)));
  2898. _this.isOpen_ = false;
  2899. /** @private {number} */
  2900. _this.openAnimationEndTimerId_ = 0;
  2901. /** @private {number} */
  2902. _this.closeAnimationEndTimerId_ = 0;
  2903. /** @private {number} */
  2904. _this.animationRequestId_ = 0;
  2905. /** @private {!{ width: number, height: number }} */
  2906. _this.dimensions_;
  2907. /** @private {!Corner} */
  2908. _this.anchorCorner_ = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* Corner */].TOP_START;
  2909. /** @private {!AnchorMargin} */
  2910. _this.anchorMargin_ = { top: 0, right: 0, bottom: 0, left: 0 };
  2911. /** @private {?AutoLayoutMeasurements} */
  2912. _this.measures_ = null;
  2913. /** @private {boolean} */
  2914. _this.quickOpen_ = false;
  2915. /** @private {boolean} */
  2916. _this.hoistedElement_ = false;
  2917. /** @private {boolean} */
  2918. _this.isFixedPosition_ = false;
  2919. /** @private {!{x: number, y: number}} */
  2920. _this.position_ = { x: 0, y: 0 };
  2921. return _this;
  2922. }
  2923. _createClass(MDCMenuSurfaceFoundation, [{
  2924. key: 'init',
  2925. value: function init() {
  2926. var _MDCMenuSurfaceFounda = MDCMenuSurfaceFoundation.cssClasses,
  2927. ROOT = _MDCMenuSurfaceFounda.ROOT,
  2928. OPEN = _MDCMenuSurfaceFounda.OPEN;
  2929. if (!this.adapter_.hasClass(ROOT)) {
  2930. throw new Error(ROOT + ' class required in root element.');
  2931. }
  2932. if (this.adapter_.hasClass(OPEN)) {
  2933. this.isOpen_ = true;
  2934. }
  2935. }
  2936. }, {
  2937. key: 'destroy',
  2938. value: function destroy() {
  2939. clearTimeout(this.openAnimationEndTimerId_);
  2940. clearTimeout(this.closeAnimationEndTimerId_);
  2941. // Cancel any currently running animations.
  2942. cancelAnimationFrame(this.animationRequestId_);
  2943. }
  2944. /**
  2945. * @param {!Corner} corner Default anchor corner alignment of top-left menu surface corner.
  2946. */
  2947. }, {
  2948. key: 'setAnchorCorner',
  2949. value: function setAnchorCorner(corner) {
  2950. this.anchorCorner_ = corner;
  2951. }
  2952. /**
  2953. * @param {!AnchorMargin} margin set of margin values from anchor.
  2954. */
  2955. }, {
  2956. key: 'setAnchorMargin',
  2957. value: function setAnchorMargin(margin) {
  2958. this.anchorMargin_.top = typeof margin.top === 'number' ? margin.top : 0;
  2959. this.anchorMargin_.right = typeof margin.right === 'number' ? margin.right : 0;
  2960. this.anchorMargin_.bottom = typeof margin.bottom === 'number' ? margin.bottom : 0;
  2961. this.anchorMargin_.left = typeof margin.left === 'number' ? margin.left : 0;
  2962. }
  2963. /**
  2964. * Used to indicate if the menu-surface is hoisted to the body.
  2965. * @param {boolean} isHoisted
  2966. */
  2967. }, {
  2968. key: 'setIsHoisted',
  2969. value: function setIsHoisted(isHoisted) {
  2970. this.hoistedElement_ = isHoisted;
  2971. }
  2972. /**
  2973. * Used to set the menu-surface calculations based on a fixed position menu.
  2974. * @param {boolean} isFixedPosition
  2975. */
  2976. }, {
  2977. key: 'setFixedPosition',
  2978. value: function setFixedPosition(isFixedPosition) {
  2979. this.isFixedPosition_ = isFixedPosition;
  2980. }
  2981. /**
  2982. * Sets the menu-surface position on the page.
  2983. * @param {number} x
  2984. * @param {number} y
  2985. */
  2986. }, {
  2987. key: 'setAbsolutePosition',
  2988. value: function setAbsolutePosition(x, y) {
  2989. this.position_.x = this.typeCheckisFinite_(x) ? x : 0;
  2990. this.position_.y = this.typeCheckisFinite_(y) ? y : 0;
  2991. }
  2992. /** @param {boolean} quickOpen */
  2993. }, {
  2994. key: 'setQuickOpen',
  2995. value: function setQuickOpen(quickOpen) {
  2996. this.quickOpen_ = quickOpen;
  2997. }
  2998. /**
  2999. * Handle clicks and close if not within menu-surface element.
  3000. * @param {!Event} evt
  3001. */
  3002. }, {
  3003. key: 'handleBodyClick',
  3004. value: function handleBodyClick(evt) {
  3005. var el = evt.target;
  3006. if (this.adapter_.isElementInContainer(el)) {
  3007. return;
  3008. }
  3009. this.close();
  3010. }
  3011. }, {
  3012. key: 'handleKeydown',
  3013. /**
  3014. * Handle keys that close the surface.
  3015. * @param {!Event} evt
  3016. */
  3017. value: function handleKeydown(evt) {
  3018. var keyCode = evt.keyCode,
  3019. key = evt.key,
  3020. shiftKey = evt.shiftKey;
  3021. var isEscape = key === 'Escape' || keyCode === 27;
  3022. var isTab = key === 'Tab' || keyCode === 9;
  3023. if (isEscape) {
  3024. this.close();
  3025. } else if (isTab) {
  3026. if (this.adapter_.isLastElementFocused() && !shiftKey) {
  3027. this.adapter_.focusFirstElement();
  3028. evt.preventDefault();
  3029. } else if (this.adapter_.isFirstElementFocused() && shiftKey) {
  3030. this.adapter_.focusLastElement();
  3031. evt.preventDefault();
  3032. }
  3033. }
  3034. }
  3035. /**
  3036. * @return {!AutoLayoutMeasurements} Measurements used to position menu surface popup.
  3037. */
  3038. }, {
  3039. key: 'getAutoLayoutMeasurements_',
  3040. value: function getAutoLayoutMeasurements_() {
  3041. var anchorRect = this.adapter_.getAnchorDimensions();
  3042. var viewport = this.adapter_.getWindowDimensions();
  3043. var bodyDimensions = this.adapter_.getBodyDimensions();
  3044. var windowScroll = this.adapter_.getWindowScroll();
  3045. if (!anchorRect) {
  3046. anchorRect = /** @type {ClientRect} */{
  3047. x: this.position_.x,
  3048. y: this.position_.y,
  3049. top: this.position_.y,
  3050. bottom: this.position_.y,
  3051. left: this.position_.x,
  3052. right: this.position_.x,
  3053. height: 0,
  3054. width: 0
  3055. };
  3056. }
  3057. return {
  3058. viewport: viewport,
  3059. bodyDimensions: bodyDimensions,
  3060. windowScroll: windowScroll,
  3061. viewportDistance: {
  3062. top: anchorRect.top,
  3063. right: viewport.width - anchorRect.right,
  3064. left: anchorRect.left,
  3065. bottom: viewport.height - anchorRect.bottom
  3066. },
  3067. anchorHeight: anchorRect.height,
  3068. anchorWidth: anchorRect.width,
  3069. surfaceHeight: this.dimensions_.height,
  3070. surfaceWidth: this.dimensions_.width
  3071. };
  3072. }
  3073. /**
  3074. * Computes the corner of the anchor from which to animate and position the menu surface.
  3075. * @return {!Corner}
  3076. * @private
  3077. */
  3078. }, {
  3079. key: 'getOriginCorner_',
  3080. value: function getOriginCorner_() {
  3081. // Defaults: open from the top left.
  3082. var corner = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* Corner */].TOP_LEFT;
  3083. var _measures_ = this.measures_,
  3084. viewportDistance = _measures_.viewportDistance,
  3085. anchorHeight = _measures_.anchorHeight,
  3086. anchorWidth = _measures_.anchorWidth,
  3087. surfaceHeight = _measures_.surfaceHeight,
  3088. surfaceWidth = _measures_.surfaceWidth;
  3089. var isBottomAligned = Boolean(this.anchorCorner_ & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM);
  3090. var availableTop = isBottomAligned ? viewportDistance.top + anchorHeight + this.anchorMargin_.bottom : viewportDistance.top + this.anchorMargin_.top;
  3091. var availableBottom = isBottomAligned ? viewportDistance.bottom - this.anchorMargin_.bottom : viewportDistance.bottom + anchorHeight - this.anchorMargin_.top;
  3092. var topOverflow = surfaceHeight - availableTop;
  3093. var bottomOverflow = surfaceHeight - availableBottom;
  3094. if (bottomOverflow > 0 && topOverflow < bottomOverflow) {
  3095. corner |= __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM;
  3096. }
  3097. var isRtl = this.adapter_.isRtl();
  3098. var isFlipRtl = Boolean(this.anchorCorner_ & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].FLIP_RTL);
  3099. var avoidHorizontalOverlap = Boolean(this.anchorCorner_ & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].RIGHT);
  3100. var isAlignedRight = avoidHorizontalOverlap && !isRtl || !avoidHorizontalOverlap && isFlipRtl && isRtl;
  3101. var availableLeft = isAlignedRight ? viewportDistance.left + anchorWidth + this.anchorMargin_.right : viewportDistance.left + this.anchorMargin_.left;
  3102. var availableRight = isAlignedRight ? viewportDistance.right - this.anchorMargin_.right : viewportDistance.right + anchorWidth - this.anchorMargin_.left;
  3103. var leftOverflow = surfaceWidth - availableLeft;
  3104. var rightOverflow = surfaceWidth - availableRight;
  3105. if (leftOverflow < 0 && isAlignedRight && isRtl || avoidHorizontalOverlap && !isAlignedRight && leftOverflow < 0 || rightOverflow > 0 && leftOverflow < rightOverflow) {
  3106. corner |= __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].RIGHT;
  3107. }
  3108. return (/** @type {Corner} */corner
  3109. );
  3110. }
  3111. /**
  3112. * @param {!Corner} corner Origin corner of the menu surface.
  3113. * @return {number} Horizontal offset of menu surface origin corner from corresponding anchor corner.
  3114. * @private
  3115. */
  3116. }, {
  3117. key: 'getHorizontalOriginOffset_',
  3118. value: function getHorizontalOriginOffset_(corner) {
  3119. var anchorWidth = this.measures_.anchorWidth;
  3120. // isRightAligned corresponds to using the 'right' property on the surface.
  3121. var isRightAligned = Boolean(corner & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].RIGHT);
  3122. var avoidHorizontalOverlap = Boolean(this.anchorCorner_ & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].RIGHT);
  3123. if (isRightAligned) {
  3124. var rightOffset = avoidHorizontalOverlap ? anchorWidth - this.anchorMargin_.left : this.anchorMargin_.right;
  3125. // For hoisted or fixed elements, adjust the offset by the difference between viewport width and body width so
  3126. // when we calculate the right value (`adjustPositionForHoistedElement_`) based on the element position,
  3127. // the right property is correct.
  3128. if (this.hoistedElement_ || this.isFixedPosition_) {
  3129. return rightOffset - (this.measures_.viewport.width - this.measures_.bodyDimensions.width);
  3130. }
  3131. return rightOffset;
  3132. }
  3133. return avoidHorizontalOverlap ? anchorWidth - this.anchorMargin_.right : this.anchorMargin_.left;
  3134. }
  3135. /**
  3136. * @param {!Corner} corner Origin corner of the menu surface.
  3137. * @return {number} Vertical offset of menu surface origin corner from corresponding anchor corner.
  3138. * @private
  3139. */
  3140. }, {
  3141. key: 'getVerticalOriginOffset_',
  3142. value: function getVerticalOriginOffset_(corner) {
  3143. var anchorHeight = this.measures_.anchorHeight;
  3144. var isBottomAligned = Boolean(corner & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM);
  3145. var avoidVerticalOverlap = Boolean(this.anchorCorner_ & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM);
  3146. var y = 0;
  3147. if (isBottomAligned) {
  3148. y = avoidVerticalOverlap ? anchorHeight - this.anchorMargin_.top : -this.anchorMargin_.bottom;
  3149. } else {
  3150. y = avoidVerticalOverlap ? anchorHeight + this.anchorMargin_.bottom : this.anchorMargin_.top;
  3151. }
  3152. return y;
  3153. }
  3154. /**
  3155. * @param {!Corner} corner Origin corner of the menu surface.
  3156. * @return {number} Maximum height of the menu surface, based on available space. 0 indicates should not be set.
  3157. * @private
  3158. */
  3159. }, {
  3160. key: 'getMenuSurfaceMaxHeight_',
  3161. value: function getMenuSurfaceMaxHeight_(corner) {
  3162. var maxHeight = 0;
  3163. var viewportDistance = this.measures_.viewportDistance;
  3164. var isBottomAligned = Boolean(corner & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM);
  3165. var MARGIN_TO_EDGE = MDCMenuSurfaceFoundation.numbers.MARGIN_TO_EDGE;
  3166. // When maximum height is not specified, it is handled from css.
  3167. if (isBottomAligned) {
  3168. maxHeight = viewportDistance.top + this.anchorMargin_.top - MARGIN_TO_EDGE;
  3169. if (!(this.anchorCorner_ & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM)) {
  3170. maxHeight += this.measures_.anchorHeight;
  3171. }
  3172. } else {
  3173. maxHeight = viewportDistance.bottom - this.anchorMargin_.bottom + this.measures_.anchorHeight - MARGIN_TO_EDGE;
  3174. if (this.anchorCorner_ & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM) {
  3175. maxHeight -= this.measures_.anchorHeight;
  3176. }
  3177. }
  3178. return maxHeight;
  3179. }
  3180. /** @private */
  3181. }, {
  3182. key: 'autoPosition_',
  3183. value: function autoPosition_() {
  3184. var _position;
  3185. // Compute measurements for autoposition methods reuse.
  3186. this.measures_ = this.getAutoLayoutMeasurements_();
  3187. var corner = this.getOriginCorner_();
  3188. var maxMenuSurfaceHeight = this.getMenuSurfaceMaxHeight_(corner);
  3189. var verticalAlignment = corner & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].BOTTOM ? 'bottom' : 'top';
  3190. var horizontalAlignment = corner & __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* CornerBit */].RIGHT ? 'right' : 'left';
  3191. var horizontalOffset = this.getHorizontalOriginOffset_(corner);
  3192. var verticalOffset = this.getVerticalOriginOffset_(corner);
  3193. var position = (_position = {}, _defineProperty(_position, horizontalAlignment, horizontalOffset ? horizontalOffset : '0'), _defineProperty(_position, verticalAlignment, verticalOffset ? verticalOffset : '0'), _position);
  3194. var _measures_2 = this.measures_,
  3195. anchorWidth = _measures_2.anchorWidth,
  3196. surfaceWidth = _measures_2.surfaceWidth;
  3197. // Center align when anchor width is comparable or greater than menu surface, otherwise keep corner.
  3198. if (anchorWidth / surfaceWidth > __WEBPACK_IMPORTED_MODULE_2__constants__["d" /* numbers */].ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO) {
  3199. horizontalAlignment = 'center';
  3200. }
  3201. // If the menu-surface has been hoisted to the body, it's no longer relative to the anchor element
  3202. if (this.hoistedElement_ || this.isFixedPosition_) {
  3203. position = this.adjustPositionForHoistedElement_(position);
  3204. }
  3205. for (var prop in position) {
  3206. if (position.hasOwnProperty(prop) && position[prop] !== '0') {
  3207. position[prop] = parseInt(position[prop], 10) + 'px';
  3208. }
  3209. }
  3210. this.adapter_.setTransformOrigin(horizontalAlignment + ' ' + verticalAlignment);
  3211. this.adapter_.setPosition(position);
  3212. this.adapter_.setMaxHeight(maxMenuSurfaceHeight ? maxMenuSurfaceHeight + 'px' : '');
  3213. // Clear measures after positioning is complete.
  3214. this.measures_ = null;
  3215. }
  3216. /**
  3217. * Calculates the offsets for positioning the menu-surface when the menu-surface has been
  3218. * hoisted to the body.
  3219. * @param {!{
  3220. * top: (string|undefined),
  3221. * right: (string|undefined),
  3222. * bottom: (string|undefined),
  3223. * left: (string|undefined)
  3224. * }} position
  3225. * @return {!{
  3226. * top: (string|undefined),
  3227. * right: (string|undefined),
  3228. * bottom: (string|undefined),
  3229. * left: (string|undefined)
  3230. * }} position
  3231. * @private
  3232. */
  3233. }, {
  3234. key: 'adjustPositionForHoistedElement_',
  3235. value: function adjustPositionForHoistedElement_(position) {
  3236. var _measures_3 = this.measures_,
  3237. windowScroll = _measures_3.windowScroll,
  3238. viewportDistance = _measures_3.viewportDistance;
  3239. for (var prop in position) {
  3240. if (position.hasOwnProperty(prop)) {
  3241. // Hoisted surfaces need to have the anchor elements location on the page added to the
  3242. // position properties for proper alignment on the body.
  3243. if (viewportDistance.hasOwnProperty(prop)) {
  3244. position[prop] = parseInt(position[prop], 10) + viewportDistance[prop];
  3245. }
  3246. // Surfaces that are absolutely positioned need to have additional calculations for scroll
  3247. // and bottom positioning.
  3248. if (!this.isFixedPosition_) {
  3249. if (prop === 'top') {
  3250. position[prop] = parseInt(position[prop], 10) + windowScroll.y;
  3251. } else if (prop === 'bottom') {
  3252. position[prop] = parseInt(position[prop], 10) - windowScroll.y;
  3253. } else if (prop === 'left') {
  3254. position[prop] = parseInt(position[prop], 10) + windowScroll.x;
  3255. } else if (prop === 'right') {
  3256. position[prop] = parseInt(position[prop], 10) - windowScroll.x;
  3257. }
  3258. }
  3259. }
  3260. }
  3261. return position;
  3262. }
  3263. /**
  3264. * Open the menu surface.
  3265. */
  3266. }, {
  3267. key: 'open',
  3268. value: function open() {
  3269. var _this2 = this;
  3270. this.adapter_.saveFocus();
  3271. if (!this.quickOpen_) {
  3272. this.adapter_.addClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_OPEN);
  3273. }
  3274. this.animationRequestId_ = requestAnimationFrame(function () {
  3275. _this2.adapter_.addClass(MDCMenuSurfaceFoundation.cssClasses.OPEN);
  3276. _this2.dimensions_ = _this2.adapter_.getInnerDimensions();
  3277. _this2.autoPosition_();
  3278. if (_this2.quickOpen_) {
  3279. _this2.adapter_.notifyOpen();
  3280. } else {
  3281. _this2.openAnimationEndTimerId_ = setTimeout(function () {
  3282. _this2.openAnimationEndTimerId_ = 0;
  3283. _this2.adapter_.removeClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_OPEN);
  3284. _this2.adapter_.notifyOpen();
  3285. }, __WEBPACK_IMPORTED_MODULE_2__constants__["d" /* numbers */].TRANSITION_OPEN_DURATION);
  3286. }
  3287. });
  3288. this.isOpen_ = true;
  3289. }
  3290. /**
  3291. * Closes the menu surface.
  3292. */
  3293. }, {
  3294. key: 'close',
  3295. value: function close() {
  3296. var _this3 = this;
  3297. if (!this.quickOpen_) {
  3298. this.adapter_.addClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_CLOSED);
  3299. }
  3300. requestAnimationFrame(function () {
  3301. _this3.adapter_.removeClass(MDCMenuSurfaceFoundation.cssClasses.OPEN);
  3302. if (_this3.quickOpen_) {
  3303. _this3.adapter_.notifyClose();
  3304. } else {
  3305. _this3.closeAnimationEndTimerId_ = setTimeout(function () {
  3306. _this3.closeAnimationEndTimerId_ = 0;
  3307. _this3.adapter_.removeClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_CLOSED);
  3308. _this3.adapter_.notifyClose();
  3309. }, __WEBPACK_IMPORTED_MODULE_2__constants__["d" /* numbers */].TRANSITION_CLOSE_DURATION);
  3310. }
  3311. });
  3312. this.isOpen_ = false;
  3313. this.maybeRestoreFocus_();
  3314. }
  3315. /**
  3316. * The last focused element when the menu surface was opened should regain focus, if the user is
  3317. * focused on or within the menu surface when it is closed.
  3318. * @private
  3319. */
  3320. }, {
  3321. key: 'maybeRestoreFocus_',
  3322. value: function maybeRestoreFocus_() {
  3323. if (this.adapter_.isFocused() || this.adapter_.isElementInContainer(document.activeElement)) {
  3324. this.adapter_.restoreFocus();
  3325. }
  3326. }
  3327. /** @return {boolean} */
  3328. }, {
  3329. key: 'isOpen',
  3330. value: function isOpen() {
  3331. return this.isOpen_;
  3332. }
  3333. /**
  3334. * isFinite that doesn't force conversion to number type.
  3335. * Equivalent to Number.isFinite in ES2015, but is not included in IE11.
  3336. * @param {number} num
  3337. * @return {boolean}
  3338. * @private
  3339. */
  3340. }, {
  3341. key: 'typeCheckisFinite_',
  3342. value: function typeCheckisFinite_(num) {
  3343. return typeof num === 'number' && isFinite(num);
  3344. }
  3345. }]);
  3346. return MDCMenuSurfaceFoundation;
  3347. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  3348. /***/ }),
  3349. /* 21 */
  3350. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3351. "use strict";
  3352. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return cssClasses; });
  3353. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return strings; });
  3354. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return numbers; });
  3355. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return CornerBit; });
  3356. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Corner; });
  3357. /**
  3358. * @license
  3359. * Copyright 2018 Google Inc.
  3360. *
  3361. * Permission is hereby granted, free of charge, to any person obtaining a copy
  3362. * of this software and associated documentation files (the "Software"), to deal
  3363. * in the Software without restriction, including without limitation the rights
  3364. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  3365. * copies of the Software, and to permit persons to whom the Software is
  3366. * furnished to do so, subject to the following conditions:
  3367. *
  3368. * The above copyright notice and this permission notice shall be included in
  3369. * all copies or substantial portions of the Software.
  3370. *
  3371. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  3372. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  3373. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  3374. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  3375. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  3376. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  3377. * THE SOFTWARE.
  3378. */
  3379. /** @enum {string} */
  3380. var cssClasses = {
  3381. ANCHOR: 'mdc-menu-surface--anchor',
  3382. ANIMATING_CLOSED: 'mdc-menu-surface--animating-closed',
  3383. ANIMATING_OPEN: 'mdc-menu-surface--animating-open',
  3384. FIXED: 'mdc-menu-surface--fixed',
  3385. OPEN: 'mdc-menu-surface--open',
  3386. ROOT: 'mdc-menu-surface'
  3387. };
  3388. /** @enum {string} */
  3389. var strings = {
  3390. CLOSED_EVENT: 'MDCMenuSurface:closed',
  3391. OPENED_EVENT: 'MDCMenuSurface:opened',
  3392. 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"])'
  3393. };
  3394. /** @enum {number} */
  3395. var numbers = {
  3396. // Total duration of menu-surface open animation.
  3397. TRANSITION_OPEN_DURATION: 120,
  3398. // Total duration of menu-surface close animation.
  3399. TRANSITION_CLOSE_DURATION: 75,
  3400. // Margin left to the edge of the viewport when menu-surface is at maximum possible height.
  3401. MARGIN_TO_EDGE: 32,
  3402. // Ratio of anchor width to menu-surface width for switching from corner positioning to center positioning.
  3403. ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO: 0.67
  3404. };
  3405. /**
  3406. * Enum for bits in the {@see Corner) bitmap.
  3407. * @enum {number}
  3408. */
  3409. var CornerBit = {
  3410. BOTTOM: 1,
  3411. CENTER: 2,
  3412. RIGHT: 4,
  3413. FLIP_RTL: 8
  3414. };
  3415. /**
  3416. * Enum for representing an element corner for positioning the menu-surface.
  3417. *
  3418. * The START constants map to LEFT if element directionality is left
  3419. * to right and RIGHT if the directionality is right to left.
  3420. * Likewise END maps to RIGHT or LEFT depending on the directionality.
  3421. *
  3422. * @enum {number}
  3423. */
  3424. var Corner = {
  3425. TOP_LEFT: 0,
  3426. TOP_RIGHT: CornerBit.RIGHT,
  3427. BOTTOM_LEFT: CornerBit.BOTTOM,
  3428. BOTTOM_RIGHT: CornerBit.BOTTOM | CornerBit.RIGHT,
  3429. TOP_START: CornerBit.FLIP_RTL,
  3430. TOP_END: CornerBit.FLIP_RTL | CornerBit.RIGHT,
  3431. BOTTOM_START: CornerBit.BOTTOM | CornerBit.FLIP_RTL,
  3432. BOTTOM_END: CornerBit.BOTTOM | CornerBit.RIGHT | CornerBit.FLIP_RTL
  3433. };
  3434. /***/ }),
  3435. /* 22 */
  3436. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3437. "use strict";
  3438. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  3439. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCNotchedOutline", function() { return MDCNotchedOutline; });
  3440. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  3441. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(46);
  3442. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(112);
  3443. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_floating_label_index__ = __webpack_require__(10);
  3444. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__constants__ = __webpack_require__(47);
  3445. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCNotchedOutlineFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  3446. 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; };
  3447. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  3448. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3449. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  3450. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  3451. /**
  3452. * @license
  3453. * Copyright 2017 Google Inc.
  3454. *
  3455. * Permission is hereby granted, free of charge, to any person obtaining a copy
  3456. * of this software and associated documentation files (the "Software"), to deal
  3457. * in the Software without restriction, including without limitation the rights
  3458. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  3459. * copies of the Software, and to permit persons to whom the Software is
  3460. * furnished to do so, subject to the following conditions:
  3461. *
  3462. * The above copyright notice and this permission notice shall be included in
  3463. * all copies or substantial portions of the Software.
  3464. *
  3465. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  3466. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  3467. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  3468. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  3469. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  3470. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  3471. * THE SOFTWARE.
  3472. */
  3473. /**
  3474. * @extends {MDCComponent<!MDCNotchedOutlineFoundation>}
  3475. * @final
  3476. */
  3477. var MDCNotchedOutline = function (_MDCComponent) {
  3478. _inherits(MDCNotchedOutline, _MDCComponent);
  3479. _createClass(MDCNotchedOutline, null, [{
  3480. key: 'attachTo',
  3481. /**
  3482. * @param {!Element} root
  3483. * @return {!MDCNotchedOutline}
  3484. */
  3485. value: function attachTo(root) {
  3486. return new MDCNotchedOutline(root);
  3487. }
  3488. /** @param {...?} args */
  3489. }]);
  3490. function MDCNotchedOutline() {
  3491. var _ref;
  3492. _classCallCheck(this, MDCNotchedOutline);
  3493. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  3494. args[_key] = arguments[_key];
  3495. }
  3496. /** @private {Element} */
  3497. var _this = _possibleConstructorReturn(this, (_ref = MDCNotchedOutline.__proto__ || Object.getPrototypeOf(MDCNotchedOutline)).call.apply(_ref, [this].concat(args)));
  3498. _this.notchElement_;
  3499. return _this;
  3500. }
  3501. _createClass(MDCNotchedOutline, [{
  3502. key: 'initialSyncWithDOM',
  3503. value: function initialSyncWithDOM() {
  3504. var label = this.root_.querySelector('.' + __WEBPACK_IMPORTED_MODULE_3__material_floating_label_index__["MDCFloatingLabelFoundation"].cssClasses.ROOT);
  3505. this.notchElement_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__constants__["c" /* strings */].NOTCH_ELEMENT_SELECTOR);
  3506. if (label) {
  3507. label.style.transitionDuration = '0s';
  3508. this.root_.classList.add(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].OUTLINE_UPGRADED);
  3509. requestAnimationFrame(function () {
  3510. label.style.transitionDuration = '';
  3511. });
  3512. } else {
  3513. this.root_.classList.add(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].NO_LABEL);
  3514. }
  3515. }
  3516. /**
  3517. * Updates outline selectors and SVG path to open notch.
  3518. * @param {number} notchWidth The notch width in the outline.
  3519. */
  3520. }, {
  3521. key: 'notch',
  3522. value: function notch(notchWidth) {
  3523. this.foundation_.notch(notchWidth);
  3524. }
  3525. /**
  3526. * Updates the outline selectors to close notch and return it to idle state.
  3527. */
  3528. }, {
  3529. key: 'closeNotch',
  3530. value: function closeNotch() {
  3531. this.foundation_.closeNotch();
  3532. }
  3533. /**
  3534. * @return {!MDCNotchedOutlineFoundation}
  3535. */
  3536. }, {
  3537. key: 'getDefaultFoundation',
  3538. value: function getDefaultFoundation() {
  3539. var _this2 = this;
  3540. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */](
  3541. /** @type {!MDCNotchedOutlineAdapter} */_extends({
  3542. addClass: function addClass(className) {
  3543. return _this2.root_.classList.add(className);
  3544. },
  3545. removeClass: function removeClass(className) {
  3546. return _this2.root_.classList.remove(className);
  3547. },
  3548. setNotchWidthProperty: function setNotchWidthProperty(width) {
  3549. return _this2.notchElement_.style.setProperty('width', width > 0 ? width + 'px' : '0');
  3550. }
  3551. }));
  3552. }
  3553. }]);
  3554. return MDCNotchedOutline;
  3555. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  3556. /***/ }),
  3557. /* 23 */
  3558. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3559. "use strict";
  3560. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCSelectIcon; });
  3561. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  3562. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(49);
  3563. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(119);
  3564. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  3565. 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; };
  3566. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  3567. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3568. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  3569. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  3570. /**
  3571. * @license
  3572. * Copyright 2018 Google Inc.
  3573. *
  3574. * Permission is hereby granted, free of charge, to any person obtaining a copy
  3575. * of this software and associated documentation files (the "Software"), to deal
  3576. * in the Software without restriction, including without limitation the rights
  3577. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  3578. * copies of the Software, and to permit persons to whom the Software is
  3579. * furnished to do so, subject to the following conditions:
  3580. *
  3581. * The above copyright notice and this permission notice shall be included in
  3582. * all copies or substantial portions of the Software.
  3583. *
  3584. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  3585. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  3586. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  3587. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  3588. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  3589. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  3590. * THE SOFTWARE.
  3591. */
  3592. /**
  3593. * @extends {MDCComponent<!MDCSelectIconFoundation>}
  3594. * @final
  3595. */
  3596. var MDCSelectIcon = function (_MDCComponent) {
  3597. _inherits(MDCSelectIcon, _MDCComponent);
  3598. function MDCSelectIcon() {
  3599. _classCallCheck(this, MDCSelectIcon);
  3600. return _possibleConstructorReturn(this, (MDCSelectIcon.__proto__ || Object.getPrototypeOf(MDCSelectIcon)).apply(this, arguments));
  3601. }
  3602. _createClass(MDCSelectIcon, [{
  3603. key: 'getDefaultFoundation',
  3604. /**
  3605. * @return {!MDCSelectIconFoundation}
  3606. */
  3607. value: function getDefaultFoundation() {
  3608. var _this2 = this;
  3609. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]( /** @type {!MDCSelectIconAdapter} */_extends({
  3610. getAttr: function getAttr(attr) {
  3611. return _this2.root_.getAttribute(attr);
  3612. },
  3613. setAttr: function setAttr(attr, value) {
  3614. return _this2.root_.setAttribute(attr, value);
  3615. },
  3616. removeAttr: function removeAttr(attr) {
  3617. return _this2.root_.removeAttribute(attr);
  3618. },
  3619. setContent: function setContent(content) {
  3620. _this2.root_.textContent = content;
  3621. },
  3622. registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
  3623. return _this2.root_.addEventListener(evtType, handler);
  3624. },
  3625. deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
  3626. return _this2.root_.removeEventListener(evtType, handler);
  3627. },
  3628. notifyIconAction: function notifyIconAction() {
  3629. return _this2.emit(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.ICON_EVENT, {} /* evtData */, true /* shouldBubble */);
  3630. }
  3631. }));
  3632. }
  3633. }, {
  3634. key: 'foundation',
  3635. /**
  3636. * @return {!MDCSelectIconFoundation}
  3637. */
  3638. get: function get() {
  3639. return this.foundation_;
  3640. }
  3641. }], [{
  3642. key: 'attachTo',
  3643. /**
  3644. * @param {!Element} root
  3645. * @return {!MDCSelectIcon}
  3646. */
  3647. value: function attachTo(root) {
  3648. return new MDCSelectIcon(root);
  3649. }
  3650. }]);
  3651. return MDCSelectIcon;
  3652. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  3653. /***/ }),
  3654. /* 24 */
  3655. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3656. "use strict";
  3657. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCSelectHelperText; });
  3658. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  3659. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(50);
  3660. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(121);
  3661. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  3662. 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; };
  3663. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  3664. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3665. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  3666. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  3667. /**
  3668. * @license
  3669. * Copyright 2018 Google Inc.
  3670. *
  3671. * Permission is hereby granted, free of charge, to any person obtaining a copy
  3672. * of this software and associated documentation files (the "Software"), to deal
  3673. * in the Software without restriction, including without limitation the rights
  3674. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  3675. * copies of the Software, and to permit persons to whom the Software is
  3676. * furnished to do so, subject to the following conditions:
  3677. *
  3678. * The above copyright notice and this permission notice shall be included in
  3679. * all copies or substantial portions of the Software.
  3680. *
  3681. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  3682. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  3683. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  3684. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  3685. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  3686. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  3687. * THE SOFTWARE.
  3688. */
  3689. /**
  3690. * @extends {MDCComponent<!MDCSelectHelperTextFoundation>}
  3691. * @final
  3692. */
  3693. var MDCSelectHelperText = function (_MDCComponent) {
  3694. _inherits(MDCSelectHelperText, _MDCComponent);
  3695. function MDCSelectHelperText() {
  3696. _classCallCheck(this, MDCSelectHelperText);
  3697. return _possibleConstructorReturn(this, (MDCSelectHelperText.__proto__ || Object.getPrototypeOf(MDCSelectHelperText)).apply(this, arguments));
  3698. }
  3699. _createClass(MDCSelectHelperText, [{
  3700. key: 'getDefaultFoundation',
  3701. /**
  3702. * @return {!MDCSelectHelperTextFoundation}
  3703. */
  3704. value: function getDefaultFoundation() {
  3705. var _this2 = this;
  3706. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]( /** @type {!MDCSelectHelperTextAdapter} */_extends({
  3707. addClass: function addClass(className) {
  3708. return _this2.root_.classList.add(className);
  3709. },
  3710. removeClass: function removeClass(className) {
  3711. return _this2.root_.classList.remove(className);
  3712. },
  3713. hasClass: function hasClass(className) {
  3714. return _this2.root_.classList.contains(className);
  3715. },
  3716. setAttr: function setAttr(attr, value) {
  3717. return _this2.root_.setAttribute(attr, value);
  3718. },
  3719. removeAttr: function removeAttr(attr) {
  3720. return _this2.root_.removeAttribute(attr);
  3721. },
  3722. setContent: function setContent(content) {
  3723. _this2.root_.textContent = content;
  3724. }
  3725. }));
  3726. }
  3727. }, {
  3728. key: 'foundation',
  3729. /**
  3730. * @return {!MDCSelectHelperTextFoundation}
  3731. */
  3732. get: function get() {
  3733. return this.foundation_;
  3734. }
  3735. }], [{
  3736. key: 'attachTo',
  3737. /**
  3738. * @param {!Element} root
  3739. * @return {!MDCSelectHelperText}
  3740. */
  3741. value: function attachTo(root) {
  3742. return new MDCSelectHelperText(root);
  3743. }
  3744. }]);
  3745. return MDCSelectHelperText;
  3746. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  3747. /***/ }),
  3748. /* 25 */
  3749. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3750. "use strict";
  3751. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  3752. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTab", function() { return MDCTab; });
  3753. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  3754. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__ = __webpack_require__(2);
  3755. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_tab_indicator_index__ = __webpack_require__(54);
  3756. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__adapter__ = __webpack_require__(11);
  3757. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation__ = __webpack_require__(135);
  3758. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTabFoundation", function() { return __WEBPACK_IMPORTED_MODULE_4__foundation__["a"]; });
  3759. 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; };
  3760. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  3761. 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); } };
  3762. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3763. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  3764. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  3765. /**
  3766. * @license
  3767. * Copyright 2018 Google Inc.
  3768. *
  3769. * Permission is hereby granted, free of charge, to any person obtaining a copy
  3770. * of this software and associated documentation files (the "Software"), to deal
  3771. * in the Software without restriction, including without limitation the rights
  3772. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  3773. * copies of the Software, and to permit persons to whom the Software is
  3774. * furnished to do so, subject to the following conditions:
  3775. *
  3776. * The above copyright notice and this permission notice shall be included in
  3777. * all copies or substantial portions of the Software.
  3778. *
  3779. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  3780. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  3781. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  3782. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  3783. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  3784. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  3785. * THE SOFTWARE.
  3786. */
  3787. /* eslint-disable no-unused-vars */
  3788. /* eslint-enable no-unused-vars */
  3789. /**
  3790. * @extends {MDCComponent<!MDCTabFoundation>}
  3791. * @final
  3792. */
  3793. var MDCTab = function (_MDCComponent) {
  3794. _inherits(MDCTab, _MDCComponent);
  3795. /**
  3796. * @param {...?} args
  3797. */
  3798. function MDCTab() {
  3799. var _ref;
  3800. _classCallCheck(this, MDCTab);
  3801. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  3802. args[_key] = arguments[_key];
  3803. }
  3804. /** @private {?MDCRipple} */
  3805. var _this = _possibleConstructorReturn(this, (_ref = MDCTab.__proto__ || Object.getPrototypeOf(MDCTab)).call.apply(_ref, [this].concat(args)));
  3806. _this.ripple_;
  3807. /** @private {?MDCTabIndicator} */
  3808. _this.tabIndicator_;
  3809. /** @private {?Element} */
  3810. _this.content_;
  3811. /** @private {?Function} */
  3812. _this.handleClick_;
  3813. return _this;
  3814. }
  3815. /**
  3816. * @param {!Element} root
  3817. * @return {!MDCTab}
  3818. */
  3819. _createClass(MDCTab, [{
  3820. key: 'initialize',
  3821. value: function initialize() {
  3822. var rippleFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el, foundation) {
  3823. return new __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"](el, foundation);
  3824. };
  3825. var tabIndicatorFactory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (el) {
  3826. return new __WEBPACK_IMPORTED_MODULE_2__material_tab_indicator_index__["MDCTabIndicator"](el);
  3827. };
  3828. var rippleSurface = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */].strings.RIPPLE_SELECTOR);
  3829. var rippleAdapter = _extends(__WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"].createAdapter( /** @type {!RippleCapableSurface} */this), {
  3830. addClass: function addClass(className) {
  3831. return rippleSurface.classList.add(className);
  3832. },
  3833. removeClass: function removeClass(className) {
  3834. return rippleSurface.classList.remove(className);
  3835. },
  3836. updateCssVariable: function updateCssVariable(varName, value) {
  3837. return rippleSurface.style.setProperty(varName, value);
  3838. }
  3839. });
  3840. var rippleFoundation = new __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRippleFoundation"](rippleAdapter);
  3841. this.ripple_ = rippleFactory(this.root_, rippleFoundation);
  3842. var tabIndicatorElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */].strings.TAB_INDICATOR_SELECTOR);
  3843. this.tabIndicator_ = tabIndicatorFactory(tabIndicatorElement);
  3844. this.content_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */].strings.CONTENT_SELECTOR);
  3845. }
  3846. }, {
  3847. key: 'initialSyncWithDOM',
  3848. value: function initialSyncWithDOM() {
  3849. this.handleClick_ = this.foundation_.handleClick.bind(this.foundation_);
  3850. this.listen('click', this.handleClick_);
  3851. }
  3852. }, {
  3853. key: 'destroy',
  3854. value: function destroy() {
  3855. this.unlisten('click', /** @type {!Function} */this.handleClick_);
  3856. this.ripple_.destroy();
  3857. _get(MDCTab.prototype.__proto__ || Object.getPrototypeOf(MDCTab.prototype), 'destroy', this).call(this);
  3858. }
  3859. /**
  3860. * @return {!MDCTabFoundation}
  3861. */
  3862. }, {
  3863. key: 'getDefaultFoundation',
  3864. value: function getDefaultFoundation() {
  3865. var _this2 = this;
  3866. return new __WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */](
  3867. /** @type {!MDCTabAdapter} */{
  3868. setAttr: function setAttr(attr, value) {
  3869. return _this2.root_.setAttribute(attr, value);
  3870. },
  3871. addClass: function addClass(className) {
  3872. return _this2.root_.classList.add(className);
  3873. },
  3874. removeClass: function removeClass(className) {
  3875. return _this2.root_.classList.remove(className);
  3876. },
  3877. hasClass: function hasClass(className) {
  3878. return _this2.root_.classList.contains(className);
  3879. },
  3880. activateIndicator: function activateIndicator(previousIndicatorClientRect) {
  3881. return _this2.tabIndicator_.activate(previousIndicatorClientRect);
  3882. },
  3883. deactivateIndicator: function deactivateIndicator() {
  3884. return _this2.tabIndicator_.deactivate();
  3885. },
  3886. notifyInteracted: function notifyInteracted() {
  3887. return _this2.emit(__WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */].strings.INTERACTED_EVENT, { tab: _this2 }, true /* bubble */);
  3888. },
  3889. getOffsetLeft: function getOffsetLeft() {
  3890. return _this2.root_.offsetLeft;
  3891. },
  3892. getOffsetWidth: function getOffsetWidth() {
  3893. return _this2.root_.offsetWidth;
  3894. },
  3895. getContentOffsetLeft: function getContentOffsetLeft() {
  3896. return _this2.content_.offsetLeft;
  3897. },
  3898. getContentOffsetWidth: function getContentOffsetWidth() {
  3899. return _this2.content_.offsetWidth;
  3900. },
  3901. focus: function focus() {
  3902. return _this2.root_.focus();
  3903. }
  3904. });
  3905. }
  3906. /**
  3907. * Getter for the active state of the tab
  3908. * @return {boolean}
  3909. */
  3910. }, {
  3911. key: 'activate',
  3912. /**
  3913. * Activates the tab
  3914. * @param {!ClientRect=} computeIndicatorClientRect
  3915. */
  3916. value: function activate(computeIndicatorClientRect) {
  3917. this.foundation_.activate(computeIndicatorClientRect);
  3918. }
  3919. /**
  3920. * Deactivates the tab
  3921. */
  3922. }, {
  3923. key: 'deactivate',
  3924. value: function deactivate() {
  3925. this.foundation_.deactivate();
  3926. }
  3927. /**
  3928. * Returns the indicator's client rect
  3929. * @return {!ClientRect}
  3930. */
  3931. }, {
  3932. key: 'computeIndicatorClientRect',
  3933. value: function computeIndicatorClientRect() {
  3934. return this.tabIndicator_.computeContentClientRect();
  3935. }
  3936. /**
  3937. * @return {!MDCTabDimensions}
  3938. */
  3939. }, {
  3940. key: 'computeDimensions',
  3941. value: function computeDimensions() {
  3942. return this.foundation_.computeDimensions();
  3943. }
  3944. /**
  3945. * Focuses the tab
  3946. */
  3947. }, {
  3948. key: 'focus',
  3949. value: function focus() {
  3950. this.root_.focus();
  3951. }
  3952. }, {
  3953. key: 'active',
  3954. get: function get() {
  3955. return this.foundation_.isActive();
  3956. }
  3957. }, {
  3958. key: 'focusOnActivate',
  3959. set: function set(focusOnActivate) {
  3960. this.foundation_.setFocusOnActivate(focusOnActivate);
  3961. }
  3962. }], [{
  3963. key: 'attachTo',
  3964. value: function attachTo(root) {
  3965. return new MDCTab(root);
  3966. }
  3967. }]);
  3968. return MDCTab;
  3969. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  3970. /***/ }),
  3971. /* 26 */
  3972. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3973. "use strict";
  3974. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  3975. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(55);
  3976. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(132);
  3977. 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; };
  3978. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  3979. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3980. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  3981. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  3982. /**
  3983. * @license
  3984. * Copyright 2018 Google Inc.
  3985. *
  3986. * Permission is hereby granted, free of charge, to any person obtaining a copy
  3987. * of this software and associated documentation files (the "Software"), to deal
  3988. * in the Software without restriction, including without limitation the rights
  3989. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  3990. * copies of the Software, and to permit persons to whom the Software is
  3991. * furnished to do so, subject to the following conditions:
  3992. *
  3993. * The above copyright notice and this permission notice shall be included in
  3994. * all copies or substantial portions of the Software.
  3995. *
  3996. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  3997. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  3998. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  3999. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  4000. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  4001. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  4002. * THE SOFTWARE.
  4003. */
  4004. /**
  4005. * @extends {MDCFoundation<!MDCTabIndicatorAdapter>}
  4006. * @abstract
  4007. */
  4008. var MDCTabIndicatorFoundation = function (_MDCFoundation) {
  4009. _inherits(MDCTabIndicatorFoundation, _MDCFoundation);
  4010. _createClass(MDCTabIndicatorFoundation, null, [{
  4011. key: 'cssClasses',
  4012. /** @return enum {string} */
  4013. get: function get() {
  4014. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  4015. }
  4016. /** @return enum {string} */
  4017. }, {
  4018. key: 'strings',
  4019. get: function get() {
  4020. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  4021. }
  4022. /**
  4023. * @see MDCTabIndicatorAdapter for typing information
  4024. * @return {!MDCTabIndicatorAdapter}
  4025. */
  4026. }, {
  4027. key: 'defaultAdapter',
  4028. get: function get() {
  4029. return (/** @type {!MDCTabIndicatorAdapter} */{
  4030. addClass: function addClass() {},
  4031. removeClass: function removeClass() {},
  4032. computeContentClientRect: function computeContentClientRect() {},
  4033. setContentStyleProperty: function setContentStyleProperty() {}
  4034. }
  4035. );
  4036. }
  4037. /** @param {!MDCTabIndicatorAdapter} adapter */
  4038. }]);
  4039. function MDCTabIndicatorFoundation(adapter) {
  4040. _classCallCheck(this, MDCTabIndicatorFoundation);
  4041. return _possibleConstructorReturn(this, (MDCTabIndicatorFoundation.__proto__ || Object.getPrototypeOf(MDCTabIndicatorFoundation)).call(this, _extends(MDCTabIndicatorFoundation.defaultAdapter, adapter)));
  4042. }
  4043. /** @return {!ClientRect} */
  4044. _createClass(MDCTabIndicatorFoundation, [{
  4045. key: 'computeContentClientRect',
  4046. value: function computeContentClientRect() {
  4047. return this.adapter_.computeContentClientRect();
  4048. }
  4049. /**
  4050. * Activates the indicator
  4051. * @param {!ClientRect=} previousIndicatorClientRect
  4052. * @abstract
  4053. */
  4054. }, {
  4055. key: 'activate',
  4056. value: function activate(previousIndicatorClientRect) {} // eslint-disable-line no-unused-vars
  4057. /** @abstract */
  4058. }, {
  4059. key: 'deactivate',
  4060. value: function deactivate() {}
  4061. }]);
  4062. return MDCTabIndicatorFoundation;
  4063. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  4064. /* harmony default export */ __webpack_exports__["a"] = (MDCTabIndicatorFoundation);
  4065. /***/ }),
  4066. /* 27 */
  4067. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4068. "use strict";
  4069. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  4070. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(61);
  4071. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(146);
  4072. 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; };
  4073. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  4074. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4075. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  4076. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  4077. /**
  4078. * @license
  4079. * Copyright 2017 Google Inc.
  4080. *
  4081. * Permission is hereby granted, free of charge, to any person obtaining a copy
  4082. * of this software and associated documentation files (the "Software"), to deal
  4083. * in the Software without restriction, including without limitation the rights
  4084. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  4085. * copies of the Software, and to permit persons to whom the Software is
  4086. * furnished to do so, subject to the following conditions:
  4087. *
  4088. * The above copyright notice and this permission notice shall be included in
  4089. * all copies or substantial portions of the Software.
  4090. *
  4091. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  4092. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  4093. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  4094. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  4095. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  4096. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  4097. * THE SOFTWARE.
  4098. */
  4099. /**
  4100. * @extends {MDCFoundation<!MDCTextFieldHelperTextAdapter>}
  4101. * @final
  4102. */
  4103. var MDCTextFieldHelperTextFoundation = function (_MDCFoundation) {
  4104. _inherits(MDCTextFieldHelperTextFoundation, _MDCFoundation);
  4105. _createClass(MDCTextFieldHelperTextFoundation, null, [{
  4106. key: 'cssClasses',
  4107. /** @return enum {string} */
  4108. get: function get() {
  4109. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  4110. }
  4111. /** @return enum {string} */
  4112. }, {
  4113. key: 'strings',
  4114. get: function get() {
  4115. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  4116. }
  4117. /**
  4118. * {@see MDCTextFieldHelperTextAdapter} for typing information on parameters and return
  4119. * types.
  4120. * @return {!MDCTextFieldHelperTextAdapter}
  4121. */
  4122. }, {
  4123. key: 'defaultAdapter',
  4124. get: function get() {
  4125. return (/** @type {!MDCTextFieldHelperTextAdapter} */{
  4126. addClass: function addClass() {},
  4127. removeClass: function removeClass() {},
  4128. hasClass: function hasClass() {},
  4129. setAttr: function setAttr() {},
  4130. removeAttr: function removeAttr() {},
  4131. setContent: function setContent() {}
  4132. }
  4133. );
  4134. }
  4135. /**
  4136. * @param {!MDCTextFieldHelperTextAdapter} adapter
  4137. */
  4138. }]);
  4139. function MDCTextFieldHelperTextFoundation(adapter) {
  4140. _classCallCheck(this, MDCTextFieldHelperTextFoundation);
  4141. return _possibleConstructorReturn(this, (MDCTextFieldHelperTextFoundation.__proto__ || Object.getPrototypeOf(MDCTextFieldHelperTextFoundation)).call(this, _extends(MDCTextFieldHelperTextFoundation.defaultAdapter, adapter)));
  4142. }
  4143. /**
  4144. * Sets the content of the helper text field.
  4145. * @param {string} content
  4146. */
  4147. _createClass(MDCTextFieldHelperTextFoundation, [{
  4148. key: 'setContent',
  4149. value: function setContent(content) {
  4150. this.adapter_.setContent(content);
  4151. }
  4152. /** @param {boolean} isPersistent Sets the persistency of the helper text. */
  4153. }, {
  4154. key: 'setPersistent',
  4155. value: function setPersistent(isPersistent) {
  4156. if (isPersistent) {
  4157. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_PERSISTENT);
  4158. } else {
  4159. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_PERSISTENT);
  4160. }
  4161. }
  4162. /**
  4163. * @param {boolean} isValidation True to make the helper text act as an
  4164. * error validation message.
  4165. */
  4166. }, {
  4167. key: 'setValidation',
  4168. value: function setValidation(isValidation) {
  4169. if (isValidation) {
  4170. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_VALIDATION_MSG);
  4171. } else {
  4172. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_VALIDATION_MSG);
  4173. }
  4174. }
  4175. /** Makes the helper text visible to the screen reader. */
  4176. }, {
  4177. key: 'showToScreenReader',
  4178. value: function showToScreenReader() {
  4179. this.adapter_.removeAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_HIDDEN);
  4180. }
  4181. /**
  4182. * Sets the validity of the helper text based on the input validity.
  4183. * @param {boolean} inputIsValid
  4184. */
  4185. }, {
  4186. key: 'setValidity',
  4187. value: function setValidity(inputIsValid) {
  4188. var helperTextIsPersistent = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_PERSISTENT);
  4189. var helperTextIsValidationMsg = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_VALIDATION_MSG);
  4190. var validationMsgNeedsDisplay = helperTextIsValidationMsg && !inputIsValid;
  4191. if (validationMsgNeedsDisplay) {
  4192. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ROLE, 'alert');
  4193. } else {
  4194. this.adapter_.removeAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ROLE);
  4195. }
  4196. if (!helperTextIsPersistent && !validationMsgNeedsDisplay) {
  4197. this.hide_();
  4198. }
  4199. }
  4200. /**
  4201. * Hides the help text from screen readers.
  4202. * @private
  4203. */
  4204. }, {
  4205. key: 'hide_',
  4206. value: function hide_() {
  4207. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_HIDDEN, 'true');
  4208. }
  4209. }]);
  4210. return MDCTextFieldHelperTextFoundation;
  4211. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  4212. /* harmony default export */ __webpack_exports__["a"] = (MDCTextFieldHelperTextFoundation);
  4213. /***/ }),
  4214. /* 28 */
  4215. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4216. "use strict";
  4217. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  4218. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(62);
  4219. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(147);
  4220. 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; };
  4221. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  4222. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4223. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  4224. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  4225. /**
  4226. * @license
  4227. * Copyright 2017 Google Inc.
  4228. *
  4229. * Permission is hereby granted, free of charge, to any person obtaining a copy
  4230. * of this software and associated documentation files (the "Software"), to deal
  4231. * in the Software without restriction, including without limitation the rights
  4232. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  4233. * copies of the Software, and to permit persons to whom the Software is
  4234. * furnished to do so, subject to the following conditions:
  4235. *
  4236. * The above copyright notice and this permission notice shall be included in
  4237. * all copies or substantial portions of the Software.
  4238. *
  4239. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  4240. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  4241. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  4242. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  4243. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  4244. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  4245. * THE SOFTWARE.
  4246. */
  4247. /**
  4248. * @extends {MDCFoundation<!MDCTextFieldIconAdapter>}
  4249. * @final
  4250. */
  4251. var MDCTextFieldIconFoundation = function (_MDCFoundation) {
  4252. _inherits(MDCTextFieldIconFoundation, _MDCFoundation);
  4253. _createClass(MDCTextFieldIconFoundation, null, [{
  4254. key: 'strings',
  4255. /** @return enum {string} */
  4256. get: function get() {
  4257. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* strings */];
  4258. }
  4259. /**
  4260. * {@see MDCTextFieldIconAdapter} for typing information on parameters and return
  4261. * types.
  4262. * @return {!MDCTextFieldIconAdapter}
  4263. */
  4264. }, {
  4265. key: 'defaultAdapter',
  4266. get: function get() {
  4267. return (/** @type {!MDCTextFieldIconAdapter} */{
  4268. getAttr: function getAttr() {},
  4269. setAttr: function setAttr() {},
  4270. removeAttr: function removeAttr() {},
  4271. setContent: function setContent() {},
  4272. registerInteractionHandler: function registerInteractionHandler() {},
  4273. deregisterInteractionHandler: function deregisterInteractionHandler() {},
  4274. notifyIconAction: function notifyIconAction() {}
  4275. }
  4276. );
  4277. }
  4278. /**
  4279. * @param {!MDCTextFieldIconAdapter} adapter
  4280. */
  4281. }]);
  4282. function MDCTextFieldIconFoundation(adapter) {
  4283. _classCallCheck(this, MDCTextFieldIconFoundation);
  4284. /** @private {string?} */
  4285. var _this = _possibleConstructorReturn(this, (MDCTextFieldIconFoundation.__proto__ || Object.getPrototypeOf(MDCTextFieldIconFoundation)).call(this, _extends(MDCTextFieldIconFoundation.defaultAdapter, adapter)));
  4286. _this.savedTabIndex_ = null;
  4287. /** @private {function(!Event): undefined} */
  4288. _this.interactionHandler_ = function (evt) {
  4289. return _this.handleInteraction(evt);
  4290. };
  4291. return _this;
  4292. }
  4293. _createClass(MDCTextFieldIconFoundation, [{
  4294. key: 'init',
  4295. value: function init() {
  4296. var _this2 = this;
  4297. this.savedTabIndex_ = this.adapter_.getAttr('tabindex');
  4298. ['click', 'keydown'].forEach(function (evtType) {
  4299. _this2.adapter_.registerInteractionHandler(evtType, _this2.interactionHandler_);
  4300. });
  4301. }
  4302. }, {
  4303. key: 'destroy',
  4304. value: function destroy() {
  4305. var _this3 = this;
  4306. ['click', 'keydown'].forEach(function (evtType) {
  4307. _this3.adapter_.deregisterInteractionHandler(evtType, _this3.interactionHandler_);
  4308. });
  4309. }
  4310. /** @param {boolean} disabled */
  4311. }, {
  4312. key: 'setDisabled',
  4313. value: function setDisabled(disabled) {
  4314. if (!this.savedTabIndex_) {
  4315. return;
  4316. }
  4317. if (disabled) {
  4318. this.adapter_.setAttr('tabindex', '-1');
  4319. this.adapter_.removeAttr('role');
  4320. } else {
  4321. this.adapter_.setAttr('tabindex', this.savedTabIndex_);
  4322. this.adapter_.setAttr('role', __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* strings */].ICON_ROLE);
  4323. }
  4324. }
  4325. /** @param {string} label */
  4326. }, {
  4327. key: 'setAriaLabel',
  4328. value: function setAriaLabel(label) {
  4329. this.adapter_.setAttr('aria-label', label);
  4330. }
  4331. /** @param {string} content */
  4332. }, {
  4333. key: 'setContent',
  4334. value: function setContent(content) {
  4335. this.adapter_.setContent(content);
  4336. }
  4337. /**
  4338. * Handles an interaction event
  4339. * @param {!Event} evt
  4340. */
  4341. }, {
  4342. key: 'handleInteraction',
  4343. value: function handleInteraction(evt) {
  4344. if (evt.type === 'click' || evt.key === 'Enter' || evt.keyCode === 13) {
  4345. this.adapter_.notifyIconAction();
  4346. }
  4347. }
  4348. }]);
  4349. return MDCTextFieldIconFoundation;
  4350. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  4351. /* harmony default export */ __webpack_exports__["a"] = (MDCTextFieldIconFoundation);
  4352. /***/ }),
  4353. /* 29 */
  4354. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4355. "use strict";
  4356. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  4357. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4358. /**
  4359. * @license
  4360. * Copyright 2016 Google Inc.
  4361. *
  4362. * Permission is hereby granted, free of charge, to any person obtaining a copy
  4363. * of this software and associated documentation files (the "Software"), to deal
  4364. * in the Software without restriction, including without limitation the rights
  4365. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  4366. * copies of the Software, and to permit persons to whom the Software is
  4367. * furnished to do so, subject to the following conditions:
  4368. *
  4369. * The above copyright notice and this permission notice shall be included in
  4370. * all copies or substantial portions of the Software.
  4371. *
  4372. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  4373. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  4374. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  4375. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  4376. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  4377. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  4378. * THE SOFTWARE.
  4379. */
  4380. /* eslint no-unused-vars: [2, {"args": "none"}] */
  4381. /**
  4382. * Adapter for MDC Ripple. Provides an interface for managing
  4383. * - classes
  4384. * - dom
  4385. * - CSS variables
  4386. * - position
  4387. * - dimensions
  4388. * - scroll position
  4389. * - event handlers
  4390. * - unbounded, active and disabled states
  4391. *
  4392. * Additionally, provides type information for the adapter to the Closure
  4393. * compiler.
  4394. *
  4395. * Implement this adapter for your framework of choice to delegate updates to
  4396. * the component in your framework of choice. See architecture documentation
  4397. * for more details.
  4398. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  4399. *
  4400. * @record
  4401. */
  4402. var MDCRippleAdapter = function () {
  4403. function MDCRippleAdapter() {
  4404. _classCallCheck(this, MDCRippleAdapter);
  4405. }
  4406. _createClass(MDCRippleAdapter, [{
  4407. key: "browserSupportsCssVars",
  4408. /** @return {boolean} */
  4409. value: function browserSupportsCssVars() {}
  4410. /** @return {boolean} */
  4411. }, {
  4412. key: "isUnbounded",
  4413. value: function isUnbounded() {}
  4414. /** @return {boolean} */
  4415. }, {
  4416. key: "isSurfaceActive",
  4417. value: function isSurfaceActive() {}
  4418. /** @return {boolean} */
  4419. }, {
  4420. key: "isSurfaceDisabled",
  4421. value: function isSurfaceDisabled() {}
  4422. /** @param {string} className */
  4423. }, {
  4424. key: "addClass",
  4425. value: function addClass(className) {}
  4426. /** @param {string} className */
  4427. }, {
  4428. key: "removeClass",
  4429. value: function removeClass(className) {}
  4430. /** @param {!EventTarget} target */
  4431. }, {
  4432. key: "containsEventTarget",
  4433. value: function containsEventTarget(target) {}
  4434. /**
  4435. * @param {string} evtType
  4436. * @param {!Function} handler
  4437. */
  4438. }, {
  4439. key: "registerInteractionHandler",
  4440. value: function registerInteractionHandler(evtType, handler) {}
  4441. /**
  4442. * @param {string} evtType
  4443. * @param {!Function} handler
  4444. */
  4445. }, {
  4446. key: "deregisterInteractionHandler",
  4447. value: function deregisterInteractionHandler(evtType, handler) {}
  4448. /**
  4449. * @param {string} evtType
  4450. * @param {!Function} handler
  4451. */
  4452. }, {
  4453. key: "registerDocumentInteractionHandler",
  4454. value: function registerDocumentInteractionHandler(evtType, handler) {}
  4455. /**
  4456. * @param {string} evtType
  4457. * @param {!Function} handler
  4458. */
  4459. }, {
  4460. key: "deregisterDocumentInteractionHandler",
  4461. value: function deregisterDocumentInteractionHandler(evtType, handler) {}
  4462. /**
  4463. * @param {!Function} handler
  4464. */
  4465. }, {
  4466. key: "registerResizeHandler",
  4467. value: function registerResizeHandler(handler) {}
  4468. /**
  4469. * @param {!Function} handler
  4470. */
  4471. }, {
  4472. key: "deregisterResizeHandler",
  4473. value: function deregisterResizeHandler(handler) {}
  4474. /**
  4475. * @param {string} varName
  4476. * @param {?number|string} value
  4477. */
  4478. }, {
  4479. key: "updateCssVariable",
  4480. value: function updateCssVariable(varName, value) {}
  4481. /** @return {!ClientRect} */
  4482. }, {
  4483. key: "computeBoundingRect",
  4484. value: function computeBoundingRect() {}
  4485. /** @return {{x: number, y: number}} */
  4486. }, {
  4487. key: "getWindowPageOffset",
  4488. value: function getWindowPageOffset() {}
  4489. }]);
  4490. return MDCRippleAdapter;
  4491. }();
  4492. /* unused harmony default export */ var _unused_webpack_default_export = (MDCRippleAdapter);
  4493. /***/ }),
  4494. /* 30 */
  4495. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4496. "use strict";
  4497. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCChip; });
  4498. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  4499. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__ = __webpack_require__(2);
  4500. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__adapter__ = __webpack_require__(31);
  4501. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation__ = __webpack_require__(32);
  4502. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__constants__ = __webpack_require__(33);
  4503. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_3__foundation__["a"]; });
  4504. 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; };
  4505. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  4506. 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); } };
  4507. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4508. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  4509. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  4510. /**
  4511. * @license
  4512. * Copyright 2016 Google Inc.
  4513. *
  4514. * Permission is hereby granted, free of charge, to any person obtaining a copy
  4515. * of this software and associated documentation files (the "Software"), to deal
  4516. * in the Software without restriction, including without limitation the rights
  4517. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  4518. * copies of the Software, and to permit persons to whom the Software is
  4519. * furnished to do so, subject to the following conditions:
  4520. *
  4521. * The above copyright notice and this permission notice shall be included in
  4522. * all copies or substantial portions of the Software.
  4523. *
  4524. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  4525. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  4526. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  4527. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  4528. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  4529. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  4530. * THE SOFTWARE.
  4531. */
  4532. var INTERACTION_EVENTS = ['click', 'keydown'];
  4533. /**
  4534. * @extends {MDCComponent<!MDCChipFoundation>}
  4535. * @final
  4536. */
  4537. var MDCChip = function (_MDCComponent) {
  4538. _inherits(MDCChip, _MDCComponent);
  4539. /**
  4540. * @param {...?} args
  4541. */
  4542. function MDCChip() {
  4543. var _ref;
  4544. _classCallCheck(this, MDCChip);
  4545. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  4546. args[_key] = arguments[_key];
  4547. }
  4548. /** @type {string} */
  4549. var _this = _possibleConstructorReturn(this, (_ref = MDCChip.__proto__ || Object.getPrototypeOf(MDCChip)).call.apply(_ref, [this].concat(args)));
  4550. _this.id;
  4551. /** @private {?Element} */
  4552. _this.leadingIcon_;
  4553. /** @private {?Element} */
  4554. _this.trailingIcon_;
  4555. /** @private {!MDCRipple} */
  4556. _this.ripple_;
  4557. /** @private {?function(?Event): undefined} */
  4558. _this.handleInteraction_;
  4559. /** @private {?function(!Event): undefined} */
  4560. _this.handleTransitionEnd_;
  4561. /** @private {function(!Event): undefined} */
  4562. _this.handleTrailingIconInteraction_;
  4563. return _this;
  4564. }
  4565. /**
  4566. * @param {!Element} root
  4567. * @return {!MDCChip}
  4568. */
  4569. _createClass(MDCChip, [{
  4570. key: 'initialize',
  4571. value: function initialize() {
  4572. var _this2 = this;
  4573. var rippleFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el, foundation) {
  4574. return new __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"](el, foundation);
  4575. };
  4576. this.id = this.root_.id;
  4577. this.leadingIcon_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].LEADING_ICON_SELECTOR);
  4578. this.trailingIcon_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].TRAILING_ICON_SELECTOR);
  4579. // Adjust ripple size for chips with animated growing width. This applies when filter chips without
  4580. // a leading icon are selected, and a leading checkmark will cause the chip width to expand.
  4581. var checkmarkEl = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].CHECKMARK_SELECTOR);
  4582. if (checkmarkEl && !this.leadingIcon_) {
  4583. var adapter = _extends(__WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"].createAdapter(this), {
  4584. computeBoundingRect: function computeBoundingRect() {
  4585. var height = _this2.root_.getBoundingClientRect().height;
  4586. // The checkmark's width is initially set to 0, so use the checkmark's height as a proxy since the
  4587. // checkmark should always be square.
  4588. var width = _this2.root_.getBoundingClientRect().width + checkmarkEl.getBoundingClientRect().height;
  4589. return { height: height, width: width };
  4590. }
  4591. });
  4592. this.ripple_ = rippleFactory(this.root_, new __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRippleFoundation"](adapter));
  4593. } else {
  4594. this.ripple_ = rippleFactory(this.root_);
  4595. }
  4596. }
  4597. }, {
  4598. key: 'initialSyncWithDOM',
  4599. value: function initialSyncWithDOM() {
  4600. var _this3 = this;
  4601. this.handleInteraction_ = function (evt) {
  4602. return _this3.foundation_.handleInteraction(evt);
  4603. };
  4604. this.handleTransitionEnd_ = function (evt) {
  4605. return _this3.foundation_.handleTransitionEnd(evt);
  4606. };
  4607. this.handleTrailingIconInteraction_ = function (evt) {
  4608. return _this3.foundation_.handleTrailingIconInteraction(evt);
  4609. };
  4610. INTERACTION_EVENTS.forEach(function (evtType) {
  4611. _this3.root_.addEventListener(evtType, _this3.handleInteraction_);
  4612. });
  4613. this.root_.addEventListener('transitionend', this.handleTransitionEnd_);
  4614. if (this.trailingIcon_) {
  4615. INTERACTION_EVENTS.forEach(function (evtType) {
  4616. _this3.trailingIcon_.addEventListener(evtType, _this3.handleTrailingIconInteraction_);
  4617. });
  4618. }
  4619. }
  4620. }, {
  4621. key: 'destroy',
  4622. value: function destroy() {
  4623. var _this4 = this;
  4624. this.ripple_.destroy();
  4625. INTERACTION_EVENTS.forEach(function (evtType) {
  4626. _this4.root_.removeEventListener(evtType, _this4.handleInteraction_);
  4627. });
  4628. this.root_.removeEventListener('transitionend', this.handleTransitionEnd_);
  4629. if (this.trailingIcon_) {
  4630. INTERACTION_EVENTS.forEach(function (evtType) {
  4631. _this4.trailingIcon_.removeEventListener(evtType, _this4.handleTrailingIconInteraction_);
  4632. });
  4633. }
  4634. _get(MDCChip.prototype.__proto__ || Object.getPrototypeOf(MDCChip.prototype), 'destroy', this).call(this);
  4635. }
  4636. /**
  4637. * Returns whether the chip is selected.
  4638. * @return {boolean}
  4639. */
  4640. }, {
  4641. key: 'beginExit',
  4642. /**
  4643. * Begins the exit animation which leads to removal of the chip.
  4644. */
  4645. value: function beginExit() {
  4646. this.foundation_.beginExit();
  4647. }
  4648. /**
  4649. * @return {!MDCChipFoundation}
  4650. */
  4651. }, {
  4652. key: 'getDefaultFoundation',
  4653. value: function getDefaultFoundation() {
  4654. var _this5 = this;
  4655. return new __WEBPACK_IMPORTED_MODULE_3__foundation__["a" /* MDCChipFoundation */]( /** @type {!MDCChipAdapter} */_extends({
  4656. addClass: function addClass(className) {
  4657. return _this5.root_.classList.add(className);
  4658. },
  4659. removeClass: function removeClass(className) {
  4660. return _this5.root_.classList.remove(className);
  4661. },
  4662. hasClass: function hasClass(className) {
  4663. return _this5.root_.classList.contains(className);
  4664. },
  4665. addClassToLeadingIcon: function addClassToLeadingIcon(className) {
  4666. if (_this5.leadingIcon_) {
  4667. _this5.leadingIcon_.classList.add(className);
  4668. }
  4669. },
  4670. removeClassFromLeadingIcon: function removeClassFromLeadingIcon(className) {
  4671. if (_this5.leadingIcon_) {
  4672. _this5.leadingIcon_.classList.remove(className);
  4673. }
  4674. },
  4675. eventTargetHasClass: function eventTargetHasClass(target, className) {
  4676. return target.classList.contains(className);
  4677. },
  4678. notifyInteraction: function notifyInteraction() {
  4679. return _this5.emit(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].INTERACTION_EVENT, { chipId: _this5.id }, true /* shouldBubble */);
  4680. },
  4681. notifySelection: function notifySelection(selected) {
  4682. return _this5.emit(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].SELECTION_EVENT, { chipId: _this5.id, selected: selected }, true /* shouldBubble */);
  4683. },
  4684. notifyTrailingIconInteraction: function notifyTrailingIconInteraction() {
  4685. return _this5.emit(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].TRAILING_ICON_INTERACTION_EVENT, { chipId: _this5.id }, true /* shouldBubble */);
  4686. },
  4687. notifyRemoval: function notifyRemoval() {
  4688. return _this5.emit(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].REMOVAL_EVENT, { chipId: _this5.id, root: _this5.root_ }, true /* shouldBubble */);
  4689. },
  4690. getComputedStyleValue: function getComputedStyleValue(propertyName) {
  4691. return window.getComputedStyle(_this5.root_).getPropertyValue(propertyName);
  4692. },
  4693. setStyleProperty: function setStyleProperty(propertyName, value) {
  4694. return _this5.root_.style.setProperty(propertyName, value);
  4695. }
  4696. }));
  4697. }
  4698. /** @return {!MDCRipple} */
  4699. }, {
  4700. key: 'selected',
  4701. get: function get() {
  4702. return this.foundation_.isSelected();
  4703. }
  4704. /**
  4705. * Sets selected state on the chip.
  4706. * @param {boolean} selected
  4707. */
  4708. ,
  4709. set: function set(selected) {
  4710. this.foundation_.setSelected(selected);
  4711. }
  4712. /**
  4713. * Returns whether a trailing icon click should trigger exit/removal of the chip.
  4714. * @return {boolean}
  4715. */
  4716. }, {
  4717. key: 'shouldRemoveOnTrailingIconClick',
  4718. get: function get() {
  4719. return this.foundation_.getShouldRemoveOnTrailingIconClick();
  4720. }
  4721. /**
  4722. * Sets whether a trailing icon click should trigger exit/removal of the chip.
  4723. * @param {boolean} shouldRemove
  4724. */
  4725. ,
  4726. set: function set(shouldRemove) {
  4727. this.foundation_.setShouldRemoveOnTrailingIconClick(shouldRemove);
  4728. }
  4729. }, {
  4730. key: 'ripple',
  4731. get: function get() {
  4732. return this.ripple_;
  4733. }
  4734. }], [{
  4735. key: 'attachTo',
  4736. value: function attachTo(root) {
  4737. return new MDCChip(root);
  4738. }
  4739. }]);
  4740. return MDCChip;
  4741. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  4742. /***/ }),
  4743. /* 31 */
  4744. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4745. "use strict";
  4746. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  4747. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4748. /**
  4749. * @license
  4750. * Copyright 2017 Google Inc.
  4751. *
  4752. * Permission is hereby granted, free of charge, to any person obtaining a copy
  4753. * of this software and associated documentation files (the "Software"), to deal
  4754. * in the Software without restriction, including without limitation the rights
  4755. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  4756. * copies of the Software, and to permit persons to whom the Software is
  4757. * furnished to do so, subject to the following conditions:
  4758. *
  4759. * The above copyright notice and this permission notice shall be included in
  4760. * all copies or substantial portions of the Software.
  4761. *
  4762. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  4763. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  4764. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  4765. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  4766. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  4767. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  4768. * THE SOFTWARE.
  4769. */
  4770. /* eslint no-unused-vars: [2, {"args": "none"}] */
  4771. /**
  4772. * Adapter for MDC Chip.
  4773. *
  4774. * Defines the shape of the adapter expected by the foundation. Implement this
  4775. * adapter to integrate the Chip into your framework. See
  4776. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  4777. * for more information.
  4778. *
  4779. * @record
  4780. */
  4781. var MDCChipAdapter = function () {
  4782. function MDCChipAdapter() {
  4783. _classCallCheck(this, MDCChipAdapter);
  4784. }
  4785. _createClass(MDCChipAdapter, [{
  4786. key: "addClass",
  4787. /**
  4788. * Adds a class to the root element.
  4789. * @param {string} className
  4790. */
  4791. value: function addClass(className) {}
  4792. /**
  4793. * Removes a class from the root element.
  4794. * @param {string} className
  4795. */
  4796. }, {
  4797. key: "removeClass",
  4798. value: function removeClass(className) {}
  4799. /**
  4800. * Returns true if the root element contains the given class.
  4801. * @param {string} className
  4802. * @return {boolean}
  4803. */
  4804. }, {
  4805. key: "hasClass",
  4806. value: function hasClass(className) {}
  4807. /**
  4808. * Adds a class to the leading icon element.
  4809. * @param {string} className
  4810. */
  4811. }, {
  4812. key: "addClassToLeadingIcon",
  4813. value: function addClassToLeadingIcon(className) {}
  4814. /**
  4815. * Removes a class from the leading icon element.
  4816. * @param {string} className
  4817. */
  4818. }, {
  4819. key: "removeClassFromLeadingIcon",
  4820. value: function removeClassFromLeadingIcon(className) {}
  4821. /**
  4822. * Returns true if target has className, false otherwise.
  4823. * @param {!EventTarget} target
  4824. * @param {string} className
  4825. * @return {boolean}
  4826. */
  4827. }, {
  4828. key: "eventTargetHasClass",
  4829. value: function eventTargetHasClass(target, className) {}
  4830. /**
  4831. * Emits a custom "MDCChip:interaction" event denoting the chip has been
  4832. * interacted with (typically on click or keydown).
  4833. */
  4834. }, {
  4835. key: "notifyInteraction",
  4836. value: function notifyInteraction() {}
  4837. /**
  4838. * Emits a custom "MDCChip:selection" event denoting the chip has been selected or deselected.
  4839. * @param {boolean} selected
  4840. */
  4841. }, {
  4842. key: "notifySelection",
  4843. value: function notifySelection(selected) {}
  4844. /**
  4845. * Emits a custom "MDCChip:trailingIconInteraction" event denoting the trailing icon has been
  4846. * interacted with (typically on click or keydown).
  4847. */
  4848. }, {
  4849. key: "notifyTrailingIconInteraction",
  4850. value: function notifyTrailingIconInteraction() {}
  4851. /**
  4852. * Emits a custom event "MDCChip:removal" denoting the chip will be removed.
  4853. */
  4854. }, {
  4855. key: "notifyRemoval",
  4856. value: function notifyRemoval() {}
  4857. /**
  4858. * Returns the computed property value of the given style property on the root element.
  4859. * @param {string} propertyName
  4860. * @return {string}
  4861. */
  4862. }, {
  4863. key: "getComputedStyleValue",
  4864. value: function getComputedStyleValue(propertyName) {}
  4865. /**
  4866. * Sets the property value of the given style property on the root element.
  4867. * @param {string} propertyName
  4868. * @param {string} value
  4869. */
  4870. }, {
  4871. key: "setStyleProperty",
  4872. value: function setStyleProperty(propertyName, value) {}
  4873. }]);
  4874. return MDCChipAdapter;
  4875. }();
  4876. /* unused harmony default export */ var _unused_webpack_default_export = (MDCChipAdapter);
  4877. /***/ }),
  4878. /* 32 */
  4879. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4880. "use strict";
  4881. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCChipFoundation; });
  4882. /* unused harmony export MDCChipInteractionEventType */
  4883. /* unused harmony export MDCChipSelectionEventType */
  4884. /* unused harmony export MDCChipRemovalEventType */
  4885. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  4886. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(31);
  4887. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(33);
  4888. 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; };
  4889. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  4890. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4891. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  4892. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  4893. /**
  4894. * @license
  4895. * Copyright 2016 Google Inc.
  4896. *
  4897. * Permission is hereby granted, free of charge, to any person obtaining a copy
  4898. * of this software and associated documentation files (the "Software"), to deal
  4899. * in the Software without restriction, including without limitation the rights
  4900. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  4901. * copies of the Software, and to permit persons to whom the Software is
  4902. * furnished to do so, subject to the following conditions:
  4903. *
  4904. * The above copyright notice and this permission notice shall be included in
  4905. * all copies or substantial portions of the Software.
  4906. *
  4907. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  4908. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  4909. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  4910. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  4911. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  4912. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  4913. * THE SOFTWARE.
  4914. */
  4915. /**
  4916. * @extends {MDCFoundation<!MDCChipAdapter>}
  4917. * @final
  4918. */
  4919. var MDCChipFoundation = function (_MDCFoundation) {
  4920. _inherits(MDCChipFoundation, _MDCFoundation);
  4921. _createClass(MDCChipFoundation, null, [{
  4922. key: 'strings',
  4923. /** @return enum {string} */
  4924. get: function get() {
  4925. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  4926. }
  4927. /** @return enum {string} */
  4928. }, {
  4929. key: 'cssClasses',
  4930. get: function get() {
  4931. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  4932. }
  4933. /**
  4934. * {@see MDCChipAdapter} for typing information on parameters and return
  4935. * types.
  4936. * @return {!MDCChipAdapter}
  4937. */
  4938. }, {
  4939. key: 'defaultAdapter',
  4940. get: function get() {
  4941. return (/** @type {!MDCChipAdapter} */{
  4942. addClass: function addClass() {},
  4943. removeClass: function removeClass() {},
  4944. hasClass: function hasClass() {},
  4945. addClassToLeadingIcon: function addClassToLeadingIcon() {},
  4946. removeClassFromLeadingIcon: function removeClassFromLeadingIcon() {},
  4947. eventTargetHasClass: function eventTargetHasClass() {},
  4948. notifyInteraction: function notifyInteraction() {},
  4949. notifySelection: function notifySelection() {},
  4950. notifyTrailingIconInteraction: function notifyTrailingIconInteraction() {},
  4951. notifyRemoval: function notifyRemoval() {},
  4952. getComputedStyleValue: function getComputedStyleValue() {},
  4953. setStyleProperty: function setStyleProperty() {}
  4954. }
  4955. );
  4956. }
  4957. /**
  4958. * @param {!MDCChipAdapter} adapter
  4959. */
  4960. }]);
  4961. function MDCChipFoundation(adapter) {
  4962. _classCallCheck(this, MDCChipFoundation);
  4963. /**
  4964. * Whether a trailing icon click should immediately trigger exit/removal of the chip.
  4965. * @private {boolean}
  4966. * */
  4967. var _this = _possibleConstructorReturn(this, (MDCChipFoundation.__proto__ || Object.getPrototypeOf(MDCChipFoundation)).call(this, _extends(MDCChipFoundation.defaultAdapter, adapter)));
  4968. _this.shouldRemoveOnTrailingIconClick_ = true;
  4969. return _this;
  4970. }
  4971. /**
  4972. * @return {boolean}
  4973. */
  4974. _createClass(MDCChipFoundation, [{
  4975. key: 'isSelected',
  4976. value: function isSelected() {
  4977. return this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SELECTED);
  4978. }
  4979. /**
  4980. * @param {boolean} selected
  4981. */
  4982. }, {
  4983. key: 'setSelected',
  4984. value: function setSelected(selected) {
  4985. if (selected) {
  4986. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SELECTED);
  4987. } else {
  4988. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SELECTED);
  4989. }
  4990. this.adapter_.notifySelection(selected);
  4991. }
  4992. /**
  4993. * @return {boolean}
  4994. */
  4995. }, {
  4996. key: 'getShouldRemoveOnTrailingIconClick',
  4997. value: function getShouldRemoveOnTrailingIconClick() {
  4998. return this.shouldRemoveOnTrailingIconClick_;
  4999. }
  5000. /**
  5001. * @param {boolean} shouldRemove
  5002. */
  5003. }, {
  5004. key: 'setShouldRemoveOnTrailingIconClick',
  5005. value: function setShouldRemoveOnTrailingIconClick(shouldRemove) {
  5006. this.shouldRemoveOnTrailingIconClick_ = shouldRemove;
  5007. }
  5008. /**
  5009. * Begins the exit animation which leads to removal of the chip.
  5010. */
  5011. }, {
  5012. key: 'beginExit',
  5013. value: function beginExit() {
  5014. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CHIP_EXIT);
  5015. }
  5016. /**
  5017. * Handles an interaction event on the root element.
  5018. * @param {!Event} evt
  5019. */
  5020. }, {
  5021. key: 'handleInteraction',
  5022. value: function handleInteraction(evt) {
  5023. if (evt.type === 'click' || evt.key === 'Enter' || evt.keyCode === 13) {
  5024. this.adapter_.notifyInteraction();
  5025. }
  5026. }
  5027. /**
  5028. * Handles a transition end event on the root element.
  5029. * @param {!Event} evt
  5030. */
  5031. }, {
  5032. key: 'handleTransitionEnd',
  5033. value: function handleTransitionEnd(evt) {
  5034. var _this2 = this;
  5035. // Handle transition end event on the chip when it is about to be removed.
  5036. if (this.adapter_.eventTargetHasClass( /** @type {!EventTarget} */evt.target, __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CHIP_EXIT)) {
  5037. if (evt.propertyName === 'width') {
  5038. this.adapter_.notifyRemoval();
  5039. } else if (evt.propertyName === 'opacity') {
  5040. // See: https://css-tricks.com/using-css-transitions-auto-dimensions/#article-header-id-5
  5041. var chipWidth = this.adapter_.getComputedStyleValue('width');
  5042. // On the next frame (once we get the computed width), explicitly set the chip's width
  5043. // to its current pixel width, so we aren't transitioning out of 'auto'.
  5044. requestAnimationFrame(function () {
  5045. _this2.adapter_.setStyleProperty('width', chipWidth);
  5046. // To mitigate jitter, start transitioning padding and margin before width.
  5047. _this2.adapter_.setStyleProperty('padding', '0');
  5048. _this2.adapter_.setStyleProperty('margin', '0');
  5049. // On the next frame (once width is explicitly set), transition width to 0.
  5050. requestAnimationFrame(function () {
  5051. _this2.adapter_.setStyleProperty('width', '0');
  5052. });
  5053. });
  5054. }
  5055. return;
  5056. }
  5057. // Handle a transition end event on the leading icon or checkmark, since the transition end event bubbles.
  5058. if (evt.propertyName !== 'opacity') {
  5059. return;
  5060. }
  5061. 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)) {
  5062. this.adapter_.addClassToLeadingIcon(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HIDDEN_LEADING_ICON);
  5063. } 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)) {
  5064. this.adapter_.removeClassFromLeadingIcon(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HIDDEN_LEADING_ICON);
  5065. }
  5066. }
  5067. /**
  5068. * Handles an interaction event on the trailing icon element. This is used to
  5069. * prevent the ripple from activating on interaction with the trailing icon.
  5070. * @param {!Event} evt
  5071. */
  5072. }, {
  5073. key: 'handleTrailingIconInteraction',
  5074. value: function handleTrailingIconInteraction(evt) {
  5075. evt.stopPropagation();
  5076. if (evt.type === 'click' || evt.key === 'Enter' || evt.keyCode === 13) {
  5077. this.adapter_.notifyTrailingIconInteraction();
  5078. if (this.shouldRemoveOnTrailingIconClick_) {
  5079. this.beginExit();
  5080. }
  5081. }
  5082. }
  5083. }]);
  5084. return MDCChipFoundation;
  5085. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  5086. /**
  5087. * @typedef {{
  5088. * detail: {
  5089. * chipId: string,
  5090. * },
  5091. * bubbles: boolean,
  5092. * }}
  5093. */
  5094. var MDCChipInteractionEventType = void 0;
  5095. /**
  5096. * @typedef {{
  5097. * detail: {
  5098. * chipId: string,
  5099. * selected: boolean,
  5100. * },
  5101. * bubbles: boolean,
  5102. * }}
  5103. */
  5104. var MDCChipSelectionEventType = void 0;
  5105. /**
  5106. * @typedef {{
  5107. * detail: {
  5108. * chipId: string,
  5109. * root: Element,
  5110. * },
  5111. * bubbles: boolean,
  5112. * }}
  5113. */
  5114. var MDCChipRemovalEventType = void 0;
  5115. /***/ }),
  5116. /* 33 */
  5117. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5118. "use strict";
  5119. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  5120. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  5121. /**
  5122. * @license
  5123. * Copyright 2016 Google Inc.
  5124. *
  5125. * Permission is hereby granted, free of charge, to any person obtaining a copy
  5126. * of this software and associated documentation files (the "Software"), to deal
  5127. * in the Software without restriction, including without limitation the rights
  5128. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  5129. * copies of the Software, and to permit persons to whom the Software is
  5130. * furnished to do so, subject to the following conditions:
  5131. *
  5132. * The above copyright notice and this permission notice shall be included in
  5133. * all copies or substantial portions of the Software.
  5134. *
  5135. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  5136. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  5137. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  5138. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  5139. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  5140. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  5141. * THE SOFTWARE.
  5142. */
  5143. /** @enum {string} */
  5144. var strings = {
  5145. ENTRY_ANIMATION_NAME: 'mdc-chip-entry',
  5146. INTERACTION_EVENT: 'MDCChip:interaction',
  5147. SELECTION_EVENT: 'MDCChip:selection',
  5148. TRAILING_ICON_INTERACTION_EVENT: 'MDCChip:trailingIconInteraction',
  5149. REMOVAL_EVENT: 'MDCChip:removal',
  5150. CHECKMARK_SELECTOR: '.mdc-chip__checkmark',
  5151. LEADING_ICON_SELECTOR: '.mdc-chip__icon--leading',
  5152. TRAILING_ICON_SELECTOR: '.mdc-chip__icon--trailing'
  5153. };
  5154. /** @enum {string} */
  5155. var cssClasses = {
  5156. CHECKMARK: 'mdc-chip__checkmark',
  5157. CHIP_EXIT: 'mdc-chip--exit',
  5158. HIDDEN_LEADING_ICON: 'mdc-chip__icon--leading-hidden',
  5159. LEADING_ICON: 'mdc-chip__icon--leading',
  5160. TRAILING_ICON: 'mdc-chip__icon--trailing',
  5161. SELECTED: 'mdc-chip--selected'
  5162. };
  5163. /***/ }),
  5164. /* 34 */
  5165. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5166. "use strict";
  5167. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  5168. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5169. /**
  5170. * @license
  5171. * Copyright 2017 Google Inc.
  5172. *
  5173. * Permission is hereby granted, free of charge, to any person obtaining a copy
  5174. * of this software and associated documentation files (the "Software"), to deal
  5175. * in the Software without restriction, including without limitation the rights
  5176. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  5177. * copies of the Software, and to permit persons to whom the Software is
  5178. * furnished to do so, subject to the following conditions:
  5179. *
  5180. * The above copyright notice and this permission notice shall be included in
  5181. * all copies or substantial portions of the Software.
  5182. *
  5183. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  5184. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  5185. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  5186. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  5187. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  5188. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  5189. * THE SOFTWARE.
  5190. */
  5191. /* eslint no-unused-vars: [2, {"args": "none"}] */
  5192. /**
  5193. * Adapter for MDC Chip Set.
  5194. *
  5195. * Defines the shape of the adapter expected by the foundation. Implement this
  5196. * adapter to integrate the Chip Set into your framework. See
  5197. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  5198. * for more information.
  5199. *
  5200. * @record
  5201. */
  5202. var MDCChipSetAdapter = function () {
  5203. function MDCChipSetAdapter() {
  5204. _classCallCheck(this, MDCChipSetAdapter);
  5205. }
  5206. _createClass(MDCChipSetAdapter, [{
  5207. key: "hasClass",
  5208. /**
  5209. * Returns true if the root element contains the given class name.
  5210. * @param {string} className
  5211. * @return {boolean}
  5212. */
  5213. value: function hasClass(className) {}
  5214. /**
  5215. * Removes the chip with the given id from the chip set.
  5216. * @param {string} chipId
  5217. */
  5218. }, {
  5219. key: "removeChip",
  5220. value: function removeChip(chipId) {}
  5221. /**
  5222. * Sets the selected state of the chip with the given id.
  5223. * @param {string} chipId
  5224. * @param {boolean} selected
  5225. */
  5226. }, {
  5227. key: "setSelected",
  5228. value: function setSelected(chipId, selected) {}
  5229. }]);
  5230. return MDCChipSetAdapter;
  5231. }();
  5232. /* unused harmony default export */ var _unused_webpack_default_export = (MDCChipSetAdapter);
  5233. /***/ }),
  5234. /* 35 */
  5235. /***/ (function(module, exports, __webpack_require__) {
  5236. var tabbable = __webpack_require__(80);
  5237. var listeningFocusTrap = null;
  5238. function focusTrap(element, userOptions) {
  5239. var tabbableNodes = [];
  5240. var firstTabbableNode = null;
  5241. var lastTabbableNode = null;
  5242. var nodeFocusedBeforeActivation = null;
  5243. var active = false;
  5244. var paused = false;
  5245. var tabEvent = null;
  5246. var container = (typeof element === 'string')
  5247. ? document.querySelector(element)
  5248. : element;
  5249. var config = userOptions || {};
  5250. config.returnFocusOnDeactivate = (userOptions && userOptions.returnFocusOnDeactivate !== undefined)
  5251. ? userOptions.returnFocusOnDeactivate
  5252. : true;
  5253. config.escapeDeactivates = (userOptions && userOptions.escapeDeactivates !== undefined)
  5254. ? userOptions.escapeDeactivates
  5255. : true;
  5256. var trap = {
  5257. activate: activate,
  5258. deactivate: deactivate,
  5259. pause: pause,
  5260. unpause: unpause,
  5261. };
  5262. return trap;
  5263. function activate(activateOptions) {
  5264. if (active) return;
  5265. var defaultedActivateOptions = {
  5266. onActivate: (activateOptions && activateOptions.onActivate !== undefined)
  5267. ? activateOptions.onActivate
  5268. : config.onActivate,
  5269. };
  5270. active = true;
  5271. paused = false;
  5272. nodeFocusedBeforeActivation = document.activeElement;
  5273. if (defaultedActivateOptions.onActivate) {
  5274. defaultedActivateOptions.onActivate();
  5275. }
  5276. addListeners();
  5277. return trap;
  5278. }
  5279. function deactivate(deactivateOptions) {
  5280. if (!active) return;
  5281. var defaultedDeactivateOptions = {
  5282. returnFocus: (deactivateOptions && deactivateOptions.returnFocus !== undefined)
  5283. ? deactivateOptions.returnFocus
  5284. : config.returnFocusOnDeactivate,
  5285. onDeactivate: (deactivateOptions && deactivateOptions.onDeactivate !== undefined)
  5286. ? deactivateOptions.onDeactivate
  5287. : config.onDeactivate,
  5288. };
  5289. removeListeners();
  5290. if (defaultedDeactivateOptions.onDeactivate) {
  5291. defaultedDeactivateOptions.onDeactivate();
  5292. }
  5293. if (defaultedDeactivateOptions.returnFocus) {
  5294. setTimeout(function () {
  5295. tryFocus(nodeFocusedBeforeActivation);
  5296. }, 0);
  5297. }
  5298. active = false;
  5299. paused = false;
  5300. return this;
  5301. }
  5302. function pause() {
  5303. if (paused || !active) return;
  5304. paused = true;
  5305. removeListeners();
  5306. }
  5307. function unpause() {
  5308. if (!paused || !active) return;
  5309. paused = false;
  5310. addListeners();
  5311. }
  5312. function addListeners() {
  5313. if (!active) return;
  5314. // There can be only one listening focus trap at a time
  5315. if (listeningFocusTrap) {
  5316. listeningFocusTrap.pause();
  5317. }
  5318. listeningFocusTrap = trap;
  5319. updateTabbableNodes();
  5320. tryFocus(firstFocusNode());
  5321. document.addEventListener('focus', checkFocus, true);
  5322. document.addEventListener('click', checkClick, true);
  5323. document.addEventListener('mousedown', checkPointerDown, true);
  5324. document.addEventListener('touchstart', checkPointerDown, true);
  5325. document.addEventListener('keydown', checkKey, true);
  5326. return trap;
  5327. }
  5328. function removeListeners() {
  5329. if (!active || listeningFocusTrap !== trap) return;
  5330. document.removeEventListener('focus', checkFocus, true);
  5331. document.removeEventListener('click', checkClick, true);
  5332. document.removeEventListener('mousedown', checkPointerDown, true);
  5333. document.removeEventListener('touchstart', checkPointerDown, true);
  5334. document.removeEventListener('keydown', checkKey, true);
  5335. listeningFocusTrap = null;
  5336. return trap;
  5337. }
  5338. function getNodeForOption(optionName) {
  5339. var optionValue = config[optionName];
  5340. var node = optionValue;
  5341. if (!optionValue) {
  5342. return null;
  5343. }
  5344. if (typeof optionValue === 'string') {
  5345. node = document.querySelector(optionValue);
  5346. if (!node) {
  5347. throw new Error('`' + optionName + '` refers to no known node');
  5348. }
  5349. }
  5350. if (typeof optionValue === 'function') {
  5351. node = optionValue();
  5352. if (!node) {
  5353. throw new Error('`' + optionName + '` did not return a node');
  5354. }
  5355. }
  5356. return node;
  5357. }
  5358. function firstFocusNode() {
  5359. var node;
  5360. if (getNodeForOption('initialFocus') !== null) {
  5361. node = getNodeForOption('initialFocus');
  5362. } else if (container.contains(document.activeElement)) {
  5363. node = document.activeElement;
  5364. } else {
  5365. node = tabbableNodes[0] || getNodeForOption('fallbackFocus');
  5366. }
  5367. if (!node) {
  5368. throw new Error('You can\'t have a focus-trap without at least one focusable element');
  5369. }
  5370. return node;
  5371. }
  5372. // This needs to be done on mousedown and touchstart instead of click
  5373. // so that it precedes the focus event
  5374. function checkPointerDown(e) {
  5375. if (config.clickOutsideDeactivates && !container.contains(e.target)) {
  5376. deactivate({ returnFocus: false });
  5377. }
  5378. }
  5379. function checkClick(e) {
  5380. if (config.clickOutsideDeactivates) return;
  5381. if (container.contains(e.target)) return;
  5382. e.preventDefault();
  5383. e.stopImmediatePropagation();
  5384. }
  5385. function checkFocus(e) {
  5386. if (container.contains(e.target)) return;
  5387. e.preventDefault();
  5388. e.stopImmediatePropagation();
  5389. // Checking for a blur method here resolves a Firefox issue (#15)
  5390. if (typeof e.target.blur === 'function') e.target.blur();
  5391. if (tabEvent) {
  5392. readjustFocus(tabEvent);
  5393. }
  5394. }
  5395. function checkKey(e) {
  5396. if (e.key === 'Tab' || e.keyCode === 9) {
  5397. handleTab(e);
  5398. }
  5399. if (config.escapeDeactivates !== false && isEscapeEvent(e)) {
  5400. deactivate();
  5401. }
  5402. }
  5403. function handleTab(e) {
  5404. updateTabbableNodes();
  5405. if (e.target.hasAttribute('tabindex') && Number(e.target.getAttribute('tabindex')) < 0) {
  5406. return tabEvent = e;
  5407. }
  5408. e.preventDefault();
  5409. var currentFocusIndex = tabbableNodes.indexOf(e.target);
  5410. if (e.shiftKey) {
  5411. if (e.target === firstTabbableNode || tabbableNodes.indexOf(e.target) === -1) {
  5412. return tryFocus(lastTabbableNode);
  5413. }
  5414. return tryFocus(tabbableNodes[currentFocusIndex - 1]);
  5415. }
  5416. if (e.target === lastTabbableNode) return tryFocus(firstTabbableNode);
  5417. tryFocus(tabbableNodes[currentFocusIndex + 1]);
  5418. }
  5419. function updateTabbableNodes() {
  5420. tabbableNodes = tabbable(container);
  5421. firstTabbableNode = tabbableNodes[0];
  5422. lastTabbableNode = tabbableNodes[tabbableNodes.length - 1];
  5423. }
  5424. function readjustFocus(e) {
  5425. if (e.shiftKey) return tryFocus(lastTabbableNode);
  5426. tryFocus(firstTabbableNode);
  5427. }
  5428. }
  5429. function isEscapeEvent(e) {
  5430. return e.key === 'Escape' || e.key === 'Esc' || e.keyCode === 27;
  5431. }
  5432. function tryFocus(node) {
  5433. if (!node || !node.focus) return;
  5434. if (node === document.activeElement) return;
  5435. node.focus();
  5436. if (node.tagName.toLowerCase() === 'input') {
  5437. node.select();
  5438. }
  5439. }
  5440. module.exports = focusTrap;
  5441. /***/ }),
  5442. /* 36 */
  5443. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5444. "use strict";
  5445. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__adapter__ = __webpack_require__(15);
  5446. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_foundation__ = __webpack_require__(0);
  5447. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(37);
  5448. 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; };
  5449. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  5450. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5451. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  5452. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  5453. /**
  5454. * @license
  5455. * Copyright 2018 Google Inc.
  5456. *
  5457. * Permission is hereby granted, free of charge, to any person obtaining a copy
  5458. * of this software and associated documentation files (the "Software"), to deal
  5459. * in the Software without restriction, including without limitation the rights
  5460. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  5461. * copies of the Software, and to permit persons to whom the Software is
  5462. * furnished to do so, subject to the following conditions:
  5463. *
  5464. * The above copyright notice and this permission notice shall be included in
  5465. * all copies or substantial portions of the Software.
  5466. *
  5467. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  5468. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  5469. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  5470. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  5471. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  5472. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  5473. * THE SOFTWARE.
  5474. */
  5475. /**
  5476. * @extends {MDCFoundation<!MDCDrawerAdapter>}
  5477. */
  5478. var MDCDismissibleDrawerFoundation = function (_MDCFoundation) {
  5479. _inherits(MDCDismissibleDrawerFoundation, _MDCFoundation);
  5480. _createClass(MDCDismissibleDrawerFoundation, null, [{
  5481. key: 'strings',
  5482. /** @return enum {string} */
  5483. get: function get() {
  5484. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  5485. }
  5486. /** @return enum {string} */
  5487. }, {
  5488. key: 'cssClasses',
  5489. get: function get() {
  5490. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  5491. }
  5492. }, {
  5493. key: 'defaultAdapter',
  5494. get: function get() {
  5495. return (/** @type {!MDCDrawerAdapter} */{
  5496. addClass: function addClass() /* className: string */{},
  5497. removeClass: function removeClass() /* className: string */{},
  5498. hasClass: function hasClass() /* className: string */{},
  5499. elementHasClass: function elementHasClass() /* element: !Element, className: string */{},
  5500. notifyClose: function notifyClose() {},
  5501. notifyOpen: function notifyOpen() {},
  5502. saveFocus: function saveFocus() {},
  5503. restoreFocus: function restoreFocus() {},
  5504. focusActiveNavigationItem: function focusActiveNavigationItem() {},
  5505. trapFocus: function trapFocus() {},
  5506. releaseFocus: function releaseFocus() {}
  5507. }
  5508. );
  5509. }
  5510. }]);
  5511. function MDCDismissibleDrawerFoundation(adapter) {
  5512. _classCallCheck(this, MDCDismissibleDrawerFoundation);
  5513. /** @private {number} */
  5514. var _this = _possibleConstructorReturn(this, (MDCDismissibleDrawerFoundation.__proto__ || Object.getPrototypeOf(MDCDismissibleDrawerFoundation)).call(this, _extends(MDCDismissibleDrawerFoundation.defaultAdapter, adapter)));
  5515. _this.animationFrame_ = 0;
  5516. /** @private {number} */
  5517. _this.animationTimer_ = 0;
  5518. return _this;
  5519. }
  5520. _createClass(MDCDismissibleDrawerFoundation, [{
  5521. key: 'destroy',
  5522. value: function destroy() {
  5523. if (this.animationFrame_) {
  5524. cancelAnimationFrame(this.animationFrame_);
  5525. }
  5526. if (this.animationTimer_) {
  5527. clearTimeout(this.animationTimer_);
  5528. }
  5529. }
  5530. /**
  5531. * Function to open the drawer.
  5532. */
  5533. }, {
  5534. key: 'open',
  5535. value: function open() {
  5536. var _this2 = this;
  5537. if (this.isOpen() || this.isOpening() || this.isClosing()) {
  5538. return;
  5539. }
  5540. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPEN);
  5541. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ANIMATE);
  5542. // Wait a frame once display is no longer "none", to establish basis for animation
  5543. this.runNextAnimationFrame_(function () {
  5544. _this2.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPENING);
  5545. });
  5546. this.adapter_.saveFocus();
  5547. }
  5548. /**
  5549. * Function to close the drawer.
  5550. */
  5551. }, {
  5552. key: 'close',
  5553. value: function close() {
  5554. if (!this.isOpen() || this.isOpening() || this.isClosing()) {
  5555. return;
  5556. }
  5557. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CLOSING);
  5558. }
  5559. /**
  5560. * Extension point for when drawer finishes open animation.
  5561. * @protected
  5562. */
  5563. }, {
  5564. key: 'opened',
  5565. value: function opened() {}
  5566. /**
  5567. * Extension point for when drawer finishes close animation.
  5568. * @protected
  5569. */
  5570. }, {
  5571. key: 'closed',
  5572. value: function closed() {}
  5573. /**
  5574. * Returns true if drawer is in open state.
  5575. * @return {boolean}
  5576. */
  5577. }, {
  5578. key: 'isOpen',
  5579. value: function isOpen() {
  5580. return this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPEN);
  5581. }
  5582. /**
  5583. * Returns true if drawer is animating open.
  5584. * @return {boolean}
  5585. */
  5586. }, {
  5587. key: 'isOpening',
  5588. value: function isOpening() {
  5589. return this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPENING) || this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ANIMATE);
  5590. }
  5591. /**
  5592. * Returns true if drawer is animating closed.
  5593. * @return {boolean}
  5594. */
  5595. }, {
  5596. key: 'isClosing',
  5597. value: function isClosing() {
  5598. return this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CLOSING);
  5599. }
  5600. /**
  5601. * Keydown handler to close drawer when key is escape.
  5602. * @param evt
  5603. */
  5604. }, {
  5605. key: 'handleKeydown',
  5606. value: function handleKeydown(evt) {
  5607. var keyCode = evt.keyCode,
  5608. key = evt.key;
  5609. var isEscape = key === 'Escape' || keyCode === 27;
  5610. if (isEscape) {
  5611. this.close();
  5612. }
  5613. }
  5614. /**
  5615. * Handles a transition end event on the root element.
  5616. * @param {!Event} evt
  5617. */
  5618. }, {
  5619. key: 'handleTransitionEnd',
  5620. value: function handleTransitionEnd(evt) {
  5621. var OPENING = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPENING,
  5622. CLOSING = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CLOSING,
  5623. OPEN = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPEN,
  5624. ANIMATE = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ANIMATE,
  5625. ROOT = __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ROOT;
  5626. // In Edge, transitionend on ripple pseudo-elements yields a target without classList, so check for Element first.
  5627. var isElement = evt.target instanceof Element;
  5628. if (!isElement || !this.adapter_.elementHasClass( /** @type {!Element} */evt.target, ROOT)) {
  5629. return;
  5630. }
  5631. if (this.isClosing()) {
  5632. this.adapter_.removeClass(OPEN);
  5633. this.adapter_.restoreFocus();
  5634. this.closed();
  5635. this.adapter_.notifyClose();
  5636. } else {
  5637. this.adapter_.focusActiveNavigationItem();
  5638. this.opened();
  5639. this.adapter_.notifyOpen();
  5640. }
  5641. this.adapter_.removeClass(ANIMATE);
  5642. this.adapter_.removeClass(OPENING);
  5643. this.adapter_.removeClass(CLOSING);
  5644. }
  5645. /**
  5646. * Runs the given logic on the next animation frame, using setTimeout to factor in Firefox reflow behavior.
  5647. * @param {Function} callback
  5648. * @private
  5649. */
  5650. }, {
  5651. key: 'runNextAnimationFrame_',
  5652. value: function runNextAnimationFrame_(callback) {
  5653. var _this3 = this;
  5654. cancelAnimationFrame(this.animationFrame_);
  5655. this.animationFrame_ = requestAnimationFrame(function () {
  5656. _this3.animationFrame_ = 0;
  5657. clearTimeout(_this3.animationTimer_);
  5658. _this3.animationTimer_ = setTimeout(callback, 0);
  5659. });
  5660. }
  5661. }]);
  5662. return MDCDismissibleDrawerFoundation;
  5663. }(__WEBPACK_IMPORTED_MODULE_1__material_base_foundation__["a" /* default */]);
  5664. /* harmony default export */ __webpack_exports__["a"] = (MDCDismissibleDrawerFoundation);
  5665. /***/ }),
  5666. /* 37 */
  5667. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5668. "use strict";
  5669. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  5670. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  5671. /**
  5672. * @license
  5673. * Copyright 2016 Google Inc.
  5674. *
  5675. * Permission is hereby granted, free of charge, to any person obtaining a copy
  5676. * of this software and associated documentation files (the "Software"), to deal
  5677. * in the Software without restriction, including without limitation the rights
  5678. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  5679. * copies of the Software, and to permit persons to whom the Software is
  5680. * furnished to do so, subject to the following conditions:
  5681. *
  5682. * The above copyright notice and this permission notice shall be included in
  5683. * all copies or substantial portions of the Software.
  5684. *
  5685. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  5686. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  5687. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  5688. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  5689. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  5690. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  5691. * THE SOFTWARE.
  5692. */
  5693. /** @enum {string} */
  5694. var cssClasses = {
  5695. ROOT: 'mdc-drawer',
  5696. DISMISSIBLE: 'mdc-drawer--dismissible',
  5697. MODAL: 'mdc-drawer--modal',
  5698. OPEN: 'mdc-drawer--open',
  5699. ANIMATE: 'mdc-drawer--animate',
  5700. OPENING: 'mdc-drawer--opening',
  5701. CLOSING: 'mdc-drawer--closing'
  5702. };
  5703. /** @enum {string} */
  5704. var strings = {
  5705. APP_CONTENT_SELECTOR: '.mdc-drawer-app-content',
  5706. SCRIM_SELECTOR: '.mdc-drawer-scrim',
  5707. CLOSE_EVENT: 'MDCDrawer:closed',
  5708. OPEN_EVENT: 'MDCDrawer:opened'
  5709. };
  5710. /***/ }),
  5711. /* 38 */
  5712. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5713. "use strict";
  5714. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  5715. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5716. /**
  5717. * @license
  5718. * Copyright 2018 Google Inc.
  5719. *
  5720. * Permission is hereby granted, free of charge, to any person obtaining a copy
  5721. * of this software and associated documentation files (the "Software"), to deal
  5722. * in the Software without restriction, including without limitation the rights
  5723. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  5724. * copies of the Software, and to permit persons to whom the Software is
  5725. * furnished to do so, subject to the following conditions:
  5726. *
  5727. * The above copyright notice and this permission notice shall be included in
  5728. * all copies or substantial portions of the Software.
  5729. *
  5730. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  5731. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  5732. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  5733. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  5734. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  5735. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  5736. * THE SOFTWARE.
  5737. */
  5738. /* eslint no-unused-vars: [2, {"args": "none"}] */
  5739. /**
  5740. * Adapter for MDC List. Provides an interface for managing focus.
  5741. *
  5742. * Additionally, provides type information for the adapter to the Closure
  5743. * compiler.
  5744. *
  5745. * Implement this adapter for your framework of choice to delegate updates to
  5746. * the component in your framework of choice. See architecture documentation
  5747. * for more details.
  5748. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  5749. *
  5750. * @record
  5751. */
  5752. var MDCListAdapter = function () {
  5753. function MDCListAdapter() {
  5754. _classCallCheck(this, MDCListAdapter);
  5755. }
  5756. _createClass(MDCListAdapter, [{
  5757. key: "getListItemCount",
  5758. /** @return {number} */
  5759. value: function getListItemCount() {}
  5760. /**
  5761. * @return {number} */
  5762. }, {
  5763. key: "getFocusedElementIndex",
  5764. value: function getFocusedElementIndex() {}
  5765. /**
  5766. * @param {number} index
  5767. * @param {string} attribute
  5768. * @param {string} value
  5769. */
  5770. }, {
  5771. key: "setAttributeForElementIndex",
  5772. value: function setAttributeForElementIndex(index, attribute, value) {}
  5773. /**
  5774. * @param {number} index
  5775. * @param {string} attribute
  5776. */
  5777. }, {
  5778. key: "removeAttributeForElementIndex",
  5779. value: function removeAttributeForElementIndex(index, attribute) {}
  5780. /**
  5781. * @param {number} index
  5782. * @param {string} className
  5783. */
  5784. }, {
  5785. key: "addClassForElementIndex",
  5786. value: function addClassForElementIndex(index, className) {}
  5787. /**
  5788. * @param {number} index
  5789. * @param {string} className
  5790. */
  5791. }, {
  5792. key: "removeClassForElementIndex",
  5793. value: function removeClassForElementIndex(index, className) {}
  5794. /**
  5795. * Focuses list item at the index specified.
  5796. * @param {number} index
  5797. */
  5798. }, {
  5799. key: "focusItemAtIndex",
  5800. value: function focusItemAtIndex(index) {}
  5801. /**
  5802. * Sets the tabindex to the value specified for all button/a element children of
  5803. * the list item at the index specified.
  5804. * @param {number} listItemIndex
  5805. * @param {number} tabIndexValue
  5806. */
  5807. }, {
  5808. key: "setTabIndexForListItemChildren",
  5809. value: function setTabIndexForListItemChildren(listItemIndex, tabIndexValue) {}
  5810. /**
  5811. * If the given element has an href, follows the link.
  5812. * @param {!Element} ele
  5813. */
  5814. }, {
  5815. key: "followHref",
  5816. value: function followHref(ele) {}
  5817. /**
  5818. * @param {number} index
  5819. * @return {boolean} Returns true if radio button is present at given list item index.
  5820. */
  5821. }, {
  5822. key: "hasRadioAtIndex",
  5823. value: function hasRadioAtIndex(index) {}
  5824. /**
  5825. * @param {number} index
  5826. * @return {boolean} Returns true if checkbox is present at given list item index.
  5827. */
  5828. }, {
  5829. key: "hasCheckboxAtIndex",
  5830. value: function hasCheckboxAtIndex(index) {}
  5831. /**
  5832. * @param {number} index
  5833. * @return {boolean} Returns true if checkbox inside a list item is checked.
  5834. */
  5835. }, {
  5836. key: "isCheckboxCheckedAtIndex",
  5837. value: function isCheckboxCheckedAtIndex(index) {}
  5838. /**
  5839. * Sets the checked status of checkbox or radio at given list item index.
  5840. * @param {number} index
  5841. * @param {boolean} isChecked
  5842. */
  5843. }, {
  5844. key: "setCheckedCheckboxOrRadioAtIndex",
  5845. value: function setCheckedCheckboxOrRadioAtIndex(index, isChecked) {}
  5846. }]);
  5847. return MDCListAdapter;
  5848. }();
  5849. /* unused harmony default export */ var _unused_webpack_default_export = (MDCListAdapter);
  5850. /***/ }),
  5851. /* 39 */
  5852. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5853. "use strict";
  5854. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  5855. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  5856. /**
  5857. * @license
  5858. * Copyright 2018 Google Inc.
  5859. *
  5860. * Permission is hereby granted, free of charge, to any person obtaining a copy
  5861. * of this software and associated documentation files (the "Software"), to deal
  5862. * in the Software without restriction, including without limitation the rights
  5863. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  5864. * copies of the Software, and to permit persons to whom the Software is
  5865. * furnished to do so, subject to the following conditions:
  5866. *
  5867. * The above copyright notice and this permission notice shall be included in
  5868. * all copies or substantial portions of the Software.
  5869. *
  5870. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  5871. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  5872. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  5873. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  5874. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  5875. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  5876. * THE SOFTWARE.
  5877. */
  5878. /** @enum {string} */
  5879. var cssClasses = {
  5880. ROOT: 'mdc-list',
  5881. LIST_ITEM_CLASS: 'mdc-list-item',
  5882. LIST_ITEM_SELECTED_CLASS: 'mdc-list-item--selected',
  5883. LIST_ITEM_ACTIVATED_CLASS: 'mdc-list-item--activated'
  5884. };
  5885. /** @enum {string} */
  5886. var strings = {
  5887. ARIA_ORIENTATION: 'aria-orientation',
  5888. ARIA_ORIENTATION_HORIZONTAL: 'horizontal',
  5889. ARIA_SELECTED: 'aria-selected',
  5890. ARIA_CHECKED: 'aria-checked',
  5891. ARIA_CHECKED_RADIO_SELECTOR: '[role="radio"][aria-checked="true"]',
  5892. RADIO_SELECTOR: 'input[type="radio"]:not(:disabled)',
  5893. CHECKBOX_SELECTOR: 'input[type="checkbox"]:not(:disabled)',
  5894. CHECKBOX_RADIO_SELECTOR: 'input[type="checkbox"]:not(:disabled), input[type="radio"]:not(:disabled)',
  5895. CHILD_ELEMENTS_TO_TOGGLE_TABINDEX: '.' + cssClasses.LIST_ITEM_CLASS + ' button:not(:disabled),\n .' + cssClasses.LIST_ITEM_CLASS + ' a',
  5896. 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)',
  5897. ENABLED_ITEMS_SELECTOR: '.mdc-list-item:not(.mdc-list-item--disabled)'
  5898. };
  5899. /***/ }),
  5900. /* 40 */
  5901. /***/ (function(module, exports, __webpack_require__) {
  5902. var tabbable = __webpack_require__(85);
  5903. var xtend = __webpack_require__(86);
  5904. var listeningFocusTrap = null;
  5905. function focusTrap(element, userOptions) {
  5906. var doc = document;
  5907. var container =
  5908. typeof element === 'string' ? doc.querySelector(element) : element;
  5909. var config = xtend(
  5910. {
  5911. returnFocusOnDeactivate: true,
  5912. escapeDeactivates: true
  5913. },
  5914. userOptions
  5915. );
  5916. var state = {
  5917. firstTabbableNode: null,
  5918. lastTabbableNode: null,
  5919. nodeFocusedBeforeActivation: null,
  5920. mostRecentlyFocusedNode: null,
  5921. active: false,
  5922. paused: false
  5923. };
  5924. var trap = {
  5925. activate: activate,
  5926. deactivate: deactivate,
  5927. pause: pause,
  5928. unpause: unpause
  5929. };
  5930. return trap;
  5931. function activate(activateOptions) {
  5932. if (state.active) return;
  5933. updateTabbableNodes();
  5934. state.active = true;
  5935. state.paused = false;
  5936. state.nodeFocusedBeforeActivation = doc.activeElement;
  5937. var onActivate =
  5938. activateOptions && activateOptions.onActivate
  5939. ? activateOptions.onActivate
  5940. : config.onActivate;
  5941. if (onActivate) {
  5942. onActivate();
  5943. }
  5944. addListeners();
  5945. return trap;
  5946. }
  5947. function deactivate(deactivateOptions) {
  5948. if (!state.active) return;
  5949. removeListeners();
  5950. state.active = false;
  5951. state.paused = false;
  5952. var onDeactivate =
  5953. deactivateOptions && deactivateOptions.onDeactivate !== undefined
  5954. ? deactivateOptions.onDeactivate
  5955. : config.onDeactivate;
  5956. if (onDeactivate) {
  5957. onDeactivate();
  5958. }
  5959. var returnFocus =
  5960. deactivateOptions && deactivateOptions.returnFocus !== undefined
  5961. ? deactivateOptions.returnFocus
  5962. : config.returnFocusOnDeactivate;
  5963. if (returnFocus) {
  5964. delay(function() {
  5965. tryFocus(state.nodeFocusedBeforeActivation);
  5966. });
  5967. }
  5968. return trap;
  5969. }
  5970. function pause() {
  5971. if (state.paused || !state.active) return;
  5972. state.paused = true;
  5973. removeListeners();
  5974. }
  5975. function unpause() {
  5976. if (!state.paused || !state.active) return;
  5977. state.paused = false;
  5978. addListeners();
  5979. }
  5980. function addListeners() {
  5981. if (!state.active) return;
  5982. // There can be only one listening focus trap at a time
  5983. if (listeningFocusTrap) {
  5984. listeningFocusTrap.pause();
  5985. }
  5986. listeningFocusTrap = trap;
  5987. updateTabbableNodes();
  5988. // Delay ensures that the focused element doesn't capture the event
  5989. // that caused the focus trap activation.
  5990. delay(function() {
  5991. tryFocus(getInitialFocusNode());
  5992. });
  5993. doc.addEventListener('focusin', checkFocusIn, true);
  5994. doc.addEventListener('mousedown', checkPointerDown, true);
  5995. doc.addEventListener('touchstart', checkPointerDown, true);
  5996. doc.addEventListener('click', checkClick, true);
  5997. doc.addEventListener('keydown', checkKey, true);
  5998. return trap;
  5999. }
  6000. function removeListeners() {
  6001. if (!state.active || listeningFocusTrap !== trap) return;
  6002. doc.removeEventListener('focusin', checkFocusIn, true);
  6003. doc.removeEventListener('mousedown', checkPointerDown, true);
  6004. doc.removeEventListener('touchstart', checkPointerDown, true);
  6005. doc.removeEventListener('click', checkClick, true);
  6006. doc.removeEventListener('keydown', checkKey, true);
  6007. listeningFocusTrap = null;
  6008. return trap;
  6009. }
  6010. function getNodeForOption(optionName) {
  6011. var optionValue = config[optionName];
  6012. var node = optionValue;
  6013. if (!optionValue) {
  6014. return null;
  6015. }
  6016. if (typeof optionValue === 'string') {
  6017. node = doc.querySelector(optionValue);
  6018. if (!node) {
  6019. throw new Error('`' + optionName + '` refers to no known node');
  6020. }
  6021. }
  6022. if (typeof optionValue === 'function') {
  6023. node = optionValue();
  6024. if (!node) {
  6025. throw new Error('`' + optionName + '` did not return a node');
  6026. }
  6027. }
  6028. return node;
  6029. }
  6030. function getInitialFocusNode() {
  6031. var node;
  6032. if (getNodeForOption('initialFocus') !== null) {
  6033. node = getNodeForOption('initialFocus');
  6034. } else if (container.contains(doc.activeElement)) {
  6035. node = doc.activeElement;
  6036. } else {
  6037. node = state.firstTabbableNode || getNodeForOption('fallbackFocus');
  6038. }
  6039. if (!node) {
  6040. throw new Error(
  6041. "You can't have a focus-trap without at least one focusable element"
  6042. );
  6043. }
  6044. return node;
  6045. }
  6046. // This needs to be done on mousedown and touchstart instead of click
  6047. // so that it precedes the focus event.
  6048. function checkPointerDown(e) {
  6049. if (container.contains(e.target)) return;
  6050. if (config.clickOutsideDeactivates) {
  6051. deactivate({
  6052. returnFocus: !tabbable.isFocusable(e.target)
  6053. });
  6054. } else {
  6055. e.preventDefault();
  6056. }
  6057. }
  6058. // In case focus escapes the trap for some strange reason, pull it back in.
  6059. function checkFocusIn(e) {
  6060. // In Firefox when you Tab out of an iframe the Document is briefly focused.
  6061. if (container.contains(e.target) || e.target instanceof Document) {
  6062. return;
  6063. }
  6064. e.stopImmediatePropagation();
  6065. tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode());
  6066. }
  6067. function checkKey(e) {
  6068. if (config.escapeDeactivates !== false && isEscapeEvent(e)) {
  6069. e.preventDefault();
  6070. deactivate();
  6071. return;
  6072. }
  6073. if (isTabEvent(e)) {
  6074. checkTab(e);
  6075. return;
  6076. }
  6077. }
  6078. // Hijack Tab events on the first and last focusable nodes of the trap,
  6079. // in order to prevent focus from escaping. If it escapes for even a
  6080. // moment it can end up scrolling the page and causing confusion so we
  6081. // kind of need to capture the action at the keydown phase.
  6082. function checkTab(e) {
  6083. updateTabbableNodes();
  6084. if (e.shiftKey && e.target === state.firstTabbableNode) {
  6085. e.preventDefault();
  6086. tryFocus(state.lastTabbableNode);
  6087. return;
  6088. }
  6089. if (!e.shiftKey && e.target === state.lastTabbableNode) {
  6090. e.preventDefault();
  6091. tryFocus(state.firstTabbableNode);
  6092. return;
  6093. }
  6094. }
  6095. function checkClick(e) {
  6096. if (config.clickOutsideDeactivates) return;
  6097. if (container.contains(e.target)) return;
  6098. e.preventDefault();
  6099. e.stopImmediatePropagation();
  6100. }
  6101. function updateTabbableNodes() {
  6102. var tabbableNodes = tabbable(container);
  6103. state.firstTabbableNode = tabbableNodes[0] || getInitialFocusNode();
  6104. state.lastTabbableNode =
  6105. tabbableNodes[tabbableNodes.length - 1] || getInitialFocusNode();
  6106. }
  6107. function tryFocus(node) {
  6108. if (node === doc.activeElement) return;
  6109. if (!node || !node.focus) {
  6110. tryFocus(getInitialFocusNode());
  6111. return;
  6112. }
  6113. node.focus();
  6114. state.mostRecentlyFocusedNode = node;
  6115. if (isSelectableInput(node)) {
  6116. node.select();
  6117. }
  6118. }
  6119. }
  6120. function isSelectableInput(node) {
  6121. return (
  6122. node.tagName &&
  6123. node.tagName.toLowerCase() === 'input' &&
  6124. typeof node.select === 'function'
  6125. );
  6126. }
  6127. function isEscapeEvent(e) {
  6128. return e.key === 'Escape' || e.key === 'Esc' || e.keyCode === 27;
  6129. }
  6130. function isTabEvent(e) {
  6131. return e.key === 'Tab' || e.keyCode === 9;
  6132. }
  6133. function delay(fn) {
  6134. return setTimeout(fn, 0);
  6135. }
  6136. module.exports = focusTrap;
  6137. /***/ }),
  6138. /* 41 */
  6139. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6140. "use strict";
  6141. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  6142. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6143. /**
  6144. * @license
  6145. * Copyright 2017 Google Inc.
  6146. *
  6147. * Permission is hereby granted, free of charge, to any person obtaining a copy
  6148. * of this software and associated documentation files (the "Software"), to deal
  6149. * in the Software without restriction, including without limitation the rights
  6150. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  6151. * copies of the Software, and to permit persons to whom the Software is
  6152. * furnished to do so, subject to the following conditions:
  6153. *
  6154. * The above copyright notice and this permission notice shall be included in
  6155. * all copies or substantial portions of the Software.
  6156. *
  6157. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  6158. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  6159. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  6160. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  6161. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  6162. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  6163. * THE SOFTWARE.
  6164. */
  6165. /* eslint no-unused-vars: [2, {"args": "none"}] */
  6166. /**
  6167. * Adapter for MDC Floating Label.
  6168. *
  6169. * Defines the shape of the adapter expected by the foundation. Implement this
  6170. * adapter to integrate the floating label into your framework. See
  6171. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  6172. * for more information.
  6173. *
  6174. * @record
  6175. */
  6176. var MDCFloatingLabelAdapter = function () {
  6177. function MDCFloatingLabelAdapter() {
  6178. _classCallCheck(this, MDCFloatingLabelAdapter);
  6179. }
  6180. _createClass(MDCFloatingLabelAdapter, [{
  6181. key: "addClass",
  6182. /**
  6183. * Adds a class to the label element.
  6184. * @param {string} className
  6185. */
  6186. value: function addClass(className) {}
  6187. /**
  6188. * Removes a class from the label element.
  6189. * @param {string} className
  6190. */
  6191. }, {
  6192. key: "removeClass",
  6193. value: function removeClass(className) {}
  6194. /**
  6195. * Returns the width of the label element.
  6196. * @return {number}
  6197. */
  6198. }, {
  6199. key: "getWidth",
  6200. value: function getWidth() {}
  6201. /**
  6202. * Registers an event listener on the root element for a given event.
  6203. * @param {string} evtType
  6204. * @param {function(!Event): undefined} handler
  6205. */
  6206. }, {
  6207. key: "registerInteractionHandler",
  6208. value: function registerInteractionHandler(evtType, handler) {}
  6209. /**
  6210. * Deregisters an event listener on the root element for a given event.
  6211. * @param {string} evtType
  6212. * @param {function(!Event): undefined} handler
  6213. */
  6214. }, {
  6215. key: "deregisterInteractionHandler",
  6216. value: function deregisterInteractionHandler(evtType, handler) {}
  6217. }]);
  6218. return MDCFloatingLabelAdapter;
  6219. }();
  6220. /* unused harmony default export */ var _unused_webpack_default_export = (MDCFloatingLabelAdapter);
  6221. /***/ }),
  6222. /* 42 */
  6223. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6224. "use strict";
  6225. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  6226. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6227. /**
  6228. * @license
  6229. * Copyright 2018 Google Inc.
  6230. *
  6231. * Permission is hereby granted, free of charge, to any person obtaining a copy
  6232. * of this software and associated documentation files (the "Software"), to deal
  6233. * in the Software without restriction, including without limitation the rights
  6234. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  6235. * copies of the Software, and to permit persons to whom the Software is
  6236. * furnished to do so, subject to the following conditions:
  6237. *
  6238. * The above copyright notice and this permission notice shall be included in
  6239. * all copies or substantial portions of the Software.
  6240. *
  6241. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  6242. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  6243. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  6244. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  6245. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  6246. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  6247. * THE SOFTWARE.
  6248. */
  6249. /* eslint no-unused-vars: [2, {"args": "none"}] */
  6250. /**
  6251. * Adapter for MDC TextField Line Ripple.
  6252. *
  6253. * Defines the shape of the adapter expected by the foundation. Implement this
  6254. * adapter to integrate the line ripple into your framework. See
  6255. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  6256. * for more information.
  6257. *
  6258. * @record
  6259. */
  6260. var MDCLineRippleAdapter = function () {
  6261. function MDCLineRippleAdapter() {
  6262. _classCallCheck(this, MDCLineRippleAdapter);
  6263. }
  6264. _createClass(MDCLineRippleAdapter, [{
  6265. key: "addClass",
  6266. /**
  6267. * Adds a class to the line ripple element.
  6268. * @param {string} className
  6269. */
  6270. value: function addClass(className) {}
  6271. /**
  6272. * Removes a class from the line ripple element.
  6273. * @param {string} className
  6274. */
  6275. }, {
  6276. key: "removeClass",
  6277. value: function removeClass(className) {}
  6278. /**
  6279. * @param {string} className
  6280. * @return {boolean}
  6281. */
  6282. }, {
  6283. key: "hasClass",
  6284. value: function hasClass(className) {}
  6285. /**
  6286. * Sets the style property with propertyName to value on the root element.
  6287. * @param {string} propertyName
  6288. * @param {string} value
  6289. */
  6290. }, {
  6291. key: "setStyle",
  6292. value: function setStyle(propertyName, value) {}
  6293. /**
  6294. * Registers an event listener on the line ripple element for a given event.
  6295. * @param {string} evtType
  6296. * @param {function(!Event): undefined} handler
  6297. */
  6298. }, {
  6299. key: "registerEventHandler",
  6300. value: function registerEventHandler(evtType, handler) {}
  6301. /**
  6302. * Deregisters an event listener on the line ripple element for a given event.
  6303. * @param {string} evtType
  6304. * @param {function(!Event): undefined} handler
  6305. */
  6306. }, {
  6307. key: "deregisterEventHandler",
  6308. value: function deregisterEventHandler(evtType, handler) {}
  6309. }]);
  6310. return MDCLineRippleAdapter;
  6311. }();
  6312. /* unused harmony default export */ var _unused_webpack_default_export = (MDCLineRippleAdapter);
  6313. /***/ }),
  6314. /* 43 */
  6315. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6316. "use strict";
  6317. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  6318. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCMenu", function() { return MDCMenu; });
  6319. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  6320. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(109);
  6321. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(19);
  6322. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_menu_surface_index__ = __webpack_require__(45);
  6323. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_menu_surface_foundation__ = __webpack_require__(20);
  6324. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__material_list_index__ = __webpack_require__(16);
  6325. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCMenuFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  6326. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "AnchorMargin", function() { return __WEBPACK_IMPORTED_MODULE_4__material_menu_surface_foundation__["a"]; });
  6327. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Corner", function() { return __WEBPACK_IMPORTED_MODULE_3__material_menu_surface_index__["Corner"]; });
  6328. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  6329. 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); } };
  6330. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6331. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  6332. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  6333. /**
  6334. * @license
  6335. * Copyright 2018 Google Inc.
  6336. *
  6337. * Permission is hereby granted, free of charge, to any person obtaining a copy
  6338. * of this software and associated documentation files (the "Software"), to deal
  6339. * in the Software without restriction, including without limitation the rights
  6340. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  6341. * copies of the Software, and to permit persons to whom the Software is
  6342. * furnished to do so, subject to the following conditions:
  6343. *
  6344. * The above copyright notice and this permission notice shall be included in
  6345. * all copies or substantial portions of the Software.
  6346. *
  6347. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  6348. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  6349. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  6350. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  6351. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  6352. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  6353. * THE SOFTWARE.
  6354. */
  6355. /**
  6356. * @extends MDCComponent<!MDCMenuFoundation>
  6357. */
  6358. var MDCMenu = function (_MDCComponent) {
  6359. _inherits(MDCMenu, _MDCComponent);
  6360. /** @param {...?} args */
  6361. function MDCMenu() {
  6362. var _ref;
  6363. _classCallCheck(this, MDCMenu);
  6364. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  6365. args[_key] = arguments[_key];
  6366. }
  6367. /** @private {!MDCMenuSurface} */
  6368. var _this = _possibleConstructorReturn(this, (_ref = MDCMenu.__proto__ || Object.getPrototypeOf(MDCMenu)).call.apply(_ref, [this].concat(args)));
  6369. _this.menuSurface_;
  6370. /** @private {!MDCList} */
  6371. _this.list_;
  6372. /** @private {!Function} */
  6373. _this.handleKeydown_;
  6374. /** @private {!Function} */
  6375. _this.handleClick_;
  6376. /** @private {!Function} */
  6377. _this.afterOpenedCallback_;
  6378. return _this;
  6379. }
  6380. /**
  6381. * @param {!HTMLElement} root
  6382. * @return {!MDCMenu}
  6383. */
  6384. _createClass(MDCMenu, [{
  6385. key: 'initialize',
  6386. value: function initialize() {
  6387. var menuSurfaceFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el) {
  6388. return new __WEBPACK_IMPORTED_MODULE_3__material_menu_surface_index__["MDCMenuSurface"](el);
  6389. };
  6390. var listFactory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (el) {
  6391. return new __WEBPACK_IMPORTED_MODULE_5__material_list_index__["MDCList"](el);
  6392. };
  6393. this.menuSurface_ = menuSurfaceFactory(this.root_);
  6394. var list = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].LIST_SELECTOR);
  6395. if (list) {
  6396. this.list_ = listFactory(list);
  6397. this.list_.wrapFocus = true;
  6398. }
  6399. }
  6400. }, {
  6401. key: 'initialSyncWithDOM',
  6402. value: function initialSyncWithDOM() {
  6403. var _this2 = this;
  6404. this.afterOpenedCallback_ = function () {
  6405. return _this2.handleAfterOpened_();
  6406. };
  6407. this.handleKeydown_ = function (evt) {
  6408. return _this2.foundation_.handleKeydown(evt);
  6409. };
  6410. this.handleClick_ = function (evt) {
  6411. return _this2.foundation_.handleClick(evt);
  6412. };
  6413. this.menuSurface_.listen(__WEBPACK_IMPORTED_MODULE_4__material_menu_surface_foundation__["b" /* MDCMenuSurfaceFoundation */].strings.OPENED_EVENT, this.afterOpenedCallback_);
  6414. this.listen('keydown', this.handleKeydown_);
  6415. this.listen('click', this.handleClick_);
  6416. }
  6417. }, {
  6418. key: 'destroy',
  6419. value: function destroy() {
  6420. if (this.list_) {
  6421. this.list_.destroy();
  6422. }
  6423. this.menuSurface_.destroy();
  6424. this.menuSurface_.unlisten(__WEBPACK_IMPORTED_MODULE_4__material_menu_surface_foundation__["b" /* MDCMenuSurfaceFoundation */].strings.OPENED_EVENT, this.afterOpenedCallback_);
  6425. this.unlisten('keydown', this.handleKeydown_);
  6426. this.unlisten('click', this.handleClick_);
  6427. _get(MDCMenu.prototype.__proto__ || Object.getPrototypeOf(MDCMenu.prototype), 'destroy', this).call(this);
  6428. }
  6429. /** @return {boolean} */
  6430. }, {
  6431. key: 'setAnchorCorner',
  6432. /**
  6433. * @param {!Corner} corner Default anchor corner alignment of top-left
  6434. * menu corner.
  6435. */
  6436. value: function setAnchorCorner(corner) {
  6437. this.menuSurface_.setAnchorCorner(corner);
  6438. }
  6439. /**
  6440. * @param {!AnchorMargin} margin
  6441. */
  6442. }, {
  6443. key: 'setAnchorMargin',
  6444. value: function setAnchorMargin(margin) {
  6445. this.menuSurface_.setAnchorMargin(margin);
  6446. }
  6447. /**
  6448. * Return the items within the menu. Note that this only contains the set of elements within
  6449. * the items container that are proper list items, and not supplemental / presentational DOM
  6450. * elements.
  6451. * @return {!Array<!HTMLElement>}
  6452. */
  6453. }, {
  6454. key: 'getOptionByIndex',
  6455. /**
  6456. * Return the item within the menu at the index specified.
  6457. * @param {number} index
  6458. * @return {?HTMLElement}
  6459. */
  6460. value: function getOptionByIndex(index) {
  6461. var items = this.items;
  6462. if (index < items.length) {
  6463. return this.items[index];
  6464. } else {
  6465. return null;
  6466. }
  6467. }
  6468. /** @param {boolean} quickOpen */
  6469. }, {
  6470. key: 'setFixedPosition',
  6471. /** @param {boolean} isFixed */
  6472. value: function setFixedPosition(isFixed) {
  6473. this.menuSurface_.setFixedPosition(isFixed);
  6474. }
  6475. }, {
  6476. key: 'hoistMenuToBody',
  6477. value: function hoistMenuToBody() {
  6478. this.menuSurface_.hoistMenuToBody();
  6479. }
  6480. /** @param {boolean} isHoisted */
  6481. }, {
  6482. key: 'setIsHoisted',
  6483. value: function setIsHoisted(isHoisted) {
  6484. this.menuSurface_.setIsHoisted(isHoisted);
  6485. }
  6486. /**
  6487. * @param {number} x
  6488. * @param {number} y
  6489. */
  6490. }, {
  6491. key: 'setAbsolutePosition',
  6492. value: function setAbsolutePosition(x, y) {
  6493. this.menuSurface_.setAbsolutePosition(x, y);
  6494. }
  6495. /**
  6496. * Sets the element that the menu-surface is anchored to.
  6497. * @param {!HTMLElement} element
  6498. */
  6499. }, {
  6500. key: 'setAnchorElement',
  6501. value: function setAnchorElement(element) {
  6502. this.menuSurface_.anchorElement = element;
  6503. }
  6504. }, {
  6505. key: 'handleAfterOpened_',
  6506. value: function handleAfterOpened_() {
  6507. var list = this.items;
  6508. if (list.length > 0) {
  6509. list[0].focus();
  6510. }
  6511. }
  6512. /** @return {!MDCMenuFoundation} */
  6513. }, {
  6514. key: 'getDefaultFoundation',
  6515. value: function getDefaultFoundation() {
  6516. var _this3 = this;
  6517. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* MDCMenuFoundation */]({
  6518. addClassToElementAtIndex: function addClassToElementAtIndex(index, className) {
  6519. var list = _this3.items;
  6520. list[index].classList.add(className);
  6521. },
  6522. removeClassFromElementAtIndex: function removeClassFromElementAtIndex(index, className) {
  6523. var list = _this3.items;
  6524. list[index].classList.remove(className);
  6525. },
  6526. addAttributeToElementAtIndex: function addAttributeToElementAtIndex(index, attr, value) {
  6527. var list = _this3.items;
  6528. list[index].setAttribute(attr, value);
  6529. },
  6530. removeAttributeFromElementAtIndex: function removeAttributeFromElementAtIndex(index, attr) {
  6531. var list = _this3.items;
  6532. list[index].removeAttribute(attr);
  6533. },
  6534. elementContainsClass: function elementContainsClass(element, className) {
  6535. return element.classList.contains(className);
  6536. },
  6537. closeSurface: function closeSurface() {
  6538. return _this3.open = false;
  6539. },
  6540. getElementIndex: function getElementIndex(element) {
  6541. return _this3.items.indexOf(element);
  6542. },
  6543. getParentElement: function getParentElement(element) {
  6544. return element.parentElement;
  6545. },
  6546. getSelectedElementIndex: function getSelectedElementIndex(selectionGroup) {
  6547. return _this3.items.indexOf(selectionGroup.querySelector('.' + __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].MENU_SELECTED_LIST_ITEM));
  6548. },
  6549. notifySelected: function notifySelected(evtData) {
  6550. return _this3.emit(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].SELECTED_EVENT, {
  6551. index: evtData.index,
  6552. item: _this3.items[evtData.index]
  6553. });
  6554. }
  6555. });
  6556. }
  6557. }, {
  6558. key: 'open',
  6559. get: function get() {
  6560. return this.menuSurface_.open;
  6561. }
  6562. /** @param {boolean} value */
  6563. ,
  6564. set: function set(value) {
  6565. this.menuSurface_.open = value;
  6566. }
  6567. /** @return {boolean} */
  6568. }, {
  6569. key: 'wrapFocus',
  6570. get: function get() {
  6571. return this.list_.wrapFocus;
  6572. }
  6573. /** @param {boolean} value */
  6574. ,
  6575. set: function set(value) {
  6576. this.list_.wrapFocus = value;
  6577. }
  6578. }, {
  6579. key: 'items',
  6580. get: function get() {
  6581. return this.list_.listElements;
  6582. }
  6583. }, {
  6584. key: 'quickOpen',
  6585. set: function set(quickOpen) {
  6586. this.menuSurface_.quickOpen = quickOpen;
  6587. }
  6588. }], [{
  6589. key: 'attachTo',
  6590. value: function attachTo(root) {
  6591. return new MDCMenu(root);
  6592. }
  6593. }]);
  6594. return MDCMenu;
  6595. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  6596. /***/ }),
  6597. /* 44 */
  6598. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6599. "use strict";
  6600. /* unused harmony export MDCMenuSurfaceAdapter */
  6601. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  6602. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6603. /**
  6604. * @license
  6605. * Copyright 2018 Google Inc.
  6606. *
  6607. * Permission is hereby granted, free of charge, to any person obtaining a copy
  6608. * of this software and associated documentation files (the "Software"), to deal
  6609. * in the Software without restriction, including without limitation the rights
  6610. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  6611. * copies of the Software, and to permit persons to whom the Software is
  6612. * furnished to do so, subject to the following conditions:
  6613. *
  6614. * The above copyright notice and this permission notice shall be included in
  6615. * all copies or substantial portions of the Software.
  6616. *
  6617. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  6618. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  6619. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  6620. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  6621. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  6622. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  6623. * THE SOFTWARE.
  6624. */
  6625. /* eslint no-unused-vars: [2, {"args": "none"}] */
  6626. /**
  6627. * Adapter for MDCMenuSurface. Provides an interface for managing
  6628. * - classes
  6629. * - dom
  6630. * - focus
  6631. * - position
  6632. * - dimensions
  6633. * - event handlers
  6634. *
  6635. * Additionally, provides type information for the adapter to the Closure
  6636. * compiler.
  6637. *
  6638. * Implement this adapter for your framework of choice to delegate updates to
  6639. * the component in your framework of choice. See architecture documentation
  6640. * for more details.
  6641. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  6642. *
  6643. * @record
  6644. */
  6645. var MDCMenuSurfaceAdapter = function () {
  6646. function MDCMenuSurfaceAdapter() {
  6647. _classCallCheck(this, MDCMenuSurfaceAdapter);
  6648. }
  6649. _createClass(MDCMenuSurfaceAdapter, [{
  6650. key: "addClass",
  6651. /** @param {string} className */
  6652. value: function addClass(className) {}
  6653. /** @param {string} className */
  6654. }, {
  6655. key: "removeClass",
  6656. value: function removeClass(className) {}
  6657. /**
  6658. * @param {string} className
  6659. * @return {boolean}
  6660. */
  6661. }, {
  6662. key: "hasClass",
  6663. value: function hasClass(className) {}
  6664. /** @return {boolean} */
  6665. }, {
  6666. key: "hasAnchor",
  6667. value: function hasAnchor() {}
  6668. /** Emits an event when the menu surface is closed. */
  6669. }, {
  6670. key: "notifyClose",
  6671. value: function notifyClose() {}
  6672. /** Emits an event when the menu surface is opened. */
  6673. }, {
  6674. key: "notifyOpen",
  6675. value: function notifyOpen() {}
  6676. /**
  6677. * @return {boolean}
  6678. * @param {EventTarget} el
  6679. */
  6680. }, {
  6681. key: "isElementInContainer",
  6682. value: function isElementInContainer(el) {}
  6683. /** @return {boolean} */
  6684. }, {
  6685. key: "isRtl",
  6686. value: function isRtl() {}
  6687. /** @param {string} origin */
  6688. }, {
  6689. key: "setTransformOrigin",
  6690. value: function setTransformOrigin(origin) {}
  6691. /** @return {boolean} */
  6692. }, {
  6693. key: "isFocused",
  6694. value: function isFocused() {}
  6695. /** Saves the element that was focused before the menu surface was opened. */
  6696. }, {
  6697. key: "saveFocus",
  6698. value: function saveFocus() {}
  6699. /** Restores focus to the element that was focused before the menu surface was opened. */
  6700. }, {
  6701. key: "restoreFocus",
  6702. value: function restoreFocus() {}
  6703. /** @return {boolean} */
  6704. }, {
  6705. key: "isFirstElementFocused",
  6706. value: function isFirstElementFocused() {}
  6707. /** @return {boolean} */
  6708. }, {
  6709. key: "isLastElementFocused",
  6710. value: function isLastElementFocused() {}
  6711. /** Focuses the first focusable element in the menu-surface. */
  6712. }, {
  6713. key: "focusFirstElement",
  6714. value: function focusFirstElement() {}
  6715. /** Focuses the first focusable element in the menu-surface. */
  6716. }, {
  6717. key: "focusLastElement",
  6718. value: function focusLastElement() {}
  6719. /** @return {!{width: number, height: number}} */
  6720. }, {
  6721. key: "getInnerDimensions",
  6722. value: function getInnerDimensions() {}
  6723. /** @return {!{width: number, height: number, top: number, right: number, bottom: number, left: number}} */
  6724. }, {
  6725. key: "getAnchorDimensions",
  6726. value: function getAnchorDimensions() {}
  6727. /** @return {!{ width: number, height: number }} */
  6728. }, {
  6729. key: "getWindowDimensions",
  6730. value: function getWindowDimensions() {}
  6731. /** @return {!{ width: number, height: number }} */
  6732. }, {
  6733. key: "getBodyDimensions",
  6734. value: function getBodyDimensions() {}
  6735. /** @return {!{ width: number, height: number }} */
  6736. }, {
  6737. key: "getWindowScroll",
  6738. value: function getWindowScroll() {}
  6739. /** @param {!{
  6740. * top: (string|undefined),
  6741. * right: (string|undefined),
  6742. * bottom: (string|undefined),
  6743. * left: (string|undefined)
  6744. * }} position */
  6745. }, {
  6746. key: "setPosition",
  6747. value: function setPosition(position) {}
  6748. /** @param {string} height */
  6749. }, {
  6750. key: "setMaxHeight",
  6751. value: function setMaxHeight(height) {}
  6752. }]);
  6753. return MDCMenuSurfaceAdapter;
  6754. }();
  6755. /***/ }),
  6756. /* 45 */
  6757. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6758. "use strict";
  6759. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  6760. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCMenuSurface", function() { return MDCMenuSurface; });
  6761. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  6762. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util__ = __webpack_require__(111);
  6763. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(20);
  6764. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__adapter__ = __webpack_require__(44);
  6765. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__constants__ = __webpack_require__(21);
  6766. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCMenuSurfaceFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["b"]; });
  6767. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "AnchorMargin", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  6768. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Corner", function() { return __WEBPACK_IMPORTED_MODULE_4__constants__["a"]; });
  6769. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "CornerBit", function() { return __WEBPACK_IMPORTED_MODULE_4__constants__["b"]; });
  6770. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "util", function() { return __WEBPACK_IMPORTED_MODULE_1__util__; });
  6771. 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; };
  6772. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  6773. 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); } };
  6774. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6775. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  6776. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  6777. /**
  6778. * @license
  6779. * Copyright 2018 Google Inc.
  6780. *
  6781. * Permission is hereby granted, free of charge, to any person obtaining a copy
  6782. * of this software and associated documentation files (the "Software"), to deal
  6783. * in the Software without restriction, including without limitation the rights
  6784. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  6785. * copies of the Software, and to permit persons to whom the Software is
  6786. * furnished to do so, subject to the following conditions:
  6787. *
  6788. * The above copyright notice and this permission notice shall be included in
  6789. * all copies or substantial portions of the Software.
  6790. *
  6791. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  6792. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  6793. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  6794. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  6795. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  6796. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  6797. * THE SOFTWARE.
  6798. */
  6799. /**
  6800. * @extends MDCComponent<!MDCMenuSurfaceFoundation>
  6801. */
  6802. var MDCMenuSurface = function (_MDCComponent) {
  6803. _inherits(MDCMenuSurface, _MDCComponent);
  6804. /** @param {...?} args */
  6805. function MDCMenuSurface() {
  6806. var _ref;
  6807. _classCallCheck(this, MDCMenuSurface);
  6808. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  6809. args[_key] = arguments[_key];
  6810. }
  6811. /** @private {!Element} */
  6812. var _this = _possibleConstructorReturn(this, (_ref = MDCMenuSurface.__proto__ || Object.getPrototypeOf(MDCMenuSurface)).call.apply(_ref, [this].concat(args)));
  6813. _this.previousFocus_;
  6814. /** @private {!Element} */
  6815. _this.anchorElement;
  6816. /** @private {Element} */
  6817. _this.firstFocusableElement_;
  6818. /** @private {Element} */
  6819. _this.lastFocusableElement_;
  6820. /** @private {!Function} */
  6821. _this.handleKeydown_;
  6822. /** @private {!Function} */
  6823. _this.handleBodyClick_;
  6824. /** @private {!Function} */
  6825. _this.registerBodyClickListener_;
  6826. /** @private {!Function} */
  6827. _this.deregisterBodyClickListener_;
  6828. return _this;
  6829. }
  6830. /**
  6831. * @param {!Element} root
  6832. * @return {!MDCMenuSurface}
  6833. */
  6834. _createClass(MDCMenuSurface, [{
  6835. key: 'initialSyncWithDOM',
  6836. value: function initialSyncWithDOM() {
  6837. var _this2 = this;
  6838. if (this.root_.parentElement && this.root_.parentElement.classList.contains(__WEBPACK_IMPORTED_MODULE_4__constants__["c" /* cssClasses */].ANCHOR)) {
  6839. this.anchorElement = this.root_.parentElement;
  6840. }
  6841. if (this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_4__constants__["c" /* cssClasses */].FIXED)) {
  6842. this.setFixedPosition(true);
  6843. }
  6844. this.handleKeydown_ = function (evt) {
  6845. return _this2.foundation_.handleKeydown(evt);
  6846. };
  6847. this.handleBodyClick_ = function (evt) {
  6848. return _this2.foundation_.handleBodyClick(evt);
  6849. };
  6850. this.registerBodyClickListener_ = function () {
  6851. return document.body.addEventListener('click', _this2.handleBodyClick_);
  6852. };
  6853. this.deregisterBodyClickListener_ = function () {
  6854. return document.body.removeEventListener('click', _this2.handleBodyClick_);
  6855. };
  6856. this.root_.addEventListener('keydown', this.handleKeydown_);
  6857. this.root_.addEventListener(__WEBPACK_IMPORTED_MODULE_4__constants__["e" /* strings */].OPENED_EVENT, this.registerBodyClickListener_);
  6858. this.root_.addEventListener(__WEBPACK_IMPORTED_MODULE_4__constants__["e" /* strings */].CLOSED_EVENT, this.deregisterBodyClickListener_);
  6859. }
  6860. }, {
  6861. key: 'destroy',
  6862. value: function destroy() {
  6863. this.root_.removeEventListener('keydown', this.handleKeydown_);
  6864. this.root_.removeEventListener(__WEBPACK_IMPORTED_MODULE_4__constants__["e" /* strings */].OPENED_EVENT, this.registerBodyClickListener_);
  6865. this.root_.removeEventListener(__WEBPACK_IMPORTED_MODULE_4__constants__["e" /* strings */].CLOSED_EVENT, this.deregisterBodyClickListener_);
  6866. _get(MDCMenuSurface.prototype.__proto__ || Object.getPrototypeOf(MDCMenuSurface.prototype), 'destroy', this).call(this);
  6867. }
  6868. /** @return {boolean} */
  6869. }, {
  6870. key: 'hoistMenuToBody',
  6871. /**
  6872. * Removes the menu-surface from it's current location and appends it to the
  6873. * body to overcome any overflow:hidden issues.
  6874. */
  6875. value: function hoistMenuToBody() {
  6876. document.body.appendChild(this.root_.parentElement.removeChild(this.root_));
  6877. this.setIsHoisted(true);
  6878. }
  6879. /**
  6880. * Sets the foundation to use page offsets for an positioning when the menu
  6881. * is hoisted to the body.
  6882. * @param {boolean} isHoisted
  6883. */
  6884. }, {
  6885. key: 'setIsHoisted',
  6886. value: function setIsHoisted(isHoisted) {
  6887. this.foundation_.setIsHoisted(isHoisted);
  6888. }
  6889. /**
  6890. * Sets the element that the menu-surface is anchored to.
  6891. * @param {!Element} element
  6892. */
  6893. }, {
  6894. key: 'setMenuSurfaceAnchorElement',
  6895. value: function setMenuSurfaceAnchorElement(element) {
  6896. this.anchorElement = element;
  6897. }
  6898. /**
  6899. * Sets the menu-surface to position: fixed.
  6900. * @param {boolean} isFixed
  6901. */
  6902. }, {
  6903. key: 'setFixedPosition',
  6904. value: function setFixedPosition(isFixed) {
  6905. if (isFixed) {
  6906. this.root_.classList.add(__WEBPACK_IMPORTED_MODULE_4__constants__["c" /* cssClasses */].FIXED);
  6907. } else {
  6908. this.root_.classList.remove(__WEBPACK_IMPORTED_MODULE_4__constants__["c" /* cssClasses */].FIXED);
  6909. }
  6910. this.foundation_.setFixedPosition(isFixed);
  6911. }
  6912. /**
  6913. * Sets the absolute x/y position to position based on. Requires the menu to be hoisted.
  6914. * @param {number} x
  6915. * @param {number} y
  6916. */
  6917. }, {
  6918. key: 'setAbsolutePosition',
  6919. value: function setAbsolutePosition(x, y) {
  6920. this.foundation_.setAbsolutePosition(x, y);
  6921. this.setIsHoisted(true);
  6922. }
  6923. /**
  6924. * @param {!Corner} corner Default anchor corner alignment of top-left
  6925. * surface corner.
  6926. */
  6927. }, {
  6928. key: 'setAnchorCorner',
  6929. value: function setAnchorCorner(corner) {
  6930. this.foundation_.setAnchorCorner(corner);
  6931. }
  6932. /**
  6933. * @param {!AnchorMargin} margin
  6934. */
  6935. }, {
  6936. key: 'setAnchorMargin',
  6937. value: function setAnchorMargin(margin) {
  6938. this.foundation_.setAnchorMargin(margin);
  6939. }
  6940. /** @param {boolean} quickOpen */
  6941. }, {
  6942. key: 'getDefaultFoundation',
  6943. /** @return {!MDCMenuSurfaceFoundation} */
  6944. value: function getDefaultFoundation() {
  6945. var _this3 = this;
  6946. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["b" /* MDCMenuSurfaceFoundation */](
  6947. /** @type {!MDCMenuSurfaceAdapter} */_extends({
  6948. addClass: function addClass(className) {
  6949. return _this3.root_.classList.add(className);
  6950. },
  6951. removeClass: function removeClass(className) {
  6952. return _this3.root_.classList.remove(className);
  6953. },
  6954. hasClass: function hasClass(className) {
  6955. return _this3.root_.classList.contains(className);
  6956. },
  6957. hasAnchor: function hasAnchor() {
  6958. return !!_this3.anchorElement;
  6959. },
  6960. notifyClose: function notifyClose() {
  6961. return _this3.emit(__WEBPACK_IMPORTED_MODULE_2__foundation__["b" /* MDCMenuSurfaceFoundation */].strings.CLOSED_EVENT, {});
  6962. },
  6963. notifyOpen: function notifyOpen() {
  6964. return _this3.emit(__WEBPACK_IMPORTED_MODULE_2__foundation__["b" /* MDCMenuSurfaceFoundation */].strings.OPENED_EVENT, {});
  6965. },
  6966. isElementInContainer: function isElementInContainer(el) {
  6967. return _this3.root_ === el || _this3.root_.contains(el);
  6968. },
  6969. isRtl: function isRtl() {
  6970. return getComputedStyle(_this3.root_).getPropertyValue('direction') === 'rtl';
  6971. },
  6972. setTransformOrigin: function setTransformOrigin(origin) {
  6973. _this3.root_.style[__WEBPACK_IMPORTED_MODULE_1__util__["getTransformPropertyName"](window) + '-origin'] = origin;
  6974. }
  6975. }, this.getFocusAdapterMethods_(), this.getDimensionAdapterMethods_()));
  6976. }
  6977. /**
  6978. * @return {!{
  6979. * isFocused: function(): boolean,
  6980. * saveFocus: function(),
  6981. * restoreFocus: function(),
  6982. * isFirstElementFocused: function(): boolean,
  6983. * isLastElementFocused: function(): boolean,
  6984. * focusFirstElement: function(),
  6985. * focusLastElement: function(),
  6986. * }}
  6987. * @private
  6988. */
  6989. }, {
  6990. key: 'getFocusAdapterMethods_',
  6991. value: function getFocusAdapterMethods_() {
  6992. var _this4 = this;
  6993. return {
  6994. isFocused: function isFocused() {
  6995. return document.activeElement === _this4.root_;
  6996. },
  6997. saveFocus: function saveFocus() {
  6998. _this4.previousFocus_ = document.activeElement;
  6999. },
  7000. restoreFocus: function restoreFocus() {
  7001. if (_this4.root_.contains(document.activeElement)) {
  7002. if (_this4.previousFocus_ && _this4.previousFocus_.focus) {
  7003. _this4.previousFocus_.focus();
  7004. }
  7005. }
  7006. },
  7007. isFirstElementFocused: function isFirstElementFocused() {
  7008. return _this4.firstFocusableElement_ && _this4.firstFocusableElement_ === document.activeElement;
  7009. },
  7010. isLastElementFocused: function isLastElementFocused() {
  7011. return _this4.lastFocusableElement_ && _this4.lastFocusableElement_ === document.activeElement;
  7012. },
  7013. focusFirstElement: function focusFirstElement() {
  7014. return _this4.firstFocusableElement_ && _this4.firstFocusableElement_.focus && _this4.firstFocusableElement_.focus();
  7015. },
  7016. focusLastElement: function focusLastElement() {
  7017. return _this4.lastFocusableElement_ && _this4.lastFocusableElement_.focus && _this4.lastFocusableElement_.focus();
  7018. }
  7019. };
  7020. }
  7021. /**
  7022. * @return {!{
  7023. * getInnerDimensions: function(),
  7024. * getAnchorDimensions: function(): (HTMLElement | null | * | ClientRect),
  7025. * getWindowDimensions: function(),
  7026. * setPosition: function(*),
  7027. * setMaxHeight: function(string)}}
  7028. * @private
  7029. */
  7030. }, {
  7031. key: 'getDimensionAdapterMethods_',
  7032. value: function getDimensionAdapterMethods_() {
  7033. var _this5 = this;
  7034. return {
  7035. getInnerDimensions: function getInnerDimensions() {
  7036. return { width: _this5.root_.offsetWidth, height: _this5.root_.offsetHeight };
  7037. },
  7038. getAnchorDimensions: function getAnchorDimensions() {
  7039. return _this5.anchorElement && _this5.anchorElement.getBoundingClientRect();
  7040. },
  7041. getWindowDimensions: function getWindowDimensions() {
  7042. return { width: window.innerWidth, height: window.innerHeight };
  7043. },
  7044. getBodyDimensions: function getBodyDimensions() {
  7045. return { width: document.body.clientWidth, height: document.body.clientHeight };
  7046. },
  7047. getWindowScroll: function getWindowScroll() {
  7048. return { x: window.pageXOffset, y: window.pageYOffset };
  7049. },
  7050. setPosition: function setPosition(position) {
  7051. _this5.root_.style.left = 'left' in position ? position.left : null;
  7052. _this5.root_.style.right = 'right' in position ? position.right : null;
  7053. _this5.root_.style.top = 'top' in position ? position.top : null;
  7054. _this5.root_.style.bottom = 'bottom' in position ? position.bottom : null;
  7055. },
  7056. setMaxHeight: function setMaxHeight(height) {
  7057. _this5.root_.style.maxHeight = height;
  7058. }
  7059. };
  7060. }
  7061. }, {
  7062. key: 'open',
  7063. get: function get() {
  7064. return this.foundation_.isOpen();
  7065. }
  7066. /** @param {boolean} value */
  7067. ,
  7068. set: function set(value) {
  7069. if (value) {
  7070. var focusableElements = this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_4__constants__["e" /* strings */].FOCUSABLE_ELEMENTS);
  7071. this.firstFocusableElement_ = focusableElements.length > 0 ? focusableElements[0] : null;
  7072. this.lastFocusableElement_ = focusableElements.length > 0 ? focusableElements[focusableElements.length - 1] : null;
  7073. this.foundation_.open();
  7074. } else {
  7075. this.foundation_.close();
  7076. }
  7077. }
  7078. }, {
  7079. key: 'quickOpen',
  7080. set: function set(quickOpen) {
  7081. this.foundation_.setQuickOpen(quickOpen);
  7082. }
  7083. }], [{
  7084. key: 'attachTo',
  7085. value: function attachTo(root) {
  7086. return new MDCMenuSurface(root);
  7087. }
  7088. }]);
  7089. return MDCMenuSurface;
  7090. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  7091. /***/ }),
  7092. /* 46 */
  7093. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7094. "use strict";
  7095. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  7096. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7097. /**
  7098. * @license
  7099. * Copyright 2017 Google Inc.
  7100. *
  7101. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7102. * of this software and associated documentation files (the "Software"), to deal
  7103. * in the Software without restriction, including without limitation the rights
  7104. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7105. * copies of the Software, and to permit persons to whom the Software is
  7106. * furnished to do so, subject to the following conditions:
  7107. *
  7108. * The above copyright notice and this permission notice shall be included in
  7109. * all copies or substantial portions of the Software.
  7110. *
  7111. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  7112. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  7113. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  7114. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  7115. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  7116. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  7117. * THE SOFTWARE.
  7118. */
  7119. /* eslint no-unused-vars: [2, {"args": "none"}] */
  7120. /**
  7121. * Adapter for MDC Notched Outline.
  7122. *
  7123. * Defines the shape of the adapter expected by the foundation. Implement this
  7124. * adapter to integrate the Notched Outline into your framework. See
  7125. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  7126. * for more information.
  7127. *
  7128. * @record
  7129. */
  7130. var MDCNotchedOutlineAdapter = function () {
  7131. function MDCNotchedOutlineAdapter() {
  7132. _classCallCheck(this, MDCNotchedOutlineAdapter);
  7133. }
  7134. _createClass(MDCNotchedOutlineAdapter, [{
  7135. key: "addClass",
  7136. /**
  7137. * Adds a class to the root element.
  7138. * @param {string} className
  7139. */
  7140. value: function addClass(className) {}
  7141. /**
  7142. * Removes a class from the root element.
  7143. * @param {string} className
  7144. */
  7145. }, {
  7146. key: "removeClass",
  7147. value: function removeClass(className) {}
  7148. /**
  7149. * Sets the width style property of the notch element.
  7150. * @param {number} width
  7151. */
  7152. }, {
  7153. key: "setNotchWidthProperty",
  7154. value: function setNotchWidthProperty(width) {}
  7155. }]);
  7156. return MDCNotchedOutlineAdapter;
  7157. }();
  7158. /* unused harmony default export */ var _unused_webpack_default_export = (MDCNotchedOutlineAdapter);
  7159. /***/ }),
  7160. /* 47 */
  7161. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7162. "use strict";
  7163. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  7164. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  7165. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  7166. /**
  7167. * @license
  7168. * Copyright 2018 Google Inc.
  7169. *
  7170. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7171. * of this software and associated documentation files (the "Software"), to deal
  7172. * in the Software without restriction, including without limitation the rights
  7173. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7174. * copies of the Software, and to permit persons to whom the Software is
  7175. * furnished to do so, subject to the following conditions:
  7176. *
  7177. * The above copyright notice and this permission notice shall be included in
  7178. * all copies or substantial portions of the Software.
  7179. *
  7180. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  7181. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  7182. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  7183. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  7184. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  7185. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  7186. * THE SOFTWARE.
  7187. */
  7188. /** @enum {string} */
  7189. var strings = {
  7190. NOTCH_ELEMENT_SELECTOR: '.mdc-notched-outline__notch'
  7191. };
  7192. /** @enum {number} */
  7193. var numbers = {
  7194. // This should stay in sync with $mdc-notched-outline-padding * 2.
  7195. NOTCH_ELEMENT_PADDING: 8
  7196. };
  7197. /** @enum {string} */
  7198. var cssClasses = {
  7199. OUTLINE_NOTCHED: 'mdc-notched-outline--notched',
  7200. OUTLINE_UPGRADED: 'mdc-notched-outline--upgraded',
  7201. NO_LABEL: 'mdc-notched-outline--no-label'
  7202. };
  7203. /***/ }),
  7204. /* 48 */
  7205. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7206. "use strict";
  7207. /* unused harmony export MDCSelectAdapter */
  7208. /* unused harmony export FoundationMapType */
  7209. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__icon_index__ = __webpack_require__(23);
  7210. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__helper_text_index__ = __webpack_require__(24);
  7211. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  7212. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7213. /**
  7214. * @license
  7215. * Copyright 2018 Google Inc.
  7216. *
  7217. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7218. * of this software and associated documentation files (the "Software"), to deal
  7219. * in the Software without restriction, including without limitation the rights
  7220. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7221. * copies of the Software, and to permit persons to whom the Software is
  7222. * furnished to do so, subject to the following conditions:
  7223. *
  7224. * The above copyright notice and this permission notice shall be included in
  7225. * all copies or substantial portions of the Software.
  7226. *
  7227. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  7228. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  7229. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  7230. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  7231. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  7232. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  7233. * THE SOFTWARE.
  7234. */
  7235. /* eslint no-unused-vars: [2, {"args": "none"}] */
  7236. /* eslint-disable no-unused-vars */
  7237. /* eslint-enable no-unused-vars */
  7238. /**
  7239. * @typedef {{
  7240. * leadingIcon: (!MDCSelectIconFoundation|undefined),
  7241. * helperText: (!MDCSelectHelperTextFoundation|undefined),
  7242. * }}
  7243. */
  7244. var FoundationMapType = void 0;
  7245. /**
  7246. * Adapter for MDC Select. Provides an interface for managing
  7247. * - classes
  7248. * - dom
  7249. * - event handlers
  7250. *
  7251. * Additionally, provides type information for the adapter to the Closure
  7252. * compiler.
  7253. *
  7254. * Implement this adapter for your framework of choice to delegate updates to
  7255. * the component in your framework of choice. See architecture documentation
  7256. * for more details.
  7257. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  7258. *
  7259. * @record
  7260. */
  7261. var MDCSelectAdapter = function () {
  7262. function MDCSelectAdapter() {
  7263. _classCallCheck(this, MDCSelectAdapter);
  7264. }
  7265. _createClass(MDCSelectAdapter, [{
  7266. key: 'addClass',
  7267. /**
  7268. * Adds class to root element.
  7269. * @param {string} className
  7270. */
  7271. value: function addClass(className) {}
  7272. /**
  7273. * Removes a class from the root element.
  7274. * @param {string} className
  7275. */
  7276. }, {
  7277. key: 'removeClass',
  7278. value: function removeClass(className) {}
  7279. /**
  7280. * Returns true if the root element contains the given class name.
  7281. * @param {string} className
  7282. * @return {boolean}
  7283. */
  7284. }, {
  7285. key: 'hasClass',
  7286. value: function hasClass(className) {}
  7287. /**
  7288. * Activates the bottom line, showing a focused state.
  7289. */
  7290. }, {
  7291. key: 'activateBottomLine',
  7292. value: function activateBottomLine() {}
  7293. /**
  7294. * Deactivates the bottom line.
  7295. */
  7296. }, {
  7297. key: 'deactivateBottomLine',
  7298. value: function deactivateBottomLine() {}
  7299. /**
  7300. * Sets the value of the select.
  7301. * @param {string} value
  7302. */
  7303. }, {
  7304. key: 'setValue',
  7305. value: function setValue(value) {}
  7306. /**
  7307. * Returns the selected value of the select element.
  7308. * @return {string}
  7309. */
  7310. }, {
  7311. key: 'getValue',
  7312. value: function getValue() {}
  7313. /**
  7314. * Floats label determined based off of the shouldFloat argument.
  7315. * @param {boolean} shouldFloat
  7316. */
  7317. }, {
  7318. key: 'floatLabel',
  7319. value: function floatLabel(shouldFloat) {}
  7320. /**
  7321. * Returns width of label in pixels, if the label exists.
  7322. * @return {number}
  7323. */
  7324. }, {
  7325. key: 'getLabelWidth',
  7326. value: function getLabelWidth() {}
  7327. /**
  7328. * Returns true if outline element exists, false if it doesn't.
  7329. * @return {boolean}
  7330. */
  7331. }, {
  7332. key: 'hasOutline',
  7333. value: function hasOutline() {}
  7334. /**
  7335. * Only implement if outline element exists.
  7336. * @param {number} labelWidth
  7337. */
  7338. }, {
  7339. key: 'notchOutline',
  7340. value: function notchOutline(labelWidth) {}
  7341. /**
  7342. * Closes notch in outline element, if the outline exists.
  7343. */
  7344. }, {
  7345. key: 'closeOutline',
  7346. value: function closeOutline() {}
  7347. /**
  7348. * Opens the menu.
  7349. */
  7350. }, {
  7351. key: 'openMenu',
  7352. value: function openMenu() {}
  7353. /**
  7354. * Closes the menu.
  7355. */
  7356. }, {
  7357. key: 'closeMenu',
  7358. value: function closeMenu() {}
  7359. /**
  7360. * Returns true if the menu is currently open.
  7361. * @return {boolean}
  7362. */
  7363. }, {
  7364. key: 'isMenuOpen',
  7365. value: function isMenuOpen() {}
  7366. /**
  7367. * Sets the selected index of the select to the index provided.
  7368. * @param {number} index
  7369. */
  7370. }, {
  7371. key: 'setSelectedIndex',
  7372. value: function setSelectedIndex(index) {}
  7373. /**
  7374. * Sets the select to disabled.
  7375. * @param {boolean} isDisabled
  7376. */
  7377. }, {
  7378. key: 'setDisabled',
  7379. value: function setDisabled(isDisabled) {}
  7380. /**
  7381. * Sets the line ripple transform origin center.
  7382. * @param {number} normalizedX
  7383. */
  7384. }, {
  7385. key: 'setRippleCenter',
  7386. value: function setRippleCenter(normalizedX) {}
  7387. /**
  7388. * Emits a change event when an element is selected.
  7389. * @param {string} value
  7390. */
  7391. }, {
  7392. key: 'notifyChange',
  7393. value: function notifyChange(value) {}
  7394. /**
  7395. * Checks if the select is currently valid.
  7396. * @return {boolean} isValid
  7397. */
  7398. }, {
  7399. key: 'checkValidity',
  7400. value: function checkValidity() {}
  7401. /**
  7402. * Adds/Removes the invalid class.
  7403. * @param {boolean} isValid
  7404. */
  7405. }, {
  7406. key: 'setValid',
  7407. value: function setValid(isValid) {}
  7408. }]);
  7409. return MDCSelectAdapter;
  7410. }();
  7411. /***/ }),
  7412. /* 49 */
  7413. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7414. "use strict";
  7415. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  7416. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7417. /**
  7418. * @license
  7419. * Copyright 2018 Google Inc.
  7420. *
  7421. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7422. * of this software and associated documentation files (the "Software"), to deal
  7423. * in the Software without restriction, including without limitation the rights
  7424. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7425. * copies of the Software, and to permit persons to whom the Software is
  7426. * furnished to do so, subject to the following conditions:
  7427. *
  7428. * The above copyright notice and this permission notice shall be included in
  7429. * all copies or substantial portions of the Software.
  7430. *
  7431. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  7432. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  7433. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  7434. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  7435. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  7436. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  7437. * THE SOFTWARE.
  7438. */
  7439. /* eslint no-unused-vars: [2, {"args": "none"}] */
  7440. /**
  7441. * Adapter for MDC Select Icon.
  7442. *
  7443. * Defines the shape of the adapter expected by the foundation. Implement this
  7444. * adapter to integrate the select icon into your framework. See
  7445. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  7446. * for more information.
  7447. *
  7448. * @record
  7449. */
  7450. var MDCSelectIconAdapter = function () {
  7451. function MDCSelectIconAdapter() {
  7452. _classCallCheck(this, MDCSelectIconAdapter);
  7453. }
  7454. _createClass(MDCSelectIconAdapter, [{
  7455. key: "getAttr",
  7456. /**
  7457. * Gets the value of an attribute on the icon element.
  7458. * @param {string} attr
  7459. * @return {string}
  7460. */
  7461. value: function getAttr(attr) {}
  7462. /**
  7463. * Sets an attribute on the icon element.
  7464. * @param {string} attr
  7465. * @param {string} value
  7466. */
  7467. }, {
  7468. key: "setAttr",
  7469. value: function setAttr(attr, value) {}
  7470. /**
  7471. * Removes an attribute from the icon element.
  7472. * @param {string} attr
  7473. */
  7474. }, {
  7475. key: "removeAttr",
  7476. value: function removeAttr(attr) {}
  7477. /**
  7478. * Sets the text content of the icon element.
  7479. * @param {string} content
  7480. */
  7481. }, {
  7482. key: "setContent",
  7483. value: function setContent(content) {}
  7484. /**
  7485. * Registers an event listener on the icon element for a given event.
  7486. * @param {string} evtType
  7487. * @param {function(!Event): undefined} handler
  7488. */
  7489. }, {
  7490. key: "registerInteractionHandler",
  7491. value: function registerInteractionHandler(evtType, handler) {}
  7492. /**
  7493. * Deregisters an event listener on the icon element for a given event.
  7494. * @param {string} evtType
  7495. * @param {function(!Event): undefined} handler
  7496. */
  7497. }, {
  7498. key: "deregisterInteractionHandler",
  7499. value: function deregisterInteractionHandler(evtType, handler) {}
  7500. /**
  7501. * Emits a custom event "MDCSelect:icon" denoting a user has clicked the icon.
  7502. */
  7503. }, {
  7504. key: "notifyIconAction",
  7505. value: function notifyIconAction() {}
  7506. }]);
  7507. return MDCSelectIconAdapter;
  7508. }();
  7509. /* unused harmony default export */ var _unused_webpack_default_export = (MDCSelectIconAdapter);
  7510. /***/ }),
  7511. /* 50 */
  7512. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7513. "use strict";
  7514. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  7515. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7516. /**
  7517. * @license
  7518. * Copyright 2018 Google Inc.
  7519. *
  7520. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7521. * of this software and associated documentation files (the "Software"), to deal
  7522. * in the Software without restriction, including without limitation the rights
  7523. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7524. * copies of the Software, and to permit persons to whom the Software is
  7525. * furnished to do so, subject to the following conditions:
  7526. *
  7527. * The above copyright notice and this permission notice shall be included in
  7528. * all copies or substantial portions of the Software.
  7529. *
  7530. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  7531. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  7532. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  7533. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  7534. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  7535. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  7536. * THE SOFTWARE.
  7537. */
  7538. /* eslint no-unused-vars: [2, {"args": "none"}] */
  7539. /**
  7540. * Adapter for MDC Select Helper Text.
  7541. *
  7542. * Defines the shape of the adapter expected by the foundation. Implement this
  7543. * adapter to integrate the Select helper text into your framework. See
  7544. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  7545. * for more information.
  7546. *
  7547. * @record
  7548. */
  7549. var MDCSelectHelperTextAdapter = function () {
  7550. function MDCSelectHelperTextAdapter() {
  7551. _classCallCheck(this, MDCSelectHelperTextAdapter);
  7552. }
  7553. _createClass(MDCSelectHelperTextAdapter, [{
  7554. key: "addClass",
  7555. /**
  7556. * Adds a class to the helper text element.
  7557. * @param {string} className
  7558. */
  7559. value: function addClass(className) {}
  7560. /**
  7561. * Removes a class from the helper text element.
  7562. * @param {string} className
  7563. */
  7564. }, {
  7565. key: "removeClass",
  7566. value: function removeClass(className) {}
  7567. /**
  7568. * Returns whether or not the helper text element contains the given class.
  7569. * @param {string} className
  7570. * @return {boolean}
  7571. */
  7572. }, {
  7573. key: "hasClass",
  7574. value: function hasClass(className) {}
  7575. /**
  7576. * Sets an attribute with a given value on the helper text element.
  7577. * @param {string} attr
  7578. * @param {string} value
  7579. */
  7580. }, {
  7581. key: "setAttr",
  7582. value: function setAttr(attr, value) {}
  7583. /**
  7584. * Removes an attribute from the helper text element.
  7585. * @param {string} attr
  7586. */
  7587. }, {
  7588. key: "removeAttr",
  7589. value: function removeAttr(attr) {}
  7590. /**
  7591. * Sets the text content for the helper text element.
  7592. * @param {string} content
  7593. */
  7594. }, {
  7595. key: "setContent",
  7596. value: function setContent(content) {}
  7597. }]);
  7598. return MDCSelectHelperTextAdapter;
  7599. }();
  7600. /* unused harmony default export */ var _unused_webpack_default_export = (MDCSelectHelperTextAdapter);
  7601. /***/ }),
  7602. /* 51 */
  7603. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7604. "use strict";
  7605. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  7606. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  7607. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  7608. /**
  7609. * @license
  7610. * Copyright 2016 Google Inc.
  7611. *
  7612. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7613. * of this software and associated documentation files (the "Software"), to deal
  7614. * in the Software without restriction, including without limitation the rights
  7615. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7616. * copies of the Software, and to permit persons to whom the Software is
  7617. * furnished to do so, subject to the following conditions:
  7618. *
  7619. * The above copyright notice and this permission notice shall be included in
  7620. * all copies or substantial portions of the Software.
  7621. *
  7622. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  7623. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  7624. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  7625. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  7626. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  7627. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  7628. * THE SOFTWARE.
  7629. */
  7630. /** @enum {string} */
  7631. var cssClasses = {
  7632. DISABLED: 'mdc-select--disabled',
  7633. ROOT: 'mdc-select',
  7634. OUTLINED: 'mdc-select--outlined',
  7635. FOCUSED: 'mdc-select--focused',
  7636. SELECTED_ITEM_CLASS: 'mdc-list-item--selected',
  7637. WITH_LEADING_ICON: 'mdc-select--with-leading-icon',
  7638. INVALID: 'mdc-select--invalid',
  7639. REQUIRED: 'mdc-select--required'
  7640. };
  7641. /** @enum {string} */
  7642. var strings = {
  7643. ARIA_CONTROLS: 'aria-controls',
  7644. CHANGE_EVENT: 'MDCSelect:change',
  7645. SELECTED_ITEM_SELECTOR: '.' + cssClasses.SELECTED_ITEM_CLASS,
  7646. LEADING_ICON_SELECTOR: '.mdc-select__icon',
  7647. SELECTED_TEXT_SELECTOR: '.mdc-select__selected-text',
  7648. HIDDEN_INPUT_SELECTOR: 'input[type="hidden"]',
  7649. MENU_SELECTOR: '.mdc-select__menu',
  7650. LINE_RIPPLE_SELECTOR: '.mdc-line-ripple',
  7651. LABEL_SELECTOR: '.mdc-floating-label',
  7652. NATIVE_CONTROL_SELECTOR: '.mdc-select__native-control',
  7653. OUTLINE_SELECTOR: '.mdc-notched-outline',
  7654. ENHANCED_VALUE_ATTR: 'data-value',
  7655. ARIA_SELECTED_ATTR: 'aria-selected'
  7656. };
  7657. /** @enum {number} */
  7658. var numbers = {
  7659. LABEL_SCALE: 0.75
  7660. };
  7661. /***/ }),
  7662. /* 52 */
  7663. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7664. "use strict";
  7665. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  7666. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  7667. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  7668. /**
  7669. * @license
  7670. * Copyright 2017 Google Inc.
  7671. *
  7672. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7673. * of this software and associated documentation files (the "Software"), to deal
  7674. * in the Software without restriction, including without limitation the rights
  7675. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7676. * copies of the Software, and to permit persons to whom the Software is
  7677. * furnished to do so, subject to the following conditions:
  7678. *
  7679. * The above copyright notice and this permission notice shall be included in
  7680. * all copies or substantial portions of the Software.
  7681. *
  7682. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  7683. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  7684. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  7685. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  7686. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  7687. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  7688. * THE SOFTWARE.
  7689. */
  7690. /** @enum {string} */
  7691. var cssClasses = {
  7692. ACTIVE: 'mdc-slider--active',
  7693. DISABLED: 'mdc-slider--disabled',
  7694. DISCRETE: 'mdc-slider--discrete',
  7695. FOCUS: 'mdc-slider--focus',
  7696. IN_TRANSIT: 'mdc-slider--in-transit',
  7697. IS_DISCRETE: 'mdc-slider--discrete',
  7698. HAS_TRACK_MARKER: 'mdc-slider--display-markers'
  7699. };
  7700. /** @enum {string} */
  7701. var strings = {
  7702. TRACK_SELECTOR: '.mdc-slider__track',
  7703. TRACK_MARKER_CONTAINER_SELECTOR: '.mdc-slider__track-marker-container',
  7704. LAST_TRACK_MARKER_SELECTOR: '.mdc-slider__track-marker:last-child',
  7705. THUMB_CONTAINER_SELECTOR: '.mdc-slider__thumb-container',
  7706. PIN_VALUE_MARKER_SELECTOR: '.mdc-slider__pin-value-marker',
  7707. ARIA_VALUEMIN: 'aria-valuemin',
  7708. ARIA_VALUEMAX: 'aria-valuemax',
  7709. ARIA_VALUENOW: 'aria-valuenow',
  7710. ARIA_DISABLED: 'aria-disabled',
  7711. STEP_DATA_ATTR: 'data-step',
  7712. CHANGE_EVENT: 'MDCSlider:change',
  7713. INPUT_EVENT: 'MDCSlider:input'
  7714. };
  7715. /** @enum {number} */
  7716. var numbers = {
  7717. PAGE_FACTOR: 4
  7718. };
  7719. /***/ }),
  7720. /* 53 */
  7721. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7722. "use strict";
  7723. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  7724. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7725. /**
  7726. * @license
  7727. * Copyright 2017 Google Inc.
  7728. *
  7729. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7730. * of this software and associated documentation files (the "Software"), to deal
  7731. * in the Software without restriction, including without limitation the rights
  7732. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7733. * copies of the Software, and to permit persons to whom the Software is
  7734. * furnished to do so, subject to the following conditions:
  7735. *
  7736. * The above copyright notice and this permission notice shall be included in
  7737. * all copies or substantial portions of the Software.
  7738. *
  7739. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  7740. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  7741. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  7742. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  7743. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  7744. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  7745. * THE SOFTWARE.
  7746. */
  7747. /* eslint-disable no-unused-vars */
  7748. /**
  7749. * Adapter for MDC Slider.
  7750. *
  7751. * Defines the shape of the adapter expected by the foundation. Implement this
  7752. * adapter to integrate the Slider into your framework. See
  7753. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  7754. * for more information.
  7755. *
  7756. * @record
  7757. */
  7758. var MDCSliderAdapter = function () {
  7759. function MDCSliderAdapter() {
  7760. _classCallCheck(this, MDCSliderAdapter);
  7761. }
  7762. _createClass(MDCSliderAdapter, [{
  7763. key: "hasClass",
  7764. /**
  7765. * Returns true if className exists for the slider Element
  7766. * @param {string} className
  7767. * @return {boolean}
  7768. */
  7769. value: function hasClass(className) {}
  7770. /**
  7771. * Adds a class to the slider Element
  7772. * @param {string} className
  7773. */
  7774. }, {
  7775. key: "addClass",
  7776. value: function addClass(className) {}
  7777. /**
  7778. * Removes a class from the slider Element
  7779. * @param {string} className
  7780. */
  7781. }, {
  7782. key: "removeClass",
  7783. value: function removeClass(className) {}
  7784. /**
  7785. * Returns a string if attribute name exists on the slider Element,
  7786. * otherwise returns null
  7787. * @param {string} name
  7788. * @return {?string}
  7789. */
  7790. }, {
  7791. key: "getAttribute",
  7792. value: function getAttribute(name) {}
  7793. /**
  7794. * Sets attribute name on slider Element to value
  7795. * @param {string} name
  7796. * @param {string} value
  7797. */
  7798. }, {
  7799. key: "setAttribute",
  7800. value: function setAttribute(name, value) {}
  7801. /**
  7802. * Removes attribute name from slider Element
  7803. * @param {string} name
  7804. */
  7805. }, {
  7806. key: "removeAttribute",
  7807. value: function removeAttribute(name) {}
  7808. /**
  7809. * Returns the bounding client rect for the slider Element
  7810. * @return {?ClientRect}
  7811. */
  7812. }, {
  7813. key: "computeBoundingRect",
  7814. value: function computeBoundingRect() {}
  7815. /**
  7816. * Returns the tab index of the slider Element
  7817. * @return {number}
  7818. */
  7819. }, {
  7820. key: "getTabIndex",
  7821. value: function getTabIndex() {}
  7822. /**
  7823. * Registers an event handler on the root element for a given event.
  7824. * @param {string} type
  7825. * @param {function(!Event): undefined} handler
  7826. */
  7827. }, {
  7828. key: "registerInteractionHandler",
  7829. value: function registerInteractionHandler(type, handler) {}
  7830. /**
  7831. * Deregisters an event handler on the root element for a given event.
  7832. * @param {string} type
  7833. * @param {function(!Event): undefined} handler
  7834. */
  7835. }, {
  7836. key: "deregisterInteractionHandler",
  7837. value: function deregisterInteractionHandler(type, handler) {}
  7838. /**
  7839. * Registers an event handler on the thumb container element for a given event.
  7840. * @param {string} type
  7841. * @param {function(!Event): undefined} handler
  7842. */
  7843. }, {
  7844. key: "registerThumbContainerInteractionHandler",
  7845. value: function registerThumbContainerInteractionHandler(type, handler) {}
  7846. /**
  7847. * Deregisters an event handler on the thumb container element for a given event.
  7848. * @param {string} type
  7849. * @param {function(!Event): undefined} handler
  7850. */
  7851. }, {
  7852. key: "deregisterThumbContainerInteractionHandler",
  7853. value: function deregisterThumbContainerInteractionHandler(type, handler) {}
  7854. /**
  7855. * Registers an event handler on the body for a given event.
  7856. * @param {string} type
  7857. * @param {function(!Event): undefined} handler
  7858. */
  7859. }, {
  7860. key: "registerBodyInteractionHandler",
  7861. value: function registerBodyInteractionHandler(type, handler) {}
  7862. /**
  7863. * Deregisters an event handler on the body for a given event.
  7864. * @param {string} type
  7865. * @param {function(!Event): undefined} handler
  7866. */
  7867. }, {
  7868. key: "deregisterBodyInteractionHandler",
  7869. value: function deregisterBodyInteractionHandler(type, handler) {}
  7870. /**
  7871. * Registers an event handler for the window resize event
  7872. * @param {function(!Event): undefined} handler
  7873. */
  7874. }, {
  7875. key: "registerResizeHandler",
  7876. value: function registerResizeHandler(handler) {}
  7877. /**
  7878. * Deregisters an event handler for the window resize event
  7879. * @param {function(!Event): undefined} handler
  7880. */
  7881. }, {
  7882. key: "deregisterResizeHandler",
  7883. value: function deregisterResizeHandler(handler) {}
  7884. /**
  7885. * Emits a custom event MDCSlider:input from the root
  7886. */
  7887. }, {
  7888. key: "notifyInput",
  7889. value: function notifyInput() {}
  7890. /**
  7891. * Emits a custom event MDCSlider:change from the root
  7892. */
  7893. }, {
  7894. key: "notifyChange",
  7895. value: function notifyChange() {}
  7896. /**
  7897. * Sets a style property of the thumb container element to the passed value
  7898. * @param {string} propertyName
  7899. * @param {string} value
  7900. */
  7901. }, {
  7902. key: "setThumbContainerStyleProperty",
  7903. value: function setThumbContainerStyleProperty(propertyName, value) {}
  7904. /**
  7905. * Sets a style property of the track element to the passed value
  7906. * @param {string} propertyName
  7907. * @param {string} value
  7908. */
  7909. }, {
  7910. key: "setTrackStyleProperty",
  7911. value: function setTrackStyleProperty(propertyName, value) {}
  7912. /**
  7913. * Sets the inner text of the pin marker to the passed value
  7914. * @param {number} value
  7915. */
  7916. }, {
  7917. key: "setMarkerValue",
  7918. value: function setMarkerValue(value) {}
  7919. /**
  7920. * Appends the passed number of track markers to the track mark container element
  7921. * @param {number} numMarkers
  7922. */
  7923. }, {
  7924. key: "appendTrackMarkers",
  7925. value: function appendTrackMarkers(numMarkers) {}
  7926. /**
  7927. * Removes all track markers fromt he track mark container element
  7928. */
  7929. }, {
  7930. key: "removeTrackMarkers",
  7931. value: function removeTrackMarkers() {}
  7932. /**
  7933. * Sets a style property of the last track marker to the passed value
  7934. * @param {string} propertyName
  7935. * @param {string} value
  7936. */
  7937. }, {
  7938. key: "setLastTrackMarkersStyleProperty",
  7939. value: function setLastTrackMarkersStyleProperty(propertyName, value) {}
  7940. /**
  7941. * Returns true if the root element is RTL, otherwise false
  7942. * @return {boolean}
  7943. */
  7944. }, {
  7945. key: "isRTL",
  7946. value: function isRTL() {}
  7947. }]);
  7948. return MDCSliderAdapter;
  7949. }();
  7950. /* unused harmony default export */ var _unused_webpack_default_export = (MDCSliderAdapter);
  7951. /***/ }),
  7952. /* 54 */
  7953. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7954. "use strict";
  7955. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  7956. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTabIndicator", function() { return MDCTabIndicator; });
  7957. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  7958. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(55);
  7959. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(26);
  7960. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__sliding_foundation__ = __webpack_require__(133);
  7961. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__fading_foundation__ = __webpack_require__(134);
  7962. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTabIndicatorFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  7963. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSlidingTabIndicatorFoundation", function() { return __WEBPACK_IMPORTED_MODULE_3__sliding_foundation__["a"]; });
  7964. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFadingTabIndicatorFoundation", function() { return __WEBPACK_IMPORTED_MODULE_4__fading_foundation__["a"]; });
  7965. 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; };
  7966. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  7967. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7968. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  7969. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  7970. /**
  7971. * @license
  7972. * Copyright 2018 Google Inc.
  7973. *
  7974. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7975. * of this software and associated documentation files (the "Software"), to deal
  7976. * in the Software without restriction, including without limitation the rights
  7977. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7978. * copies of the Software, and to permit persons to whom the Software is
  7979. * furnished to do so, subject to the following conditions:
  7980. *
  7981. * The above copyright notice and this permission notice shall be included in
  7982. * all copies or substantial portions of the Software.
  7983. *
  7984. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  7985. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  7986. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  7987. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  7988. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  7989. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  7990. * THE SOFTWARE.
  7991. */
  7992. /**
  7993. * @extends {MDCComponent<!MDCTabIndicatorFoundation>}
  7994. * @final
  7995. */
  7996. var MDCTabIndicator = function (_MDCComponent) {
  7997. _inherits(MDCTabIndicator, _MDCComponent);
  7998. _createClass(MDCTabIndicator, null, [{
  7999. key: 'attachTo',
  8000. /**
  8001. * @param {!Element} root
  8002. * @return {!MDCTabIndicator}
  8003. */
  8004. value: function attachTo(root) {
  8005. return new MDCTabIndicator(root);
  8006. }
  8007. /**
  8008. * @param {...?} args
  8009. */
  8010. }]);
  8011. function MDCTabIndicator() {
  8012. var _ref;
  8013. _classCallCheck(this, MDCTabIndicator);
  8014. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  8015. args[_key] = arguments[_key];
  8016. }
  8017. /** @type {?Element} */
  8018. var _this = _possibleConstructorReturn(this, (_ref = MDCTabIndicator.__proto__ || Object.getPrototypeOf(MDCTabIndicator)).call.apply(_ref, [this].concat(args)));
  8019. _this.content_;
  8020. return _this;
  8021. }
  8022. _createClass(MDCTabIndicator, [{
  8023. key: 'initialize',
  8024. value: function initialize() {
  8025. this.content_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.CONTENT_SELECTOR);
  8026. }
  8027. /**
  8028. * @return {!ClientRect}
  8029. */
  8030. }, {
  8031. key: 'computeContentClientRect',
  8032. value: function computeContentClientRect() {
  8033. return this.foundation_.computeContentClientRect();
  8034. }
  8035. /**
  8036. * @return {!MDCTabIndicatorFoundation}
  8037. */
  8038. }, {
  8039. key: 'getDefaultFoundation',
  8040. value: function getDefaultFoundation() {
  8041. var _this2 = this;
  8042. var adapter = /** @type {!MDCTabIndicatorAdapter} */_extends({
  8043. addClass: function addClass(className) {
  8044. return _this2.root_.classList.add(className);
  8045. },
  8046. removeClass: function removeClass(className) {
  8047. return _this2.root_.classList.remove(className);
  8048. },
  8049. computeContentClientRect: function computeContentClientRect() {
  8050. return _this2.content_.getBoundingClientRect();
  8051. },
  8052. setContentStyleProperty: function setContentStyleProperty(prop, value) {
  8053. return _this2.content_.style.setProperty(prop, value);
  8054. }
  8055. });
  8056. if (this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].cssClasses.FADE)) {
  8057. return new __WEBPACK_IMPORTED_MODULE_4__fading_foundation__["a" /* default */](adapter);
  8058. }
  8059. // Default to the sliding indicator
  8060. return new __WEBPACK_IMPORTED_MODULE_3__sliding_foundation__["a" /* default */](adapter);
  8061. }
  8062. /**
  8063. * @param {!ClientRect=} previousIndicatorClientRect
  8064. */
  8065. }, {
  8066. key: 'activate',
  8067. value: function activate(previousIndicatorClientRect) {
  8068. this.foundation_.activate(previousIndicatorClientRect);
  8069. }
  8070. }, {
  8071. key: 'deactivate',
  8072. value: function deactivate() {
  8073. this.foundation_.deactivate();
  8074. }
  8075. }]);
  8076. return MDCTabIndicator;
  8077. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  8078. /***/ }),
  8079. /* 55 */
  8080. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8081. "use strict";
  8082. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  8083. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8084. /**
  8085. * @license
  8086. * Copyright 2018 Google Inc.
  8087. *
  8088. * Permission is hereby granted, free of charge, to any person obtaining a copy
  8089. * of this software and associated documentation files (the "Software"), to deal
  8090. * in the Software without restriction, including without limitation the rights
  8091. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8092. * copies of the Software, and to permit persons to whom the Software is
  8093. * furnished to do so, subject to the following conditions:
  8094. *
  8095. * The above copyright notice and this permission notice shall be included in
  8096. * all copies or substantial portions of the Software.
  8097. *
  8098. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  8099. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  8100. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  8101. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  8102. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  8103. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  8104. * THE SOFTWARE.
  8105. */
  8106. /* eslint no-unused-vars: [2, {"args": "none"}] */
  8107. /**
  8108. * Adapter for MDC Tab Indicator.
  8109. *
  8110. * Defines the shape of the adapter expected by the foundation. Implement this
  8111. * adapter to integrate the Tab Indicator into your framework. See
  8112. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  8113. * for more information.
  8114. *
  8115. * @record
  8116. */
  8117. var MDCTabIndicatorAdapter = function () {
  8118. function MDCTabIndicatorAdapter() {
  8119. _classCallCheck(this, MDCTabIndicatorAdapter);
  8120. }
  8121. _createClass(MDCTabIndicatorAdapter, [{
  8122. key: "addClass",
  8123. /**
  8124. * Adds the given className to the root element.
  8125. * @param {string} className The className to add
  8126. */
  8127. value: function addClass(className) {}
  8128. /**
  8129. * Removes the given className from the root element.
  8130. * @param {string} className The className to remove
  8131. */
  8132. }, {
  8133. key: "removeClass",
  8134. value: function removeClass(className) {}
  8135. /**
  8136. * Returns the client rect of the content element.
  8137. * @return {!ClientRect}
  8138. */
  8139. }, {
  8140. key: "computeContentClientRect",
  8141. value: function computeContentClientRect() {}
  8142. /**
  8143. * Sets a style property of the content element to the passed value
  8144. * @param {string} propName The style property name to set
  8145. * @param {string} value The style property value
  8146. */
  8147. }, {
  8148. key: "setContentStyleProperty",
  8149. value: function setContentStyleProperty(propName, value) {}
  8150. }]);
  8151. return MDCTabIndicatorAdapter;
  8152. }();
  8153. /* unused harmony default export */ var _unused_webpack_default_export = (MDCTabIndicatorAdapter);
  8154. /***/ }),
  8155. /* 56 */
  8156. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8157. "use strict";
  8158. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  8159. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTabScroller", function() { return MDCTabScroller; });
  8160. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  8161. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(5);
  8162. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(138);
  8163. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util__ = __webpack_require__(142);
  8164. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTabScrollerFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  8165. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "util", function() { return __WEBPACK_IMPORTED_MODULE_3__util__; });
  8166. 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); } };
  8167. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  8168. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8169. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  8170. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  8171. /**
  8172. * @license
  8173. * Copyright 2018 Google Inc.
  8174. *
  8175. * Permission is hereby granted, free of charge, to any person obtaining a copy
  8176. * of this software and associated documentation files (the "Software"), to deal
  8177. * in the Software without restriction, including without limitation the rights
  8178. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8179. * copies of the Software, and to permit persons to whom the Software is
  8180. * furnished to do so, subject to the following conditions:
  8181. *
  8182. * The above copyright notice and this permission notice shall be included in
  8183. * all copies or substantial portions of the Software.
  8184. *
  8185. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  8186. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  8187. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  8188. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  8189. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  8190. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  8191. * THE SOFTWARE.
  8192. */
  8193. /**
  8194. * @extends {MDCComponent<!MDCTabScrollerFoundation>}
  8195. * @final
  8196. */
  8197. var MDCTabScroller = function (_MDCComponent) {
  8198. _inherits(MDCTabScroller, _MDCComponent);
  8199. _createClass(MDCTabScroller, null, [{
  8200. key: 'attachTo',
  8201. /**
  8202. * @param {!Element} root
  8203. * @return {!MDCTabScroller}
  8204. */
  8205. value: function attachTo(root) {
  8206. return new MDCTabScroller(root);
  8207. }
  8208. }]);
  8209. function MDCTabScroller() {
  8210. var _ref;
  8211. _classCallCheck(this, MDCTabScroller);
  8212. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  8213. args[_key] = arguments[_key];
  8214. }
  8215. /** @private {?Element} */
  8216. var _this = _possibleConstructorReturn(this, (_ref = MDCTabScroller.__proto__ || Object.getPrototypeOf(MDCTabScroller)).call.apply(_ref, [this].concat(args)));
  8217. _this.content_;
  8218. /** @private {?Element} */
  8219. _this.area_;
  8220. /** @private {?function(?Event): undefined} */
  8221. _this.handleInteraction_;
  8222. /** @private {?function(!Event): undefined} */
  8223. _this.handleTransitionEnd_;
  8224. return _this;
  8225. }
  8226. _createClass(MDCTabScroller, [{
  8227. key: 'initialize',
  8228. value: function initialize() {
  8229. this.area_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.AREA_SELECTOR);
  8230. this.content_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.CONTENT_SELECTOR);
  8231. }
  8232. }, {
  8233. key: 'initialSyncWithDOM',
  8234. value: function initialSyncWithDOM() {
  8235. var _this2 = this;
  8236. this.handleInteraction_ = function () {
  8237. return _this2.foundation_.handleInteraction();
  8238. };
  8239. this.handleTransitionEnd_ = function (evt) {
  8240. return _this2.foundation_.handleTransitionEnd(evt);
  8241. };
  8242. this.area_.addEventListener('wheel', this.handleInteraction_);
  8243. this.area_.addEventListener('touchstart', this.handleInteraction_);
  8244. this.area_.addEventListener('pointerdown', this.handleInteraction_);
  8245. this.area_.addEventListener('mousedown', this.handleInteraction_);
  8246. this.area_.addEventListener('keydown', this.handleInteraction_);
  8247. this.content_.addEventListener('transitionend', this.handleTransitionEnd_);
  8248. }
  8249. }, {
  8250. key: 'destroy',
  8251. value: function destroy() {
  8252. _get(MDCTabScroller.prototype.__proto__ || Object.getPrototypeOf(MDCTabScroller.prototype), 'destroy', this).call(this);
  8253. this.area_.removeEventListener('wheel', this.handleInteraction_);
  8254. this.area_.removeEventListener('touchstart', this.handleInteraction_);
  8255. this.area_.removeEventListener('pointerdown', this.handleInteraction_);
  8256. this.area_.removeEventListener('mousedown', this.handleInteraction_);
  8257. this.area_.removeEventListener('keydown', this.handleInteraction_);
  8258. this.content_.removeEventListener('transitionend', this.handleTransitionEnd_);
  8259. }
  8260. /**
  8261. * @return {!MDCTabScrollerFoundation}
  8262. */
  8263. }, {
  8264. key: 'getDefaultFoundation',
  8265. value: function getDefaultFoundation() {
  8266. var _this3 = this;
  8267. var adapter = /** @type {!MDCTabScrollerAdapter} */{
  8268. eventTargetMatchesSelector: function eventTargetMatchesSelector(evtTarget, selector) {
  8269. var MATCHES = __WEBPACK_IMPORTED_MODULE_3__util__["getMatchesProperty"](HTMLElement.prototype);
  8270. return evtTarget[MATCHES](selector);
  8271. },
  8272. addClass: function addClass(className) {
  8273. return _this3.root_.classList.add(className);
  8274. },
  8275. removeClass: function removeClass(className) {
  8276. return _this3.root_.classList.remove(className);
  8277. },
  8278. addScrollAreaClass: function addScrollAreaClass(className) {
  8279. return _this3.area_.classList.add(className);
  8280. },
  8281. setScrollAreaStyleProperty: function setScrollAreaStyleProperty(prop, value) {
  8282. return _this3.area_.style.setProperty(prop, value);
  8283. },
  8284. setScrollContentStyleProperty: function setScrollContentStyleProperty(prop, value) {
  8285. return _this3.content_.style.setProperty(prop, value);
  8286. },
  8287. getScrollContentStyleValue: function getScrollContentStyleValue(propName) {
  8288. return window.getComputedStyle(_this3.content_).getPropertyValue(propName);
  8289. },
  8290. setScrollAreaScrollLeft: function setScrollAreaScrollLeft(scrollX) {
  8291. return _this3.area_.scrollLeft = scrollX;
  8292. },
  8293. getScrollAreaScrollLeft: function getScrollAreaScrollLeft() {
  8294. return _this3.area_.scrollLeft;
  8295. },
  8296. getScrollContentOffsetWidth: function getScrollContentOffsetWidth() {
  8297. return _this3.content_.offsetWidth;
  8298. },
  8299. getScrollAreaOffsetWidth: function getScrollAreaOffsetWidth() {
  8300. return _this3.area_.offsetWidth;
  8301. },
  8302. computeScrollAreaClientRect: function computeScrollAreaClientRect() {
  8303. return _this3.area_.getBoundingClientRect();
  8304. },
  8305. computeScrollContentClientRect: function computeScrollContentClientRect() {
  8306. return _this3.content_.getBoundingClientRect();
  8307. },
  8308. computeHorizontalScrollbarHeight: function computeHorizontalScrollbarHeight() {
  8309. return __WEBPACK_IMPORTED_MODULE_3__util__["computeHorizontalScrollbarHeight"](document);
  8310. }
  8311. };
  8312. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */](adapter);
  8313. }
  8314. /**
  8315. * Returns the current visual scroll position
  8316. * @return {number}
  8317. */
  8318. }, {
  8319. key: 'getScrollPosition',
  8320. value: function getScrollPosition() {
  8321. return this.foundation_.getScrollPosition();
  8322. }
  8323. /**
  8324. * Returns the width of the scroll content
  8325. * @return {number}
  8326. */
  8327. }, {
  8328. key: 'getScrollContentWidth',
  8329. value: function getScrollContentWidth() {
  8330. return this.content_.offsetWidth;
  8331. }
  8332. /**
  8333. * Increments the scroll value by the given amount
  8334. * @param {number} scrollXIncrement The pixel value by which to increment the scroll value
  8335. */
  8336. }, {
  8337. key: 'incrementScroll',
  8338. value: function incrementScroll(scrollXIncrement) {
  8339. this.foundation_.incrementScroll(scrollXIncrement);
  8340. }
  8341. /**
  8342. * Scrolls to the given pixel position
  8343. * @param {number} scrollX The pixel value to scroll to
  8344. */
  8345. }, {
  8346. key: 'scrollTo',
  8347. value: function scrollTo(scrollX) {
  8348. this.foundation_.scrollTo(scrollX);
  8349. }
  8350. }]);
  8351. return MDCTabScroller;
  8352. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  8353. /***/ }),
  8354. /* 57 */
  8355. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8356. "use strict";
  8357. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  8358. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  8359. /**
  8360. * @license
  8361. * Copyright 2018 Google Inc.
  8362. *
  8363. * Permission is hereby granted, free of charge, to any person obtaining a copy
  8364. * of this software and associated documentation files (the "Software"), to deal
  8365. * in the Software without restriction, including without limitation the rights
  8366. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8367. * copies of the Software, and to permit persons to whom the Software is
  8368. * furnished to do so, subject to the following conditions:
  8369. *
  8370. * The above copyright notice and this permission notice shall be included in
  8371. * all copies or substantial portions of the Software.
  8372. *
  8373. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  8374. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  8375. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  8376. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  8377. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  8378. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  8379. * THE SOFTWARE.
  8380. */
  8381. /** @enum {string} */
  8382. var cssClasses = {
  8383. ANIMATING: 'mdc-tab-scroller--animating',
  8384. SCROLL_TEST: 'mdc-tab-scroller__test',
  8385. SCROLL_AREA_SCROLL: 'mdc-tab-scroller__scroll-area--scroll'
  8386. };
  8387. /** @enum {string} */
  8388. var strings = {
  8389. AREA_SELECTOR: '.mdc-tab-scroller__scroll-area',
  8390. CONTENT_SELECTOR: '.mdc-tab-scroller__scroll-content'
  8391. };
  8392. /***/ }),
  8393. /* 58 */
  8394. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8395. "use strict";
  8396. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_tab_adapter__ = __webpack_require__(11);
  8397. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_tab_index__ = __webpack_require__(25);
  8398. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  8399. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8400. /**
  8401. * @license
  8402. * Copyright 2018 Google Inc.
  8403. *
  8404. * Permission is hereby granted, free of charge, to any person obtaining a copy
  8405. * of this software and associated documentation files (the "Software"), to deal
  8406. * in the Software without restriction, including without limitation the rights
  8407. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8408. * copies of the Software, and to permit persons to whom the Software is
  8409. * furnished to do so, subject to the following conditions:
  8410. *
  8411. * The above copyright notice and this permission notice shall be included in
  8412. * all copies or substantial portions of the Software.
  8413. *
  8414. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  8415. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  8416. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  8417. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  8418. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  8419. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  8420. * THE SOFTWARE.
  8421. */
  8422. /* eslint no-unused-vars: [2, {"args": "none"}] */
  8423. /* eslint-disable no-unused-vars */
  8424. /* eslint-enable no-unused-vars */
  8425. /**
  8426. * Adapter for MDC Tab Bar.
  8427. *
  8428. * Defines the shape of the adapter expected by the foundation. Implement this
  8429. * adapter to integrate the Tab Bar into your framework. See
  8430. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  8431. * for more information.
  8432. *
  8433. * @record
  8434. */
  8435. var MDCTabBarAdapter = function () {
  8436. function MDCTabBarAdapter() {
  8437. _classCallCheck(this, MDCTabBarAdapter);
  8438. }
  8439. _createClass(MDCTabBarAdapter, [{
  8440. key: 'scrollTo',
  8441. /**
  8442. * Scrolls to the given position
  8443. * @param {number} scrollX The position to scroll to
  8444. */
  8445. value: function scrollTo(scrollX) {}
  8446. /**
  8447. * Increments the current scroll position by the given amount
  8448. * @param {number} scrollXIncrement The amount to increment scroll
  8449. */
  8450. }, {
  8451. key: 'incrementScroll',
  8452. value: function incrementScroll(scrollXIncrement) {}
  8453. /**
  8454. * Returns the current scroll position
  8455. * @return {number}
  8456. */
  8457. }, {
  8458. key: 'getScrollPosition',
  8459. value: function getScrollPosition() {}
  8460. /**
  8461. * Returns the width of the scroll content
  8462. * @return {number}
  8463. */
  8464. }, {
  8465. key: 'getScrollContentWidth',
  8466. value: function getScrollContentWidth() {}
  8467. /**
  8468. * Returns the root element's offsetWidth
  8469. * @return {number}
  8470. */
  8471. }, {
  8472. key: 'getOffsetWidth',
  8473. value: function getOffsetWidth() {}
  8474. /**
  8475. * Returns if the Tab Bar language direction is RTL
  8476. * @return {boolean}
  8477. */
  8478. }, {
  8479. key: 'isRTL',
  8480. value: function isRTL() {}
  8481. /**
  8482. * Sets the tab at the given index to be activated
  8483. * @param {number} index The index of the tab to activate
  8484. */
  8485. }, {
  8486. key: 'setActiveTab',
  8487. value: function setActiveTab(index) {}
  8488. /**
  8489. * Activates the tab at the given index with the given client rect
  8490. * @param {number} index The index of the tab to activate
  8491. * @param {!ClientRect} clientRect The client rect of the previously active Tab Indicator
  8492. */
  8493. }, {
  8494. key: 'activateTabAtIndex',
  8495. value: function activateTabAtIndex(index, clientRect) {}
  8496. /**
  8497. * Deactivates the tab at the given index
  8498. * @param {number} index The index of the tab to deactivate
  8499. */
  8500. }, {
  8501. key: 'deactivateTabAtIndex',
  8502. value: function deactivateTabAtIndex(index) {}
  8503. /**
  8504. * Focuses the tab at the given index
  8505. * @param {number} index The index of the tab to focus
  8506. */
  8507. }, {
  8508. key: 'focusTabAtIndex',
  8509. value: function focusTabAtIndex(index) {}
  8510. /**
  8511. * Returns the client rect of the tab's indicator
  8512. * @param {number} index The index of the tab
  8513. * @return {!ClientRect}
  8514. */
  8515. }, {
  8516. key: 'getTabIndicatorClientRectAtIndex',
  8517. value: function getTabIndicatorClientRectAtIndex(index) {}
  8518. /**
  8519. * Returns the tab dimensions of the tab at the given index
  8520. * @param {number} index The index of the tab
  8521. * @return {!MDCTabDimensions}
  8522. */
  8523. }, {
  8524. key: 'getTabDimensionsAtIndex',
  8525. value: function getTabDimensionsAtIndex(index) {}
  8526. /**
  8527. * Returns the length of the tab list
  8528. * @return {number}
  8529. */
  8530. }, {
  8531. key: 'getTabListLength',
  8532. value: function getTabListLength() {}
  8533. /**
  8534. * Returns the index of the previously active tab
  8535. * @return {number}
  8536. */
  8537. }, {
  8538. key: 'getPreviousActiveTabIndex',
  8539. value: function getPreviousActiveTabIndex() {}
  8540. /**
  8541. * Returns the index of the focused tab
  8542. * @return {number}
  8543. */
  8544. }, {
  8545. key: 'getFocusedTabIndex',
  8546. value: function getFocusedTabIndex() {}
  8547. /**
  8548. * Returns the index of the given tab
  8549. * @param {!MDCTab} tab The tab whose index to determin
  8550. * @return {number}
  8551. */
  8552. }, {
  8553. key: 'getIndexOfTab',
  8554. value: function getIndexOfTab(tab) {}
  8555. /**
  8556. * Emits the MDCTabBar:activated event
  8557. * @param {number} index The index of the activated tab
  8558. */
  8559. }, {
  8560. key: 'notifyTabActivated',
  8561. value: function notifyTabActivated(index) {}
  8562. }]);
  8563. return MDCTabBarAdapter;
  8564. }();
  8565. /* unused harmony default export */ var _unused_webpack_default_export = (MDCTabBarAdapter);
  8566. /***/ }),
  8567. /* 59 */
  8568. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8569. "use strict";
  8570. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return cssClasses; });
  8571. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return strings; });
  8572. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return numbers; });
  8573. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return VALIDATION_ATTR_WHITELIST; });
  8574. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ALWAYS_FLOAT_TYPES; });
  8575. /**
  8576. * @license
  8577. * Copyright 2016 Google Inc.
  8578. *
  8579. * Permission is hereby granted, free of charge, to any person obtaining a copy
  8580. * of this software and associated documentation files (the "Software"), to deal
  8581. * in the Software without restriction, including without limitation the rights
  8582. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8583. * copies of the Software, and to permit persons to whom the Software is
  8584. * furnished to do so, subject to the following conditions:
  8585. *
  8586. * The above copyright notice and this permission notice shall be included in
  8587. * all copies or substantial portions of the Software.
  8588. *
  8589. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  8590. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  8591. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  8592. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  8593. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  8594. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  8595. * THE SOFTWARE.
  8596. */
  8597. /** @enum {string} */
  8598. var strings = {
  8599. ARIA_CONTROLS: 'aria-controls',
  8600. INPUT_SELECTOR: '.mdc-text-field__input',
  8601. LABEL_SELECTOR: '.mdc-floating-label',
  8602. ICON_SELECTOR: '.mdc-text-field__icon',
  8603. OUTLINE_SELECTOR: '.mdc-notched-outline',
  8604. LINE_RIPPLE_SELECTOR: '.mdc-line-ripple'
  8605. };
  8606. /** @enum {string} */
  8607. var cssClasses = {
  8608. ROOT: 'mdc-text-field',
  8609. DISABLED: 'mdc-text-field--disabled',
  8610. DENSE: 'mdc-text-field--dense',
  8611. FOCUSED: 'mdc-text-field--focused',
  8612. INVALID: 'mdc-text-field--invalid',
  8613. TEXTAREA: 'mdc-text-field--textarea',
  8614. OUTLINED: 'mdc-text-field--outlined',
  8615. WITH_LEADING_ICON: 'mdc-text-field--with-leading-icon'
  8616. };
  8617. /** @enum {number} */
  8618. var numbers = {
  8619. LABEL_SCALE: 0.75,
  8620. DENSE_LABEL_SCALE: 0.923
  8621. };
  8622. // whitelist based off of https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation
  8623. // under section: `Validation-related attributes`
  8624. var VALIDATION_ATTR_WHITELIST = ['pattern', 'min', 'max', 'required', 'step', 'minlength', 'maxlength'];
  8625. // Label should always float for these types as they show some UI even if value is empty.
  8626. var ALWAYS_FLOAT_TYPES = ['color', 'date', 'datetime-local', 'month', 'range', 'time', 'week'];
  8627. /***/ }),
  8628. /* 60 */
  8629. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8630. "use strict";
  8631. /* unused harmony export MDCTextFieldAdapter */
  8632. /* unused harmony export NativeInputType */
  8633. /* unused harmony export FoundationMapType */
  8634. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__helper_text_foundation__ = __webpack_require__(27);
  8635. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__icon_foundation__ = __webpack_require__(28);
  8636. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  8637. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8638. /**
  8639. * @license
  8640. * Copyright 2017 Google Inc.
  8641. *
  8642. * Permission is hereby granted, free of charge, to any person obtaining a copy
  8643. * of this software and associated documentation files (the "Software"), to deal
  8644. * in the Software without restriction, including without limitation the rights
  8645. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8646. * copies of the Software, and to permit persons to whom the Software is
  8647. * furnished to do so, subject to the following conditions:
  8648. *
  8649. * The above copyright notice and this permission notice shall be included in
  8650. * all copies or substantial portions of the Software.
  8651. *
  8652. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  8653. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  8654. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  8655. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  8656. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  8657. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  8658. * THE SOFTWARE.
  8659. */
  8660. /* eslint-disable no-unused-vars */
  8661. /* eslint no-unused-vars: [2, {"args": "none"}] */
  8662. /**
  8663. * @typedef {{
  8664. * value: string,
  8665. * disabled: boolean,
  8666. * badInput: boolean,
  8667. * validity: {
  8668. * badInput: boolean,
  8669. * valid: boolean,
  8670. * },
  8671. * }}
  8672. */
  8673. var NativeInputType = void 0;
  8674. /**
  8675. * @typedef {{
  8676. * helperText: (!MDCTextFieldHelperTextFoundation|undefined),
  8677. * leadingIcon: (!MDCTextFieldIconFoundation|undefined),
  8678. * trailingIcon: (!MDCTextFieldIconFoundation|undefined),
  8679. * }}
  8680. */
  8681. var FoundationMapType = void 0;
  8682. /**
  8683. * Adapter for MDC Text Field.
  8684. *
  8685. * Defines the shape of the adapter expected by the foundation. Implement this
  8686. * adapter to integrate the Text Field into your framework. See
  8687. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  8688. * for more information.
  8689. *
  8690. * @record
  8691. */
  8692. var MDCTextFieldAdapter = function () {
  8693. function MDCTextFieldAdapter() {
  8694. _classCallCheck(this, MDCTextFieldAdapter);
  8695. }
  8696. _createClass(MDCTextFieldAdapter, [{
  8697. key: 'addClass',
  8698. /**
  8699. * Adds a class to the root Element.
  8700. * @param {string} className
  8701. */
  8702. value: function addClass(className) {}
  8703. /**
  8704. * Removes a class from the root Element.
  8705. * @param {string} className
  8706. */
  8707. }, {
  8708. key: 'removeClass',
  8709. value: function removeClass(className) {}
  8710. /**
  8711. * Returns true if the root element contains the given class name.
  8712. * @param {string} className
  8713. * @return {boolean}
  8714. */
  8715. }, {
  8716. key: 'hasClass',
  8717. value: function hasClass(className) {}
  8718. /**
  8719. * Registers an event handler on the root element for a given event.
  8720. * @param {string} type
  8721. * @param {function(!Event): undefined} handler
  8722. */
  8723. }, {
  8724. key: 'registerTextFieldInteractionHandler',
  8725. value: function registerTextFieldInteractionHandler(type, handler) {}
  8726. /**
  8727. * Deregisters an event handler on the root element for a given event.
  8728. * @param {string} type
  8729. * @param {function(!Event): undefined} handler
  8730. */
  8731. }, {
  8732. key: 'deregisterTextFieldInteractionHandler',
  8733. value: function deregisterTextFieldInteractionHandler(type, handler) {}
  8734. /**
  8735. * Registers an event listener on the native input element for a given event.
  8736. * @param {string} evtType
  8737. * @param {function(!Event): undefined} handler
  8738. */
  8739. }, {
  8740. key: 'registerInputInteractionHandler',
  8741. value: function registerInputInteractionHandler(evtType, handler) {}
  8742. /**
  8743. * Deregisters an event listener on the native input element for a given event.
  8744. * @param {string} evtType
  8745. * @param {function(!Event): undefined} handler
  8746. */
  8747. }, {
  8748. key: 'deregisterInputInteractionHandler',
  8749. value: function deregisterInputInteractionHandler(evtType, handler) {}
  8750. /**
  8751. * Registers a validation attribute change listener on the input element.
  8752. * Handler accepts list of attribute names.
  8753. * @param {function(!Array<string>): undefined} handler
  8754. * @return {!MutationObserver}
  8755. */
  8756. }, {
  8757. key: 'registerValidationAttributeChangeHandler',
  8758. value: function registerValidationAttributeChangeHandler(handler) {}
  8759. /**
  8760. * Disconnects a validation attribute observer on the input element.
  8761. * @param {!MutationObserver} observer
  8762. */
  8763. }, {
  8764. key: 'deregisterValidationAttributeChangeHandler',
  8765. value: function deregisterValidationAttributeChangeHandler(observer) {}
  8766. /**
  8767. * Returns an object representing the native text input element, with a
  8768. * similar API shape. The object returned should include the value, disabled
  8769. * and badInput properties, as well as the checkValidity() function. We never
  8770. * alter the value within our code, however we do update the disabled
  8771. * property, so if you choose to duck-type the return value for this method
  8772. * in your implementation it's important to keep this in mind. Also note that
  8773. * this method can return null, which the foundation will handle gracefully.
  8774. * @return {?Element|?NativeInputType}
  8775. */
  8776. }, {
  8777. key: 'getNativeInput',
  8778. value: function getNativeInput() {}
  8779. /**
  8780. * Returns true if the textfield is focused.
  8781. * We achieve this via `document.activeElement === this.root_`.
  8782. * @return {boolean}
  8783. */
  8784. }, {
  8785. key: 'isFocused',
  8786. value: function isFocused() {}
  8787. /**
  8788. * Activates the line ripple.
  8789. */
  8790. }, {
  8791. key: 'activateLineRipple',
  8792. value: function activateLineRipple() {}
  8793. /**
  8794. * Deactivates the line ripple.
  8795. */
  8796. }, {
  8797. key: 'deactivateLineRipple',
  8798. value: function deactivateLineRipple() {}
  8799. /**
  8800. * Sets the transform origin of the line ripple.
  8801. * @param {number} normalizedX
  8802. */
  8803. }, {
  8804. key: 'setLineRippleTransformOrigin',
  8805. value: function setLineRippleTransformOrigin(normalizedX) {}
  8806. /**
  8807. * Only implement if label exists.
  8808. * Shakes label if shouldShake is true.
  8809. * @param {boolean} shouldShake
  8810. */
  8811. }, {
  8812. key: 'shakeLabel',
  8813. value: function shakeLabel(shouldShake) {}
  8814. /**
  8815. * Only implement if label exists.
  8816. * Floats the label above the input element if shouldFloat is true.
  8817. * @param {boolean} shouldFloat
  8818. */
  8819. }, {
  8820. key: 'floatLabel',
  8821. value: function floatLabel(shouldFloat) {}
  8822. /**
  8823. * Returns true if label element exists, false if it doesn't.
  8824. * @return {boolean}
  8825. */
  8826. }, {
  8827. key: 'hasLabel',
  8828. value: function hasLabel() {}
  8829. /**
  8830. * Only implement if label exists.
  8831. * Returns width of label in pixels.
  8832. * @return {number}
  8833. */
  8834. }, {
  8835. key: 'getLabelWidth',
  8836. value: function getLabelWidth() {}
  8837. /**
  8838. * Returns true if outline element exists, false if it doesn't.
  8839. * @return {boolean}
  8840. */
  8841. }, {
  8842. key: 'hasOutline',
  8843. value: function hasOutline() {}
  8844. /**
  8845. * Only implement if outline element exists.
  8846. * @param {number} labelWidth
  8847. */
  8848. }, {
  8849. key: 'notchOutline',
  8850. value: function notchOutline(labelWidth) {}
  8851. /**
  8852. * Only implement if outline element exists.
  8853. * Closes notch in outline element.
  8854. */
  8855. }, {
  8856. key: 'closeOutline',
  8857. value: function closeOutline() {}
  8858. }]);
  8859. return MDCTextFieldAdapter;
  8860. }();
  8861. /***/ }),
  8862. /* 61 */
  8863. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8864. "use strict";
  8865. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  8866. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8867. /**
  8868. * @license
  8869. * Copyright 2017 Google Inc.
  8870. *
  8871. * Permission is hereby granted, free of charge, to any person obtaining a copy
  8872. * of this software and associated documentation files (the "Software"), to deal
  8873. * in the Software without restriction, including without limitation the rights
  8874. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8875. * copies of the Software, and to permit persons to whom the Software is
  8876. * furnished to do so, subject to the following conditions:
  8877. *
  8878. * The above copyright notice and this permission notice shall be included in
  8879. * all copies or substantial portions of the Software.
  8880. *
  8881. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  8882. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  8883. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  8884. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  8885. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  8886. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  8887. * THE SOFTWARE.
  8888. */
  8889. /* eslint no-unused-vars: [2, {"args": "none"}] */
  8890. /**
  8891. * Adapter for MDC Text Field Helper Text.
  8892. *
  8893. * Defines the shape of the adapter expected by the foundation. Implement this
  8894. * adapter to integrate the TextField helper text into your framework. See
  8895. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  8896. * for more information.
  8897. *
  8898. * @record
  8899. */
  8900. var MDCTextFieldHelperTextAdapter = function () {
  8901. function MDCTextFieldHelperTextAdapter() {
  8902. _classCallCheck(this, MDCTextFieldHelperTextAdapter);
  8903. }
  8904. _createClass(MDCTextFieldHelperTextAdapter, [{
  8905. key: "addClass",
  8906. /**
  8907. * Adds a class to the helper text element.
  8908. * @param {string} className
  8909. */
  8910. value: function addClass(className) {}
  8911. /**
  8912. * Removes a class from the helper text element.
  8913. * @param {string} className
  8914. */
  8915. }, {
  8916. key: "removeClass",
  8917. value: function removeClass(className) {}
  8918. /**
  8919. * Returns whether or not the helper text element contains the given class.
  8920. * @param {string} className
  8921. * @return {boolean}
  8922. */
  8923. }, {
  8924. key: "hasClass",
  8925. value: function hasClass(className) {}
  8926. /**
  8927. * Sets an attribute with a given value on the helper text element.
  8928. * @param {string} attr
  8929. * @param {string} value
  8930. */
  8931. }, {
  8932. key: "setAttr",
  8933. value: function setAttr(attr, value) {}
  8934. /**
  8935. * Removes an attribute from the helper text element.
  8936. * @param {string} attr
  8937. */
  8938. }, {
  8939. key: "removeAttr",
  8940. value: function removeAttr(attr) {}
  8941. /**
  8942. * Sets the text content for the helper text element.
  8943. * @param {string} content
  8944. */
  8945. }, {
  8946. key: "setContent",
  8947. value: function setContent(content) {}
  8948. }]);
  8949. return MDCTextFieldHelperTextAdapter;
  8950. }();
  8951. /* unused harmony default export */ var _unused_webpack_default_export = (MDCTextFieldHelperTextAdapter);
  8952. /***/ }),
  8953. /* 62 */
  8954. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8955. "use strict";
  8956. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  8957. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8958. /**
  8959. * @license
  8960. * Copyright 2017 Google Inc.
  8961. *
  8962. * Permission is hereby granted, free of charge, to any person obtaining a copy
  8963. * of this software and associated documentation files (the "Software"), to deal
  8964. * in the Software without restriction, including without limitation the rights
  8965. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8966. * copies of the Software, and to permit persons to whom the Software is
  8967. * furnished to do so, subject to the following conditions:
  8968. *
  8969. * The above copyright notice and this permission notice shall be included in
  8970. * all copies or substantial portions of the Software.
  8971. *
  8972. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  8973. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  8974. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  8975. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  8976. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  8977. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  8978. * THE SOFTWARE.
  8979. */
  8980. /* eslint no-unused-vars: [2, {"args": "none"}] */
  8981. /**
  8982. * Adapter for MDC Text Field Icon.
  8983. *
  8984. * Defines the shape of the adapter expected by the foundation. Implement this
  8985. * adapter to integrate the text field icon into your framework. See
  8986. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  8987. * for more information.
  8988. *
  8989. * @record
  8990. */
  8991. var MDCTextFieldIconAdapter = function () {
  8992. function MDCTextFieldIconAdapter() {
  8993. _classCallCheck(this, MDCTextFieldIconAdapter);
  8994. }
  8995. _createClass(MDCTextFieldIconAdapter, [{
  8996. key: "getAttr",
  8997. /**
  8998. * Gets the value of an attribute on the icon element.
  8999. * @param {string} attr
  9000. * @return {string}
  9001. */
  9002. value: function getAttr(attr) {}
  9003. /**
  9004. * Sets an attribute on the icon element.
  9005. * @param {string} attr
  9006. * @param {string} value
  9007. */
  9008. }, {
  9009. key: "setAttr",
  9010. value: function setAttr(attr, value) {}
  9011. /**
  9012. * Removes an attribute from the icon element.
  9013. * @param {string} attr
  9014. */
  9015. }, {
  9016. key: "removeAttr",
  9017. value: function removeAttr(attr) {}
  9018. /**
  9019. * Sets the text content of the icon element.
  9020. * @param {string} content
  9021. */
  9022. }, {
  9023. key: "setContent",
  9024. value: function setContent(content) {}
  9025. /**
  9026. * Registers an event listener on the icon element for a given event.
  9027. * @param {string} evtType
  9028. * @param {function(!Event): undefined} handler
  9029. */
  9030. }, {
  9031. key: "registerInteractionHandler",
  9032. value: function registerInteractionHandler(evtType, handler) {}
  9033. /**
  9034. * Deregisters an event listener on the icon element for a given event.
  9035. * @param {string} evtType
  9036. * @param {function(!Event): undefined} handler
  9037. */
  9038. }, {
  9039. key: "deregisterInteractionHandler",
  9040. value: function deregisterInteractionHandler(evtType, handler) {}
  9041. /**
  9042. * Emits a custom event "MDCTextField:icon" denoting a user has clicked the icon.
  9043. */
  9044. }, {
  9045. key: "notifyIconAction",
  9046. value: function notifyIconAction() {}
  9047. }]);
  9048. return MDCTextFieldIconAdapter;
  9049. }();
  9050. /* unused harmony default export */ var _unused_webpack_default_export = (MDCTextFieldIconAdapter);
  9051. /***/ }),
  9052. /* 63 */
  9053. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9054. "use strict";
  9055. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  9056. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__ = __webpack_require__(64);
  9057. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_index__ = __webpack_require__(3);
  9058. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_checkbox_index__ = __webpack_require__(65);
  9059. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_chips_index__ = __webpack_require__(71);
  9060. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_dialog_index__ = __webpack_require__(75);
  9061. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__material_dom_index__ = __webpack_require__(81);
  9062. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__material_drawer_index__ = __webpack_require__(82);
  9063. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__material_floating_label_index__ = __webpack_require__(10);
  9064. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__material_form_field_index__ = __webpack_require__(89);
  9065. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__material_grid_list_index__ = __webpack_require__(93);
  9066. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__material_icon_button_index__ = __webpack_require__(96);
  9067. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__material_icon_toggle_index__ = __webpack_require__(100);
  9068. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__material_linear_progress_index__ = __webpack_require__(104);
  9069. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__material_line_ripple_index__ = __webpack_require__(18);
  9070. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__material_list_index__ = __webpack_require__(16);
  9071. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__material_menu_index__ = __webpack_require__(43);
  9072. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__material_menu_surface_index__ = __webpack_require__(45);
  9073. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__material_notched_outline_index__ = __webpack_require__(22);
  9074. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__material_radio_index__ = __webpack_require__(113);
  9075. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__material_ripple_index__ = __webpack_require__(2);
  9076. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__material_select_index__ = __webpack_require__(117);
  9077. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__material_selection_control_index__ = __webpack_require__(4);
  9078. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__material_slider_index__ = __webpack_require__(123);
  9079. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__material_snackbar_index__ = __webpack_require__(125);
  9080. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__material_switch_index__ = __webpack_require__(128);
  9081. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__material_tab_index__ = __webpack_require__(25);
  9082. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__material_tab_bar_index__ = __webpack_require__(137);
  9083. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_27__material_tab_indicator_index__ = __webpack_require__(54);
  9084. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__material_tab_scroller_index__ = __webpack_require__(56);
  9085. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_29__material_textfield_index__ = __webpack_require__(145);
  9086. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_30__material_toolbar_index__ = __webpack_require__(151);
  9087. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_31__material_top_app_bar_index__ = __webpack_require__(154);
  9088. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "autoInit", function() { return __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a"]; });
  9089. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "base", function() { return __WEBPACK_IMPORTED_MODULE_1__material_base_index__; });
  9090. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "checkbox", function() { return __WEBPACK_IMPORTED_MODULE_2__material_checkbox_index__; });
  9091. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "chips", function() { return __WEBPACK_IMPORTED_MODULE_3__material_chips_index__; });
  9092. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "dialog", function() { return __WEBPACK_IMPORTED_MODULE_4__material_dialog_index__; });
  9093. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "dom", function() { return __WEBPACK_IMPORTED_MODULE_5__material_dom_index__; });
  9094. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "drawer", function() { return __WEBPACK_IMPORTED_MODULE_6__material_drawer_index__; });
  9095. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "floatingLabel", function() { return __WEBPACK_IMPORTED_MODULE_7__material_floating_label_index__; });
  9096. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "formField", function() { return __WEBPACK_IMPORTED_MODULE_8__material_form_field_index__; });
  9097. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "gridList", function() { return __WEBPACK_IMPORTED_MODULE_9__material_grid_list_index__; });
  9098. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "iconButton", function() { return __WEBPACK_IMPORTED_MODULE_10__material_icon_button_index__; });
  9099. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "iconToggle", function() { return __WEBPACK_IMPORTED_MODULE_11__material_icon_toggle_index__; });
  9100. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "lineRipple", function() { return __WEBPACK_IMPORTED_MODULE_13__material_line_ripple_index__; });
  9101. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "linearProgress", function() { return __WEBPACK_IMPORTED_MODULE_12__material_linear_progress_index__; });
  9102. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "list", function() { return __WEBPACK_IMPORTED_MODULE_14__material_list_index__; });
  9103. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "menu", function() { return __WEBPACK_IMPORTED_MODULE_15__material_menu_index__; });
  9104. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "menuSurface", function() { return __WEBPACK_IMPORTED_MODULE_16__material_menu_surface_index__; });
  9105. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "notchedOutline", function() { return __WEBPACK_IMPORTED_MODULE_17__material_notched_outline_index__; });
  9106. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "radio", function() { return __WEBPACK_IMPORTED_MODULE_18__material_radio_index__; });
  9107. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "ripple", function() { return __WEBPACK_IMPORTED_MODULE_19__material_ripple_index__; });
  9108. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "select", function() { return __WEBPACK_IMPORTED_MODULE_20__material_select_index__; });
  9109. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "selectionControl", function() { return __WEBPACK_IMPORTED_MODULE_21__material_selection_control_index__; });
  9110. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "slider", function() { return __WEBPACK_IMPORTED_MODULE_22__material_slider_index__; });
  9111. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "switchControl", function() { return __WEBPACK_IMPORTED_MODULE_24__material_switch_index__; });
  9112. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "snackbar", function() { return __WEBPACK_IMPORTED_MODULE_23__material_snackbar_index__; });
  9113. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "tab", function() { return __WEBPACK_IMPORTED_MODULE_25__material_tab_index__; });
  9114. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "tabBar", function() { return __WEBPACK_IMPORTED_MODULE_26__material_tab_bar_index__; });
  9115. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "tabIndicator", function() { return __WEBPACK_IMPORTED_MODULE_27__material_tab_indicator_index__; });
  9116. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "tabScroller", function() { return __WEBPACK_IMPORTED_MODULE_28__material_tab_scroller_index__; });
  9117. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "textField", function() { return __WEBPACK_IMPORTED_MODULE_29__material_textfield_index__; });
  9118. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "toolbar", function() { return __WEBPACK_IMPORTED_MODULE_30__material_toolbar_index__; });
  9119. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "topAppBar", function() { return __WEBPACK_IMPORTED_MODULE_31__material_top_app_bar_index__; });
  9120. /**
  9121. * @license
  9122. * Copyright 2016 Google Inc.
  9123. *
  9124. * Permission is hereby granted, free of charge, to any person obtaining a copy
  9125. * of this software and associated documentation files (the "Software"), to deal
  9126. * in the Software without restriction, including without limitation the rights
  9127. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9128. * copies of the Software, and to permit persons to whom the Software is
  9129. * furnished to do so, subject to the following conditions:
  9130. *
  9131. * The above copyright notice and this permission notice shall be included in
  9132. * all copies or substantial portions of the Software.
  9133. *
  9134. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  9135. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  9136. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  9137. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  9138. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  9139. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  9140. * THE SOFTWARE.
  9141. */
  9142. // Register all components
  9143. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCCheckbox', __WEBPACK_IMPORTED_MODULE_2__material_checkbox_index__["MDCCheckbox"]);
  9144. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCChip', __WEBPACK_IMPORTED_MODULE_3__material_chips_index__["MDCChip"]);
  9145. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCChipSet', __WEBPACK_IMPORTED_MODULE_3__material_chips_index__["MDCChipSet"]);
  9146. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCDialog', __WEBPACK_IMPORTED_MODULE_4__material_dialog_index__["MDCDialog"]);
  9147. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCDrawer', __WEBPACK_IMPORTED_MODULE_6__material_drawer_index__["MDCDrawer"]);
  9148. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCFloatingLabel', __WEBPACK_IMPORTED_MODULE_7__material_floating_label_index__["MDCFloatingLabel"]);
  9149. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCFormField', __WEBPACK_IMPORTED_MODULE_8__material_form_field_index__["MDCFormField"]);
  9150. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCRipple', __WEBPACK_IMPORTED_MODULE_19__material_ripple_index__["MDCRipple"]);
  9151. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCGridList', __WEBPACK_IMPORTED_MODULE_9__material_grid_list_index__["MDCGridList"]);
  9152. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCIconButtonToggle', __WEBPACK_IMPORTED_MODULE_10__material_icon_button_index__["MDCIconButtonToggle"]);
  9153. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCIconToggle', __WEBPACK_IMPORTED_MODULE_11__material_icon_toggle_index__["MDCIconToggle"]);
  9154. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCLineRipple', __WEBPACK_IMPORTED_MODULE_13__material_line_ripple_index__["MDCLineRipple"]);
  9155. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCLinearProgress', __WEBPACK_IMPORTED_MODULE_12__material_linear_progress_index__["MDCLinearProgress"]);
  9156. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCList', __WEBPACK_IMPORTED_MODULE_14__material_list_index__["MDCList"]);
  9157. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCNotchedOutline', __WEBPACK_IMPORTED_MODULE_17__material_notched_outline_index__["MDCNotchedOutline"]);
  9158. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCRadio', __WEBPACK_IMPORTED_MODULE_18__material_radio_index__["MDCRadio"]);
  9159. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCSnackbar', __WEBPACK_IMPORTED_MODULE_23__material_snackbar_index__["MDCSnackbar"]);
  9160. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCTabBar', __WEBPACK_IMPORTED_MODULE_26__material_tab_bar_index__["MDCTabBar"]);
  9161. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCTextField', __WEBPACK_IMPORTED_MODULE_29__material_textfield_index__["MDCTextField"]);
  9162. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCMenu', __WEBPACK_IMPORTED_MODULE_15__material_menu_index__["MDCMenu"]);
  9163. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCMenuSurface', __WEBPACK_IMPORTED_MODULE_16__material_menu_surface_index__["MDCMenuSurface"]);
  9164. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCSelect', __WEBPACK_IMPORTED_MODULE_20__material_select_index__["MDCSelect"]);
  9165. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCSlider', __WEBPACK_IMPORTED_MODULE_22__material_slider_index__["MDCSlider"]);
  9166. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCSwitch', __WEBPACK_IMPORTED_MODULE_24__material_switch_index__["MDCSwitch"]);
  9167. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCToolbar', __WEBPACK_IMPORTED_MODULE_30__material_toolbar_index__["MDCToolbar"]);
  9168. __WEBPACK_IMPORTED_MODULE_0__material_auto_init_index__["a" /* default */].register('MDCTopAppBar', __WEBPACK_IMPORTED_MODULE_31__material_top_app_bar_index__["MDCTopAppBar"]);
  9169. // Export all components.
  9170. /***/ }),
  9171. /* 64 */
  9172. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9173. "use strict";
  9174. /* harmony export (immutable) */ __webpack_exports__["a"] = mdcAutoInit;
  9175. /**
  9176. * @license
  9177. * Copyright 2016 Google Inc.
  9178. *
  9179. * Permission is hereby granted, free of charge, to any person obtaining a copy
  9180. * of this software and associated documentation files (the "Software"), to deal
  9181. * in the Software without restriction, including without limitation the rights
  9182. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9183. * copies of the Software, and to permit persons to whom the Software is
  9184. * furnished to do so, subject to the following conditions:
  9185. *
  9186. * The above copyright notice and this permission notice shall be included in
  9187. * all copies or substantial portions of the Software.
  9188. *
  9189. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  9190. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  9191. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  9192. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  9193. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  9194. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  9195. * THE SOFTWARE.
  9196. */
  9197. var registry = Object.create(null);
  9198. var CONSOLE_WARN = console.warn.bind(console);
  9199. function _emit(evtType, evtData) {
  9200. var shouldBubble = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  9201. var evt = void 0;
  9202. if (typeof CustomEvent === 'function') {
  9203. evt = new CustomEvent(evtType, {
  9204. detail: evtData,
  9205. bubbles: shouldBubble
  9206. });
  9207. } else {
  9208. evt = document.createEvent('CustomEvent');
  9209. evt.initCustomEvent(evtType, shouldBubble, false, evtData);
  9210. }
  9211. document.dispatchEvent(evt);
  9212. }
  9213. /**
  9214. * Auto-initializes all mdc components on a page.
  9215. */
  9216. function mdcAutoInit() {
  9217. var root = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
  9218. var warn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : CONSOLE_WARN;
  9219. var components = [];
  9220. var nodes = root.querySelectorAll('[data-mdc-auto-init]');
  9221. for (var i = 0, node; node = nodes[i]; i++) {
  9222. var ctorName = node.dataset.mdcAutoInit;
  9223. if (!ctorName) {
  9224. throw new Error('(mdc-auto-init) Constructor name must be given.');
  9225. }
  9226. var Ctor = registry[ctorName];
  9227. if (typeof Ctor !== 'function') {
  9228. throw new Error('(mdc-auto-init) Could not find constructor in registry for ' + ctorName);
  9229. }
  9230. if (node[ctorName]) {
  9231. warn('(mdc-auto-init) Component already initialized for ' + node + '. Skipping...');
  9232. continue;
  9233. }
  9234. // TODO: Should we make an eslint rule for an attachTo() static method?
  9235. var component = Ctor.attachTo(node);
  9236. Object.defineProperty(node, ctorName, {
  9237. value: component,
  9238. writable: false,
  9239. enumerable: false,
  9240. configurable: true
  9241. });
  9242. components.push(component);
  9243. }
  9244. _emit('MDCAutoInit:End', {});
  9245. return components;
  9246. }
  9247. mdcAutoInit.register = function (componentName, Ctor) {
  9248. var warn = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : CONSOLE_WARN;
  9249. if (typeof Ctor !== 'function') {
  9250. throw new Error('(mdc-auto-init) Invalid Ctor value ' + Ctor + '. Expected function');
  9251. }
  9252. if (registry[componentName]) {
  9253. warn('(mdc-auto-init) Overriding registration for ' + componentName + ' with ' + Ctor + '. ' + ('Was: ' + registry[componentName]));
  9254. }
  9255. registry[componentName] = Ctor;
  9256. };
  9257. mdcAutoInit.deregister = function (componentName) {
  9258. delete registry[componentName];
  9259. };
  9260. mdcAutoInit.deregisterAll = function () {
  9261. Object.keys(registry).forEach(this.deregister, this);
  9262. };
  9263. /***/ }),
  9264. /* 65 */
  9265. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9266. "use strict";
  9267. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  9268. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCCheckbox", function() { return MDCCheckbox; });
  9269. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_animation_index__ = __webpack_require__(9);
  9270. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(1);
  9271. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_selection_control_index__ = __webpack_require__(4);
  9272. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation__ = __webpack_require__(68);
  9273. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_ripple_index__ = __webpack_require__(2);
  9274. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__material_ripple_util__ = __webpack_require__(6);
  9275. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCCheckboxFoundation", function() { return __WEBPACK_IMPORTED_MODULE_3__foundation__["a"]; });
  9276. 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; };
  9277. 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); } };
  9278. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  9279. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9280. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  9281. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  9282. /**
  9283. * @license
  9284. * Copyright 2016 Google Inc.
  9285. *
  9286. * Permission is hereby granted, free of charge, to any person obtaining a copy
  9287. * of this software and associated documentation files (the "Software"), to deal
  9288. * in the Software without restriction, including without limitation the rights
  9289. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9290. * copies of the Software, and to permit persons to whom the Software is
  9291. * furnished to do so, subject to the following conditions:
  9292. *
  9293. * The above copyright notice and this permission notice shall be included in
  9294. * all copies or substantial portions of the Software.
  9295. *
  9296. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  9297. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  9298. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  9299. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  9300. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  9301. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  9302. * THE SOFTWARE.
  9303. */
  9304. /* eslint-disable no-unused-vars */
  9305. /* eslint-enable no-unused-vars */
  9306. /** @const {!Array<string>} */
  9307. var CB_PROTO_PROPS = ['checked', 'indeterminate'];
  9308. /**
  9309. * @extends MDCComponent<!MDCCheckboxFoundation>
  9310. * @implements {MDCSelectionControl}
  9311. */
  9312. var MDCCheckbox = function (_MDCComponent) {
  9313. _inherits(MDCCheckbox, _MDCComponent);
  9314. _createClass(MDCCheckbox, [{
  9315. key: 'nativeCb_',
  9316. /**
  9317. * Returns the state of the native control element, or null if the native control element is not present.
  9318. * @return {!MDCSelectionControlState}
  9319. * @private
  9320. */
  9321. get: function get() {
  9322. var NATIVE_CONTROL_SELECTOR = __WEBPACK_IMPORTED_MODULE_3__foundation__["a" /* default */].strings.NATIVE_CONTROL_SELECTOR;
  9323. var cbEl = /** @type {!MDCSelectionControlState} */this.root_.querySelector(NATIVE_CONTROL_SELECTOR);
  9324. return cbEl;
  9325. }
  9326. }], [{
  9327. key: 'attachTo',
  9328. value: function attachTo(root) {
  9329. return new MDCCheckbox(root);
  9330. }
  9331. }]);
  9332. function MDCCheckbox() {
  9333. var _ref;
  9334. _classCallCheck(this, MDCCheckbox);
  9335. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  9336. args[_key] = arguments[_key];
  9337. }
  9338. /** @private {!MDCRipple} */
  9339. var _this = _possibleConstructorReturn(this, (_ref = MDCCheckbox.__proto__ || Object.getPrototypeOf(MDCCheckbox)).call.apply(_ref, [this].concat(args)));
  9340. _this.ripple_ = _this.initRipple_();
  9341. /** @private {!Function} */
  9342. _this.handleChange_;
  9343. /** @private {!Function} */
  9344. _this.handleAnimationEnd_;
  9345. return _this;
  9346. }
  9347. _createClass(MDCCheckbox, [{
  9348. key: 'initialSyncWithDOM',
  9349. value: function initialSyncWithDOM() {
  9350. var _this2 = this;
  9351. this.handleChange_ = function () {
  9352. return _this2.foundation_.handleChange();
  9353. };
  9354. this.handleAnimationEnd_ = function () {
  9355. return _this2.foundation_.handleAnimationEnd();
  9356. };
  9357. this.nativeCb_.addEventListener('change', this.handleChange_);
  9358. this.listen(Object(__WEBPACK_IMPORTED_MODULE_0__material_animation_index__["a" /* getCorrectEventName */])(window, 'animationend'), this.handleAnimationEnd_);
  9359. this.installPropertyChangeHooks_();
  9360. }
  9361. /**
  9362. * @return {!MDCRipple}
  9363. * @private
  9364. */
  9365. }, {
  9366. key: 'initRipple_',
  9367. value: function initRipple_() {
  9368. var _this3 = this;
  9369. var MATCHES = Object(__WEBPACK_IMPORTED_MODULE_5__material_ripple_util__["getMatchesProperty"])(HTMLElement.prototype);
  9370. var adapter = _extends(__WEBPACK_IMPORTED_MODULE_4__material_ripple_index__["MDCRipple"].createAdapter(this), {
  9371. isUnbounded: function isUnbounded() {
  9372. return true;
  9373. },
  9374. isSurfaceActive: function isSurfaceActive() {
  9375. return _this3.nativeCb_[MATCHES](':active');
  9376. },
  9377. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  9378. return _this3.nativeCb_.addEventListener(type, handler);
  9379. },
  9380. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  9381. return _this3.nativeCb_.removeEventListener(type, handler);
  9382. }
  9383. });
  9384. var foundation = new __WEBPACK_IMPORTED_MODULE_4__material_ripple_index__["MDCRippleFoundation"](adapter);
  9385. return new __WEBPACK_IMPORTED_MODULE_4__material_ripple_index__["MDCRipple"](this.root_, foundation);
  9386. }
  9387. /** @private */
  9388. }, {
  9389. key: 'installPropertyChangeHooks_',
  9390. value: function installPropertyChangeHooks_() {
  9391. var _this4 = this;
  9392. var nativeCb = this.nativeCb_;
  9393. var cbProto = Object.getPrototypeOf(nativeCb);
  9394. CB_PROTO_PROPS.forEach(function (controlState) {
  9395. var desc = Object.getOwnPropertyDescriptor(cbProto, controlState);
  9396. // We have to check for this descriptor, since some browsers (Safari) don't support its return.
  9397. // See: https://bugs.webkit.org/show_bug.cgi?id=49739
  9398. if (validDescriptor(desc)) {
  9399. var nativeCbDesc = /** @type {!ObjectPropertyDescriptor} */{
  9400. get: desc.get,
  9401. set: function set(state) {
  9402. desc.set.call(nativeCb, state);
  9403. _this4.foundation_.handleChange();
  9404. },
  9405. configurable: desc.configurable,
  9406. enumerable: desc.enumerable
  9407. };
  9408. Object.defineProperty(nativeCb, controlState, nativeCbDesc);
  9409. }
  9410. });
  9411. }
  9412. /** @private */
  9413. }, {
  9414. key: 'uninstallPropertyChangeHooks_',
  9415. value: function uninstallPropertyChangeHooks_() {
  9416. var nativeCb = this.nativeCb_;
  9417. var cbProto = Object.getPrototypeOf(nativeCb);
  9418. CB_PROTO_PROPS.forEach(function (controlState) {
  9419. var desc = /** @type {!ObjectPropertyDescriptor} */Object.getOwnPropertyDescriptor(cbProto, controlState);
  9420. if (validDescriptor(desc)) {
  9421. Object.defineProperty(nativeCb, controlState, desc);
  9422. }
  9423. });
  9424. }
  9425. /** @return {!MDCCheckboxFoundation} */
  9426. }, {
  9427. key: 'getDefaultFoundation',
  9428. value: function getDefaultFoundation() {
  9429. var _this5 = this;
  9430. return new __WEBPACK_IMPORTED_MODULE_3__foundation__["a" /* default */]({
  9431. addClass: function addClass(className) {
  9432. return _this5.root_.classList.add(className);
  9433. },
  9434. removeClass: function removeClass(className) {
  9435. return _this5.root_.classList.remove(className);
  9436. },
  9437. setNativeControlAttr: function setNativeControlAttr(attr, value) {
  9438. return _this5.nativeCb_.setAttribute(attr, value);
  9439. },
  9440. removeNativeControlAttr: function removeNativeControlAttr(attr) {
  9441. return _this5.nativeCb_.removeAttribute(attr);
  9442. },
  9443. isIndeterminate: function isIndeterminate() {
  9444. return _this5.indeterminate;
  9445. },
  9446. isChecked: function isChecked() {
  9447. return _this5.checked;
  9448. },
  9449. hasNativeControl: function hasNativeControl() {
  9450. return !!_this5.nativeCb_;
  9451. },
  9452. setNativeControlDisabled: function setNativeControlDisabled(disabled) {
  9453. return _this5.nativeCb_.disabled = disabled;
  9454. },
  9455. forceLayout: function forceLayout() {
  9456. return _this5.root_.offsetWidth;
  9457. },
  9458. isAttachedToDOM: function isAttachedToDOM() {
  9459. return Boolean(_this5.root_.parentNode);
  9460. }
  9461. });
  9462. }
  9463. /** @return {!MDCRipple} */
  9464. }, {
  9465. key: 'destroy',
  9466. value: function destroy() {
  9467. this.ripple_.destroy();
  9468. this.nativeCb_.removeEventListener('change', this.handleChange_);
  9469. this.unlisten(Object(__WEBPACK_IMPORTED_MODULE_0__material_animation_index__["a" /* getCorrectEventName */])(window, 'animationend'), this.handleAnimationEnd_);
  9470. this.uninstallPropertyChangeHooks_();
  9471. _get(MDCCheckbox.prototype.__proto__ || Object.getPrototypeOf(MDCCheckbox.prototype), 'destroy', this).call(this);
  9472. }
  9473. }, {
  9474. key: 'ripple',
  9475. get: function get() {
  9476. return this.ripple_;
  9477. }
  9478. /** @return {boolean} */
  9479. }, {
  9480. key: 'checked',
  9481. get: function get() {
  9482. return this.nativeCb_.checked;
  9483. }
  9484. /** @param {boolean} checked */
  9485. ,
  9486. set: function set(checked) {
  9487. this.nativeCb_.checked = checked;
  9488. }
  9489. /** @return {boolean} */
  9490. }, {
  9491. key: 'indeterminate',
  9492. get: function get() {
  9493. return this.nativeCb_.indeterminate;
  9494. }
  9495. /** @param {boolean} indeterminate */
  9496. ,
  9497. set: function set(indeterminate) {
  9498. this.nativeCb_.indeterminate = indeterminate;
  9499. }
  9500. /** @return {boolean} */
  9501. }, {
  9502. key: 'disabled',
  9503. get: function get() {
  9504. return this.nativeCb_.disabled;
  9505. }
  9506. /** @param {boolean} disabled */
  9507. ,
  9508. set: function set(disabled) {
  9509. this.foundation_.setDisabled(disabled);
  9510. }
  9511. /** @return {?string} */
  9512. }, {
  9513. key: 'value',
  9514. get: function get() {
  9515. return this.nativeCb_.value;
  9516. }
  9517. /** @param {?string} value */
  9518. ,
  9519. set: function set(value) {
  9520. this.nativeCb_.value = value;
  9521. }
  9522. }]);
  9523. return MDCCheckbox;
  9524. }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* default */]);
  9525. /**
  9526. * @param {ObjectPropertyDescriptor|undefined} inputPropDesc
  9527. * @return {boolean}
  9528. */
  9529. function validDescriptor(inputPropDesc) {
  9530. return !!inputPropDesc && typeof inputPropDesc.set === 'function';
  9531. }
  9532. /***/ }),
  9533. /* 66 */
  9534. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9535. "use strict";
  9536. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  9537. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(29);
  9538. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(67);
  9539. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util__ = __webpack_require__(6);
  9540. 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; };
  9541. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  9542. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9543. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  9544. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  9545. /**
  9546. * @license
  9547. * Copyright 2016 Google Inc.
  9548. *
  9549. * Permission is hereby granted, free of charge, to any person obtaining a copy
  9550. * of this software and associated documentation files (the "Software"), to deal
  9551. * in the Software without restriction, including without limitation the rights
  9552. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9553. * copies of the Software, and to permit persons to whom the Software is
  9554. * furnished to do so, subject to the following conditions:
  9555. *
  9556. * The above copyright notice and this permission notice shall be included in
  9557. * all copies or substantial portions of the Software.
  9558. *
  9559. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  9560. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  9561. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  9562. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  9563. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  9564. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  9565. * THE SOFTWARE.
  9566. */
  9567. /**
  9568. * @typedef {{
  9569. * isActivated: (boolean|undefined),
  9570. * hasDeactivationUXRun: (boolean|undefined),
  9571. * wasActivatedByPointer: (boolean|undefined),
  9572. * wasElementMadeActive: (boolean|undefined),
  9573. * activationEvent: (!Event|undefined),
  9574. * isProgrammatic: (boolean|undefined)
  9575. * }}
  9576. */
  9577. var ActivationStateType = void 0;
  9578. /**
  9579. * @typedef {{
  9580. * activate: (string|undefined),
  9581. * deactivate: (string|undefined),
  9582. * focus: (string|undefined),
  9583. * blur: (string|undefined)
  9584. * }}
  9585. */
  9586. var ListenerInfoType = void 0;
  9587. /**
  9588. * @typedef {{
  9589. * activate: function(!Event),
  9590. * deactivate: function(!Event=),
  9591. * focus: function(),
  9592. * blur: function()
  9593. * }}
  9594. */
  9595. var ListenersType = void 0;
  9596. /**
  9597. * @typedef {{
  9598. * x: number,
  9599. * y: number
  9600. * }}
  9601. */
  9602. var PointType = void 0;
  9603. // Activation events registered on the root element of each instance for activation
  9604. var ACTIVATION_EVENT_TYPES = ['touchstart', 'pointerdown', 'mousedown', 'keydown'];
  9605. // Deactivation events registered on documentElement when a pointer-related down event occurs
  9606. var POINTER_DEACTIVATION_EVENT_TYPES = ['touchend', 'pointerup', 'mouseup', 'contextmenu'];
  9607. // Tracks activations that have occurred on the current frame, to avoid simultaneous nested activations
  9608. /** @type {!Array<!EventTarget>} */
  9609. var activatedTargets = [];
  9610. /**
  9611. * @extends {MDCFoundation<!MDCRippleAdapter>}
  9612. */
  9613. var MDCRippleFoundation = function (_MDCFoundation) {
  9614. _inherits(MDCRippleFoundation, _MDCFoundation);
  9615. _createClass(MDCRippleFoundation, null, [{
  9616. key: 'cssClasses',
  9617. get: function get() {
  9618. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  9619. }
  9620. }, {
  9621. key: 'strings',
  9622. get: function get() {
  9623. return __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */];
  9624. }
  9625. }, {
  9626. key: 'numbers',
  9627. get: function get() {
  9628. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */];
  9629. }
  9630. }, {
  9631. key: 'defaultAdapter',
  9632. get: function get() {
  9633. return {
  9634. browserSupportsCssVars: function browserSupportsCssVars() /* boolean - cached */{},
  9635. isUnbounded: function isUnbounded() /* boolean */{},
  9636. isSurfaceActive: function isSurfaceActive() /* boolean */{},
  9637. isSurfaceDisabled: function isSurfaceDisabled() /* boolean */{},
  9638. addClass: function addClass() /* className: string */{},
  9639. removeClass: function removeClass() /* className: string */{},
  9640. containsEventTarget: function containsEventTarget() /* target: !EventTarget */{},
  9641. registerInteractionHandler: function registerInteractionHandler() /* evtType: string, handler: EventListener */{},
  9642. deregisterInteractionHandler: function deregisterInteractionHandler() /* evtType: string, handler: EventListener */{},
  9643. registerDocumentInteractionHandler: function registerDocumentInteractionHandler() /* evtType: string, handler: EventListener */{},
  9644. deregisterDocumentInteractionHandler: function deregisterDocumentInteractionHandler() /* evtType: string, handler: EventListener */{},
  9645. registerResizeHandler: function registerResizeHandler() /* handler: EventListener */{},
  9646. deregisterResizeHandler: function deregisterResizeHandler() /* handler: EventListener */{},
  9647. updateCssVariable: function updateCssVariable() /* varName: string, value: string */{},
  9648. computeBoundingRect: function computeBoundingRect() /* ClientRect */{},
  9649. getWindowPageOffset: function getWindowPageOffset() /* {x: number, y: number} */{}
  9650. };
  9651. }
  9652. }]);
  9653. function MDCRippleFoundation(adapter) {
  9654. _classCallCheck(this, MDCRippleFoundation);
  9655. /** @private {number} */
  9656. var _this = _possibleConstructorReturn(this, (MDCRippleFoundation.__proto__ || Object.getPrototypeOf(MDCRippleFoundation)).call(this, _extends(MDCRippleFoundation.defaultAdapter, adapter)));
  9657. _this.layoutFrame_ = 0;
  9658. /** @private {!ClientRect} */
  9659. _this.frame_ = /** @type {!ClientRect} */{ width: 0, height: 0 };
  9660. /** @private {!ActivationStateType} */
  9661. _this.activationState_ = _this.defaultActivationState_();
  9662. /** @private {number} */
  9663. _this.initialSize_ = 0;
  9664. /** @private {number} */
  9665. _this.maxRadius_ = 0;
  9666. /** @private {function(!Event)} */
  9667. _this.activateHandler_ = function (e) {
  9668. return _this.activate_(e);
  9669. };
  9670. /** @private {function(!Event=)} */
  9671. _this.deactivateHandler_ = function () {
  9672. return _this.deactivate_();
  9673. };
  9674. /** @private {function(!Event=)} */
  9675. _this.focusHandler_ = function () {
  9676. return _this.handleFocus();
  9677. };
  9678. /** @private {function(!Event=)} */
  9679. _this.blurHandler_ = function () {
  9680. return _this.handleBlur();
  9681. };
  9682. /** @private {!Function} */
  9683. _this.resizeHandler_ = function () {
  9684. return _this.layout();
  9685. };
  9686. /** @private {{left: number, top:number}} */
  9687. _this.unboundedCoords_ = {
  9688. left: 0,
  9689. top: 0
  9690. };
  9691. /** @private {number} */
  9692. _this.fgScale_ = 0;
  9693. /** @private {number} */
  9694. _this.activationTimer_ = 0;
  9695. /** @private {number} */
  9696. _this.fgDeactivationRemovalTimer_ = 0;
  9697. /** @private {boolean} */
  9698. _this.activationAnimationHasEnded_ = false;
  9699. /** @private {!Function} */
  9700. _this.activationTimerCallback_ = function () {
  9701. _this.activationAnimationHasEnded_ = true;
  9702. _this.runDeactivationUXLogicIfReady_();
  9703. };
  9704. /** @private {!Event|undefined} */
  9705. _this.previousActivationEvent_;
  9706. return _this;
  9707. }
  9708. /**
  9709. * We compute this property so that we are not querying information about the client
  9710. * until the point in time where the foundation requests it. This prevents scenarios where
  9711. * client-side feature-detection may happen too early, such as when components are rendered on the server
  9712. * and then initialized at mount time on the client.
  9713. * @return {boolean}
  9714. * @private
  9715. */
  9716. _createClass(MDCRippleFoundation, [{
  9717. key: 'supportsPressRipple_',
  9718. value: function supportsPressRipple_() {
  9719. return this.adapter_.browserSupportsCssVars();
  9720. }
  9721. /**
  9722. * @return {!ActivationStateType}
  9723. */
  9724. }, {
  9725. key: 'defaultActivationState_',
  9726. value: function defaultActivationState_() {
  9727. return {
  9728. isActivated: false,
  9729. hasDeactivationUXRun: false,
  9730. wasActivatedByPointer: false,
  9731. wasElementMadeActive: false,
  9732. activationEvent: undefined,
  9733. isProgrammatic: false
  9734. };
  9735. }
  9736. /** @override */
  9737. }, {
  9738. key: 'init',
  9739. value: function init() {
  9740. var _this2 = this;
  9741. var supportsPressRipple = this.supportsPressRipple_();
  9742. this.registerRootHandlers_(supportsPressRipple);
  9743. if (supportsPressRipple) {
  9744. var _MDCRippleFoundation$ = MDCRippleFoundation.cssClasses,
  9745. ROOT = _MDCRippleFoundation$.ROOT,
  9746. UNBOUNDED = _MDCRippleFoundation$.UNBOUNDED;
  9747. requestAnimationFrame(function () {
  9748. _this2.adapter_.addClass(ROOT);
  9749. if (_this2.adapter_.isUnbounded()) {
  9750. _this2.adapter_.addClass(UNBOUNDED);
  9751. // Unbounded ripples need layout logic applied immediately to set coordinates for both shade and ripple
  9752. _this2.layoutInternal_();
  9753. }
  9754. });
  9755. }
  9756. }
  9757. /** @override */
  9758. }, {
  9759. key: 'destroy',
  9760. value: function destroy() {
  9761. var _this3 = this;
  9762. if (this.supportsPressRipple_()) {
  9763. if (this.activationTimer_) {
  9764. clearTimeout(this.activationTimer_);
  9765. this.activationTimer_ = 0;
  9766. this.adapter_.removeClass(MDCRippleFoundation.cssClasses.FG_ACTIVATION);
  9767. }
  9768. if (this.fgDeactivationRemovalTimer_) {
  9769. clearTimeout(this.fgDeactivationRemovalTimer_);
  9770. this.fgDeactivationRemovalTimer_ = 0;
  9771. this.adapter_.removeClass(MDCRippleFoundation.cssClasses.FG_DEACTIVATION);
  9772. }
  9773. var _MDCRippleFoundation$2 = MDCRippleFoundation.cssClasses,
  9774. ROOT = _MDCRippleFoundation$2.ROOT,
  9775. UNBOUNDED = _MDCRippleFoundation$2.UNBOUNDED;
  9776. requestAnimationFrame(function () {
  9777. _this3.adapter_.removeClass(ROOT);
  9778. _this3.adapter_.removeClass(UNBOUNDED);
  9779. _this3.removeCssVars_();
  9780. });
  9781. }
  9782. this.deregisterRootHandlers_();
  9783. this.deregisterDeactivationHandlers_();
  9784. }
  9785. /**
  9786. * @param {boolean} supportsPressRipple Passed from init to save a redundant function call
  9787. * @private
  9788. */
  9789. }, {
  9790. key: 'registerRootHandlers_',
  9791. value: function registerRootHandlers_(supportsPressRipple) {
  9792. var _this4 = this;
  9793. if (supportsPressRipple) {
  9794. ACTIVATION_EVENT_TYPES.forEach(function (type) {
  9795. _this4.adapter_.registerInteractionHandler(type, _this4.activateHandler_);
  9796. });
  9797. if (this.adapter_.isUnbounded()) {
  9798. this.adapter_.registerResizeHandler(this.resizeHandler_);
  9799. }
  9800. }
  9801. this.adapter_.registerInteractionHandler('focus', this.focusHandler_);
  9802. this.adapter_.registerInteractionHandler('blur', this.blurHandler_);
  9803. }
  9804. /**
  9805. * @param {!Event} e
  9806. * @private
  9807. */
  9808. }, {
  9809. key: 'registerDeactivationHandlers_',
  9810. value: function registerDeactivationHandlers_(e) {
  9811. var _this5 = this;
  9812. if (e.type === 'keydown') {
  9813. this.adapter_.registerInteractionHandler('keyup', this.deactivateHandler_);
  9814. } else {
  9815. POINTER_DEACTIVATION_EVENT_TYPES.forEach(function (type) {
  9816. _this5.adapter_.registerDocumentInteractionHandler(type, _this5.deactivateHandler_);
  9817. });
  9818. }
  9819. }
  9820. /** @private */
  9821. }, {
  9822. key: 'deregisterRootHandlers_',
  9823. value: function deregisterRootHandlers_() {
  9824. var _this6 = this;
  9825. ACTIVATION_EVENT_TYPES.forEach(function (type) {
  9826. _this6.adapter_.deregisterInteractionHandler(type, _this6.activateHandler_);
  9827. });
  9828. this.adapter_.deregisterInteractionHandler('focus', this.focusHandler_);
  9829. this.adapter_.deregisterInteractionHandler('blur', this.blurHandler_);
  9830. if (this.adapter_.isUnbounded()) {
  9831. this.adapter_.deregisterResizeHandler(this.resizeHandler_);
  9832. }
  9833. }
  9834. /** @private */
  9835. }, {
  9836. key: 'deregisterDeactivationHandlers_',
  9837. value: function deregisterDeactivationHandlers_() {
  9838. var _this7 = this;
  9839. this.adapter_.deregisterInteractionHandler('keyup', this.deactivateHandler_);
  9840. POINTER_DEACTIVATION_EVENT_TYPES.forEach(function (type) {
  9841. _this7.adapter_.deregisterDocumentInteractionHandler(type, _this7.deactivateHandler_);
  9842. });
  9843. }
  9844. /** @private */
  9845. }, {
  9846. key: 'removeCssVars_',
  9847. value: function removeCssVars_() {
  9848. var _this8 = this;
  9849. var strings = MDCRippleFoundation.strings;
  9850. Object.keys(strings).forEach(function (k) {
  9851. if (k.indexOf('VAR_') === 0) {
  9852. _this8.adapter_.updateCssVariable(strings[k], null);
  9853. }
  9854. });
  9855. }
  9856. /**
  9857. * @param {!Event=} e
  9858. * @private
  9859. */
  9860. }, {
  9861. key: 'activate_',
  9862. value: function activate_(e) {
  9863. var _this9 = this;
  9864. if (this.adapter_.isSurfaceDisabled()) {
  9865. return;
  9866. }
  9867. var activationState = this.activationState_;
  9868. if (activationState.isActivated) {
  9869. return;
  9870. }
  9871. // Avoid reacting to follow-on events fired by touch device after an already-processed user interaction
  9872. var previousActivationEvent = this.previousActivationEvent_;
  9873. var isSameInteraction = previousActivationEvent && e !== undefined && previousActivationEvent.type !== e.type;
  9874. if (isSameInteraction) {
  9875. return;
  9876. }
  9877. activationState.isActivated = true;
  9878. activationState.isProgrammatic = e === undefined;
  9879. activationState.activationEvent = e;
  9880. activationState.wasActivatedByPointer = activationState.isProgrammatic ? false : e !== undefined && (e.type === 'mousedown' || e.type === 'touchstart' || e.type === 'pointerdown');
  9881. var hasActivatedChild = e !== undefined && activatedTargets.length > 0 && activatedTargets.some(function (target) {
  9882. return _this9.adapter_.containsEventTarget(target);
  9883. });
  9884. if (hasActivatedChild) {
  9885. // Immediately reset activation state, while preserving logic that prevents touch follow-on events
  9886. this.resetActivationState_();
  9887. return;
  9888. }
  9889. if (e !== undefined) {
  9890. activatedTargets.push( /** @type {!EventTarget} */e.target);
  9891. this.registerDeactivationHandlers_(e);
  9892. }
  9893. activationState.wasElementMadeActive = this.checkElementMadeActive_(e);
  9894. if (activationState.wasElementMadeActive) {
  9895. this.animateActivation_();
  9896. }
  9897. requestAnimationFrame(function () {
  9898. // Reset array on next frame after the current event has had a chance to bubble to prevent ancestor ripples
  9899. activatedTargets = [];
  9900. if (!activationState.wasElementMadeActive && e !== undefined && (e.key === ' ' || e.keyCode === 32)) {
  9901. // If space was pressed, try again within an rAF call to detect :active, because different UAs report
  9902. // active states inconsistently when they're called within event handling code:
  9903. // - https://bugs.chromium.org/p/chromium/issues/detail?id=635971
  9904. // - https://bugzilla.mozilla.org/show_bug.cgi?id=1293741
  9905. // We try first outside rAF to support Edge, which does not exhibit this problem, but will crash if a CSS
  9906. // variable is set within a rAF callback for a submit button interaction (#2241).
  9907. activationState.wasElementMadeActive = _this9.checkElementMadeActive_(e);
  9908. if (activationState.wasElementMadeActive) {
  9909. _this9.animateActivation_();
  9910. }
  9911. }
  9912. if (!activationState.wasElementMadeActive) {
  9913. // Reset activation state immediately if element was not made active.
  9914. _this9.activationState_ = _this9.defaultActivationState_();
  9915. }
  9916. });
  9917. }
  9918. /**
  9919. * @param {!Event=} e
  9920. * @private
  9921. */
  9922. }, {
  9923. key: 'checkElementMadeActive_',
  9924. value: function checkElementMadeActive_(e) {
  9925. return e !== undefined && e.type === 'keydown' ? this.adapter_.isSurfaceActive() : true;
  9926. }
  9927. /**
  9928. * @param {!Event=} event Optional event containing position information.
  9929. */
  9930. }, {
  9931. key: 'activate',
  9932. value: function activate(event) {
  9933. this.activate_(event);
  9934. }
  9935. /** @private */
  9936. }, {
  9937. key: 'animateActivation_',
  9938. value: function animateActivation_() {
  9939. var _this10 = this;
  9940. var _MDCRippleFoundation$3 = MDCRippleFoundation.strings,
  9941. VAR_FG_TRANSLATE_START = _MDCRippleFoundation$3.VAR_FG_TRANSLATE_START,
  9942. VAR_FG_TRANSLATE_END = _MDCRippleFoundation$3.VAR_FG_TRANSLATE_END;
  9943. var _MDCRippleFoundation$4 = MDCRippleFoundation.cssClasses,
  9944. FG_DEACTIVATION = _MDCRippleFoundation$4.FG_DEACTIVATION,
  9945. FG_ACTIVATION = _MDCRippleFoundation$4.FG_ACTIVATION;
  9946. var DEACTIVATION_TIMEOUT_MS = MDCRippleFoundation.numbers.DEACTIVATION_TIMEOUT_MS;
  9947. this.layoutInternal_();
  9948. var translateStart = '';
  9949. var translateEnd = '';
  9950. if (!this.adapter_.isUnbounded()) {
  9951. var _getFgTranslationCoor = this.getFgTranslationCoordinates_(),
  9952. startPoint = _getFgTranslationCoor.startPoint,
  9953. endPoint = _getFgTranslationCoor.endPoint;
  9954. translateStart = startPoint.x + 'px, ' + startPoint.y + 'px';
  9955. translateEnd = endPoint.x + 'px, ' + endPoint.y + 'px';
  9956. }
  9957. this.adapter_.updateCssVariable(VAR_FG_TRANSLATE_START, translateStart);
  9958. this.adapter_.updateCssVariable(VAR_FG_TRANSLATE_END, translateEnd);
  9959. // Cancel any ongoing activation/deactivation animations
  9960. clearTimeout(this.activationTimer_);
  9961. clearTimeout(this.fgDeactivationRemovalTimer_);
  9962. this.rmBoundedActivationClasses_();
  9963. this.adapter_.removeClass(FG_DEACTIVATION);
  9964. // Force layout in order to re-trigger the animation.
  9965. this.adapter_.computeBoundingRect();
  9966. this.adapter_.addClass(FG_ACTIVATION);
  9967. this.activationTimer_ = setTimeout(function () {
  9968. return _this10.activationTimerCallback_();
  9969. }, DEACTIVATION_TIMEOUT_MS);
  9970. }
  9971. /**
  9972. * @private
  9973. * @return {{startPoint: PointType, endPoint: PointType}}
  9974. */
  9975. }, {
  9976. key: 'getFgTranslationCoordinates_',
  9977. value: function getFgTranslationCoordinates_() {
  9978. var _activationState_ = this.activationState_,
  9979. activationEvent = _activationState_.activationEvent,
  9980. wasActivatedByPointer = _activationState_.wasActivatedByPointer;
  9981. var startPoint = void 0;
  9982. if (wasActivatedByPointer) {
  9983. startPoint = Object(__WEBPACK_IMPORTED_MODULE_3__util__["getNormalizedEventCoords"])(
  9984. /** @type {!Event} */activationEvent, this.adapter_.getWindowPageOffset(), this.adapter_.computeBoundingRect());
  9985. } else {
  9986. startPoint = {
  9987. x: this.frame_.width / 2,
  9988. y: this.frame_.height / 2
  9989. };
  9990. }
  9991. // Center the element around the start point.
  9992. startPoint = {
  9993. x: startPoint.x - this.initialSize_ / 2,
  9994. y: startPoint.y - this.initialSize_ / 2
  9995. };
  9996. var endPoint = {
  9997. x: this.frame_.width / 2 - this.initialSize_ / 2,
  9998. y: this.frame_.height / 2 - this.initialSize_ / 2
  9999. };
  10000. return { startPoint: startPoint, endPoint: endPoint };
  10001. }
  10002. /** @private */
  10003. }, {
  10004. key: 'runDeactivationUXLogicIfReady_',
  10005. value: function runDeactivationUXLogicIfReady_() {
  10006. var _this11 = this;
  10007. // This method is called both when a pointing device is released, and when the activation animation ends.
  10008. // The deactivation animation should only run after both of those occur.
  10009. var FG_DEACTIVATION = MDCRippleFoundation.cssClasses.FG_DEACTIVATION;
  10010. var _activationState_2 = this.activationState_,
  10011. hasDeactivationUXRun = _activationState_2.hasDeactivationUXRun,
  10012. isActivated = _activationState_2.isActivated;
  10013. var activationHasEnded = hasDeactivationUXRun || !isActivated;
  10014. if (activationHasEnded && this.activationAnimationHasEnded_) {
  10015. this.rmBoundedActivationClasses_();
  10016. this.adapter_.addClass(FG_DEACTIVATION);
  10017. this.fgDeactivationRemovalTimer_ = setTimeout(function () {
  10018. _this11.adapter_.removeClass(FG_DEACTIVATION);
  10019. }, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].FG_DEACTIVATION_MS);
  10020. }
  10021. }
  10022. /** @private */
  10023. }, {
  10024. key: 'rmBoundedActivationClasses_',
  10025. value: function rmBoundedActivationClasses_() {
  10026. var FG_ACTIVATION = MDCRippleFoundation.cssClasses.FG_ACTIVATION;
  10027. this.adapter_.removeClass(FG_ACTIVATION);
  10028. this.activationAnimationHasEnded_ = false;
  10029. this.adapter_.computeBoundingRect();
  10030. }
  10031. }, {
  10032. key: 'resetActivationState_',
  10033. value: function resetActivationState_() {
  10034. var _this12 = this;
  10035. this.previousActivationEvent_ = this.activationState_.activationEvent;
  10036. this.activationState_ = this.defaultActivationState_();
  10037. // Touch devices may fire additional events for the same interaction within a short time.
  10038. // Store the previous event until it's safe to assume that subsequent events are for new interactions.
  10039. setTimeout(function () {
  10040. return _this12.previousActivationEvent_ = undefined;
  10041. }, MDCRippleFoundation.numbers.TAP_DELAY_MS);
  10042. }
  10043. /**
  10044. * @private
  10045. */
  10046. }, {
  10047. key: 'deactivate_',
  10048. value: function deactivate_() {
  10049. var _this13 = this;
  10050. var activationState = this.activationState_;
  10051. // This can happen in scenarios such as when you have a keyup event that blurs the element.
  10052. if (!activationState.isActivated) {
  10053. return;
  10054. }
  10055. var state = /** @type {!ActivationStateType} */_extends({}, activationState);
  10056. if (activationState.isProgrammatic) {
  10057. requestAnimationFrame(function () {
  10058. return _this13.animateDeactivation_(state);
  10059. });
  10060. this.resetActivationState_();
  10061. } else {
  10062. this.deregisterDeactivationHandlers_();
  10063. requestAnimationFrame(function () {
  10064. _this13.activationState_.hasDeactivationUXRun = true;
  10065. _this13.animateDeactivation_(state);
  10066. _this13.resetActivationState_();
  10067. });
  10068. }
  10069. }
  10070. }, {
  10071. key: 'deactivate',
  10072. value: function deactivate() {
  10073. this.deactivate_();
  10074. }
  10075. /**
  10076. * @param {!ActivationStateType} options
  10077. * @private
  10078. */
  10079. }, {
  10080. key: 'animateDeactivation_',
  10081. value: function animateDeactivation_(_ref) {
  10082. var wasActivatedByPointer = _ref.wasActivatedByPointer,
  10083. wasElementMadeActive = _ref.wasElementMadeActive;
  10084. if (wasActivatedByPointer || wasElementMadeActive) {
  10085. this.runDeactivationUXLogicIfReady_();
  10086. }
  10087. }
  10088. }, {
  10089. key: 'layout',
  10090. value: function layout() {
  10091. var _this14 = this;
  10092. if (this.layoutFrame_) {
  10093. cancelAnimationFrame(this.layoutFrame_);
  10094. }
  10095. this.layoutFrame_ = requestAnimationFrame(function () {
  10096. _this14.layoutInternal_();
  10097. _this14.layoutFrame_ = 0;
  10098. });
  10099. }
  10100. /** @private */
  10101. }, {
  10102. key: 'layoutInternal_',
  10103. value: function layoutInternal_() {
  10104. var _this15 = this;
  10105. this.frame_ = this.adapter_.computeBoundingRect();
  10106. var maxDim = Math.max(this.frame_.height, this.frame_.width);
  10107. // Surface diameter is treated differently for unbounded vs. bounded ripples.
  10108. // Unbounded ripple diameter is calculated smaller since the surface is expected to already be padded appropriately
  10109. // to extend the hitbox, and the ripple is expected to meet the edges of the padded hitbox (which is typically
  10110. // square). Bounded ripples, on the other hand, are fully expected to expand beyond the surface's longest diameter
  10111. // (calculated based on the diagonal plus a constant padding), and are clipped at the surface's border via
  10112. // `overflow: hidden`.
  10113. var getBoundedRadius = function getBoundedRadius() {
  10114. var hypotenuse = Math.sqrt(Math.pow(_this15.frame_.width, 2) + Math.pow(_this15.frame_.height, 2));
  10115. return hypotenuse + MDCRippleFoundation.numbers.PADDING;
  10116. };
  10117. this.maxRadius_ = this.adapter_.isUnbounded() ? maxDim : getBoundedRadius();
  10118. // Ripple is sized as a fraction of the largest dimension of the surface, then scales up using a CSS scale transform
  10119. this.initialSize_ = Math.floor(maxDim * MDCRippleFoundation.numbers.INITIAL_ORIGIN_SCALE);
  10120. this.fgScale_ = this.maxRadius_ / this.initialSize_;
  10121. this.updateLayoutCssVars_();
  10122. }
  10123. /** @private */
  10124. }, {
  10125. key: 'updateLayoutCssVars_',
  10126. value: function updateLayoutCssVars_() {
  10127. var _MDCRippleFoundation$5 = MDCRippleFoundation.strings,
  10128. VAR_FG_SIZE = _MDCRippleFoundation$5.VAR_FG_SIZE,
  10129. VAR_LEFT = _MDCRippleFoundation$5.VAR_LEFT,
  10130. VAR_TOP = _MDCRippleFoundation$5.VAR_TOP,
  10131. VAR_FG_SCALE = _MDCRippleFoundation$5.VAR_FG_SCALE;
  10132. this.adapter_.updateCssVariable(VAR_FG_SIZE, this.initialSize_ + 'px');
  10133. this.adapter_.updateCssVariable(VAR_FG_SCALE, this.fgScale_);
  10134. if (this.adapter_.isUnbounded()) {
  10135. this.unboundedCoords_ = {
  10136. left: Math.round(this.frame_.width / 2 - this.initialSize_ / 2),
  10137. top: Math.round(this.frame_.height / 2 - this.initialSize_ / 2)
  10138. };
  10139. this.adapter_.updateCssVariable(VAR_LEFT, this.unboundedCoords_.left + 'px');
  10140. this.adapter_.updateCssVariable(VAR_TOP, this.unboundedCoords_.top + 'px');
  10141. }
  10142. }
  10143. /** @param {boolean} unbounded */
  10144. }, {
  10145. key: 'setUnbounded',
  10146. value: function setUnbounded(unbounded) {
  10147. var UNBOUNDED = MDCRippleFoundation.cssClasses.UNBOUNDED;
  10148. if (unbounded) {
  10149. this.adapter_.addClass(UNBOUNDED);
  10150. } else {
  10151. this.adapter_.removeClass(UNBOUNDED);
  10152. }
  10153. }
  10154. }, {
  10155. key: 'handleFocus',
  10156. value: function handleFocus() {
  10157. var _this16 = this;
  10158. requestAnimationFrame(function () {
  10159. return _this16.adapter_.addClass(MDCRippleFoundation.cssClasses.BG_FOCUSED);
  10160. });
  10161. }
  10162. }, {
  10163. key: 'handleBlur',
  10164. value: function handleBlur() {
  10165. var _this17 = this;
  10166. requestAnimationFrame(function () {
  10167. return _this17.adapter_.removeClass(MDCRippleFoundation.cssClasses.BG_FOCUSED);
  10168. });
  10169. }
  10170. }]);
  10171. return MDCRippleFoundation;
  10172. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  10173. /* harmony default export */ __webpack_exports__["a"] = (MDCRippleFoundation);
  10174. /***/ }),
  10175. /* 67 */
  10176. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10177. "use strict";
  10178. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  10179. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  10180. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  10181. /**
  10182. * @license
  10183. * Copyright 2016 Google Inc.
  10184. *
  10185. * Permission is hereby granted, free of charge, to any person obtaining a copy
  10186. * of this software and associated documentation files (the "Software"), to deal
  10187. * in the Software without restriction, including without limitation the rights
  10188. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10189. * copies of the Software, and to permit persons to whom the Software is
  10190. * furnished to do so, subject to the following conditions:
  10191. *
  10192. * The above copyright notice and this permission notice shall be included in
  10193. * all copies or substantial portions of the Software.
  10194. *
  10195. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  10196. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  10197. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  10198. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  10199. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  10200. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  10201. * THE SOFTWARE.
  10202. */
  10203. var cssClasses = {
  10204. // Ripple is a special case where the "root" component is really a "mixin" of sorts,
  10205. // given that it's an 'upgrade' to an existing component. That being said it is the root
  10206. // CSS class that all other CSS classes derive from.
  10207. ROOT: 'mdc-ripple-upgraded',
  10208. UNBOUNDED: 'mdc-ripple-upgraded--unbounded',
  10209. BG_FOCUSED: 'mdc-ripple-upgraded--background-focused',
  10210. FG_ACTIVATION: 'mdc-ripple-upgraded--foreground-activation',
  10211. FG_DEACTIVATION: 'mdc-ripple-upgraded--foreground-deactivation'
  10212. };
  10213. var strings = {
  10214. VAR_LEFT: '--mdc-ripple-left',
  10215. VAR_TOP: '--mdc-ripple-top',
  10216. VAR_FG_SIZE: '--mdc-ripple-fg-size',
  10217. VAR_FG_SCALE: '--mdc-ripple-fg-scale',
  10218. VAR_FG_TRANSLATE_START: '--mdc-ripple-fg-translate-start',
  10219. VAR_FG_TRANSLATE_END: '--mdc-ripple-fg-translate-end'
  10220. };
  10221. var numbers = {
  10222. PADDING: 10,
  10223. INITIAL_ORIGIN_SCALE: 0.6,
  10224. DEACTIVATION_TIMEOUT_MS: 225, // Corresponds to $mdc-ripple-translate-duration (i.e. activation animation duration)
  10225. FG_DEACTIVATION_MS: 150, // Corresponds to $mdc-ripple-fade-out-duration (i.e. deactivation animation duration)
  10226. TAP_DELAY_MS: 300 };
  10227. /***/ }),
  10228. /* 68 */
  10229. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10230. "use strict";
  10231. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  10232. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_selection_control_index__ = __webpack_require__(4);
  10233. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__adapter__ = __webpack_require__(69);
  10234. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(70);
  10235. 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; };
  10236. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  10237. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10238. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  10239. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  10240. /**
  10241. * @license
  10242. * Copyright 2016 Google Inc.
  10243. *
  10244. * Permission is hereby granted, free of charge, to any person obtaining a copy
  10245. * of this software and associated documentation files (the "Software"), to deal
  10246. * in the Software without restriction, including without limitation the rights
  10247. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10248. * copies of the Software, and to permit persons to whom the Software is
  10249. * furnished to do so, subject to the following conditions:
  10250. *
  10251. * The above copyright notice and this permission notice shall be included in
  10252. * all copies or substantial portions of the Software.
  10253. *
  10254. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  10255. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  10256. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  10257. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  10258. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  10259. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  10260. * THE SOFTWARE.
  10261. */
  10262. /* eslint-disable no-unused-vars */
  10263. /* eslint-enable no-unused-vars */
  10264. /**
  10265. * @extends {MDCFoundation<!MDCCheckboxAdapter>}
  10266. */
  10267. var MDCCheckboxFoundation = function (_MDCFoundation) {
  10268. _inherits(MDCCheckboxFoundation, _MDCFoundation);
  10269. _createClass(MDCCheckboxFoundation, null, [{
  10270. key: 'cssClasses',
  10271. /** @return enum {cssClasses} */
  10272. get: function get() {
  10273. return __WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */];
  10274. }
  10275. /** @return enum {strings} */
  10276. }, {
  10277. key: 'strings',
  10278. get: function get() {
  10279. return __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */];
  10280. }
  10281. /** @return enum {numbers} */
  10282. }, {
  10283. key: 'numbers',
  10284. get: function get() {
  10285. return __WEBPACK_IMPORTED_MODULE_3__constants__["b" /* numbers */];
  10286. }
  10287. /** @return {!MDCCheckboxAdapter} */
  10288. }, {
  10289. key: 'defaultAdapter',
  10290. get: function get() {
  10291. return (/** @type {!MDCCheckboxAdapter} */{
  10292. addClass: function addClass() /* className: string */{},
  10293. removeClass: function removeClass() /* className: string */{},
  10294. setNativeControlAttr: function setNativeControlAttr() /* attr: string, value: string */{},
  10295. removeNativeControlAttr: function removeNativeControlAttr() /* attr: string */{},
  10296. forceLayout: function forceLayout() {},
  10297. isAttachedToDOM: function isAttachedToDOM() /* boolean */{},
  10298. isIndeterminate: function isIndeterminate() /* boolean */{},
  10299. isChecked: function isChecked() /* boolean */{},
  10300. hasNativeControl: function hasNativeControl() /* boolean */{},
  10301. setNativeControlDisabled: function setNativeControlDisabled() /* disabled: boolean */{}
  10302. }
  10303. );
  10304. }
  10305. }]);
  10306. function MDCCheckboxFoundation(adapter) {
  10307. _classCallCheck(this, MDCCheckboxFoundation);
  10308. /** @private {string} */
  10309. var _this = _possibleConstructorReturn(this, (MDCCheckboxFoundation.__proto__ || Object.getPrototypeOf(MDCCheckboxFoundation)).call(this, _extends(MDCCheckboxFoundation.defaultAdapter, adapter)));
  10310. _this.currentCheckState_ = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRANSITION_STATE_INIT;
  10311. /** @private {string} */
  10312. _this.currentAnimationClass_ = '';
  10313. /** @private {number} */
  10314. _this.animEndLatchTimer_ = 0;
  10315. /** @private {boolean} */
  10316. _this.enableAnimationEndHandler_ = false;
  10317. return _this;
  10318. }
  10319. /** @override */
  10320. _createClass(MDCCheckboxFoundation, [{
  10321. key: 'init',
  10322. value: function init() {
  10323. this.currentCheckState_ = this.determineCheckState_();
  10324. this.updateAriaChecked_();
  10325. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].UPGRADED);
  10326. }
  10327. /** @override */
  10328. }, {
  10329. key: 'destroy',
  10330. value: function destroy() {
  10331. clearTimeout(this.animEndLatchTimer_);
  10332. }
  10333. /** @param {boolean} disabled */
  10334. }, {
  10335. key: 'setDisabled',
  10336. value: function setDisabled(disabled) {
  10337. this.adapter_.setNativeControlDisabled(disabled);
  10338. if (disabled) {
  10339. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].DISABLED);
  10340. } else {
  10341. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].DISABLED);
  10342. }
  10343. }
  10344. /**
  10345. * Handles the animationend event for the checkbox
  10346. */
  10347. }, {
  10348. key: 'handleAnimationEnd',
  10349. value: function handleAnimationEnd() {
  10350. var _this2 = this;
  10351. if (!this.enableAnimationEndHandler_) return;
  10352. clearTimeout(this.animEndLatchTimer_);
  10353. this.animEndLatchTimer_ = setTimeout(function () {
  10354. _this2.adapter_.removeClass(_this2.currentAnimationClass_);
  10355. _this2.enableAnimationEndHandler_ = false;
  10356. }, __WEBPACK_IMPORTED_MODULE_3__constants__["b" /* numbers */].ANIM_END_LATCH_MS);
  10357. }
  10358. /**
  10359. * Handles the change event for the checkbox
  10360. */
  10361. }, {
  10362. key: 'handleChange',
  10363. value: function handleChange() {
  10364. this.transitionCheckState_();
  10365. }
  10366. /** @private */
  10367. }, {
  10368. key: 'transitionCheckState_',
  10369. value: function transitionCheckState_() {
  10370. if (!this.adapter_.hasNativeControl()) {
  10371. return;
  10372. }
  10373. var oldState = this.currentCheckState_;
  10374. var newState = this.determineCheckState_();
  10375. if (oldState === newState) {
  10376. return;
  10377. }
  10378. this.updateAriaChecked_();
  10379. // Check to ensure that there isn't a previously existing animation class, in case for example
  10380. // the user interacted with the checkbox before the animation was finished.
  10381. if (this.currentAnimationClass_.length > 0) {
  10382. clearTimeout(this.animEndLatchTimer_);
  10383. this.adapter_.forceLayout();
  10384. this.adapter_.removeClass(this.currentAnimationClass_);
  10385. }
  10386. this.currentAnimationClass_ = this.getTransitionAnimationClass_(oldState, newState);
  10387. this.currentCheckState_ = newState;
  10388. // Check for parentNode so that animations are only run when the element is attached
  10389. // to the DOM.
  10390. if (this.adapter_.isAttachedToDOM() && this.currentAnimationClass_.length > 0) {
  10391. this.adapter_.addClass(this.currentAnimationClass_);
  10392. this.enableAnimationEndHandler_ = true;
  10393. }
  10394. }
  10395. /**
  10396. * @return {string}
  10397. * @private
  10398. */
  10399. }, {
  10400. key: 'determineCheckState_',
  10401. value: function determineCheckState_() {
  10402. var TRANSITION_STATE_INDETERMINATE = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRANSITION_STATE_INDETERMINATE,
  10403. TRANSITION_STATE_CHECKED = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRANSITION_STATE_CHECKED,
  10404. TRANSITION_STATE_UNCHECKED = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRANSITION_STATE_UNCHECKED;
  10405. if (this.adapter_.isIndeterminate()) {
  10406. return TRANSITION_STATE_INDETERMINATE;
  10407. }
  10408. return this.adapter_.isChecked() ? TRANSITION_STATE_CHECKED : TRANSITION_STATE_UNCHECKED;
  10409. }
  10410. /**
  10411. * @param {string} oldState
  10412. * @param {string} newState
  10413. * @return {string}
  10414. */
  10415. }, {
  10416. key: 'getTransitionAnimationClass_',
  10417. value: function getTransitionAnimationClass_(oldState, newState) {
  10418. var TRANSITION_STATE_INIT = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRANSITION_STATE_INIT,
  10419. TRANSITION_STATE_CHECKED = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRANSITION_STATE_CHECKED,
  10420. TRANSITION_STATE_UNCHECKED = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRANSITION_STATE_UNCHECKED;
  10421. var _MDCCheckboxFoundatio = MDCCheckboxFoundation.cssClasses,
  10422. ANIM_UNCHECKED_CHECKED = _MDCCheckboxFoundatio.ANIM_UNCHECKED_CHECKED,
  10423. ANIM_UNCHECKED_INDETERMINATE = _MDCCheckboxFoundatio.ANIM_UNCHECKED_INDETERMINATE,
  10424. ANIM_CHECKED_UNCHECKED = _MDCCheckboxFoundatio.ANIM_CHECKED_UNCHECKED,
  10425. ANIM_CHECKED_INDETERMINATE = _MDCCheckboxFoundatio.ANIM_CHECKED_INDETERMINATE,
  10426. ANIM_INDETERMINATE_CHECKED = _MDCCheckboxFoundatio.ANIM_INDETERMINATE_CHECKED,
  10427. ANIM_INDETERMINATE_UNCHECKED = _MDCCheckboxFoundatio.ANIM_INDETERMINATE_UNCHECKED;
  10428. switch (oldState) {
  10429. case TRANSITION_STATE_INIT:
  10430. if (newState === TRANSITION_STATE_UNCHECKED) {
  10431. return '';
  10432. }
  10433. // fallthrough
  10434. case TRANSITION_STATE_UNCHECKED:
  10435. return newState === TRANSITION_STATE_CHECKED ? ANIM_UNCHECKED_CHECKED : ANIM_UNCHECKED_INDETERMINATE;
  10436. case TRANSITION_STATE_CHECKED:
  10437. return newState === TRANSITION_STATE_UNCHECKED ? ANIM_CHECKED_UNCHECKED : ANIM_CHECKED_INDETERMINATE;
  10438. // TRANSITION_STATE_INDETERMINATE
  10439. default:
  10440. return newState === TRANSITION_STATE_CHECKED ? ANIM_INDETERMINATE_CHECKED : ANIM_INDETERMINATE_UNCHECKED;
  10441. }
  10442. }
  10443. }, {
  10444. key: 'updateAriaChecked_',
  10445. value: function updateAriaChecked_() {
  10446. // Ensure aria-checked is set to mixed if checkbox is in indeterminate state.
  10447. if (this.adapter_.isIndeterminate()) {
  10448. this.adapter_.setNativeControlAttr(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ARIA_CHECKED_ATTR, __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ARIA_CHECKED_INDETERMINATE_VALUE);
  10449. } else {
  10450. // The on/off state does not need to keep track of aria-checked, since
  10451. // the screenreader uses the checked property on the checkbox element.
  10452. this.adapter_.removeNativeControlAttr(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ARIA_CHECKED_ATTR);
  10453. }
  10454. }
  10455. }]);
  10456. return MDCCheckboxFoundation;
  10457. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  10458. /* harmony default export */ __webpack_exports__["a"] = (MDCCheckboxFoundation);
  10459. /***/ }),
  10460. /* 69 */
  10461. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10462. "use strict";
  10463. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_selection_control_index__ = __webpack_require__(4);
  10464. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  10465. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10466. /**
  10467. * @license
  10468. * Copyright 2016 Google Inc.
  10469. *
  10470. * Permission is hereby granted, free of charge, to any person obtaining a copy
  10471. * of this software and associated documentation files (the "Software"), to deal
  10472. * in the Software without restriction, including without limitation the rights
  10473. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10474. * copies of the Software, and to permit persons to whom the Software is
  10475. * furnished to do so, subject to the following conditions:
  10476. *
  10477. * The above copyright notice and this permission notice shall be included in
  10478. * all copies or substantial portions of the Software.
  10479. *
  10480. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  10481. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  10482. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  10483. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  10484. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  10485. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  10486. * THE SOFTWARE.
  10487. */
  10488. /* eslint-disable no-unused-vars */
  10489. /* eslint no-unused-vars: [2, {"args": "none"}] */
  10490. /**
  10491. * Adapter for MDC Checkbox. Provides an interface for managing
  10492. * - classes
  10493. * - dom
  10494. * - event handlers
  10495. *
  10496. * Additionally, provides type information for the adapter to the Closure
  10497. * compiler.
  10498. *
  10499. * Implement this adapter for your framework of choice to delegate updates to
  10500. * the component in your framework of choice. See architecture documentation
  10501. * for more details.
  10502. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  10503. *
  10504. * @record
  10505. */
  10506. var MDCCheckboxAdapter = function () {
  10507. function MDCCheckboxAdapter() {
  10508. _classCallCheck(this, MDCCheckboxAdapter);
  10509. }
  10510. _createClass(MDCCheckboxAdapter, [{
  10511. key: 'addClass',
  10512. /** @param {string} className */
  10513. value: function addClass(className) {}
  10514. /** @param {string} className */
  10515. }, {
  10516. key: 'removeClass',
  10517. value: function removeClass(className) {}
  10518. /**
  10519. * Sets an attribute with a given value on the input element.
  10520. * @param {string} attr
  10521. * @param {string} value
  10522. */
  10523. }, {
  10524. key: 'setNativeControlAttr',
  10525. value: function setNativeControlAttr(attr, value) {}
  10526. /**
  10527. * Removes an attribute from the input element.
  10528. * @param {string} attr
  10529. */
  10530. }, {
  10531. key: 'removeNativeControlAttr',
  10532. value: function removeNativeControlAttr(attr) {}
  10533. }, {
  10534. key: 'forceLayout',
  10535. value: function forceLayout() {}
  10536. /** @return {boolean} */
  10537. }, {
  10538. key: 'isAttachedToDOM',
  10539. value: function isAttachedToDOM() {}
  10540. /** @return {boolean} */
  10541. }, {
  10542. key: 'isIndeterminate',
  10543. value: function isIndeterminate() {}
  10544. /** @return {boolean} */
  10545. }, {
  10546. key: 'isChecked',
  10547. value: function isChecked() {}
  10548. /** @return {boolean} */
  10549. }, {
  10550. key: 'hasNativeControl',
  10551. value: function hasNativeControl() {}
  10552. /** @param {boolean} disabled */
  10553. }, {
  10554. key: 'setNativeControlDisabled',
  10555. value: function setNativeControlDisabled(disabled) {}
  10556. }]);
  10557. return MDCCheckboxAdapter;
  10558. }();
  10559. /* unused harmony default export */ var _unused_webpack_default_export = (MDCCheckboxAdapter);
  10560. /***/ }),
  10561. /* 70 */
  10562. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10563. "use strict";
  10564. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  10565. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  10566. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  10567. /**
  10568. * @license
  10569. * Copyright 2016 Google Inc.
  10570. *
  10571. * Permission is hereby granted, free of charge, to any person obtaining a copy
  10572. * of this software and associated documentation files (the "Software"), to deal
  10573. * in the Software without restriction, including without limitation the rights
  10574. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10575. * copies of the Software, and to permit persons to whom the Software is
  10576. * furnished to do so, subject to the following conditions:
  10577. *
  10578. * The above copyright notice and this permission notice shall be included in
  10579. * all copies or substantial portions of the Software.
  10580. *
  10581. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  10582. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  10583. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  10584. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  10585. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  10586. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  10587. * THE SOFTWARE.
  10588. */
  10589. /** @const {string} */
  10590. var ROOT = 'mdc-checkbox';
  10591. /** @enum {string} */
  10592. var cssClasses = {
  10593. UPGRADED: 'mdc-checkbox--upgraded',
  10594. CHECKED: 'mdc-checkbox--checked',
  10595. INDETERMINATE: 'mdc-checkbox--indeterminate',
  10596. DISABLED: 'mdc-checkbox--disabled',
  10597. ANIM_UNCHECKED_CHECKED: 'mdc-checkbox--anim-unchecked-checked',
  10598. ANIM_UNCHECKED_INDETERMINATE: 'mdc-checkbox--anim-unchecked-indeterminate',
  10599. ANIM_CHECKED_UNCHECKED: 'mdc-checkbox--anim-checked-unchecked',
  10600. ANIM_CHECKED_INDETERMINATE: 'mdc-checkbox--anim-checked-indeterminate',
  10601. ANIM_INDETERMINATE_CHECKED: 'mdc-checkbox--anim-indeterminate-checked',
  10602. ANIM_INDETERMINATE_UNCHECKED: 'mdc-checkbox--anim-indeterminate-unchecked'
  10603. };
  10604. /** @enum {string} */
  10605. var strings = {
  10606. NATIVE_CONTROL_SELECTOR: '.' + ROOT + '__native-control',
  10607. TRANSITION_STATE_INIT: 'init',
  10608. TRANSITION_STATE_CHECKED: 'checked',
  10609. TRANSITION_STATE_UNCHECKED: 'unchecked',
  10610. TRANSITION_STATE_INDETERMINATE: 'indeterminate',
  10611. ARIA_CHECKED_ATTR: 'aria-checked',
  10612. ARIA_CHECKED_INDETERMINATE_VALUE: 'mixed'
  10613. };
  10614. /** @enum {number} */
  10615. var numbers = {
  10616. ANIM_END_LATCH_MS: 250
  10617. };
  10618. /***/ }),
  10619. /* 71 */
  10620. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10621. "use strict";
  10622. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  10623. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__chip_index__ = __webpack_require__(30);
  10624. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__chip_set_index__ = __webpack_require__(72);
  10625. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCChipFoundation", function() { return __WEBPACK_IMPORTED_MODULE_0__chip_index__["b"]; });
  10626. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCChip", function() { return __WEBPACK_IMPORTED_MODULE_0__chip_index__["a"]; });
  10627. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCChipSetFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__chip_set_index__["b"]; });
  10628. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCChipSet", function() { return __WEBPACK_IMPORTED_MODULE_1__chip_set_index__["a"]; });
  10629. /**
  10630. * @license
  10631. * Copyright 2017 Google Inc.
  10632. *
  10633. * Permission is hereby granted, free of charge, to any person obtaining a copy
  10634. * of this software and associated documentation files (the "Software"), to deal
  10635. * in the Software without restriction, including without limitation the rights
  10636. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10637. * copies of the Software, and to permit persons to whom the Software is
  10638. * furnished to do so, subject to the following conditions:
  10639. *
  10640. * The above copyright notice and this permission notice shall be included in
  10641. * all copies or substantial portions of the Software.
  10642. *
  10643. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  10644. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  10645. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  10646. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  10647. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  10648. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  10649. * THE SOFTWARE.
  10650. */
  10651. /***/ }),
  10652. /* 72 */
  10653. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10654. "use strict";
  10655. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCChipSet; });
  10656. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  10657. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(34);
  10658. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(73);
  10659. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__chip_index__ = __webpack_require__(30);
  10660. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  10661. 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; };
  10662. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  10663. 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); } };
  10664. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10665. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  10666. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  10667. /**
  10668. * @license
  10669. * Copyright 2016 Google Inc.
  10670. *
  10671. * Permission is hereby granted, free of charge, to any person obtaining a copy
  10672. * of this software and associated documentation files (the "Software"), to deal
  10673. * in the Software without restriction, including without limitation the rights
  10674. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10675. * copies of the Software, and to permit persons to whom the Software is
  10676. * furnished to do so, subject to the following conditions:
  10677. *
  10678. * The above copyright notice and this permission notice shall be included in
  10679. * all copies or substantial portions of the Software.
  10680. *
  10681. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  10682. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  10683. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  10684. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  10685. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  10686. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  10687. * THE SOFTWARE.
  10688. */
  10689. var idCounter = 0;
  10690. /**
  10691. * @extends {MDCComponent<!MDCChipSetFoundation>}
  10692. * @final
  10693. */
  10694. var MDCChipSet = function (_MDCComponent) {
  10695. _inherits(MDCChipSet, _MDCComponent);
  10696. /**
  10697. * @param {...?} args
  10698. */
  10699. function MDCChipSet() {
  10700. var _ref;
  10701. _classCallCheck(this, MDCChipSet);
  10702. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  10703. args[_key] = arguments[_key];
  10704. }
  10705. /** @type {!Array<!MDCChip>} */
  10706. var _this = _possibleConstructorReturn(this, (_ref = MDCChipSet.__proto__ || Object.getPrototypeOf(MDCChipSet)).call.apply(_ref, [this].concat(args)));
  10707. _this.chips;
  10708. /** @private {(function(!Element): !MDCChip)} */
  10709. _this.chipFactory_;
  10710. /** @private {?function(?Event): undefined} */
  10711. _this.handleChipInteraction_;
  10712. /** @private {?function(?Event): undefined} */
  10713. _this.handleChipSelection_;
  10714. /** @private {?function(?Event): undefined} */
  10715. _this.handleChipRemoval_;
  10716. return _this;
  10717. }
  10718. /**
  10719. * @param {!Element} root
  10720. * @return {!MDCChipSet}
  10721. */
  10722. _createClass(MDCChipSet, [{
  10723. key: 'initialize',
  10724. /**
  10725. * @param {(function(!Element): !MDCChip)=} chipFactory A function which
  10726. * creates a new MDCChip.
  10727. */
  10728. value: function initialize() {
  10729. var chipFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el) {
  10730. return new __WEBPACK_IMPORTED_MODULE_3__chip_index__["a" /* MDCChip */](el);
  10731. };
  10732. this.chipFactory_ = chipFactory;
  10733. this.chips = this.instantiateChips_(this.chipFactory_);
  10734. }
  10735. }, {
  10736. key: 'initialSyncWithDOM',
  10737. value: function initialSyncWithDOM() {
  10738. var _this2 = this;
  10739. this.chips.forEach(function (chip) {
  10740. if (chip.selected) {
  10741. _this2.foundation_.select(chip.id);
  10742. }
  10743. });
  10744. this.handleChipInteraction_ = function (evt) {
  10745. return _this2.foundation_.handleChipInteraction(evt.detail.chipId);
  10746. };
  10747. this.handleChipSelection_ = function (evt) {
  10748. return _this2.foundation_.handleChipSelection(evt.detail.chipId, evt.detail.selected);
  10749. };
  10750. this.handleChipRemoval_ = function (evt) {
  10751. return _this2.foundation_.handleChipRemoval(evt.detail.chipId);
  10752. };
  10753. this.root_.addEventListener(__WEBPACK_IMPORTED_MODULE_3__chip_index__["b" /* MDCChipFoundation */].strings.INTERACTION_EVENT, this.handleChipInteraction_);
  10754. this.root_.addEventListener(__WEBPACK_IMPORTED_MODULE_3__chip_index__["b" /* MDCChipFoundation */].strings.SELECTION_EVENT, this.handleChipSelection_);
  10755. this.root_.addEventListener(__WEBPACK_IMPORTED_MODULE_3__chip_index__["b" /* MDCChipFoundation */].strings.REMOVAL_EVENT, this.handleChipRemoval_);
  10756. }
  10757. }, {
  10758. key: 'destroy',
  10759. value: function destroy() {
  10760. this.chips.forEach(function (chip) {
  10761. chip.destroy();
  10762. });
  10763. this.root_.removeEventListener(__WEBPACK_IMPORTED_MODULE_3__chip_index__["b" /* MDCChipFoundation */].strings.INTERACTION_EVENT, this.handleChipInteraction_);
  10764. this.root_.removeEventListener(__WEBPACK_IMPORTED_MODULE_3__chip_index__["b" /* MDCChipFoundation */].strings.SELECTION_EVENT, this.handleChipSelection_);
  10765. this.root_.removeEventListener(__WEBPACK_IMPORTED_MODULE_3__chip_index__["b" /* MDCChipFoundation */].strings.REMOVAL_EVENT, this.handleChipRemoval_);
  10766. _get(MDCChipSet.prototype.__proto__ || Object.getPrototypeOf(MDCChipSet.prototype), 'destroy', this).call(this);
  10767. }
  10768. /**
  10769. * Adds a new chip object to the chip set from the given chip element.
  10770. * @param {!Element} chipEl
  10771. */
  10772. }, {
  10773. key: 'addChip',
  10774. value: function addChip(chipEl) {
  10775. chipEl.id = chipEl.id || 'mdc-chip-' + ++idCounter;
  10776. this.chips.push(this.chipFactory_(chipEl));
  10777. }
  10778. /**
  10779. * Returns an array of the IDs of all selected chips.
  10780. * @return {!Array<string>}
  10781. */
  10782. }, {
  10783. key: 'getDefaultFoundation',
  10784. /**
  10785. * @return {!MDCChipSetFoundation}
  10786. */
  10787. value: function getDefaultFoundation() {
  10788. var _this3 = this;
  10789. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]( /** @type {!MDCChipSetAdapter} */_extends({
  10790. hasClass: function hasClass(className) {
  10791. return _this3.root_.classList.contains(className);
  10792. },
  10793. removeChip: function removeChip(chipId) {
  10794. var index = _this3.findChipIndex_(chipId);
  10795. if (index >= 0) {
  10796. _this3.chips[index].destroy();
  10797. _this3.chips.splice(index, 1);
  10798. }
  10799. },
  10800. setSelected: function setSelected(chipId, selected) {
  10801. var index = _this3.findChipIndex_(chipId);
  10802. if (index >= 0) {
  10803. _this3.chips[index].selected = selected;
  10804. }
  10805. }
  10806. }));
  10807. }
  10808. /**
  10809. * Instantiates chip components on all of the chip set's child chip elements.
  10810. * @param {(function(!Element): !MDCChip)} chipFactory
  10811. * @return {!Array<!MDCChip>}
  10812. */
  10813. }, {
  10814. key: 'instantiateChips_',
  10815. value: function instantiateChips_(chipFactory) {
  10816. var chipElements = [].slice.call(this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.CHIP_SELECTOR));
  10817. return chipElements.map(function (el) {
  10818. el.id = el.id || 'mdc-chip-' + ++idCounter;
  10819. return chipFactory(el);
  10820. });
  10821. }
  10822. /**
  10823. * Returns the index of the chip with the given id, or -1 if the chip does not exist.
  10824. * @param {string} chipId
  10825. * @return {number}
  10826. */
  10827. }, {
  10828. key: 'findChipIndex_',
  10829. value: function findChipIndex_(chipId) {
  10830. for (var i = 0; i < this.chips.length; i++) {
  10831. if (this.chips[i].id === chipId) {
  10832. return i;
  10833. }
  10834. }
  10835. return -1;
  10836. }
  10837. }, {
  10838. key: 'selectedChipIds',
  10839. get: function get() {
  10840. return this.foundation_.getSelectedChipIds();
  10841. }
  10842. }], [{
  10843. key: 'attachTo',
  10844. value: function attachTo(root) {
  10845. return new MDCChipSet(root);
  10846. }
  10847. }]);
  10848. return MDCChipSet;
  10849. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  10850. /***/ }),
  10851. /* 73 */
  10852. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10853. "use strict";
  10854. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  10855. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(34);
  10856. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__chip_foundation__ = __webpack_require__(32);
  10857. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(74);
  10858. 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; };
  10859. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  10860. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10861. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  10862. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  10863. /**
  10864. * @license
  10865. * Copyright 2017 Google Inc.
  10866. *
  10867. * Permission is hereby granted, free of charge, to any person obtaining a copy
  10868. * of this software and associated documentation files (the "Software"), to deal
  10869. * in the Software without restriction, including without limitation the rights
  10870. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10871. * copies of the Software, and to permit persons to whom the Software is
  10872. * furnished to do so, subject to the following conditions:
  10873. *
  10874. * The above copyright notice and this permission notice shall be included in
  10875. * all copies or substantial portions of the Software.
  10876. *
  10877. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  10878. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  10879. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  10880. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  10881. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  10882. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  10883. * THE SOFTWARE.
  10884. */
  10885. // eslint-disable-next-line no-unused-vars
  10886. /**
  10887. * @extends {MDCFoundation<!MDCChipSetAdapter>}
  10888. * @final
  10889. */
  10890. var MDCChipSetFoundation = function (_MDCFoundation) {
  10891. _inherits(MDCChipSetFoundation, _MDCFoundation);
  10892. _createClass(MDCChipSetFoundation, null, [{
  10893. key: 'strings',
  10894. /** @return enum {string} */
  10895. get: function get() {
  10896. return __WEBPACK_IMPORTED_MODULE_3__constants__["b" /* strings */];
  10897. }
  10898. /** @return enum {string} */
  10899. }, {
  10900. key: 'cssClasses',
  10901. get: function get() {
  10902. return __WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */];
  10903. }
  10904. /**
  10905. * {@see MDCChipSetAdapter} for typing information on parameters and return
  10906. * types.
  10907. * @return {!MDCChipSetAdapter}
  10908. */
  10909. }, {
  10910. key: 'defaultAdapter',
  10911. get: function get() {
  10912. return (/** @type {!MDCChipSetAdapter} */{
  10913. hasClass: function hasClass() {},
  10914. removeChip: function removeChip() {},
  10915. setSelected: function setSelected() {}
  10916. }
  10917. );
  10918. }
  10919. /**
  10920. * @param {!MDCChipSetAdapter} adapter
  10921. */
  10922. }]);
  10923. function MDCChipSetFoundation(adapter) {
  10924. _classCallCheck(this, MDCChipSetFoundation);
  10925. /**
  10926. * The ids of the selected chips in the set. Only used for choice chip set or filter chip set.
  10927. * @private {!Array<string>}
  10928. */
  10929. var _this = _possibleConstructorReturn(this, (MDCChipSetFoundation.__proto__ || Object.getPrototypeOf(MDCChipSetFoundation)).call(this, _extends(MDCChipSetFoundation.defaultAdapter, adapter)));
  10930. _this.selectedChipIds_ = [];
  10931. return _this;
  10932. }
  10933. /**
  10934. * Returns an array of the IDs of all selected chips.
  10935. * @return {!Array<string>}
  10936. */
  10937. _createClass(MDCChipSetFoundation, [{
  10938. key: 'getSelectedChipIds',
  10939. value: function getSelectedChipIds() {
  10940. return this.selectedChipIds_;
  10941. }
  10942. /**
  10943. * Toggles selection of the chip with the given id.
  10944. * @private
  10945. * @param {string} chipId
  10946. */
  10947. }, {
  10948. key: 'toggleSelect_',
  10949. value: function toggleSelect_(chipId) {
  10950. if (this.selectedChipIds_.indexOf(chipId) >= 0) {
  10951. this.deselect_(chipId);
  10952. } else {
  10953. this.select(chipId);
  10954. }
  10955. }
  10956. /**
  10957. * Selects the chip with the given id. Deselects all other chips if the chip set is of the choice variant.
  10958. * @param {string} chipId
  10959. */
  10960. }, {
  10961. key: 'select',
  10962. value: function select(chipId) {
  10963. if (this.selectedChipIds_.indexOf(chipId) >= 0) {
  10964. return;
  10965. }
  10966. if (this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].CHOICE) && this.selectedChipIds_.length > 0) {
  10967. var previouslySelectedChip = this.selectedChipIds_[0];
  10968. this.selectedChipIds_.length = 0;
  10969. this.adapter_.setSelected(previouslySelectedChip, false);
  10970. }
  10971. this.selectedChipIds_.push(chipId);
  10972. this.adapter_.setSelected(chipId, true);
  10973. }
  10974. /**
  10975. * Deselects the chip with the given id.
  10976. * @private
  10977. * @param {string} chipId
  10978. */
  10979. }, {
  10980. key: 'deselect_',
  10981. value: function deselect_(chipId) {
  10982. var index = this.selectedChipIds_.indexOf(chipId);
  10983. if (index >= 0) {
  10984. this.selectedChipIds_.splice(index, 1);
  10985. this.adapter_.setSelected(chipId, false);
  10986. }
  10987. }
  10988. /**
  10989. * Handles a chip interaction event
  10990. * @param {string} chipId
  10991. */
  10992. }, {
  10993. key: 'handleChipInteraction',
  10994. value: function handleChipInteraction(chipId) {
  10995. if (this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].CHOICE) || this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].FILTER)) {
  10996. this.toggleSelect_(chipId);
  10997. }
  10998. }
  10999. /**
  11000. * Handles a chip selection event, used to handle discrepancy when selection state is set directly on the Chip.
  11001. * @param {string} chipId
  11002. * @param {boolean} selected
  11003. */
  11004. }, {
  11005. key: 'handleChipSelection',
  11006. value: function handleChipSelection(chipId, selected) {
  11007. var chipIsSelected = this.selectedChipIds_.indexOf(chipId) >= 0;
  11008. if (selected && !chipIsSelected) {
  11009. this.select(chipId);
  11010. } else if (!selected && chipIsSelected) {
  11011. this.deselect_(chipId);
  11012. }
  11013. }
  11014. /**
  11015. * Handles the event when a chip is removed.
  11016. * @param {string} chipId
  11017. */
  11018. }, {
  11019. key: 'handleChipRemoval',
  11020. value: function handleChipRemoval(chipId) {
  11021. this.deselect_(chipId);
  11022. this.adapter_.removeChip(chipId);
  11023. }
  11024. }]);
  11025. return MDCChipSetFoundation;
  11026. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  11027. /* harmony default export */ __webpack_exports__["a"] = (MDCChipSetFoundation);
  11028. /***/ }),
  11029. /* 74 */
  11030. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11031. "use strict";
  11032. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  11033. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  11034. /**
  11035. * @license
  11036. * Copyright 2016 Google Inc.
  11037. *
  11038. * Permission is hereby granted, free of charge, to any person obtaining a copy
  11039. * of this software and associated documentation files (the "Software"), to deal
  11040. * in the Software without restriction, including without limitation the rights
  11041. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11042. * copies of the Software, and to permit persons to whom the Software is
  11043. * furnished to do so, subject to the following conditions:
  11044. *
  11045. * The above copyright notice and this permission notice shall be included in
  11046. * all copies or substantial portions of the Software.
  11047. *
  11048. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  11049. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  11050. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  11051. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  11052. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  11053. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  11054. * THE SOFTWARE.
  11055. */
  11056. /** @enum {string} */
  11057. var strings = {
  11058. CHIP_SELECTOR: '.mdc-chip'
  11059. };
  11060. /** @enum {string} */
  11061. var cssClasses = {
  11062. CHOICE: 'mdc-chip-set--choice',
  11063. FILTER: 'mdc-chip-set--filter'
  11064. };
  11065. /***/ }),
  11066. /* 75 */
  11067. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11068. "use strict";
  11069. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  11070. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCDialog", function() { return MDCDialog; });
  11071. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(3);
  11072. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__ = __webpack_require__(2);
  11073. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(76);
  11074. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util__ = __webpack_require__(79);
  11075. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_dom_ponyfill__ = __webpack_require__(14);
  11076. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_focus_trap__ = __webpack_require__(35);
  11077. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_focus_trap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_focus_trap__);
  11078. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCDialogFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  11079. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "util", function() { return __WEBPACK_IMPORTED_MODULE_3__util__; });
  11080. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  11081. 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); } };
  11082. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11083. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  11084. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  11085. /**
  11086. * @license
  11087. * Copyright 2017 Google Inc.
  11088. *
  11089. * Permission is hereby granted, free of charge, to any person obtaining a copy
  11090. * of this software and associated documentation files (the "Software"), to deal
  11091. * in the Software without restriction, including without limitation the rights
  11092. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11093. * copies of the Software, and to permit persons to whom the Software is
  11094. * furnished to do so, subject to the following conditions:
  11095. *
  11096. * The above copyright notice and this permission notice shall be included in
  11097. * all copies or substantial portions of the Software.
  11098. *
  11099. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  11100. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  11101. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  11102. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  11103. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  11104. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  11105. * THE SOFTWARE.
  11106. */
  11107. var strings = __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings;
  11108. var MDCDialog = function (_MDCComponent) {
  11109. _inherits(MDCDialog, _MDCComponent);
  11110. function MDCDialog() {
  11111. var _ref;
  11112. _classCallCheck(this, MDCDialog);
  11113. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  11114. args[_key] = arguments[_key];
  11115. }
  11116. /**
  11117. * @type {!Array<!MDCRipple>}
  11118. * @private
  11119. */
  11120. var _this = _possibleConstructorReturn(this, (_ref = MDCDialog.__proto__ || Object.getPrototypeOf(MDCDialog)).call.apply(_ref, [this].concat(args)));
  11121. _this.buttonRipples_;
  11122. /** @private {!Array<!Element>} */
  11123. _this.buttons_;
  11124. /** @private {?Element} */
  11125. _this.defaultButton_;
  11126. /** @private {!Element} */
  11127. _this.container_;
  11128. /** @private {?Element} */
  11129. _this.content_;
  11130. /** @private {?Element} */
  11131. _this.initialFocusEl_;
  11132. /** @private {!Function} */
  11133. _this.focusTrapFactory_;
  11134. /** @private {!FocusTrapInstance} */
  11135. _this.focusTrap_;
  11136. /** @private {!Function} */
  11137. _this.handleInteraction_;
  11138. /** @private {!Function} */
  11139. _this.handleDocumentKeydown_;
  11140. /** @private {!Function} */
  11141. _this.handleOpening_;
  11142. /** @private {!Function} */
  11143. _this.handleClosing_;
  11144. /** @private {Function} */
  11145. _this.layout_;
  11146. return _this;
  11147. }
  11148. _createClass(MDCDialog, [{
  11149. key: 'initialize',
  11150. value: function initialize() {
  11151. var focusTrapFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : __WEBPACK_IMPORTED_MODULE_5_focus_trap___default.a;
  11152. var initialFocusEl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
  11153. this.container_ = /** @type {!Element} */this.root_.querySelector(strings.CONTAINER_SELECTOR);
  11154. this.content_ = this.root_.querySelector(strings.CONTENT_SELECTOR);
  11155. this.buttons_ = [].slice.call(this.root_.querySelectorAll(strings.BUTTON_SELECTOR));
  11156. this.defaultButton_ = this.root_.querySelector(strings.DEFAULT_BUTTON_SELECTOR);
  11157. this.buttonRipples_ = [];
  11158. this.focusTrapFactory_ = focusTrapFactory;
  11159. this.initialFocusEl_ = initialFocusEl;
  11160. for (var i = 0, buttonEl; buttonEl = this.buttons_[i]; i++) {
  11161. this.buttonRipples_.push(new __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"](buttonEl));
  11162. }
  11163. }
  11164. }, {
  11165. key: 'initialSyncWithDOM',
  11166. value: function initialSyncWithDOM() {
  11167. var _this2 = this;
  11168. this.focusTrap_ = __WEBPACK_IMPORTED_MODULE_3__util__["createFocusTrapInstance"](this.container_, this.focusTrapFactory_, this.initialFocusEl_);
  11169. this.handleInteraction_ = this.foundation_.handleInteraction.bind(this.foundation_);
  11170. this.handleDocumentKeydown_ = this.foundation_.handleDocumentKeydown.bind(this.foundation_);
  11171. this.layout_ = this.layout.bind(this);
  11172. var LAYOUT_EVENTS = ['resize', 'orientationchange'];
  11173. this.handleOpening_ = function () {
  11174. LAYOUT_EVENTS.forEach(function (type) {
  11175. return window.addEventListener(type, _this2.layout_);
  11176. });
  11177. document.addEventListener('keydown', _this2.handleDocumentKeydown_);
  11178. };
  11179. this.handleClosing_ = function () {
  11180. LAYOUT_EVENTS.forEach(function (type) {
  11181. return window.removeEventListener(type, _this2.layout_);
  11182. });
  11183. document.removeEventListener('keydown', _this2.handleDocumentKeydown_);
  11184. };
  11185. this.listen('click', this.handleInteraction_);
  11186. this.listen('keydown', this.handleInteraction_);
  11187. this.listen(strings.OPENING_EVENT, this.handleOpening_);
  11188. this.listen(strings.CLOSING_EVENT, this.handleClosing_);
  11189. }
  11190. }, {
  11191. key: 'destroy',
  11192. value: function destroy() {
  11193. this.unlisten('click', this.handleInteraction_);
  11194. this.unlisten('keydown', this.handleInteraction_);
  11195. this.unlisten(strings.OPENING_EVENT, this.handleOpening_);
  11196. this.unlisten(strings.CLOSING_EVENT, this.handleClosing_);
  11197. this.handleClosing_();
  11198. this.buttonRipples_.forEach(function (ripple) {
  11199. return ripple.destroy();
  11200. });
  11201. _get(MDCDialog.prototype.__proto__ || Object.getPrototypeOf(MDCDialog.prototype), 'destroy', this).call(this);
  11202. }
  11203. }, {
  11204. key: 'layout',
  11205. value: function layout() {
  11206. this.foundation_.layout();
  11207. }
  11208. }, {
  11209. key: 'open',
  11210. value: function open() {
  11211. this.foundation_.open();
  11212. }
  11213. /**
  11214. * @param {string=} action
  11215. */
  11216. }, {
  11217. key: 'close',
  11218. value: function close() {
  11219. var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  11220. this.foundation_.close(action);
  11221. }
  11222. }, {
  11223. key: 'getDefaultFoundation',
  11224. value: function getDefaultFoundation() {
  11225. var _this3 = this;
  11226. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]({
  11227. addClass: function addClass(className) {
  11228. return _this3.root_.classList.add(className);
  11229. },
  11230. removeClass: function removeClass(className) {
  11231. return _this3.root_.classList.remove(className);
  11232. },
  11233. hasClass: function hasClass(className) {
  11234. return _this3.root_.classList.contains(className);
  11235. },
  11236. addBodyClass: function addBodyClass(className) {
  11237. return document.body.classList.add(className);
  11238. },
  11239. removeBodyClass: function removeBodyClass(className) {
  11240. return document.body.classList.remove(className);
  11241. },
  11242. eventTargetMatches: function eventTargetMatches(target, selector) {
  11243. return Object(__WEBPACK_IMPORTED_MODULE_4__material_dom_ponyfill__["matches"])(target, selector);
  11244. },
  11245. trapFocus: function trapFocus() {
  11246. return _this3.focusTrap_.activate();
  11247. },
  11248. releaseFocus: function releaseFocus() {
  11249. return _this3.focusTrap_.deactivate();
  11250. },
  11251. isContentScrollable: function isContentScrollable() {
  11252. return !!_this3.content_ && __WEBPACK_IMPORTED_MODULE_3__util__["isScrollable"]( /** @type {!Element} */_this3.content_);
  11253. },
  11254. areButtonsStacked: function areButtonsStacked() {
  11255. return __WEBPACK_IMPORTED_MODULE_3__util__["areTopsMisaligned"](_this3.buttons_);
  11256. },
  11257. getActionFromEvent: function getActionFromEvent(event) {
  11258. var element = Object(__WEBPACK_IMPORTED_MODULE_4__material_dom_ponyfill__["closest"])(event.target, '[' + strings.ACTION_ATTRIBUTE + ']');
  11259. return element && element.getAttribute(strings.ACTION_ATTRIBUTE);
  11260. },
  11261. clickDefaultButton: function clickDefaultButton() {
  11262. if (_this3.defaultButton_) {
  11263. _this3.defaultButton_.click();
  11264. }
  11265. },
  11266. reverseButtons: function reverseButtons() {
  11267. _this3.buttons_.reverse();
  11268. _this3.buttons_.forEach(function (button) {
  11269. return button.parentElement.appendChild(button);
  11270. });
  11271. },
  11272. notifyOpening: function notifyOpening() {
  11273. return _this3.emit(strings.OPENING_EVENT, {});
  11274. },
  11275. notifyOpened: function notifyOpened() {
  11276. return _this3.emit(strings.OPENED_EVENT, {});
  11277. },
  11278. notifyClosing: function notifyClosing(action) {
  11279. return _this3.emit(strings.CLOSING_EVENT, action ? { action: action } : {});
  11280. },
  11281. notifyClosed: function notifyClosed(action) {
  11282. return _this3.emit(strings.CLOSED_EVENT, action ? { action: action } : {});
  11283. }
  11284. });
  11285. }
  11286. }, {
  11287. key: 'isOpen',
  11288. get: function get() {
  11289. return this.foundation_.isOpen();
  11290. }
  11291. }, {
  11292. key: 'escapeKeyAction',
  11293. get: function get() {
  11294. return this.foundation_.getEscapeKeyAction();
  11295. },
  11296. set: function set(action) {
  11297. this.foundation_.setEscapeKeyAction(action);
  11298. }
  11299. }, {
  11300. key: 'scrimClickAction',
  11301. get: function get() {
  11302. return this.foundation_.getScrimClickAction();
  11303. },
  11304. set: function set(action) {
  11305. this.foundation_.setScrimClickAction(action);
  11306. }
  11307. }, {
  11308. key: 'autoStackButtons',
  11309. get: function get() {
  11310. return this.foundation_.getAutoStackButtons();
  11311. },
  11312. set: function set(autoStack) {
  11313. this.foundation_.setAutoStackButtons(autoStack);
  11314. }
  11315. }], [{
  11316. key: 'attachTo',
  11317. value: function attachTo(root) {
  11318. return new MDCDialog(root);
  11319. }
  11320. }]);
  11321. return MDCDialog;
  11322. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCComponent"]);
  11323. /***/ }),
  11324. /* 76 */
  11325. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11326. "use strict";
  11327. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(3);
  11328. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(77);
  11329. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(78);
  11330. 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; };
  11331. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  11332. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11333. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  11334. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  11335. /**
  11336. * @license
  11337. * Copyright 2017 Google Inc.
  11338. *
  11339. * Permission is hereby granted, free of charge, to any person obtaining a copy
  11340. * of this software and associated documentation files (the "Software"), to deal
  11341. * in the Software without restriction, including without limitation the rights
  11342. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11343. * copies of the Software, and to permit persons to whom the Software is
  11344. * furnished to do so, subject to the following conditions:
  11345. *
  11346. * The above copyright notice and this permission notice shall be included in
  11347. * all copies or substantial portions of the Software.
  11348. *
  11349. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  11350. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  11351. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  11352. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  11353. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  11354. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  11355. * THE SOFTWARE.
  11356. */
  11357. var MDCDialogFoundation = function (_MDCFoundation) {
  11358. _inherits(MDCDialogFoundation, _MDCFoundation);
  11359. _createClass(MDCDialogFoundation, null, [{
  11360. key: 'cssClasses',
  11361. get: function get() {
  11362. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  11363. }
  11364. }, {
  11365. key: 'strings',
  11366. get: function get() {
  11367. return __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */];
  11368. }
  11369. }, {
  11370. key: 'numbers',
  11371. get: function get() {
  11372. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */];
  11373. }
  11374. }, {
  11375. key: 'defaultAdapter',
  11376. get: function get() {
  11377. return (/** @type {!MDCDialogAdapter} */{
  11378. addClass: function addClass() /* className: string */{},
  11379. removeClass: function removeClass() /* className: string */{},
  11380. hasClass: function hasClass() /* className: string */{},
  11381. addBodyClass: function addBodyClass() /* className: string */{},
  11382. removeBodyClass: function removeBodyClass() /* className: string */{},
  11383. eventTargetMatches: function eventTargetMatches() /* target: !EventTarget, selector: string */{},
  11384. trapFocus: function trapFocus() {},
  11385. releaseFocus: function releaseFocus() {},
  11386. isContentScrollable: function isContentScrollable() {},
  11387. areButtonsStacked: function areButtonsStacked() {},
  11388. getActionFromEvent: function getActionFromEvent() /* event: !Event */{},
  11389. clickDefaultButton: function clickDefaultButton() {},
  11390. reverseButtons: function reverseButtons() {},
  11391. notifyOpening: function notifyOpening() {},
  11392. notifyOpened: function notifyOpened() {},
  11393. notifyClosing: function notifyClosing() /* action: ?string */{},
  11394. notifyClosed: function notifyClosed() /* action: ?string */{}
  11395. }
  11396. );
  11397. }
  11398. /**
  11399. * @param {!MDCDialogAdapter=} adapter
  11400. */
  11401. }]);
  11402. function MDCDialogFoundation(adapter) {
  11403. _classCallCheck(this, MDCDialogFoundation);
  11404. /** @private {boolean} */
  11405. var _this = _possibleConstructorReturn(this, (MDCDialogFoundation.__proto__ || Object.getPrototypeOf(MDCDialogFoundation)).call(this, _extends(MDCDialogFoundation.defaultAdapter, adapter)));
  11406. _this.isOpen_ = false;
  11407. /** @private {number} */
  11408. _this.animationFrame_ = 0;
  11409. /** @private {number} */
  11410. _this.animationTimer_ = 0;
  11411. /** @private {number} */
  11412. _this.layoutFrame_ = 0;
  11413. /** @private {string} */
  11414. _this.escapeKeyAction_ = __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].CLOSE_ACTION;
  11415. /** @private {string} */
  11416. _this.scrimClickAction_ = __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].CLOSE_ACTION;
  11417. /** @private {boolean} */
  11418. _this.autoStackButtons_ = true;
  11419. /** @private {boolean} */
  11420. _this.areButtonsStacked_ = false;
  11421. return _this;
  11422. }
  11423. _createClass(MDCDialogFoundation, [{
  11424. key: 'init',
  11425. value: function init() {
  11426. if (this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].STACKED)) {
  11427. this.setAutoStackButtons(false);
  11428. }
  11429. }
  11430. }, {
  11431. key: 'destroy',
  11432. value: function destroy() {
  11433. if (this.isOpen_) {
  11434. this.close(__WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].DESTROY_ACTION);
  11435. }
  11436. if (this.animationTimer_) {
  11437. clearTimeout(this.animationTimer_);
  11438. this.handleAnimationTimerEnd_();
  11439. }
  11440. if (this.layoutFrame_) {
  11441. cancelAnimationFrame(this.layoutFrame_);
  11442. this.layoutFrame_ = 0;
  11443. }
  11444. }
  11445. }, {
  11446. key: 'open',
  11447. value: function open() {
  11448. var _this2 = this;
  11449. this.isOpen_ = true;
  11450. this.adapter_.notifyOpening();
  11451. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPENING);
  11452. // Wait a frame once display is no longer "none", to establish basis for animation
  11453. this.runNextAnimationFrame_(function () {
  11454. _this2.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPEN);
  11455. _this2.adapter_.addBodyClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SCROLL_LOCK);
  11456. _this2.layout();
  11457. _this2.animationTimer_ = setTimeout(function () {
  11458. _this2.handleAnimationTimerEnd_();
  11459. _this2.adapter_.trapFocus();
  11460. _this2.adapter_.notifyOpened();
  11461. }, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].DIALOG_ANIMATION_OPEN_TIME_MS);
  11462. });
  11463. }
  11464. /**
  11465. * @param {string=} action
  11466. */
  11467. }, {
  11468. key: 'close',
  11469. value: function close() {
  11470. var _this3 = this;
  11471. var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  11472. if (!this.isOpen_) {
  11473. // Avoid redundant close calls (and events), e.g. from keydown on elements that inherently emit click
  11474. return;
  11475. }
  11476. this.isOpen_ = false;
  11477. this.adapter_.notifyClosing(action);
  11478. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CLOSING);
  11479. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPEN);
  11480. this.adapter_.removeBodyClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SCROLL_LOCK);
  11481. cancelAnimationFrame(this.animationFrame_);
  11482. this.animationFrame_ = 0;
  11483. clearTimeout(this.animationTimer_);
  11484. this.animationTimer_ = setTimeout(function () {
  11485. _this3.adapter_.releaseFocus();
  11486. _this3.handleAnimationTimerEnd_();
  11487. _this3.adapter_.notifyClosed(action);
  11488. }, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].DIALOG_ANIMATION_CLOSE_TIME_MS);
  11489. }
  11490. }, {
  11491. key: 'isOpen',
  11492. value: function isOpen() {
  11493. return this.isOpen_;
  11494. }
  11495. /** @return {string} */
  11496. }, {
  11497. key: 'getEscapeKeyAction',
  11498. value: function getEscapeKeyAction() {
  11499. return this.escapeKeyAction_;
  11500. }
  11501. /** @param {string} action */
  11502. }, {
  11503. key: 'setEscapeKeyAction',
  11504. value: function setEscapeKeyAction(action) {
  11505. this.escapeKeyAction_ = action;
  11506. }
  11507. /** @return {string} */
  11508. }, {
  11509. key: 'getScrimClickAction',
  11510. value: function getScrimClickAction() {
  11511. return this.scrimClickAction_;
  11512. }
  11513. /** @param {string} action */
  11514. }, {
  11515. key: 'setScrimClickAction',
  11516. value: function setScrimClickAction(action) {
  11517. this.scrimClickAction_ = action;
  11518. }
  11519. /** @return {boolean} */
  11520. }, {
  11521. key: 'getAutoStackButtons',
  11522. value: function getAutoStackButtons() {
  11523. return this.autoStackButtons_;
  11524. }
  11525. /** @param {boolean} autoStack */
  11526. }, {
  11527. key: 'setAutoStackButtons',
  11528. value: function setAutoStackButtons(autoStack) {
  11529. this.autoStackButtons_ = autoStack;
  11530. }
  11531. }, {
  11532. key: 'layout',
  11533. value: function layout() {
  11534. var _this4 = this;
  11535. if (this.layoutFrame_) {
  11536. cancelAnimationFrame(this.layoutFrame_);
  11537. }
  11538. this.layoutFrame_ = requestAnimationFrame(function () {
  11539. _this4.layoutInternal_();
  11540. _this4.layoutFrame_ = 0;
  11541. });
  11542. }
  11543. }, {
  11544. key: 'layoutInternal_',
  11545. value: function layoutInternal_() {
  11546. if (this.autoStackButtons_) {
  11547. this.detectStackedButtons_();
  11548. }
  11549. this.detectScrollableContent_();
  11550. }
  11551. /** @private */
  11552. }, {
  11553. key: 'detectStackedButtons_',
  11554. value: function detectStackedButtons_() {
  11555. // Remove the class first to let us measure the buttons' natural positions.
  11556. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].STACKED);
  11557. var areButtonsStacked = this.adapter_.areButtonsStacked();
  11558. if (areButtonsStacked) {
  11559. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].STACKED);
  11560. }
  11561. if (areButtonsStacked !== this.areButtonsStacked_) {
  11562. this.adapter_.reverseButtons();
  11563. this.areButtonsStacked_ = areButtonsStacked;
  11564. }
  11565. }
  11566. /** @private */
  11567. }, {
  11568. key: 'detectScrollableContent_',
  11569. value: function detectScrollableContent_() {
  11570. // Remove the class first to let us measure the natural height of the content.
  11571. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SCROLLABLE);
  11572. if (this.adapter_.isContentScrollable()) {
  11573. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SCROLLABLE);
  11574. }
  11575. }
  11576. /**
  11577. * @param {!Event} evt
  11578. * @private
  11579. */
  11580. }, {
  11581. key: 'handleInteraction',
  11582. value: function handleInteraction(evt) {
  11583. var isClick = evt.type === 'click';
  11584. var isEnter = evt.key === 'Enter' || evt.keyCode === 13;
  11585. // Check for scrim click first since it doesn't require querying ancestors
  11586. if (isClick && this.adapter_.eventTargetMatches(evt.target, __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].SCRIM_SELECTOR) && this.scrimClickAction_ !== '') {
  11587. this.close(this.scrimClickAction_);
  11588. } else if (isClick || evt.key === 'Space' || evt.keyCode === 32 || isEnter) {
  11589. var action = this.adapter_.getActionFromEvent(evt);
  11590. if (action) {
  11591. this.close(action);
  11592. } else if (isEnter && !this.adapter_.eventTargetMatches(evt.target, __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].SUPPRESS_DEFAULT_PRESS_SELECTOR)) {
  11593. this.adapter_.clickDefaultButton();
  11594. }
  11595. }
  11596. }
  11597. /**
  11598. * @param {!KeyboardEvent} evt
  11599. * @private
  11600. */
  11601. }, {
  11602. key: 'handleDocumentKeydown',
  11603. value: function handleDocumentKeydown(evt) {
  11604. if ((evt.key === 'Escape' || evt.keyCode === 27) && this.escapeKeyAction_ !== '') {
  11605. this.close(this.escapeKeyAction_);
  11606. }
  11607. }
  11608. /** @private */
  11609. }, {
  11610. key: 'handleAnimationTimerEnd_',
  11611. value: function handleAnimationTimerEnd_() {
  11612. this.animationTimer_ = 0;
  11613. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].OPENING);
  11614. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CLOSING);
  11615. }
  11616. /**
  11617. * Runs the given logic on the next animation frame, using setTimeout to factor in Firefox reflow behavior.
  11618. * @param {Function} callback
  11619. * @private
  11620. */
  11621. }, {
  11622. key: 'runNextAnimationFrame_',
  11623. value: function runNextAnimationFrame_(callback) {
  11624. var _this5 = this;
  11625. cancelAnimationFrame(this.animationFrame_);
  11626. this.animationFrame_ = requestAnimationFrame(function () {
  11627. _this5.animationFrame_ = 0;
  11628. clearTimeout(_this5.animationTimer_);
  11629. _this5.animationTimer_ = setTimeout(callback, 0);
  11630. });
  11631. }
  11632. }]);
  11633. return MDCDialogFoundation;
  11634. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCFoundation"]);
  11635. /* harmony default export */ __webpack_exports__["a"] = (MDCDialogFoundation);
  11636. /***/ }),
  11637. /* 77 */
  11638. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11639. "use strict";
  11640. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  11641. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11642. /**
  11643. * @license
  11644. * Copyright 2018 Google Inc.
  11645. *
  11646. * Permission is hereby granted, free of charge, to any person obtaining a copy
  11647. * of this software and associated documentation files (the "Software"), to deal
  11648. * in the Software without restriction, including without limitation the rights
  11649. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11650. * copies of the Software, and to permit persons to whom the Software is
  11651. * furnished to do so, subject to the following conditions:
  11652. *
  11653. * The above copyright notice and this permission notice shall be included in
  11654. * all copies or substantial portions of the Software.
  11655. *
  11656. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  11657. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  11658. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  11659. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  11660. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  11661. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  11662. * THE SOFTWARE.
  11663. */
  11664. /* eslint no-unused-vars: [2, {"args": "none"}] */
  11665. /**
  11666. * Adapter for MDC Dialog. Provides an interface for managing:
  11667. * - CSS classes
  11668. * - DOM
  11669. * - Event handlers
  11670. *
  11671. * Additionally, provides type information for the adapter to the Closure
  11672. * compiler.
  11673. *
  11674. * Implement this adapter for your framework of choice to delegate updates to
  11675. * the component in your framework of choice. See architecture documentation
  11676. * for more details.
  11677. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  11678. *
  11679. * @record
  11680. */
  11681. var MDCDialogAdapter = function () {
  11682. function MDCDialogAdapter() {
  11683. _classCallCheck(this, MDCDialogAdapter);
  11684. }
  11685. _createClass(MDCDialogAdapter, [{
  11686. key: "addClass",
  11687. /** @param {string} className */
  11688. value: function addClass(className) {}
  11689. /** @param {string} className */
  11690. }, {
  11691. key: "removeClass",
  11692. value: function removeClass(className) {}
  11693. /**
  11694. * @param {string} className
  11695. * @return {boolean}
  11696. */
  11697. }, {
  11698. key: "hasClass",
  11699. value: function hasClass(className) {}
  11700. /** @param {string} className */
  11701. }, {
  11702. key: "addBodyClass",
  11703. value: function addBodyClass(className) {}
  11704. /** @param {string} className */
  11705. }, {
  11706. key: "removeBodyClass",
  11707. value: function removeBodyClass(className) {}
  11708. /**
  11709. * @param {!EventTarget} target
  11710. * @param {string} selector
  11711. * @return {boolean}
  11712. */
  11713. }, {
  11714. key: "eventTargetMatches",
  11715. value: function eventTargetMatches(target, selector) {}
  11716. }, {
  11717. key: "trapFocus",
  11718. value: function trapFocus() {}
  11719. }, {
  11720. key: "releaseFocus",
  11721. value: function releaseFocus() {}
  11722. /** @return {boolean} */
  11723. }, {
  11724. key: "isContentScrollable",
  11725. value: function isContentScrollable() {}
  11726. /** @return {boolean} */
  11727. }, {
  11728. key: "areButtonsStacked",
  11729. value: function areButtonsStacked() {}
  11730. /**
  11731. * @param {!Event} event
  11732. * @return {?string}
  11733. */
  11734. }, {
  11735. key: "getActionFromEvent",
  11736. value: function getActionFromEvent(event) {}
  11737. }, {
  11738. key: "clickDefaultButton",
  11739. value: function clickDefaultButton() {}
  11740. }, {
  11741. key: "reverseButtons",
  11742. value: function reverseButtons() {}
  11743. }, {
  11744. key: "notifyOpening",
  11745. value: function notifyOpening() {}
  11746. }, {
  11747. key: "notifyOpened",
  11748. value: function notifyOpened() {}
  11749. /**
  11750. * @param {string} action
  11751. */
  11752. }, {
  11753. key: "notifyClosing",
  11754. value: function notifyClosing(action) {}
  11755. /**
  11756. * @param {string} action
  11757. */
  11758. }, {
  11759. key: "notifyClosed",
  11760. value: function notifyClosed(action) {}
  11761. }]);
  11762. return MDCDialogAdapter;
  11763. }();
  11764. /* unused harmony default export */ var _unused_webpack_default_export = (MDCDialogAdapter);
  11765. /***/ }),
  11766. /* 78 */
  11767. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11768. "use strict";
  11769. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  11770. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  11771. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  11772. /**
  11773. * @license
  11774. * Copyright 2016 Google Inc.
  11775. *
  11776. * Permission is hereby granted, free of charge, to any person obtaining a copy
  11777. * of this software and associated documentation files (the "Software"), to deal
  11778. * in the Software without restriction, including without limitation the rights
  11779. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11780. * copies of the Software, and to permit persons to whom the Software is
  11781. * furnished to do so, subject to the following conditions:
  11782. *
  11783. * The above copyright notice and this permission notice shall be included in
  11784. * all copies or substantial portions of the Software.
  11785. *
  11786. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  11787. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  11788. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  11789. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  11790. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  11791. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  11792. * THE SOFTWARE.
  11793. */
  11794. var cssClasses = {
  11795. OPEN: 'mdc-dialog--open',
  11796. OPENING: 'mdc-dialog--opening',
  11797. CLOSING: 'mdc-dialog--closing',
  11798. SCROLLABLE: 'mdc-dialog--scrollable',
  11799. STACKED: 'mdc-dialog--stacked',
  11800. SCROLL_LOCK: 'mdc-dialog-scroll-lock'
  11801. };
  11802. var strings = {
  11803. SCRIM_SELECTOR: '.mdc-dialog__scrim',
  11804. CONTAINER_SELECTOR: '.mdc-dialog__container',
  11805. SURFACE_SELECTOR: '.mdc-dialog__surface',
  11806. CONTENT_SELECTOR: '.mdc-dialog__content',
  11807. BUTTON_SELECTOR: '.mdc-dialog__button',
  11808. DEFAULT_BUTTON_SELECTOR: '.mdc-dialog__button--default',
  11809. SUPPRESS_DEFAULT_PRESS_SELECTOR: ['textarea', '.mdc-menu .mdc-list-item'].join(', '),
  11810. OPENING_EVENT: 'MDCDialog:opening',
  11811. OPENED_EVENT: 'MDCDialog:opened',
  11812. CLOSING_EVENT: 'MDCDialog:closing',
  11813. CLOSED_EVENT: 'MDCDialog:closed',
  11814. ACTION_ATTRIBUTE: 'data-mdc-dialog-action',
  11815. CLOSE_ACTION: 'close',
  11816. DESTROY_ACTION: 'destroy'
  11817. };
  11818. var numbers = {
  11819. DIALOG_ANIMATION_OPEN_TIME_MS: 150,
  11820. DIALOG_ANIMATION_CLOSE_TIME_MS: 75
  11821. };
  11822. /***/ }),
  11823. /* 79 */
  11824. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11825. "use strict";
  11826. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  11827. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFocusTrapInstance", function() { return createFocusTrapInstance; });
  11828. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isScrollable", function() { return isScrollable; });
  11829. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "areTopsMisaligned", function() { return areTopsMisaligned; });
  11830. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_focus_trap__ = __webpack_require__(35);
  11831. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_focus_trap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_focus_trap__);
  11832. /**
  11833. * @license
  11834. * Copyright 2016 Google Inc.
  11835. *
  11836. * Permission is hereby granted, free of charge, to any person obtaining a copy
  11837. * of this software and associated documentation files (the "Software"), to deal
  11838. * in the Software without restriction, including without limitation the rights
  11839. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11840. * copies of the Software, and to permit persons to whom the Software is
  11841. * furnished to do so, subject to the following conditions:
  11842. *
  11843. * The above copyright notice and this permission notice shall be included in
  11844. * all copies or substantial portions of the Software.
  11845. *
  11846. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  11847. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  11848. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  11849. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  11850. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  11851. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  11852. * THE SOFTWARE.
  11853. */
  11854. /**
  11855. * @param {!Element} surfaceEl
  11856. * @param {?Element=} initialFocusEl
  11857. * @param {function(!Element, !FocusTrapCreateOptions): !FocusTrapInstance} focusTrapFactory
  11858. * @return {!FocusTrapInstance}
  11859. */
  11860. function createFocusTrapInstance(surfaceEl) {
  11861. var focusTrapFactory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : __WEBPACK_IMPORTED_MODULE_0_focus_trap___default.a;
  11862. var initialFocusEl = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  11863. return focusTrapFactory(surfaceEl, {
  11864. initialFocus: initialFocusEl,
  11865. escapeDeactivates: false, // Dialog foundation handles escape key
  11866. clickOutsideDeactivates: true });
  11867. }
  11868. /**
  11869. * @param {!Element} el
  11870. * @return {boolean}
  11871. */
  11872. function isScrollable(el) {
  11873. return el.scrollHeight > el.offsetHeight;
  11874. }
  11875. /**
  11876. * @param {!Array<!Element>|!NodeList} els
  11877. * @return {boolean}
  11878. */
  11879. function areTopsMisaligned(els) {
  11880. var tops = new Set();
  11881. [].forEach.call(els, function (el) {
  11882. return tops.add(el.offsetTop);
  11883. });
  11884. return tops.size > 1;
  11885. }
  11886. /***/ }),
  11887. /* 80 */
  11888. /***/ (function(module, exports) {
  11889. module.exports = function(el, options) {
  11890. options = options || {};
  11891. var elementDocument = el.ownerDocument || el;
  11892. var basicTabbables = [];
  11893. var orderedTabbables = [];
  11894. // A node is "available" if
  11895. // - it's computed style
  11896. var isUnavailable = createIsUnavailable(elementDocument);
  11897. var candidateSelectors = [
  11898. 'input',
  11899. 'select',
  11900. 'a[href]',
  11901. 'textarea',
  11902. 'button',
  11903. '[tabindex]',
  11904. ];
  11905. var candidates = el.querySelectorAll(candidateSelectors.join(','));
  11906. if (options.includeContainer) {
  11907. var matches = Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
  11908. if (
  11909. candidateSelectors.some(function(candidateSelector) {
  11910. return matches.call(el, candidateSelector);
  11911. })
  11912. ) {
  11913. candidates = Array.prototype.slice.apply(candidates);
  11914. candidates.unshift(el);
  11915. }
  11916. }
  11917. var candidate, candidateIndex;
  11918. for (var i = 0, l = candidates.length; i < l; i++) {
  11919. candidate = candidates[i];
  11920. candidateIndex = parseInt(candidate.getAttribute('tabindex'), 10) || candidate.tabIndex;
  11921. if (
  11922. candidateIndex < 0
  11923. || (candidate.tagName === 'INPUT' && candidate.type === 'hidden')
  11924. || candidate.disabled
  11925. || isUnavailable(candidate, elementDocument)
  11926. ) {
  11927. continue;
  11928. }
  11929. if (candidateIndex === 0) {
  11930. basicTabbables.push(candidate);
  11931. } else {
  11932. orderedTabbables.push({
  11933. index: i,
  11934. tabIndex: candidateIndex,
  11935. node: candidate,
  11936. });
  11937. }
  11938. }
  11939. var tabbableNodes = orderedTabbables
  11940. .sort(function(a, b) {
  11941. return a.tabIndex === b.tabIndex ? a.index - b.index : a.tabIndex - b.tabIndex;
  11942. })
  11943. .map(function(a) {
  11944. return a.node
  11945. });
  11946. Array.prototype.push.apply(tabbableNodes, basicTabbables);
  11947. return tabbableNodes;
  11948. }
  11949. function createIsUnavailable(elementDocument) {
  11950. // Node cache must be refreshed on every check, in case
  11951. // the content of the element has changed
  11952. var isOffCache = [];
  11953. // "off" means `display: none;`, as opposed to "hidden",
  11954. // which means `visibility: hidden;`. getComputedStyle
  11955. // accurately reflects visiblity in context but not
  11956. // "off" state, so we need to recursively check parents.
  11957. function isOff(node, nodeComputedStyle) {
  11958. if (node === elementDocument.documentElement) return false;
  11959. // Find the cached node (Array.prototype.find not available in IE9)
  11960. for (var i = 0, length = isOffCache.length; i < length; i++) {
  11961. if (isOffCache[i][0] === node) return isOffCache[i][1];
  11962. }
  11963. nodeComputedStyle = nodeComputedStyle || elementDocument.defaultView.getComputedStyle(node);
  11964. var result = false;
  11965. if (nodeComputedStyle.display === 'none') {
  11966. result = true;
  11967. } else if (node.parentNode) {
  11968. result = isOff(node.parentNode);
  11969. }
  11970. isOffCache.push([node, result]);
  11971. return result;
  11972. }
  11973. return function isUnavailable(node) {
  11974. if (node === elementDocument.documentElement) return false;
  11975. var computedStyle = elementDocument.defaultView.getComputedStyle(node);
  11976. if (isOff(node, computedStyle)) return true;
  11977. return computedStyle.visibility === 'hidden';
  11978. }
  11979. }
  11980. /***/ }),
  11981. /* 81 */
  11982. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11983. "use strict";
  11984. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  11985. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ponyfill__ = __webpack_require__(14);
  11986. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "ponyfill", function() { return __WEBPACK_IMPORTED_MODULE_0__ponyfill__; });
  11987. /**
  11988. * @license
  11989. * Copyright 2018 Google Inc.
  11990. *
  11991. * Permission is hereby granted, free of charge, to any person obtaining a copy
  11992. * of this software and associated documentation files (the "Software"), to deal
  11993. * in the Software without restriction, including without limitation the rights
  11994. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11995. * copies of the Software, and to permit persons to whom the Software is
  11996. * furnished to do so, subject to the following conditions:
  11997. *
  11998. * The above copyright notice and this permission notice shall be included in
  11999. * all copies or substantial portions of the Software.
  12000. *
  12001. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12002. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  12003. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  12004. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  12005. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  12006. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  12007. * THE SOFTWARE.
  12008. */
  12009. /***/ }),
  12010. /* 82 */
  12011. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12012. "use strict";
  12013. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  12014. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCDrawer", function() { return MDCDrawer; });
  12015. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(3);
  12016. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__dismissible_foundation__ = __webpack_require__(36);
  12017. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__modal_foundation__ = __webpack_require__(83);
  12018. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__adapter__ = __webpack_require__(15);
  12019. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_list_index__ = __webpack_require__(16);
  12020. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__material_list_foundation__ = __webpack_require__(17);
  12021. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__constants__ = __webpack_require__(37);
  12022. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__util__ = __webpack_require__(84);
  12023. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_focus_trap__ = __webpack_require__(40);
  12024. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_focus_trap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_focus_trap__);
  12025. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCDismissibleDrawerFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__dismissible_foundation__["a"]; });
  12026. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCModalDrawerFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__modal_foundation__["a"]; });
  12027. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "util", function() { return __WEBPACK_IMPORTED_MODULE_7__util__; });
  12028. 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; };
  12029. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  12030. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12031. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  12032. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  12033. /**
  12034. * @license
  12035. * Copyright 2016 Google Inc.
  12036. *
  12037. * Permission is hereby granted, free of charge, to any person obtaining a copy
  12038. * of this software and associated documentation files (the "Software"), to deal
  12039. * in the Software without restriction, including without limitation the rights
  12040. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12041. * copies of the Software, and to permit persons to whom the Software is
  12042. * furnished to do so, subject to the following conditions:
  12043. *
  12044. * The above copyright notice and this permission notice shall be included in
  12045. * all copies or substantial portions of the Software.
  12046. *
  12047. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12048. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  12049. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  12050. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  12051. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  12052. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  12053. * THE SOFTWARE.
  12054. */
  12055. /**
  12056. * @extends {MDCComponent<!MDCDismissibleDrawerFoundation>}
  12057. * @final
  12058. */
  12059. var MDCDrawer = function (_MDCComponent) {
  12060. _inherits(MDCDrawer, _MDCComponent);
  12061. /**
  12062. * @param {...?} args
  12063. */
  12064. function MDCDrawer() {
  12065. var _ref;
  12066. _classCallCheck(this, MDCDrawer);
  12067. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  12068. args[_key] = arguments[_key];
  12069. }
  12070. /** @private {!Element} */
  12071. var _this = _possibleConstructorReturn(this, (_ref = MDCDrawer.__proto__ || Object.getPrototypeOf(MDCDrawer)).call.apply(_ref, [this].concat(args)));
  12072. _this.previousFocus_;
  12073. /** @private {!Function} */
  12074. _this.handleKeydown_;
  12075. /** @private {!Function} */
  12076. _this.handleTransitionEnd_;
  12077. /** @private {!Function} */
  12078. _this.focusTrapFactory_;
  12079. /** @private {!FocusTrapInstance} */
  12080. _this.focusTrap_;
  12081. /** @private {?Element} */
  12082. _this.scrim_;
  12083. /** @private {?Function} */
  12084. _this.handleScrimClick_;
  12085. /** @private {?MDCList} */
  12086. _this.list_;
  12087. return _this;
  12088. }
  12089. /**
  12090. * @param {!Element} root
  12091. * @return {!MDCDrawer}
  12092. */
  12093. _createClass(MDCDrawer, [{
  12094. key: 'initialize',
  12095. value: function initialize() {
  12096. var focusTrapFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : __WEBPACK_IMPORTED_MODULE_8_focus_trap___default.a;
  12097. var listFactory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (el) {
  12098. return new __WEBPACK_IMPORTED_MODULE_4__material_list_index__["MDCList"](el);
  12099. };
  12100. var listEl = /** @type {!Element} */this.root_.querySelector('.' + __WEBPACK_IMPORTED_MODULE_5__material_list_foundation__["a" /* default */].cssClasses.ROOT);
  12101. if (listEl) {
  12102. this.list_ = listFactory(listEl);
  12103. this.list_.wrapFocus = true;
  12104. }
  12105. this.focusTrapFactory_ = focusTrapFactory;
  12106. }
  12107. }, {
  12108. key: 'initialSyncWithDOM',
  12109. value: function initialSyncWithDOM() {
  12110. var _this2 = this;
  12111. var MODAL = __WEBPACK_IMPORTED_MODULE_1__dismissible_foundation__["a" /* default */].cssClasses.MODAL;
  12112. if (this.root_.classList.contains(MODAL)) {
  12113. var SCRIM_SELECTOR = __WEBPACK_IMPORTED_MODULE_1__dismissible_foundation__["a" /* default */].strings.SCRIM_SELECTOR;
  12114. this.scrim_ = /** @type {!Element} */this.root_.parentElement.querySelector(SCRIM_SELECTOR);
  12115. this.handleScrimClick_ = function () {
  12116. return (/** @type {!MDCModalDrawerFoundation} */_this2.foundation_.handleScrimClick()
  12117. );
  12118. };
  12119. this.scrim_.addEventListener('click', this.handleScrimClick_);
  12120. this.focusTrap_ = __WEBPACK_IMPORTED_MODULE_7__util__["createFocusTrapInstance"](this.root_, this.focusTrapFactory_);
  12121. }
  12122. this.handleKeydown_ = function (evt) {
  12123. return _this2.foundation_.handleKeydown(evt);
  12124. };
  12125. this.handleTransitionEnd_ = function (evt) {
  12126. return _this2.foundation_.handleTransitionEnd(evt);
  12127. };
  12128. this.root_.addEventListener('keydown', this.handleKeydown_);
  12129. this.root_.addEventListener('transitionend', this.handleTransitionEnd_);
  12130. }
  12131. }, {
  12132. key: 'destroy',
  12133. value: function destroy() {
  12134. this.root_.removeEventListener('keydown', this.handleKeydown_);
  12135. this.root_.removeEventListener('transitionend', this.handleTransitionEnd_);
  12136. if (this.list_) {
  12137. this.list_.destroy();
  12138. }
  12139. var MODAL = __WEBPACK_IMPORTED_MODULE_1__dismissible_foundation__["a" /* default */].cssClasses.MODAL;
  12140. if (this.root_.classList.contains(MODAL)) {
  12141. this.scrim_.removeEventListener('click', /** @type {!Function} */this.handleScrimClick_);
  12142. // Ensure drawer is closed to hide scrim and release focus
  12143. this.open = false;
  12144. }
  12145. }
  12146. }, {
  12147. key: 'getDefaultFoundation',
  12148. value: function getDefaultFoundation() {
  12149. var _this3 = this;
  12150. /** @type {!MDCDrawerAdapter} */
  12151. var adapter = /** @type {!MDCDrawerAdapter} */_extends({
  12152. addClass: function addClass(className) {
  12153. return _this3.root_.classList.add(className);
  12154. },
  12155. removeClass: function removeClass(className) {
  12156. return _this3.root_.classList.remove(className);
  12157. },
  12158. hasClass: function hasClass(className) {
  12159. return _this3.root_.classList.contains(className);
  12160. },
  12161. elementHasClass: function elementHasClass(element, className) {
  12162. return element.classList.contains(className);
  12163. },
  12164. saveFocus: function saveFocus() {
  12165. _this3.previousFocus_ = document.activeElement;
  12166. },
  12167. restoreFocus: function restoreFocus() {
  12168. var previousFocus = _this3.previousFocus_ && _this3.previousFocus_.focus;
  12169. if (_this3.root_.contains(document.activeElement) && previousFocus) {
  12170. _this3.previousFocus_.focus();
  12171. }
  12172. },
  12173. focusActiveNavigationItem: function focusActiveNavigationItem() {
  12174. var activeNavItemEl = _this3.root_.querySelector('.' + __WEBPACK_IMPORTED_MODULE_5__material_list_foundation__["a" /* default */].cssClasses.LIST_ITEM_ACTIVATED_CLASS);
  12175. if (activeNavItemEl) {
  12176. activeNavItemEl.focus();
  12177. }
  12178. },
  12179. notifyClose: function notifyClose() {
  12180. return _this3.emit(__WEBPACK_IMPORTED_MODULE_6__constants__["b" /* strings */].CLOSE_EVENT, {}, true /* shouldBubble */);
  12181. },
  12182. notifyOpen: function notifyOpen() {
  12183. return _this3.emit(__WEBPACK_IMPORTED_MODULE_6__constants__["b" /* strings */].OPEN_EVENT, {}, true /* shouldBubble */);
  12184. },
  12185. trapFocus: function trapFocus() {
  12186. return _this3.focusTrap_.activate();
  12187. },
  12188. releaseFocus: function releaseFocus() {
  12189. return _this3.focusTrap_.deactivate();
  12190. }
  12191. });
  12192. var _MDCDismissibleDrawer = __WEBPACK_IMPORTED_MODULE_1__dismissible_foundation__["a" /* default */].cssClasses,
  12193. DISMISSIBLE = _MDCDismissibleDrawer.DISMISSIBLE,
  12194. MODAL = _MDCDismissibleDrawer.MODAL;
  12195. if (this.root_.classList.contains(DISMISSIBLE)) {
  12196. return new __WEBPACK_IMPORTED_MODULE_1__dismissible_foundation__["a" /* default */](adapter);
  12197. } else if (this.root_.classList.contains(MODAL)) {
  12198. return new __WEBPACK_IMPORTED_MODULE_2__modal_foundation__["a" /* default */](adapter);
  12199. } else {
  12200. throw new Error('MDCDrawer: Failed to instantiate component. Supported variants are ' + DISMISSIBLE + ' and ' + MODAL + '.');
  12201. }
  12202. }
  12203. }, {
  12204. key: 'open',
  12205. /**
  12206. * Returns true if drawer is in the open position.
  12207. * @return {boolean}
  12208. */
  12209. get: function get() {
  12210. return this.foundation_.isOpen();
  12211. }
  12212. /**
  12213. * Toggles the drawer open and closed.
  12214. * @param {boolean} isOpen
  12215. */
  12216. ,
  12217. set: function set(isOpen) {
  12218. if (isOpen) {
  12219. this.foundation_.open();
  12220. } else {
  12221. this.foundation_.close();
  12222. }
  12223. }
  12224. }], [{
  12225. key: 'attachTo',
  12226. value: function attachTo(root) {
  12227. return new MDCDrawer(root);
  12228. }
  12229. }]);
  12230. return MDCDrawer;
  12231. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCComponent"]);
  12232. /***/ }),
  12233. /* 83 */
  12234. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12235. "use strict";
  12236. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__adapter__ = __webpack_require__(15);
  12237. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__dismissible_foundation__ = __webpack_require__(36);
  12238. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  12239. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12240. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  12241. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  12242. /**
  12243. * @license
  12244. * Copyright 2018 Google Inc.
  12245. *
  12246. * Permission is hereby granted, free of charge, to any person obtaining a copy
  12247. * of this software and associated documentation files (the "Software"), to deal
  12248. * in the Software without restriction, including without limitation the rights
  12249. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12250. * copies of the Software, and to permit persons to whom the Software is
  12251. * furnished to do so, subject to the following conditions:
  12252. *
  12253. * The above copyright notice and this permission notice shall be included in
  12254. * all copies or substantial portions of the Software.
  12255. *
  12256. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12257. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  12258. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  12259. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  12260. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  12261. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  12262. * THE SOFTWARE.
  12263. */
  12264. /**
  12265. * @extends {MDCDismissibleDrawerFoundation}
  12266. */
  12267. var MDCModalDrawerFoundation = function (_MDCDismissibleDrawer) {
  12268. _inherits(MDCModalDrawerFoundation, _MDCDismissibleDrawer);
  12269. function MDCModalDrawerFoundation() {
  12270. _classCallCheck(this, MDCModalDrawerFoundation);
  12271. return _possibleConstructorReturn(this, (MDCModalDrawerFoundation.__proto__ || Object.getPrototypeOf(MDCModalDrawerFoundation)).apply(this, arguments));
  12272. }
  12273. _createClass(MDCModalDrawerFoundation, [{
  12274. key: 'opened',
  12275. /**
  12276. * Called when drawer finishes open animation.
  12277. * @override
  12278. */
  12279. value: function opened() {
  12280. this.adapter_.trapFocus();
  12281. }
  12282. /**
  12283. * Called when drawer finishes close animation.
  12284. * @override
  12285. */
  12286. }, {
  12287. key: 'closed',
  12288. value: function closed() {
  12289. this.adapter_.releaseFocus();
  12290. }
  12291. /**
  12292. * Handles click event on scrim.
  12293. */
  12294. }, {
  12295. key: 'handleScrimClick',
  12296. value: function handleScrimClick() {
  12297. this.close();
  12298. }
  12299. }]);
  12300. return MDCModalDrawerFoundation;
  12301. }(__WEBPACK_IMPORTED_MODULE_1__dismissible_foundation__["a" /* default */]);
  12302. /* harmony default export */ __webpack_exports__["a"] = (MDCModalDrawerFoundation);
  12303. /***/ }),
  12304. /* 84 */
  12305. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12306. "use strict";
  12307. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  12308. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createFocusTrapInstance", function() { return createFocusTrapInstance; });
  12309. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_focus_trap__ = __webpack_require__(40);
  12310. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_focus_trap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_focus_trap__);
  12311. /**
  12312. * @license
  12313. * Copyright 2016 Google Inc.
  12314. *
  12315. * Permission is hereby granted, free of charge, to any person obtaining a copy
  12316. * of this software and associated documentation files (the "Software"), to deal
  12317. * in the Software without restriction, including without limitation the rights
  12318. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12319. * copies of the Software, and to permit persons to whom the Software is
  12320. * furnished to do so, subject to the following conditions:
  12321. *
  12322. * The above copyright notice and this permission notice shall be included in
  12323. * all copies or substantial portions of the Software.
  12324. *
  12325. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12326. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  12327. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  12328. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  12329. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  12330. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  12331. * THE SOFTWARE.
  12332. */
  12333. /**
  12334. * @param {!Element} surfaceEl
  12335. * @param {!Function} focusTrapFactory
  12336. * @return {!FocusTrapInstance}
  12337. */
  12338. function createFocusTrapInstance(surfaceEl) {
  12339. var focusTrapFactory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : __WEBPACK_IMPORTED_MODULE_0_focus_trap___default.a;
  12340. return focusTrapFactory(surfaceEl, {
  12341. clickOutsideDeactivates: true,
  12342. initialFocus: false, // Navigation drawer handles focusing on active nav item.
  12343. escapeDeactivates: false, // Navigation drawer handles ESC.
  12344. returnFocusOnDeactivate: false });
  12345. }
  12346. /***/ }),
  12347. /* 85 */
  12348. /***/ (function(module, exports) {
  12349. var candidateSelectors = [
  12350. 'input',
  12351. 'select',
  12352. 'textarea',
  12353. 'a[href]',
  12354. 'button',
  12355. '[tabindex]',
  12356. 'audio[controls]',
  12357. 'video[controls]',
  12358. '[contenteditable]:not([contenteditable="false"])',
  12359. ];
  12360. var candidateSelector = candidateSelectors.join(',');
  12361. var matches = Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
  12362. function tabbable(el, options) {
  12363. options = options || {};
  12364. var elementDocument = el.ownerDocument || el;
  12365. var regularTabbables = [];
  12366. var orderedTabbables = [];
  12367. var untouchabilityChecker = new UntouchabilityChecker(elementDocument);
  12368. var candidates = el.querySelectorAll(candidateSelector);
  12369. if (options.includeContainer) {
  12370. if (matches.call(el, candidateSelector)) {
  12371. candidates = Array.prototype.slice.apply(candidates);
  12372. candidates.unshift(el);
  12373. }
  12374. }
  12375. var i, candidate, candidateTabindex;
  12376. for (i = 0; i < candidates.length; i++) {
  12377. candidate = candidates[i];
  12378. if (!isNodeMatchingSelectorTabbable(candidate, untouchabilityChecker)) continue;
  12379. candidateTabindex = getTabindex(candidate);
  12380. if (candidateTabindex === 0) {
  12381. regularTabbables.push(candidate);
  12382. } else {
  12383. orderedTabbables.push({
  12384. documentOrder: i,
  12385. tabIndex: candidateTabindex,
  12386. node: candidate,
  12387. });
  12388. }
  12389. }
  12390. var tabbableNodes = orderedTabbables
  12391. .sort(sortOrderedTabbables)
  12392. .map(function(a) { return a.node })
  12393. .concat(regularTabbables);
  12394. return tabbableNodes;
  12395. }
  12396. tabbable.isTabbable = isTabbable;
  12397. tabbable.isFocusable = isFocusable;
  12398. function isNodeMatchingSelectorTabbable(node, untouchabilityChecker) {
  12399. if (
  12400. !isNodeMatchingSelectorFocusable(node, untouchabilityChecker)
  12401. || isNonTabbableRadio(node)
  12402. || getTabindex(node) < 0
  12403. ) {
  12404. return false;
  12405. }
  12406. return true;
  12407. }
  12408. function isTabbable(node, untouchabilityChecker) {
  12409. if (!node) throw new Error('No node provided');
  12410. if (matches.call(node, candidateSelector) === false) return false;
  12411. return isNodeMatchingSelectorTabbable(node, untouchabilityChecker);
  12412. }
  12413. function isNodeMatchingSelectorFocusable(node, untouchabilityChecker) {
  12414. untouchabilityChecker = untouchabilityChecker || new UntouchabilityChecker(node.ownerDocument || node);
  12415. if (
  12416. node.disabled
  12417. || isHiddenInput(node)
  12418. || untouchabilityChecker.isUntouchable(node)
  12419. ) {
  12420. return false;
  12421. }
  12422. return true;
  12423. }
  12424. var focusableCandidateSelector = candidateSelectors.concat('iframe').join(',');
  12425. function isFocusable(node, untouchabilityChecker) {
  12426. if (!node) throw new Error('No node provided');
  12427. if (matches.call(node, focusableCandidateSelector) === false) return false;
  12428. return isNodeMatchingSelectorFocusable(node, untouchabilityChecker);
  12429. }
  12430. function getTabindex(node) {
  12431. var tabindexAttr = parseInt(node.getAttribute('tabindex'), 10);
  12432. if (!isNaN(tabindexAttr)) return tabindexAttr;
  12433. // Browsers do not return `tabIndex` correctly for contentEditable nodes;
  12434. // so if they don't have a tabindex attribute specifically set, assume it's 0.
  12435. if (isContentEditable(node)) return 0;
  12436. return node.tabIndex;
  12437. }
  12438. function sortOrderedTabbables(a, b) {
  12439. return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex;
  12440. }
  12441. // Array.prototype.find not available in IE.
  12442. function find(list, predicate) {
  12443. for (var i = 0, length = list.length; i < length; i++) {
  12444. if (predicate(list[i])) return list[i];
  12445. }
  12446. }
  12447. function isContentEditable(node) {
  12448. return node.contentEditable === 'true';
  12449. }
  12450. function isInput(node) {
  12451. return node.tagName === 'INPUT';
  12452. }
  12453. function isHiddenInput(node) {
  12454. return isInput(node) && node.type === 'hidden';
  12455. }
  12456. function isRadio(node) {
  12457. return isInput(node) && node.type === 'radio';
  12458. }
  12459. function isNonTabbableRadio(node) {
  12460. return isRadio(node) && !isTabbableRadio(node);
  12461. }
  12462. function getCheckedRadio(nodes) {
  12463. for (var i = 0; i < nodes.length; i++) {
  12464. if (nodes[i].checked) {
  12465. return nodes[i];
  12466. }
  12467. }
  12468. }
  12469. function isTabbableRadio(node) {
  12470. if (!node.name) return true;
  12471. // This won't account for the edge case where you have radio groups with the same
  12472. // in separate forms on the same page.
  12473. var radioSet = node.ownerDocument.querySelectorAll('input[type="radio"][name="' + node.name + '"]');
  12474. var checked = getCheckedRadio(radioSet);
  12475. return !checked || checked === node;
  12476. }
  12477. // An element is "untouchable" if *it or one of its ancestors* has
  12478. // `visibility: hidden` or `display: none`.
  12479. function UntouchabilityChecker(elementDocument) {
  12480. this.doc = elementDocument;
  12481. // Node cache must be refreshed on every check, in case
  12482. // the content of the element has changed. The cache contains tuples
  12483. // mapping nodes to their boolean result.
  12484. this.cache = [];
  12485. }
  12486. // getComputedStyle accurately reflects `visibility: hidden` of ancestors
  12487. // but not `display: none`, so we need to recursively check parents.
  12488. UntouchabilityChecker.prototype.hasDisplayNone = function hasDisplayNone(node, nodeComputedStyle) {
  12489. if (node === this.doc.documentElement) return false;
  12490. // Search for a cached result.
  12491. var cached = find(this.cache, function(item) {
  12492. return item === node;
  12493. });
  12494. if (cached) return cached[1];
  12495. nodeComputedStyle = nodeComputedStyle || this.doc.defaultView.getComputedStyle(node);
  12496. var result = false;
  12497. if (nodeComputedStyle.display === 'none') {
  12498. result = true;
  12499. } else if (node.parentNode) {
  12500. result = this.hasDisplayNone(node.parentNode);
  12501. }
  12502. this.cache.push([node, result]);
  12503. return result;
  12504. }
  12505. UntouchabilityChecker.prototype.isUntouchable = function isUntouchable(node) {
  12506. if (node === this.doc.documentElement) return false;
  12507. var computedStyle = this.doc.defaultView.getComputedStyle(node);
  12508. if (this.hasDisplayNone(node, computedStyle)) return true;
  12509. return computedStyle.visibility === 'hidden';
  12510. }
  12511. module.exports = tabbable;
  12512. /***/ }),
  12513. /* 86 */
  12514. /***/ (function(module, exports) {
  12515. module.exports = extend
  12516. var hasOwnProperty = Object.prototype.hasOwnProperty;
  12517. function extend() {
  12518. var target = {}
  12519. for (var i = 0; i < arguments.length; i++) {
  12520. var source = arguments[i]
  12521. for (var key in source) {
  12522. if (hasOwnProperty.call(source, key)) {
  12523. target[key] = source[key]
  12524. }
  12525. }
  12526. }
  12527. return target
  12528. }
  12529. /***/ }),
  12530. /* 87 */
  12531. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12532. "use strict";
  12533. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  12534. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(41);
  12535. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(88);
  12536. 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; };
  12537. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  12538. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12539. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  12540. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  12541. /**
  12542. * @license
  12543. * Copyright 2016 Google Inc.
  12544. *
  12545. * Permission is hereby granted, free of charge, to any person obtaining a copy
  12546. * of this software and associated documentation files (the "Software"), to deal
  12547. * in the Software without restriction, including without limitation the rights
  12548. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12549. * copies of the Software, and to permit persons to whom the Software is
  12550. * furnished to do so, subject to the following conditions:
  12551. *
  12552. * The above copyright notice and this permission notice shall be included in
  12553. * all copies or substantial portions of the Software.
  12554. *
  12555. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12556. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  12557. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  12558. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  12559. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  12560. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  12561. * THE SOFTWARE.
  12562. */
  12563. /**
  12564. * @extends {MDCFoundation<!MDCFloatingLabelAdapter>}
  12565. * @final
  12566. */
  12567. var MDCFloatingLabelFoundation = function (_MDCFoundation) {
  12568. _inherits(MDCFloatingLabelFoundation, _MDCFoundation);
  12569. _createClass(MDCFloatingLabelFoundation, null, [{
  12570. key: 'cssClasses',
  12571. /** @return enum {string} */
  12572. get: function get() {
  12573. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  12574. }
  12575. /**
  12576. * {@see MDCFloatingLabelAdapter} for typing information on parameters and return
  12577. * types.
  12578. * @return {!MDCFloatingLabelAdapter}
  12579. */
  12580. }, {
  12581. key: 'defaultAdapter',
  12582. get: function get() {
  12583. return (/** @type {!MDCFloatingLabelAdapter} */{
  12584. addClass: function addClass() {},
  12585. removeClass: function removeClass() {},
  12586. getWidth: function getWidth() {},
  12587. registerInteractionHandler: function registerInteractionHandler() {},
  12588. deregisterInteractionHandler: function deregisterInteractionHandler() {}
  12589. }
  12590. );
  12591. }
  12592. /**
  12593. * @param {!MDCFloatingLabelAdapter} adapter
  12594. */
  12595. }]);
  12596. function MDCFloatingLabelFoundation(adapter) {
  12597. _classCallCheck(this, MDCFloatingLabelFoundation);
  12598. /** @private {function(!Event): undefined} */
  12599. var _this = _possibleConstructorReturn(this, (MDCFloatingLabelFoundation.__proto__ || Object.getPrototypeOf(MDCFloatingLabelFoundation)).call(this, _extends(MDCFloatingLabelFoundation.defaultAdapter, adapter)));
  12600. _this.shakeAnimationEndHandler_ = function () {
  12601. return _this.handleShakeAnimationEnd_();
  12602. };
  12603. return _this;
  12604. }
  12605. _createClass(MDCFloatingLabelFoundation, [{
  12606. key: 'init',
  12607. value: function init() {
  12608. this.adapter_.registerInteractionHandler('animationend', this.shakeAnimationEndHandler_);
  12609. }
  12610. }, {
  12611. key: 'destroy',
  12612. value: function destroy() {
  12613. this.adapter_.deregisterInteractionHandler('animationend', this.shakeAnimationEndHandler_);
  12614. }
  12615. /**
  12616. * Returns the width of the label element.
  12617. * @return {number}
  12618. */
  12619. }, {
  12620. key: 'getWidth',
  12621. value: function getWidth() {
  12622. return this.adapter_.getWidth();
  12623. }
  12624. /**
  12625. * Styles the label to produce the label shake for errors.
  12626. * @param {boolean} shouldShake adds shake class if true,
  12627. * otherwise removes shake class.
  12628. */
  12629. }, {
  12630. key: 'shake',
  12631. value: function shake(shouldShake) {
  12632. var LABEL_SHAKE = MDCFloatingLabelFoundation.cssClasses.LABEL_SHAKE;
  12633. if (shouldShake) {
  12634. this.adapter_.addClass(LABEL_SHAKE);
  12635. } else {
  12636. this.adapter_.removeClass(LABEL_SHAKE);
  12637. }
  12638. }
  12639. /**
  12640. * Styles the label to float or dock.
  12641. * @param {boolean} shouldFloat adds float class if true, otherwise remove
  12642. * float and shake class to dock label.
  12643. */
  12644. }, {
  12645. key: 'float',
  12646. value: function float(shouldFloat) {
  12647. var _MDCFloatingLabelFoun = MDCFloatingLabelFoundation.cssClasses,
  12648. LABEL_FLOAT_ABOVE = _MDCFloatingLabelFoun.LABEL_FLOAT_ABOVE,
  12649. LABEL_SHAKE = _MDCFloatingLabelFoun.LABEL_SHAKE;
  12650. if (shouldFloat) {
  12651. this.adapter_.addClass(LABEL_FLOAT_ABOVE);
  12652. } else {
  12653. this.adapter_.removeClass(LABEL_FLOAT_ABOVE);
  12654. this.adapter_.removeClass(LABEL_SHAKE);
  12655. }
  12656. }
  12657. /**
  12658. * Handles an interaction event on the root element.
  12659. */
  12660. }, {
  12661. key: 'handleShakeAnimationEnd_',
  12662. value: function handleShakeAnimationEnd_() {
  12663. var LABEL_SHAKE = MDCFloatingLabelFoundation.cssClasses.LABEL_SHAKE;
  12664. this.adapter_.removeClass(LABEL_SHAKE);
  12665. }
  12666. }]);
  12667. return MDCFloatingLabelFoundation;
  12668. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  12669. /* harmony default export */ __webpack_exports__["a"] = (MDCFloatingLabelFoundation);
  12670. /***/ }),
  12671. /* 88 */
  12672. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12673. "use strict";
  12674. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  12675. /**
  12676. * @license
  12677. * Copyright 2016 Google Inc.
  12678. *
  12679. * Permission is hereby granted, free of charge, to any person obtaining a copy
  12680. * of this software and associated documentation files (the "Software"), to deal
  12681. * in the Software without restriction, including without limitation the rights
  12682. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12683. * copies of the Software, and to permit persons to whom the Software is
  12684. * furnished to do so, subject to the following conditions:
  12685. *
  12686. * The above copyright notice and this permission notice shall be included in
  12687. * all copies or substantial portions of the Software.
  12688. *
  12689. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12690. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  12691. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  12692. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  12693. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  12694. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  12695. * THE SOFTWARE.
  12696. */
  12697. /** @enum {string} */
  12698. var cssClasses = {
  12699. LABEL_FLOAT_ABOVE: 'mdc-floating-label--float-above',
  12700. LABEL_SHAKE: 'mdc-floating-label--shake',
  12701. ROOT: 'mdc-floating-label'
  12702. };
  12703. /***/ }),
  12704. /* 89 */
  12705. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12706. "use strict";
  12707. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  12708. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFormField", function() { return MDCFormField; });
  12709. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  12710. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(90);
  12711. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_selection_control_index__ = __webpack_require__(4);
  12712. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFormFieldFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  12713. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  12714. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12715. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  12716. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  12717. /**
  12718. * @license
  12719. * Copyright 2017 Google Inc.
  12720. *
  12721. * Permission is hereby granted, free of charge, to any person obtaining a copy
  12722. * of this software and associated documentation files (the "Software"), to deal
  12723. * in the Software without restriction, including without limitation the rights
  12724. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12725. * copies of the Software, and to permit persons to whom the Software is
  12726. * furnished to do so, subject to the following conditions:
  12727. *
  12728. * The above copyright notice and this permission notice shall be included in
  12729. * all copies or substantial portions of the Software.
  12730. *
  12731. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12732. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  12733. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  12734. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  12735. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  12736. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  12737. * THE SOFTWARE.
  12738. */
  12739. /* eslint-disable no-unused-vars */
  12740. /* eslint-enable no-unused-vars */
  12741. /**
  12742. * @extends MDCComponent<!MDCFormFieldFoundation>
  12743. */
  12744. var MDCFormField = function (_MDCComponent) {
  12745. _inherits(MDCFormField, _MDCComponent);
  12746. _createClass(MDCFormField, [{
  12747. key: 'input',
  12748. /** @param {?MDCSelectionControl} input */
  12749. set: function set(input) {
  12750. this.input_ = input;
  12751. }
  12752. /** @return {?MDCSelectionControl} */
  12753. ,
  12754. get: function get() {
  12755. return this.input_;
  12756. }
  12757. }], [{
  12758. key: 'attachTo',
  12759. value: function attachTo(root) {
  12760. return new MDCFormField(root);
  12761. }
  12762. }]);
  12763. function MDCFormField() {
  12764. var _ref;
  12765. _classCallCheck(this, MDCFormField);
  12766. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  12767. args[_key] = arguments[_key];
  12768. }
  12769. /** @private {?MDCSelectionControl} */
  12770. var _this = _possibleConstructorReturn(this, (_ref = MDCFormField.__proto__ || Object.getPrototypeOf(MDCFormField)).call.apply(_ref, [this].concat(args)));
  12771. _this.input_;
  12772. return _this;
  12773. }
  12774. /**
  12775. * @return {!Element}
  12776. * @private
  12777. */
  12778. _createClass(MDCFormField, [{
  12779. key: 'getDefaultFoundation',
  12780. /** @return {!MDCFormFieldFoundation} */
  12781. value: function getDefaultFoundation() {
  12782. var _this2 = this;
  12783. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]({
  12784. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  12785. return _this2.label_.addEventListener(type, handler);
  12786. },
  12787. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  12788. return _this2.label_.removeEventListener(type, handler);
  12789. },
  12790. activateInputRipple: function activateInputRipple() {
  12791. if (_this2.input_ && _this2.input_.ripple) {
  12792. _this2.input_.ripple.activate();
  12793. }
  12794. },
  12795. deactivateInputRipple: function deactivateInputRipple() {
  12796. if (_this2.input_ && _this2.input_.ripple) {
  12797. _this2.input_.ripple.deactivate();
  12798. }
  12799. }
  12800. });
  12801. }
  12802. }, {
  12803. key: 'label_',
  12804. get: function get() {
  12805. var LABEL_SELECTOR = __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.LABEL_SELECTOR;
  12806. return (/** @type {!Element} */this.root_.querySelector(LABEL_SELECTOR)
  12807. );
  12808. }
  12809. }]);
  12810. return MDCFormField;
  12811. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  12812. /***/ }),
  12813. /* 90 */
  12814. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12815. "use strict";
  12816. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  12817. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(91);
  12818. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(92);
  12819. 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; };
  12820. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  12821. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12822. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  12823. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  12824. /**
  12825. * @license
  12826. * Copyright 2017 Google Inc.
  12827. *
  12828. * Permission is hereby granted, free of charge, to any person obtaining a copy
  12829. * of this software and associated documentation files (the "Software"), to deal
  12830. * in the Software without restriction, including without limitation the rights
  12831. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12832. * copies of the Software, and to permit persons to whom the Software is
  12833. * furnished to do so, subject to the following conditions:
  12834. *
  12835. * The above copyright notice and this permission notice shall be included in
  12836. * all copies or substantial portions of the Software.
  12837. *
  12838. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12839. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  12840. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  12841. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  12842. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  12843. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  12844. * THE SOFTWARE.
  12845. */
  12846. /**
  12847. * @extends {MDCFoundation<!MDCFormFieldAdapter>}
  12848. */
  12849. var MDCFormFieldFoundation = function (_MDCFoundation) {
  12850. _inherits(MDCFormFieldFoundation, _MDCFoundation);
  12851. _createClass(MDCFormFieldFoundation, null, [{
  12852. key: 'cssClasses',
  12853. /** @return enum {cssClasses} */
  12854. get: function get() {
  12855. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  12856. }
  12857. /** @return enum {strings} */
  12858. }, {
  12859. key: 'strings',
  12860. get: function get() {
  12861. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  12862. }
  12863. /** @return {!MDCFormFieldAdapter} */
  12864. }, {
  12865. key: 'defaultAdapter',
  12866. get: function get() {
  12867. return {
  12868. registerInteractionHandler: function registerInteractionHandler() /* type: string, handler: EventListener */{},
  12869. deregisterInteractionHandler: function deregisterInteractionHandler() /* type: string, handler: EventListener */{},
  12870. activateInputRipple: function activateInputRipple() {},
  12871. deactivateInputRipple: function deactivateInputRipple() {}
  12872. };
  12873. }
  12874. }]);
  12875. function MDCFormFieldFoundation(adapter) {
  12876. _classCallCheck(this, MDCFormFieldFoundation);
  12877. /** @private {!EventListener} */
  12878. var _this = _possibleConstructorReturn(this, (MDCFormFieldFoundation.__proto__ || Object.getPrototypeOf(MDCFormFieldFoundation)).call(this, _extends(MDCFormFieldFoundation.defaultAdapter, adapter)));
  12879. _this.clickHandler_ = /** @type {!EventListener} */function () {
  12880. return _this.handleClick_();
  12881. };
  12882. return _this;
  12883. }
  12884. _createClass(MDCFormFieldFoundation, [{
  12885. key: 'init',
  12886. value: function init() {
  12887. this.adapter_.registerInteractionHandler('click', this.clickHandler_);
  12888. }
  12889. }, {
  12890. key: 'destroy',
  12891. value: function destroy() {
  12892. this.adapter_.deregisterInteractionHandler('click', this.clickHandler_);
  12893. }
  12894. /** @private */
  12895. }, {
  12896. key: 'handleClick_',
  12897. value: function handleClick_() {
  12898. var _this2 = this;
  12899. this.adapter_.activateInputRipple();
  12900. requestAnimationFrame(function () {
  12901. return _this2.adapter_.deactivateInputRipple();
  12902. });
  12903. }
  12904. }]);
  12905. return MDCFormFieldFoundation;
  12906. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  12907. /* harmony default export */ __webpack_exports__["a"] = (MDCFormFieldFoundation);
  12908. /***/ }),
  12909. /* 91 */
  12910. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12911. "use strict";
  12912. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  12913. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12914. /**
  12915. * @license
  12916. * Copyright 2016 Google Inc.
  12917. *
  12918. * Permission is hereby granted, free of charge, to any person obtaining a copy
  12919. * of this software and associated documentation files (the "Software"), to deal
  12920. * in the Software without restriction, including without limitation the rights
  12921. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12922. * copies of the Software, and to permit persons to whom the Software is
  12923. * furnished to do so, subject to the following conditions:
  12924. *
  12925. * The above copyright notice and this permission notice shall be included in
  12926. * all copies or substantial portions of the Software.
  12927. *
  12928. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12929. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  12930. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  12931. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  12932. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  12933. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  12934. * THE SOFTWARE.
  12935. */
  12936. /* eslint no-unused-vars: [2, {"args": "none"}] */
  12937. /**
  12938. * Adapter for MDC Form Field. Provides an interface for managing
  12939. * - event handlers
  12940. * - ripple activation
  12941. *
  12942. * Additionally, provides type information for the adapter to the Closure
  12943. * compiler.
  12944. *
  12945. * Implement this adapter for your framework of choice to delegate updates to
  12946. * the component in your framework of choice. See architecture documentation
  12947. * for more details.
  12948. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  12949. *
  12950. * @record
  12951. */
  12952. var MDCFormFieldAdapter = function () {
  12953. function MDCFormFieldAdapter() {
  12954. _classCallCheck(this, MDCFormFieldAdapter);
  12955. }
  12956. _createClass(MDCFormFieldAdapter, [{
  12957. key: "registerInteractionHandler",
  12958. /**
  12959. * @param {string} type
  12960. * @param {!EventListener} handler
  12961. */
  12962. value: function registerInteractionHandler(type, handler) {}
  12963. /**
  12964. * @param {string} type
  12965. * @param {!EventListener} handler
  12966. */
  12967. }, {
  12968. key: "deregisterInteractionHandler",
  12969. value: function deregisterInteractionHandler(type, handler) {}
  12970. }, {
  12971. key: "activateInputRipple",
  12972. value: function activateInputRipple() {}
  12973. }, {
  12974. key: "deactivateInputRipple",
  12975. value: function deactivateInputRipple() {}
  12976. }]);
  12977. return MDCFormFieldAdapter;
  12978. }();
  12979. /* unused harmony default export */ var _unused_webpack_default_export = (MDCFormFieldAdapter);
  12980. /***/ }),
  12981. /* 92 */
  12982. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  12983. "use strict";
  12984. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  12985. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  12986. /**
  12987. * @license
  12988. * Copyright 2017 Google Inc.
  12989. *
  12990. * Permission is hereby granted, free of charge, to any person obtaining a copy
  12991. * of this software and associated documentation files (the "Software"), to deal
  12992. * in the Software without restriction, including without limitation the rights
  12993. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12994. * copies of the Software, and to permit persons to whom the Software is
  12995. * furnished to do so, subject to the following conditions:
  12996. *
  12997. * The above copyright notice and this permission notice shall be included in
  12998. * all copies or substantial portions of the Software.
  12999. *
  13000. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13001. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13002. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13003. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  13004. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  13005. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  13006. * THE SOFTWARE.
  13007. */
  13008. /** @enum {string} */
  13009. var cssClasses = {
  13010. ROOT: 'mdc-form-field'
  13011. };
  13012. /** @enum {string} */
  13013. var strings = {
  13014. LABEL_SELECTOR: '.mdc-form-field > label'
  13015. };
  13016. /***/ }),
  13017. /* 93 */
  13018. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13019. "use strict";
  13020. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  13021. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCGridList", function() { return MDCGridList; });
  13022. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(3);
  13023. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(94);
  13024. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCGridListFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  13025. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  13026. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13027. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  13028. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  13029. /**
  13030. * @license
  13031. * Copyright 2016 Google Inc.
  13032. *
  13033. * Permission is hereby granted, free of charge, to any person obtaining a copy
  13034. * of this software and associated documentation files (the "Software"), to deal
  13035. * in the Software without restriction, including without limitation the rights
  13036. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13037. * copies of the Software, and to permit persons to whom the Software is
  13038. * furnished to do so, subject to the following conditions:
  13039. *
  13040. * The above copyright notice and this permission notice shall be included in
  13041. * all copies or substantial portions of the Software.
  13042. *
  13043. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13044. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13045. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13046. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  13047. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  13048. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  13049. * THE SOFTWARE.
  13050. */
  13051. var MDCGridList = function (_MDCComponent) {
  13052. _inherits(MDCGridList, _MDCComponent);
  13053. function MDCGridList() {
  13054. _classCallCheck(this, MDCGridList);
  13055. return _possibleConstructorReturn(this, (MDCGridList.__proto__ || Object.getPrototypeOf(MDCGridList)).apply(this, arguments));
  13056. }
  13057. _createClass(MDCGridList, [{
  13058. key: 'getDefaultFoundation',
  13059. value: function getDefaultFoundation() {
  13060. var _this2 = this;
  13061. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]({
  13062. getOffsetWidth: function getOffsetWidth() {
  13063. return _this2.root_.offsetWidth;
  13064. },
  13065. getNumberOfTiles: function getNumberOfTiles() {
  13066. return _this2.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.TILE_SELECTOR).length;
  13067. },
  13068. getOffsetWidthForTileAtIndex: function getOffsetWidthForTileAtIndex(index) {
  13069. return _this2.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.TILE_SELECTOR)[index].offsetWidth;
  13070. },
  13071. setStyleForTilesElement: function setStyleForTilesElement(property, value) {
  13072. _this2.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.TILES_SELECTOR).style[property] = value;
  13073. },
  13074. registerResizeHandler: function registerResizeHandler(handler) {
  13075. return window.addEventListener('resize', handler);
  13076. },
  13077. deregisterResizeHandler: function deregisterResizeHandler(handler) {
  13078. return window.removeEventListener('resize', handler);
  13079. }
  13080. });
  13081. }
  13082. }], [{
  13083. key: 'attachTo',
  13084. value: function attachTo(root) {
  13085. return new MDCGridList(root);
  13086. }
  13087. }]);
  13088. return MDCGridList;
  13089. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCComponent"]);
  13090. /***/ }),
  13091. /* 94 */
  13092. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13093. "use strict";
  13094. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(3);
  13095. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(95);
  13096. 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; };
  13097. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  13098. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13099. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  13100. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  13101. /**
  13102. * @license
  13103. * Copyright 2016 Google Inc.
  13104. *
  13105. * Permission is hereby granted, free of charge, to any person obtaining a copy
  13106. * of this software and associated documentation files (the "Software"), to deal
  13107. * in the Software without restriction, including without limitation the rights
  13108. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13109. * copies of the Software, and to permit persons to whom the Software is
  13110. * furnished to do so, subject to the following conditions:
  13111. *
  13112. * The above copyright notice and this permission notice shall be included in
  13113. * all copies or substantial portions of the Software.
  13114. *
  13115. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13116. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13117. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13118. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  13119. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  13120. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  13121. * THE SOFTWARE.
  13122. */
  13123. var MDCGridListFoundation = function (_MDCFoundation) {
  13124. _inherits(MDCGridListFoundation, _MDCFoundation);
  13125. _createClass(MDCGridListFoundation, null, [{
  13126. key: 'strings',
  13127. get: function get() {
  13128. return __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* strings */];
  13129. }
  13130. }, {
  13131. key: 'defaultAdapter',
  13132. get: function get() {
  13133. return {
  13134. getOffsetWidth: function getOffsetWidth() {
  13135. return (/* number */0
  13136. );
  13137. },
  13138. getNumberOfTiles: function getNumberOfTiles() {
  13139. return (/* number */0
  13140. );
  13141. },
  13142. getOffsetWidthForTileAtIndex: function getOffsetWidthForTileAtIndex() {
  13143. return (/* index: number */ /* number */0
  13144. );
  13145. },
  13146. setStyleForTilesElement: function setStyleForTilesElement() /* property: string, value: string */{},
  13147. registerResizeHandler: function registerResizeHandler() /* handler: EventListener */{},
  13148. deregisterResizeHandler: function deregisterResizeHandler() /* handler: EventListener */{}
  13149. };
  13150. }
  13151. }]);
  13152. function MDCGridListFoundation(adapter) {
  13153. _classCallCheck(this, MDCGridListFoundation);
  13154. var _this = _possibleConstructorReturn(this, (MDCGridListFoundation.__proto__ || Object.getPrototypeOf(MDCGridListFoundation)).call(this, _extends(MDCGridListFoundation.defaultAdapter, adapter)));
  13155. _this.resizeHandler_ = function () {
  13156. return _this.alignCenter();
  13157. };
  13158. _this.resizeFrame_ = 0;
  13159. return _this;
  13160. }
  13161. _createClass(MDCGridListFoundation, [{
  13162. key: 'init',
  13163. value: function init() {
  13164. this.alignCenter();
  13165. this.adapter_.registerResizeHandler(this.resizeHandler_);
  13166. }
  13167. }, {
  13168. key: 'destroy',
  13169. value: function destroy() {
  13170. this.adapter_.deregisterResizeHandler(this.resizeHandler_);
  13171. }
  13172. }, {
  13173. key: 'alignCenter',
  13174. value: function alignCenter() {
  13175. var _this2 = this;
  13176. if (this.resizeFrame_ !== 0) {
  13177. cancelAnimationFrame(this.resizeFrame_);
  13178. }
  13179. this.resizeFrame_ = requestAnimationFrame(function () {
  13180. _this2.alignCenter_();
  13181. _this2.resizeFrame_ = 0;
  13182. });
  13183. }
  13184. }, {
  13185. key: 'alignCenter_',
  13186. value: function alignCenter_() {
  13187. if (this.adapter_.getNumberOfTiles() == 0) {
  13188. return;
  13189. }
  13190. var gridWidth = this.adapter_.getOffsetWidth();
  13191. var itemWidth = this.adapter_.getOffsetWidthForTileAtIndex(0);
  13192. var tilesWidth = itemWidth * Math.floor(gridWidth / itemWidth);
  13193. this.adapter_.setStyleForTilesElement('width', tilesWidth + 'px');
  13194. }
  13195. }]);
  13196. return MDCGridListFoundation;
  13197. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCFoundation"]);
  13198. /* harmony default export */ __webpack_exports__["a"] = (MDCGridListFoundation);
  13199. /***/ }),
  13200. /* 95 */
  13201. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13202. "use strict";
  13203. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return strings; });
  13204. /**
  13205. * @license
  13206. * Copyright 2016 Google Inc.
  13207. *
  13208. * Permission is hereby granted, free of charge, to any person obtaining a copy
  13209. * of this software and associated documentation files (the "Software"), to deal
  13210. * in the Software without restriction, including without limitation the rights
  13211. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13212. * copies of the Software, and to permit persons to whom the Software is
  13213. * furnished to do so, subject to the following conditions:
  13214. *
  13215. * The above copyright notice and this permission notice shall be included in
  13216. * all copies or substantial portions of the Software.
  13217. *
  13218. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13219. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13220. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13221. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  13222. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  13223. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  13224. * THE SOFTWARE.
  13225. */
  13226. var strings = {
  13227. TILES_SELECTOR: '.mdc-grid-list__tiles',
  13228. TILE_SELECTOR: '.mdc-grid-tile'
  13229. };
  13230. /***/ }),
  13231. /* 96 */
  13232. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13233. "use strict";
  13234. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  13235. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCIconButtonToggle", function() { return MDCIconButtonToggle; });
  13236. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  13237. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(97);
  13238. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_ripple_index__ = __webpack_require__(2);
  13239. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCIconButtonToggleFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  13240. 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); } };
  13241. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  13242. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13243. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  13244. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  13245. /**
  13246. * @license
  13247. * Copyright 2018 Google Inc.
  13248. *
  13249. * Permission is hereby granted, free of charge, to any person obtaining a copy
  13250. * of this software and associated documentation files (the "Software"), to deal
  13251. * in the Software without restriction, including without limitation the rights
  13252. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13253. * copies of the Software, and to permit persons to whom the Software is
  13254. * furnished to do so, subject to the following conditions:
  13255. *
  13256. * The above copyright notice and this permission notice shall be included in
  13257. * all copies or substantial portions of the Software.
  13258. *
  13259. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13260. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13261. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13262. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  13263. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  13264. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  13265. * THE SOFTWARE.
  13266. */
  13267. /**
  13268. * @extends {MDCComponent<!MDCIconButtonToggleFoundation>}
  13269. */
  13270. var MDCIconButtonToggle = function (_MDCComponent) {
  13271. _inherits(MDCIconButtonToggle, _MDCComponent);
  13272. _createClass(MDCIconButtonToggle, null, [{
  13273. key: 'attachTo',
  13274. value: function attachTo(root) {
  13275. return new MDCIconButtonToggle(root);
  13276. }
  13277. }]);
  13278. function MDCIconButtonToggle() {
  13279. var _ref;
  13280. _classCallCheck(this, MDCIconButtonToggle);
  13281. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  13282. args[_key] = arguments[_key];
  13283. }
  13284. /** @private {!MDCRipple} */
  13285. var _this = _possibleConstructorReturn(this, (_ref = MDCIconButtonToggle.__proto__ || Object.getPrototypeOf(MDCIconButtonToggle)).call.apply(_ref, [this].concat(args)));
  13286. _this.ripple_ = _this.initRipple_();
  13287. /** @private {!Function} */
  13288. _this.handleClick_;
  13289. return _this;
  13290. }
  13291. /**
  13292. * @return {!MDCRipple}
  13293. * @private
  13294. */
  13295. _createClass(MDCIconButtonToggle, [{
  13296. key: 'initRipple_',
  13297. value: function initRipple_() {
  13298. var ripple = new __WEBPACK_IMPORTED_MODULE_2__material_ripple_index__["MDCRipple"](this.root_);
  13299. ripple.unbounded = true;
  13300. return ripple;
  13301. }
  13302. }, {
  13303. key: 'destroy',
  13304. value: function destroy() {
  13305. this.root_.removeEventListener('click', this.handleClick_);
  13306. this.ripple_.destroy();
  13307. _get(MDCIconButtonToggle.prototype.__proto__ || Object.getPrototypeOf(MDCIconButtonToggle.prototype), 'destroy', this).call(this);
  13308. }
  13309. /** @return {!MDCIconButtonToggleFoundation} */
  13310. }, {
  13311. key: 'getDefaultFoundation',
  13312. value: function getDefaultFoundation() {
  13313. var _this2 = this;
  13314. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]({
  13315. addClass: function addClass(className) {
  13316. return _this2.root_.classList.add(className);
  13317. },
  13318. removeClass: function removeClass(className) {
  13319. return _this2.root_.classList.remove(className);
  13320. },
  13321. hasClass: function hasClass(className) {
  13322. return _this2.root_.classList.contains(className);
  13323. },
  13324. setAttr: function setAttr(attrName, attrValue) {
  13325. return _this2.root_.setAttribute(attrName, attrValue);
  13326. },
  13327. notifyChange: function notifyChange(evtData) {
  13328. return _this2.emit(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.CHANGE_EVENT, evtData);
  13329. }
  13330. });
  13331. }
  13332. }, {
  13333. key: 'initialSyncWithDOM',
  13334. value: function initialSyncWithDOM() {
  13335. this.handleClick_ = this.foundation_.handleClick.bind(this.foundation_);
  13336. this.root_.addEventListener('click', this.handleClick_);
  13337. }
  13338. /** @return {!MDCRipple} */
  13339. }, {
  13340. key: 'ripple',
  13341. get: function get() {
  13342. return this.ripple_;
  13343. }
  13344. /** @return {boolean} */
  13345. }, {
  13346. key: 'on',
  13347. get: function get() {
  13348. return this.foundation_.isOn();
  13349. }
  13350. /** @param {boolean} isOn */
  13351. ,
  13352. set: function set(isOn) {
  13353. this.foundation_.toggle(isOn);
  13354. }
  13355. }]);
  13356. return MDCIconButtonToggle;
  13357. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  13358. /***/ }),
  13359. /* 97 */
  13360. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13361. "use strict";
  13362. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  13363. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(98);
  13364. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(99);
  13365. 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; };
  13366. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  13367. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13368. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  13369. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  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-disable no-unused-vars */
  13393. /**
  13394. * @extends {MDCFoundation<!MDCIconButtonToggleAdapter>}
  13395. */
  13396. var MDCIconButtonToggleFoundation = function (_MDCFoundation) {
  13397. _inherits(MDCIconButtonToggleFoundation, _MDCFoundation);
  13398. _createClass(MDCIconButtonToggleFoundation, null, [{
  13399. key: 'cssClasses',
  13400. get: function get() {
  13401. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  13402. }
  13403. }, {
  13404. key: 'strings',
  13405. get: function get() {
  13406. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  13407. }
  13408. }, {
  13409. key: 'defaultAdapter',
  13410. get: function get() {
  13411. return {
  13412. addClass: function addClass() {},
  13413. removeClass: function removeClass() {},
  13414. hasClass: function hasClass() {},
  13415. setAttr: function setAttr() {},
  13416. notifyChange: function notifyChange() {}
  13417. };
  13418. }
  13419. }]);
  13420. function MDCIconButtonToggleFoundation(adapter) {
  13421. _classCallCheck(this, MDCIconButtonToggleFoundation);
  13422. /** @private {boolean} */
  13423. var _this = _possibleConstructorReturn(this, (MDCIconButtonToggleFoundation.__proto__ || Object.getPrototypeOf(MDCIconButtonToggleFoundation)).call(this, _extends(MDCIconButtonToggleFoundation.defaultAdapter, adapter)));
  13424. _this.disabled_ = false;
  13425. return _this;
  13426. }
  13427. _createClass(MDCIconButtonToggleFoundation, [{
  13428. key: 'init',
  13429. value: function init() {
  13430. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_PRESSED, '' + this.isOn());
  13431. }
  13432. }, {
  13433. key: 'handleClick',
  13434. value: function handleClick() {
  13435. this.toggle();
  13436. this.adapter_.notifyChange( /** @type {!IconButtonToggleEvent} */{ isOn: this.isOn() });
  13437. }
  13438. /** @return {boolean} */
  13439. }, {
  13440. key: 'isOn',
  13441. value: function isOn() {
  13442. return this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ICON_BUTTON_ON);
  13443. }
  13444. /** @param {boolean=} isOn */
  13445. }, {
  13446. key: 'toggle',
  13447. value: function toggle() {
  13448. var isOn = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !this.isOn();
  13449. if (isOn) {
  13450. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ICON_BUTTON_ON);
  13451. } else {
  13452. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ICON_BUTTON_ON);
  13453. }
  13454. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_PRESSED, '' + isOn);
  13455. }
  13456. }]);
  13457. return MDCIconButtonToggleFoundation;
  13458. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  13459. /** @record */
  13460. var IconButtonToggleState = function IconButtonToggleState() {
  13461. _classCallCheck(this, IconButtonToggleState);
  13462. };
  13463. /* harmony default export */ __webpack_exports__["a"] = (MDCIconButtonToggleFoundation);
  13464. /***/ }),
  13465. /* 98 */
  13466. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13467. "use strict";
  13468. /* unused harmony export MDCIconButtonToggleAdapter */
  13469. /* unused harmony export IconButtonToggleEvent */
  13470. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  13471. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13472. /**
  13473. * @license
  13474. * Copyright 2018 Google Inc.
  13475. *
  13476. * Permission is hereby granted, free of charge, to any person obtaining a copy
  13477. * of this software and associated documentation files (the "Software"), to deal
  13478. * in the Software without restriction, including without limitation the rights
  13479. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13480. * copies of the Software, and to permit persons to whom the Software is
  13481. * furnished to do so, subject to the following conditions:
  13482. *
  13483. * The above copyright notice and this permission notice shall be included in
  13484. * all copies or substantial portions of the Software.
  13485. *
  13486. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13487. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13488. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13489. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  13490. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  13491. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  13492. * THE SOFTWARE.
  13493. */
  13494. /* eslint no-unused-vars: [2, {"args": "none"}] */
  13495. /**
  13496. * Adapter for MDC Icon Button Toggle. Provides an interface for managing
  13497. * - classes
  13498. * - dom
  13499. * - inner text
  13500. * - event handlers
  13501. * - event dispatch
  13502. *
  13503. * Additionally, provides type information for the adapter to the Closure
  13504. * compiler.
  13505. *
  13506. * Implement this adapter for your framework of choice to delegate updates to
  13507. * the component in your framework of choice. See architecture documentation
  13508. * for more details.
  13509. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  13510. *
  13511. * @record
  13512. */
  13513. var MDCIconButtonToggleAdapter = function () {
  13514. function MDCIconButtonToggleAdapter() {
  13515. _classCallCheck(this, MDCIconButtonToggleAdapter);
  13516. }
  13517. _createClass(MDCIconButtonToggleAdapter, [{
  13518. key: "addClass",
  13519. /** @param {string} className */
  13520. value: function addClass(className) {}
  13521. /** @param {string} className */
  13522. }, {
  13523. key: "removeClass",
  13524. value: function removeClass(className) {}
  13525. /**
  13526. * @param {string} className
  13527. * @return {boolean}
  13528. * */
  13529. }, {
  13530. key: "hasClass",
  13531. value: function hasClass(className) {}
  13532. /**
  13533. * @param {string} attrName
  13534. * @param {string} attrValue
  13535. */
  13536. }, {
  13537. key: "setAttr",
  13538. value: function setAttr(attrName, attrValue) {}
  13539. /** @param {!IconButtonToggleEvent} evtData */
  13540. }, {
  13541. key: "notifyChange",
  13542. value: function notifyChange(evtData) {}
  13543. }]);
  13544. return MDCIconButtonToggleAdapter;
  13545. }();
  13546. /**
  13547. * @typedef {{
  13548. * isOn: boolean,
  13549. * }}
  13550. */
  13551. var IconButtonToggleEvent = void 0;
  13552. /***/ }),
  13553. /* 99 */
  13554. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13555. "use strict";
  13556. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  13557. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  13558. /**
  13559. * @license
  13560. * Copyright 2018 Google Inc.
  13561. *
  13562. * Permission is hereby granted, free of charge, to any person obtaining a copy
  13563. * of this software and associated documentation files (the "Software"), to deal
  13564. * in the Software without restriction, including without limitation the rights
  13565. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13566. * copies of the Software, and to permit persons to whom the Software is
  13567. * furnished to do so, subject to the following conditions:
  13568. *
  13569. * The above copyright notice and this permission notice shall be included in
  13570. * all copies or substantial portions of the Software.
  13571. *
  13572. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13573. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13574. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13575. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  13576. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  13577. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  13578. * THE SOFTWARE.
  13579. */
  13580. /** @enum {string} */
  13581. var cssClasses = {
  13582. ROOT: 'mdc-icon-button',
  13583. ICON_BUTTON_ON: 'mdc-icon-button--on'
  13584. };
  13585. /** @enum {string} */
  13586. var strings = {
  13587. ARIA_PRESSED: 'aria-pressed',
  13588. CHANGE_EVENT: 'MDCIconButtonToggle:change'
  13589. };
  13590. /***/ }),
  13591. /* 100 */
  13592. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13593. "use strict";
  13594. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  13595. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCIconToggle", function() { return MDCIconToggle; });
  13596. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  13597. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(101);
  13598. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_ripple_index__ = __webpack_require__(2);
  13599. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCIconToggleFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  13600. 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; };
  13601. 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); } };
  13602. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  13603. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13604. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  13605. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  13606. /**
  13607. * @license
  13608. * Copyright 2016 Google Inc.
  13609. *
  13610. * Permission is hereby granted, free of charge, to any person obtaining a copy
  13611. * of this software and associated documentation files (the "Software"), to deal
  13612. * in the Software without restriction, including without limitation the rights
  13613. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13614. * copies of the Software, and to permit persons to whom the Software is
  13615. * furnished to do so, subject to the following conditions:
  13616. *
  13617. * The above copyright notice and this permission notice shall be included in
  13618. * all copies or substantial portions of the Software.
  13619. *
  13620. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13621. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13622. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13623. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  13624. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  13625. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  13626. * THE SOFTWARE.
  13627. */
  13628. /**
  13629. * @extends {MDCComponent<!MDCIconToggleFoundation>}
  13630. */
  13631. var MDCIconToggle = function (_MDCComponent) {
  13632. _inherits(MDCIconToggle, _MDCComponent);
  13633. _createClass(MDCIconToggle, null, [{
  13634. key: 'attachTo',
  13635. value: function attachTo(root) {
  13636. return new MDCIconToggle(root);
  13637. }
  13638. }]);
  13639. function MDCIconToggle() {
  13640. var _ref;
  13641. _classCallCheck(this, MDCIconToggle);
  13642. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  13643. args[_key] = arguments[_key];
  13644. }
  13645. /** @private {!MDCRipple} */
  13646. var _this = _possibleConstructorReturn(this, (_ref = MDCIconToggle.__proto__ || Object.getPrototypeOf(MDCIconToggle)).call.apply(_ref, [this].concat(args)));
  13647. _this.ripple_ = _this.initRipple_();
  13648. return _this;
  13649. }
  13650. /** @return {!Element} */
  13651. _createClass(MDCIconToggle, [{
  13652. key: 'initRipple_',
  13653. /**
  13654. * @return {!MDCRipple}
  13655. * @private
  13656. */
  13657. value: function initRipple_() {
  13658. var _this2 = this;
  13659. var adapter = _extends(__WEBPACK_IMPORTED_MODULE_2__material_ripple_index__["MDCRipple"].createAdapter(this), {
  13660. isUnbounded: function isUnbounded() {
  13661. return true;
  13662. },
  13663. isSurfaceActive: function isSurfaceActive() {
  13664. return _this2.foundation_.isKeyboardActivated();
  13665. }
  13666. });
  13667. var foundation = new __WEBPACK_IMPORTED_MODULE_2__material_ripple_index__["MDCRippleFoundation"](adapter);
  13668. return new __WEBPACK_IMPORTED_MODULE_2__material_ripple_index__["MDCRipple"](this.root_, foundation);
  13669. }
  13670. }, {
  13671. key: 'destroy',
  13672. value: function destroy() {
  13673. this.ripple_.destroy();
  13674. _get(MDCIconToggle.prototype.__proto__ || Object.getPrototypeOf(MDCIconToggle.prototype), 'destroy', this).call(this);
  13675. }
  13676. /** @return {!MDCIconToggleFoundation} */
  13677. }, {
  13678. key: 'getDefaultFoundation',
  13679. value: function getDefaultFoundation() {
  13680. var _this3 = this;
  13681. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]({
  13682. addClass: function addClass(className) {
  13683. return _this3.iconEl_.classList.add(className);
  13684. },
  13685. removeClass: function removeClass(className) {
  13686. return _this3.iconEl_.classList.remove(className);
  13687. },
  13688. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  13689. return _this3.root_.addEventListener(type, handler);
  13690. },
  13691. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  13692. return _this3.root_.removeEventListener(type, handler);
  13693. },
  13694. setText: function setText(text) {
  13695. return _this3.iconEl_.textContent = text;
  13696. },
  13697. getTabIndex: function getTabIndex() {
  13698. return (/* number */_this3.root_.tabIndex
  13699. );
  13700. },
  13701. setTabIndex: function setTabIndex(tabIndex) {
  13702. return _this3.root_.tabIndex = tabIndex;
  13703. },
  13704. getAttr: function getAttr(name, value) {
  13705. return _this3.root_.getAttribute(name, value);
  13706. },
  13707. setAttr: function setAttr(name, value) {
  13708. return _this3.root_.setAttribute(name, value);
  13709. },
  13710. rmAttr: function rmAttr(name) {
  13711. return _this3.root_.removeAttribute(name);
  13712. },
  13713. notifyChange: function notifyChange(evtData) {
  13714. return _this3.emit(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.CHANGE_EVENT, evtData);
  13715. }
  13716. });
  13717. }
  13718. }, {
  13719. key: 'initialSyncWithDOM',
  13720. value: function initialSyncWithDOM() {
  13721. this.on = this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.ARIA_PRESSED) === 'true';
  13722. this.disabled = this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.ARIA_DISABLED) === 'true';
  13723. }
  13724. /** @return {!MDCRipple} */
  13725. }, {
  13726. key: 'refreshToggleData',
  13727. value: function refreshToggleData() {
  13728. this.foundation_.refreshToggleData();
  13729. }
  13730. }, {
  13731. key: 'iconEl_',
  13732. get: function get() {
  13733. var sel = this.root_.dataset['iconInnerSelector'];
  13734. return sel ?
  13735. /** @type {!Element} */this.root_.querySelector(sel) : this.root_;
  13736. }
  13737. }, {
  13738. key: 'ripple',
  13739. get: function get() {
  13740. return this.ripple_;
  13741. }
  13742. /** @return {boolean} */
  13743. }, {
  13744. key: 'on',
  13745. get: function get() {
  13746. return this.foundation_.isOn();
  13747. }
  13748. /** @param {boolean} isOn */
  13749. ,
  13750. set: function set(isOn) {
  13751. this.foundation_.toggle(isOn);
  13752. }
  13753. /** @return {boolean} */
  13754. }, {
  13755. key: 'disabled',
  13756. get: function get() {
  13757. return this.foundation_.isDisabled();
  13758. }
  13759. /** @param {boolean} isDisabled */
  13760. ,
  13761. set: function set(isDisabled) {
  13762. this.foundation_.setDisabled(isDisabled);
  13763. }
  13764. }]);
  13765. return MDCIconToggle;
  13766. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  13767. /***/ }),
  13768. /* 101 */
  13769. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  13770. "use strict";
  13771. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  13772. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(102);
  13773. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(103);
  13774. 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; };
  13775. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  13776. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13777. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  13778. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  13779. /**
  13780. * @license
  13781. * Copyright 2016 Google Inc.
  13782. *
  13783. * Permission is hereby granted, free of charge, to any person obtaining a copy
  13784. * of this software and associated documentation files (the "Software"), to deal
  13785. * in the Software without restriction, including without limitation the rights
  13786. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13787. * copies of the Software, and to permit persons to whom the Software is
  13788. * furnished to do so, subject to the following conditions:
  13789. *
  13790. * The above copyright notice and this permission notice shall be included in
  13791. * all copies or substantial portions of the Software.
  13792. *
  13793. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13794. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13795. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13796. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  13797. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  13798. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  13799. * THE SOFTWARE.
  13800. */
  13801. /* eslint-disable no-unused-vars */
  13802. /**
  13803. * @extends {MDCFoundation<!MDCIconToggleAdapter>}
  13804. */
  13805. var MDCIconToggleFoundation = function (_MDCFoundation) {
  13806. _inherits(MDCIconToggleFoundation, _MDCFoundation);
  13807. _createClass(MDCIconToggleFoundation, null, [{
  13808. key: 'cssClasses',
  13809. get: function get() {
  13810. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  13811. }
  13812. }, {
  13813. key: 'strings',
  13814. get: function get() {
  13815. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  13816. }
  13817. }, {
  13818. key: 'defaultAdapter',
  13819. get: function get() {
  13820. return {
  13821. addClass: function addClass() /* className: string */{},
  13822. removeClass: function removeClass() /* className: string */{},
  13823. registerInteractionHandler: function registerInteractionHandler() /* type: string, handler: EventListener */{},
  13824. deregisterInteractionHandler: function deregisterInteractionHandler() /* type: string, handler: EventListener */{},
  13825. setText: function setText() /* text: string */{},
  13826. getTabIndex: function getTabIndex() {
  13827. return (/* number */0
  13828. );
  13829. },
  13830. setTabIndex: function setTabIndex() /* tabIndex: number */{},
  13831. getAttr: function getAttr() {
  13832. return (/* name: string */ /* string */''
  13833. );
  13834. },
  13835. setAttr: function setAttr() /* name: string, value: string */{},
  13836. rmAttr: function rmAttr() /* name: string */{},
  13837. notifyChange: function notifyChange() /* evtData: IconToggleEvent */{}
  13838. };
  13839. }
  13840. }]);
  13841. function MDCIconToggleFoundation(adapter) {
  13842. _classCallCheck(this, MDCIconToggleFoundation);
  13843. /** @private {boolean} */
  13844. var _this = _possibleConstructorReturn(this, (MDCIconToggleFoundation.__proto__ || Object.getPrototypeOf(MDCIconToggleFoundation)).call(this, _extends(MDCIconToggleFoundation.defaultAdapter, adapter)));
  13845. _this.on_ = false;
  13846. /** @private {boolean} */
  13847. _this.disabled_ = false;
  13848. /** @private {number} */
  13849. _this.savedTabIndex_ = -1;
  13850. /** @private {?IconToggleState} */
  13851. _this.toggleOnData_ = null;
  13852. /** @private {?IconToggleState} */
  13853. _this.toggleOffData_ = null;
  13854. _this.clickHandler_ = /** @private {!EventListener} */function () {
  13855. return _this.toggleFromEvt_();
  13856. };
  13857. /** @private {boolean} */
  13858. _this.isHandlingKeydown_ = false;
  13859. _this.keydownHandler_ = /** @private {!EventListener} */function ( /** @type {!KeyboardKey} */evt) {
  13860. if (isSpace(evt)) {
  13861. _this.isHandlingKeydown_ = true;
  13862. return evt.preventDefault();
  13863. }
  13864. };
  13865. _this.keyupHandler_ = /** @private {!EventListener} */function ( /** @type {!KeyboardKey} */evt) {
  13866. if (isSpace(evt)) {
  13867. _this.isHandlingKeydown_ = false;
  13868. _this.toggleFromEvt_();
  13869. }
  13870. };
  13871. return _this;
  13872. }
  13873. _createClass(MDCIconToggleFoundation, [{
  13874. key: 'init',
  13875. value: function init() {
  13876. this.refreshToggleData();
  13877. this.savedTabIndex_ = this.adapter_.getTabIndex();
  13878. this.adapter_.registerInteractionHandler('click', this.clickHandler_);
  13879. this.adapter_.registerInteractionHandler('keydown', this.keydownHandler_);
  13880. this.adapter_.registerInteractionHandler('keyup', this.keyupHandler_);
  13881. }
  13882. }, {
  13883. key: 'refreshToggleData',
  13884. value: function refreshToggleData() {
  13885. var _MDCIconToggleFoundat = MDCIconToggleFoundation.strings,
  13886. DATA_TOGGLE_ON = _MDCIconToggleFoundat.DATA_TOGGLE_ON,
  13887. DATA_TOGGLE_OFF = _MDCIconToggleFoundat.DATA_TOGGLE_OFF;
  13888. this.toggleOnData_ = this.parseJsonDataAttr_(DATA_TOGGLE_ON);
  13889. this.toggleOffData_ = this.parseJsonDataAttr_(DATA_TOGGLE_OFF);
  13890. }
  13891. }, {
  13892. key: 'destroy',
  13893. value: function destroy() {
  13894. this.adapter_.deregisterInteractionHandler('click', this.clickHandler_);
  13895. this.adapter_.deregisterInteractionHandler('keydown', this.keydownHandler_);
  13896. this.adapter_.deregisterInteractionHandler('keyup', this.keyupHandler_);
  13897. }
  13898. /** @private */
  13899. }, {
  13900. key: 'toggleFromEvt_',
  13901. value: function toggleFromEvt_() {
  13902. this.toggle();
  13903. var isOn = this.on_;
  13904. this.adapter_.notifyChange( /** @type {!IconToggleEvent} */{ isOn: isOn });
  13905. }
  13906. /** @return {boolean} */
  13907. }, {
  13908. key: 'isOn',
  13909. value: function isOn() {
  13910. return this.on_;
  13911. }
  13912. /** @param {boolean=} isOn */
  13913. }, {
  13914. key: 'toggle',
  13915. value: function toggle() {
  13916. var isOn = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !this.on_;
  13917. this.on_ = isOn;
  13918. var _MDCIconToggleFoundat2 = MDCIconToggleFoundation.strings,
  13919. ARIA_LABEL = _MDCIconToggleFoundat2.ARIA_LABEL,
  13920. ARIA_PRESSED = _MDCIconToggleFoundat2.ARIA_PRESSED;
  13921. if (this.on_) {
  13922. this.adapter_.setAttr(ARIA_PRESSED, 'true');
  13923. } else {
  13924. this.adapter_.setAttr(ARIA_PRESSED, 'false');
  13925. }
  13926. var _ref = this.on_ ? this.toggleOffData_ : this.toggleOnData_,
  13927. classToRemove = _ref.cssClass;
  13928. if (classToRemove) {
  13929. this.adapter_.removeClass(classToRemove);
  13930. }
  13931. var _ref2 = this.on_ ? this.toggleOnData_ : this.toggleOffData_,
  13932. content = _ref2.content,
  13933. label = _ref2.label,
  13934. cssClass = _ref2.cssClass;
  13935. if (cssClass) {
  13936. this.adapter_.addClass(cssClass);
  13937. }
  13938. if (content) {
  13939. this.adapter_.setText(content);
  13940. }
  13941. if (label) {
  13942. this.adapter_.setAttr(ARIA_LABEL, label);
  13943. }
  13944. }
  13945. /**
  13946. * @param {string} dataAttr
  13947. * @return {!IconToggleState}
  13948. */
  13949. }, {
  13950. key: 'parseJsonDataAttr_',
  13951. value: function parseJsonDataAttr_(dataAttr) {
  13952. var val = this.adapter_.getAttr(dataAttr);
  13953. if (!val) {
  13954. return {};
  13955. }
  13956. return (/** @type {!IconToggleState} */JSON.parse(val)
  13957. );
  13958. }
  13959. /** @return {boolean} */
  13960. }, {
  13961. key: 'isDisabled',
  13962. value: function isDisabled() {
  13963. return this.disabled_;
  13964. }
  13965. /** @param {boolean} isDisabled */
  13966. }, {
  13967. key: 'setDisabled',
  13968. value: function setDisabled(isDisabled) {
  13969. this.disabled_ = isDisabled;
  13970. var DISABLED = MDCIconToggleFoundation.cssClasses.DISABLED;
  13971. var ARIA_DISABLED = MDCIconToggleFoundation.strings.ARIA_DISABLED;
  13972. if (this.disabled_) {
  13973. this.savedTabIndex_ = this.adapter_.getTabIndex();
  13974. this.adapter_.setTabIndex(-1);
  13975. this.adapter_.setAttr(ARIA_DISABLED, 'true');
  13976. this.adapter_.addClass(DISABLED);
  13977. } else {
  13978. this.adapter_.setTabIndex(this.savedTabIndex_);
  13979. this.adapter_.rmAttr(ARIA_DISABLED);
  13980. this.adapter_.removeClass(DISABLED);
  13981. }
  13982. }
  13983. /** @return {boolean} */
  13984. }, {
  13985. key: 'isKeyboardActivated',
  13986. value: function isKeyboardActivated() {
  13987. return this.isHandlingKeydown_;
  13988. }
  13989. }]);
  13990. return MDCIconToggleFoundation;
  13991. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  13992. /**
  13993. * @typedef {{
  13994. * key: string,
  13995. * keyCode: number
  13996. * }}
  13997. */
  13998. var KeyboardKey = void 0;
  13999. /**
  14000. * @param {!KeyboardKey} keyboardKey
  14001. * @return {boolean}
  14002. */
  14003. function isSpace(keyboardKey) {
  14004. return keyboardKey.key === 'Space' || keyboardKey.keyCode === 32;
  14005. }
  14006. /** @record */
  14007. var IconToggleState = function IconToggleState() {
  14008. _classCallCheck(this, IconToggleState);
  14009. };
  14010. /**
  14011. * The aria-label value of the icon toggle, or undefined if there is no aria-label.
  14012. * @export {string|undefined}
  14013. */
  14014. IconToggleState.prototype.label;
  14015. /**
  14016. * The text for the icon toggle, or undefined if there is no text.
  14017. * @export {string|undefined}
  14018. */
  14019. IconToggleState.prototype.content;
  14020. /**
  14021. * The CSS class to add to the icon toggle, or undefined if there is no CSS class.
  14022. * @export {string|undefined}
  14023. */
  14024. IconToggleState.prototype.cssClass;
  14025. /* harmony default export */ __webpack_exports__["a"] = (MDCIconToggleFoundation);
  14026. /***/ }),
  14027. /* 102 */
  14028. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14029. "use strict";
  14030. /* unused harmony export MDCIconToggleAdapter */
  14031. /* unused harmony export IconToggleEvent */
  14032. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  14033. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14034. /**
  14035. * @license
  14036. * Copyright 2017 Google Inc.
  14037. *
  14038. * Permission is hereby granted, free of charge, to any person obtaining a copy
  14039. * of this software and associated documentation files (the "Software"), to deal
  14040. * in the Software without restriction, including without limitation the rights
  14041. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  14042. * copies of the Software, and to permit persons to whom the Software is
  14043. * furnished to do so, subject to the following conditions:
  14044. *
  14045. * The above copyright notice and this permission notice shall be included in
  14046. * all copies or substantial portions of the Software.
  14047. *
  14048. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14049. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14050. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14051. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  14052. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  14053. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  14054. * THE SOFTWARE.
  14055. */
  14056. /* eslint no-unused-vars: [2, {"args": "none"}] */
  14057. /**
  14058. * Adapter for MDC Icon Toggle. Provides an interface for managing
  14059. * - classes
  14060. * - dom
  14061. * - inner text
  14062. * - event handlers
  14063. * - event dispatch
  14064. *
  14065. * Additionally, provides type information for the adapter to the Closure
  14066. * compiler.
  14067. *
  14068. * Implement this adapter for your framework of choice to delegate updates to
  14069. * the component in your framework of choice. See architecture documentation
  14070. * for more details.
  14071. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  14072. *
  14073. * @record
  14074. */
  14075. var MDCIconToggleAdapter = function () {
  14076. function MDCIconToggleAdapter() {
  14077. _classCallCheck(this, MDCIconToggleAdapter);
  14078. }
  14079. _createClass(MDCIconToggleAdapter, [{
  14080. key: "addClass",
  14081. /** @param {string} className */
  14082. value: function addClass(className) {}
  14083. /** @param {string} className */
  14084. }, {
  14085. key: "removeClass",
  14086. value: function removeClass(className) {}
  14087. /**
  14088. * @param {string} type
  14089. * @param {!EventListener} handler
  14090. */
  14091. }, {
  14092. key: "registerInteractionHandler",
  14093. value: function registerInteractionHandler(type, handler) {}
  14094. /**
  14095. * @param {string} type
  14096. * @param {!EventListener} handler
  14097. */
  14098. }, {
  14099. key: "deregisterInteractionHandler",
  14100. value: function deregisterInteractionHandler(type, handler) {}
  14101. /** @param {string} text */
  14102. }, {
  14103. key: "setText",
  14104. value: function setText(text) {}
  14105. /** @return {number} */
  14106. }, {
  14107. key: "getTabIndex",
  14108. value: function getTabIndex() {}
  14109. /** @param {number} tabIndex */
  14110. }, {
  14111. key: "setTabIndex",
  14112. value: function setTabIndex(tabIndex) {}
  14113. /**
  14114. * @param {string} name
  14115. * @return {string}
  14116. */
  14117. }, {
  14118. key: "getAttr",
  14119. value: function getAttr(name) {}
  14120. /**
  14121. * @param {string} name
  14122. * @param {string} value
  14123. */
  14124. }, {
  14125. key: "setAttr",
  14126. value: function setAttr(name, value) {}
  14127. /** @param {string} name */
  14128. }, {
  14129. key: "rmAttr",
  14130. value: function rmAttr(name) {}
  14131. /** @param {!IconToggleEvent} evtData */
  14132. }, {
  14133. key: "notifyChange",
  14134. value: function notifyChange(evtData) {}
  14135. }]);
  14136. return MDCIconToggleAdapter;
  14137. }();
  14138. /**
  14139. * @typedef {{
  14140. * isOn: boolean,
  14141. * }}
  14142. */
  14143. var IconToggleEvent = void 0;
  14144. /***/ }),
  14145. /* 103 */
  14146. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14147. "use strict";
  14148. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  14149. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  14150. /**
  14151. * @license
  14152. * Copyright 2016 Google Inc.
  14153. *
  14154. * Permission is hereby granted, free of charge, to any person obtaining a copy
  14155. * of this software and associated documentation files (the "Software"), to deal
  14156. * in the Software without restriction, including without limitation the rights
  14157. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  14158. * copies of the Software, and to permit persons to whom the Software is
  14159. * furnished to do so, subject to the following conditions:
  14160. *
  14161. * The above copyright notice and this permission notice shall be included in
  14162. * all copies or substantial portions of the Software.
  14163. *
  14164. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14165. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14166. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14167. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  14168. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  14169. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  14170. * THE SOFTWARE.
  14171. */
  14172. /** @enum {string} */
  14173. var cssClasses = {
  14174. ROOT: 'mdc-icon-toggle',
  14175. DISABLED: 'mdc-icon-toggle--disabled'
  14176. };
  14177. /** @enum {string} */
  14178. var strings = {
  14179. DATA_TOGGLE_ON: 'data-toggle-on',
  14180. DATA_TOGGLE_OFF: 'data-toggle-off',
  14181. ARIA_PRESSED: 'aria-pressed',
  14182. ARIA_DISABLED: 'aria-disabled',
  14183. ARIA_LABEL: 'aria-label',
  14184. CHANGE_EVENT: 'MDCIconToggle:change'
  14185. };
  14186. /***/ }),
  14187. /* 104 */
  14188. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14189. "use strict";
  14190. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  14191. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCLinearProgress", function() { return MDCLinearProgress; });
  14192. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(3);
  14193. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(105);
  14194. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCLinearProgressFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  14195. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  14196. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14197. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  14198. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  14199. /**
  14200. * @license
  14201. * Copyright 2017 Google Inc.
  14202. *
  14203. * Permission is hereby granted, free of charge, to any person obtaining a copy
  14204. * of this software and associated documentation files (the "Software"), to deal
  14205. * in the Software without restriction, including without limitation the rights
  14206. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  14207. * copies of the Software, and to permit persons to whom the Software is
  14208. * furnished to do so, subject to the following conditions:
  14209. *
  14210. * The above copyright notice and this permission notice shall be included in
  14211. * all copies or substantial portions of the Software.
  14212. *
  14213. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14214. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14215. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14216. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  14217. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  14218. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  14219. * THE SOFTWARE.
  14220. */
  14221. var MDCLinearProgress = function (_MDCComponent) {
  14222. _inherits(MDCLinearProgress, _MDCComponent);
  14223. function MDCLinearProgress() {
  14224. _classCallCheck(this, MDCLinearProgress);
  14225. return _possibleConstructorReturn(this, (MDCLinearProgress.__proto__ || Object.getPrototypeOf(MDCLinearProgress)).apply(this, arguments));
  14226. }
  14227. _createClass(MDCLinearProgress, [{
  14228. key: 'open',
  14229. value: function open() {
  14230. this.foundation_.open();
  14231. }
  14232. }, {
  14233. key: 'close',
  14234. value: function close() {
  14235. this.foundation_.close();
  14236. }
  14237. }, {
  14238. key: 'getDefaultFoundation',
  14239. value: function getDefaultFoundation() {
  14240. var _this2 = this;
  14241. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]({
  14242. addClass: function addClass(className) {
  14243. return _this2.root_.classList.add(className);
  14244. },
  14245. getPrimaryBar: function getPrimaryBar() {
  14246. return _this2.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.PRIMARY_BAR_SELECTOR);
  14247. },
  14248. getBuffer: function getBuffer() {
  14249. return _this2.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.BUFFER_SELECTOR);
  14250. },
  14251. hasClass: function hasClass(className) {
  14252. return _this2.root_.classList.contains(className);
  14253. },
  14254. removeClass: function removeClass(className) {
  14255. return _this2.root_.classList.remove(className);
  14256. },
  14257. setStyle: function setStyle(el, styleProperty, value) {
  14258. return el.style[styleProperty] = value;
  14259. }
  14260. });
  14261. }
  14262. }, {
  14263. key: 'determinate',
  14264. set: function set(value) {
  14265. this.foundation_.setDeterminate(value);
  14266. }
  14267. }, {
  14268. key: 'progress',
  14269. set: function set(value) {
  14270. this.foundation_.setProgress(value);
  14271. }
  14272. }, {
  14273. key: 'buffer',
  14274. set: function set(value) {
  14275. this.foundation_.setBuffer(value);
  14276. }
  14277. }, {
  14278. key: 'reverse',
  14279. set: function set(value) {
  14280. this.foundation_.setReverse(value);
  14281. }
  14282. }], [{
  14283. key: 'attachTo',
  14284. value: function attachTo(root) {
  14285. return new MDCLinearProgress(root);
  14286. }
  14287. }]);
  14288. return MDCLinearProgress;
  14289. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCComponent"]);
  14290. /***/ }),
  14291. /* 105 */
  14292. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14293. "use strict";
  14294. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(3);
  14295. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_animation_index__ = __webpack_require__(9);
  14296. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(106);
  14297. 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; };
  14298. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  14299. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14300. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  14301. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  14302. /**
  14303. * @license
  14304. * Copyright 2017 Google Inc.
  14305. *
  14306. * Permission is hereby granted, free of charge, to any person obtaining a copy
  14307. * of this software and associated documentation files (the "Software"), to deal
  14308. * in the Software without restriction, including without limitation the rights
  14309. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  14310. * copies of the Software, and to permit persons to whom the Software is
  14311. * furnished to do so, subject to the following conditions:
  14312. *
  14313. * The above copyright notice and this permission notice shall be included in
  14314. * all copies or substantial portions of the Software.
  14315. *
  14316. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14317. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14318. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14319. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  14320. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  14321. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  14322. * THE SOFTWARE.
  14323. */
  14324. var MDCLinearProgressFoundation = function (_MDCFoundation) {
  14325. _inherits(MDCLinearProgressFoundation, _MDCFoundation);
  14326. _createClass(MDCLinearProgressFoundation, null, [{
  14327. key: 'cssClasses',
  14328. get: function get() {
  14329. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  14330. }
  14331. }, {
  14332. key: 'strings',
  14333. get: function get() {
  14334. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  14335. }
  14336. }, {
  14337. key: 'defaultAdapter',
  14338. get: function get() {
  14339. return {
  14340. addClass: function addClass() /* className: string */{},
  14341. getPrimaryBar: function getPrimaryBar() /* el: Element */{},
  14342. getBuffer: function getBuffer() /* el: Element */{},
  14343. hasClass: function hasClass() {
  14344. return (/* className: string */false
  14345. );
  14346. },
  14347. removeClass: function removeClass() /* className: string */{},
  14348. setStyle: function setStyle() /* el: Element, styleProperty: string, value: string */{}
  14349. };
  14350. }
  14351. }]);
  14352. function MDCLinearProgressFoundation(adapter) {
  14353. _classCallCheck(this, MDCLinearProgressFoundation);
  14354. return _possibleConstructorReturn(this, (MDCLinearProgressFoundation.__proto__ || Object.getPrototypeOf(MDCLinearProgressFoundation)).call(this, _extends(MDCLinearProgressFoundation.defaultAdapter, adapter)));
  14355. }
  14356. _createClass(MDCLinearProgressFoundation, [{
  14357. key: 'init',
  14358. value: function init() {
  14359. this.determinate_ = !this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].INDETERMINATE_CLASS);
  14360. this.reverse_ = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].REVERSED_CLASS);
  14361. this.progress_ = 0;
  14362. }
  14363. }, {
  14364. key: 'setDeterminate',
  14365. value: function setDeterminate(isDeterminate) {
  14366. this.determinate_ = isDeterminate;
  14367. if (this.determinate_) {
  14368. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].INDETERMINATE_CLASS);
  14369. this.setScale_(this.adapter_.getPrimaryBar(), this.progress_);
  14370. } else {
  14371. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].INDETERMINATE_CLASS);
  14372. this.setScale_(this.adapter_.getPrimaryBar(), 1);
  14373. this.setScale_(this.adapter_.getBuffer(), 1);
  14374. }
  14375. }
  14376. }, {
  14377. key: 'setProgress',
  14378. value: function setProgress(value) {
  14379. this.progress_ = value;
  14380. if (this.determinate_) {
  14381. this.setScale_(this.adapter_.getPrimaryBar(), value);
  14382. }
  14383. }
  14384. }, {
  14385. key: 'setBuffer',
  14386. value: function setBuffer(value) {
  14387. if (this.determinate_) {
  14388. this.setScale_(this.adapter_.getBuffer(), value);
  14389. }
  14390. }
  14391. }, {
  14392. key: 'setReverse',
  14393. value: function setReverse(isReversed) {
  14394. this.reverse_ = isReversed;
  14395. if (this.reverse_) {
  14396. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].REVERSED_CLASS);
  14397. } else {
  14398. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].REVERSED_CLASS);
  14399. }
  14400. }
  14401. }, {
  14402. key: 'open',
  14403. value: function open() {
  14404. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CLOSED_CLASS);
  14405. }
  14406. }, {
  14407. key: 'close',
  14408. value: function close() {
  14409. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CLOSED_CLASS);
  14410. }
  14411. }, {
  14412. key: 'setScale_',
  14413. value: function setScale_(el, scaleValue) {
  14414. var _this2 = this;
  14415. var value = 'scaleX(' + scaleValue + ')';
  14416. __WEBPACK_IMPORTED_MODULE_1__material_animation_index__["c" /* transformStyleProperties */].forEach(function (transformStyleProperty) {
  14417. _this2.adapter_.setStyle(el, transformStyleProperty, value);
  14418. });
  14419. }
  14420. }]);
  14421. return MDCLinearProgressFoundation;
  14422. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCFoundation"]);
  14423. /* harmony default export */ __webpack_exports__["a"] = (MDCLinearProgressFoundation);
  14424. /***/ }),
  14425. /* 106 */
  14426. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14427. "use strict";
  14428. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  14429. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  14430. /**
  14431. * @license
  14432. * Copyright 2017 Google Inc.
  14433. *
  14434. * Permission is hereby granted, free of charge, to any person obtaining a copy
  14435. * of this software and associated documentation files (the "Software"), to deal
  14436. * in the Software without restriction, including without limitation the rights
  14437. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  14438. * copies of the Software, and to permit persons to whom the Software is
  14439. * furnished to do so, subject to the following conditions:
  14440. *
  14441. * The above copyright notice and this permission notice shall be included in
  14442. * all copies or substantial portions of the Software.
  14443. *
  14444. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14445. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14446. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14447. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  14448. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  14449. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  14450. * THE SOFTWARE.
  14451. */
  14452. var cssClasses = {
  14453. CLOSED_CLASS: 'mdc-linear-progress--closed',
  14454. INDETERMINATE_CLASS: 'mdc-linear-progress--indeterminate',
  14455. REVERSED_CLASS: 'mdc-linear-progress--reversed'
  14456. };
  14457. var strings = {
  14458. PRIMARY_BAR_SELECTOR: '.mdc-linear-progress__primary-bar',
  14459. BUFFER_SELECTOR: '.mdc-linear-progress__buffer'
  14460. };
  14461. /***/ }),
  14462. /* 107 */
  14463. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14464. "use strict";
  14465. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  14466. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(42);
  14467. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(108);
  14468. 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; };
  14469. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  14470. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14471. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  14472. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  14473. /**
  14474. * @license
  14475. * Copyright 2018 Google Inc.
  14476. *
  14477. * Permission is hereby granted, free of charge, to any person obtaining a copy
  14478. * of this software and associated documentation files (the "Software"), to deal
  14479. * in the Software without restriction, including without limitation the rights
  14480. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  14481. * copies of the Software, and to permit persons to whom the Software is
  14482. * furnished to do so, subject to the following conditions:
  14483. *
  14484. * The above copyright notice and this permission notice shall be included in
  14485. * all copies or substantial portions of the Software.
  14486. *
  14487. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14488. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14489. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14490. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  14491. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  14492. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  14493. * THE SOFTWARE.
  14494. */
  14495. /**
  14496. * @extends {MDCFoundation<!MDCLineRippleAdapter>}
  14497. * @final
  14498. */
  14499. var MDCLineRippleFoundation = function (_MDCFoundation) {
  14500. _inherits(MDCLineRippleFoundation, _MDCFoundation);
  14501. _createClass(MDCLineRippleFoundation, null, [{
  14502. key: 'cssClasses',
  14503. /** @return enum {string} */
  14504. get: function get() {
  14505. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  14506. }
  14507. /**
  14508. * {@see MDCLineRippleAdapter} for typing information on parameters and return
  14509. * types.
  14510. * @return {!MDCLineRippleAdapter}
  14511. */
  14512. }, {
  14513. key: 'defaultAdapter',
  14514. get: function get() {
  14515. return (/** @type {!MDCLineRippleAdapter} */{
  14516. addClass: function addClass() {},
  14517. removeClass: function removeClass() {},
  14518. hasClass: function hasClass() {},
  14519. setStyle: function setStyle() {},
  14520. registerEventHandler: function registerEventHandler() {},
  14521. deregisterEventHandler: function deregisterEventHandler() {}
  14522. }
  14523. );
  14524. }
  14525. /**
  14526. * @param {!MDCLineRippleAdapter=} adapter
  14527. */
  14528. }]);
  14529. function MDCLineRippleFoundation(adapter) {
  14530. _classCallCheck(this, MDCLineRippleFoundation);
  14531. /** @private {function(!Event): undefined} */
  14532. var _this = _possibleConstructorReturn(this, (MDCLineRippleFoundation.__proto__ || Object.getPrototypeOf(MDCLineRippleFoundation)).call(this, _extends(MDCLineRippleFoundation.defaultAdapter, adapter)));
  14533. _this.transitionEndHandler_ = function (evt) {
  14534. return _this.handleTransitionEnd(evt);
  14535. };
  14536. return _this;
  14537. }
  14538. _createClass(MDCLineRippleFoundation, [{
  14539. key: 'init',
  14540. value: function init() {
  14541. this.adapter_.registerEventHandler('transitionend', this.transitionEndHandler_);
  14542. }
  14543. }, {
  14544. key: 'destroy',
  14545. value: function destroy() {
  14546. this.adapter_.deregisterEventHandler('transitionend', this.transitionEndHandler_);
  14547. }
  14548. /**
  14549. * Activates the line ripple
  14550. */
  14551. }, {
  14552. key: 'activate',
  14553. value: function activate() {
  14554. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LINE_RIPPLE_DEACTIVATING);
  14555. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LINE_RIPPLE_ACTIVE);
  14556. }
  14557. /**
  14558. * Sets the center of the ripple animation to the given X coordinate.
  14559. * @param {number} xCoordinate
  14560. */
  14561. }, {
  14562. key: 'setRippleCenter',
  14563. value: function setRippleCenter(xCoordinate) {
  14564. this.adapter_.setStyle('transform-origin', xCoordinate + 'px center');
  14565. }
  14566. /**
  14567. * Deactivates the line ripple
  14568. */
  14569. }, {
  14570. key: 'deactivate',
  14571. value: function deactivate() {
  14572. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LINE_RIPPLE_DEACTIVATING);
  14573. }
  14574. /**
  14575. * Handles a transition end event
  14576. * @param {!Event} evt
  14577. */
  14578. }, {
  14579. key: 'handleTransitionEnd',
  14580. value: function handleTransitionEnd(evt) {
  14581. // Wait for the line ripple to be either transparent or opaque
  14582. // before emitting the animation end event
  14583. var isDeactivating = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LINE_RIPPLE_DEACTIVATING);
  14584. if (evt.propertyName === 'opacity') {
  14585. if (isDeactivating) {
  14586. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LINE_RIPPLE_ACTIVE);
  14587. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LINE_RIPPLE_DEACTIVATING);
  14588. }
  14589. }
  14590. }
  14591. }]);
  14592. return MDCLineRippleFoundation;
  14593. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  14594. /* harmony default export */ __webpack_exports__["a"] = (MDCLineRippleFoundation);
  14595. /***/ }),
  14596. /* 108 */
  14597. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14598. "use strict";
  14599. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  14600. /**
  14601. * @license
  14602. * Copyright 2018 Google Inc.
  14603. *
  14604. * Permission is hereby granted, free of charge, to any person obtaining a copy
  14605. * of this software and associated documentation files (the "Software"), to deal
  14606. * in the Software without restriction, including without limitation the rights
  14607. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  14608. * copies of the Software, and to permit persons to whom the Software is
  14609. * furnished to do so, subject to the following conditions:
  14610. *
  14611. * The above copyright notice and this permission notice shall be included in
  14612. * all copies or substantial portions of the Software.
  14613. *
  14614. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14615. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14616. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14617. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  14618. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  14619. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  14620. * THE SOFTWARE.
  14621. */
  14622. /** @enum {string} */
  14623. var cssClasses = {
  14624. LINE_RIPPLE_ACTIVE: 'mdc-line-ripple--active',
  14625. LINE_RIPPLE_DEACTIVATING: 'mdc-line-ripple--deactivating'
  14626. };
  14627. /***/ }),
  14628. /* 109 */
  14629. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14630. "use strict";
  14631. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCMenuFoundation; });
  14632. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  14633. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(110);
  14634. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(19);
  14635. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_menu_surface_foundation__ = __webpack_require__(20);
  14636. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_list_foundation__ = __webpack_require__(17);
  14637. 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; };
  14638. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  14639. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14640. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  14641. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  14642. /**
  14643. * @license
  14644. * Copyright 2018 Google Inc.
  14645. *
  14646. * Permission is hereby granted, free of charge, to any person obtaining a copy
  14647. * of this software and associated documentation files (the "Software"), to deal
  14648. * in the Software without restriction, including without limitation the rights
  14649. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  14650. * copies of the Software, and to permit persons to whom the Software is
  14651. * furnished to do so, subject to the following conditions:
  14652. *
  14653. * The above copyright notice and this permission notice shall be included in
  14654. * all copies or substantial portions of the Software.
  14655. *
  14656. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14657. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14658. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14659. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  14660. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  14661. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  14662. * THE SOFTWARE.
  14663. */
  14664. var ELEMENTS_KEY_ALLOWED_IN = ['input', 'button', 'textarea', 'select', 'a'];
  14665. /**
  14666. * @extends {MDCFoundation<!MDCMenuAdapter>}
  14667. */
  14668. var MDCMenuFoundation = function (_MDCFoundation) {
  14669. _inherits(MDCMenuFoundation, _MDCFoundation);
  14670. _createClass(MDCMenuFoundation, null, [{
  14671. key: 'cssClasses',
  14672. /** @return enum{cssClasses} */
  14673. get: function get() {
  14674. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  14675. }
  14676. /** @return enum{strings} */
  14677. }, {
  14678. key: 'strings',
  14679. get: function get() {
  14680. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  14681. }
  14682. /**
  14683. * {@see MDCMenuAdapter} for typing information on parameters and return
  14684. * types.
  14685. * @return {!MDCMenuAdapter}
  14686. */
  14687. }, {
  14688. key: 'defaultAdapter',
  14689. get: function get() {
  14690. return (/** @type {!MDCMenuAdapter} */{
  14691. addClassToElementAtIndex: function addClassToElementAtIndex() {},
  14692. removeClassFromElementAtIndex: function removeClassFromElementAtIndex() {},
  14693. addAttributeToElementAtIndex: function addAttributeToElementAtIndex() {},
  14694. removeAttributeFromElementAtIndex: function removeAttributeFromElementAtIndex() {},
  14695. elementContainsClass: function elementContainsClass() {},
  14696. closeSurface: function closeSurface() {},
  14697. getElementIndex: function getElementIndex() {},
  14698. getParentElement: function getParentElement() {},
  14699. getSelectedElementIndex: function getSelectedElementIndex() {},
  14700. notifySelected: function notifySelected() {}
  14701. }
  14702. );
  14703. }
  14704. /** @param {!MDCMenuAdapter} adapter */
  14705. }]);
  14706. function MDCMenuFoundation(adapter) {
  14707. _classCallCheck(this, MDCMenuFoundation);
  14708. /** @type {number} */
  14709. var _this = _possibleConstructorReturn(this, (MDCMenuFoundation.__proto__ || Object.getPrototypeOf(MDCMenuFoundation)).call(this, _extends(MDCMenuFoundation.defaultAdapter, adapter)));
  14710. _this.closeAnimationEndTimerId_ = 0;
  14711. return _this;
  14712. }
  14713. _createClass(MDCMenuFoundation, [{
  14714. key: 'destroy',
  14715. value: function destroy() {
  14716. if (this.closeAnimationEndTimerId_) {
  14717. clearTimeout(this.closeAnimationEndTimerId_);
  14718. }
  14719. this.adapter_.closeSurface();
  14720. }
  14721. /**
  14722. * Handler function for the keydown events.
  14723. * @param {!Event} evt
  14724. */
  14725. }, {
  14726. key: 'handleKeydown',
  14727. value: function handleKeydown(evt) {
  14728. var key = evt.key,
  14729. keyCode = evt.keyCode;
  14730. var isSpace = key === 'Space' || keyCode === 32;
  14731. var isEnter = key === 'Enter' || keyCode === 13;
  14732. var isTab = key === 'Tab' || keyCode === 9;
  14733. if (isSpace || isEnter) {
  14734. this.handleAction_(evt);
  14735. } else if (isTab) {
  14736. this.adapter_.closeSurface();
  14737. }
  14738. }
  14739. /**
  14740. * Handler function for the click events.
  14741. * @param {!Event} evt
  14742. */
  14743. }, {
  14744. key: 'handleClick',
  14745. value: function handleClick(evt) {
  14746. this.handleAction_(evt);
  14747. }
  14748. /**
  14749. * Combined action handling for click/keypress events.
  14750. * @param {!Event} evt
  14751. * @private
  14752. */
  14753. }, {
  14754. key: 'handleAction_',
  14755. value: function handleAction_(evt) {
  14756. var listItem = this.getListItem_( /** @type {HTMLElement} */evt.target);
  14757. if (listItem) {
  14758. this.handleSelection(listItem);
  14759. this.preventDefaultEvent_(evt);
  14760. }
  14761. }
  14762. /**
  14763. * Handler for a selected list item.
  14764. * @param {?HTMLElement} listItem
  14765. */
  14766. }, {
  14767. key: 'handleSelection',
  14768. value: function handleSelection(listItem) {
  14769. var _this2 = this;
  14770. var index = this.adapter_.getElementIndex(listItem);
  14771. if (index < 0) {
  14772. return;
  14773. }
  14774. this.adapter_.notifySelected({ index: index });
  14775. this.adapter_.closeSurface();
  14776. // Wait for the menu to close before adding/removing classes that affect styles.
  14777. this.closeAnimationEndTimerId_ = setTimeout(function () {
  14778. var selectionGroup = _this2.getSelectionGroup_(listItem);
  14779. if (selectionGroup !== null) {
  14780. _this2.handleSelectionGroup_( /** @type {!HTMLElement} */selectionGroup, index);
  14781. }
  14782. }, __WEBPACK_IMPORTED_MODULE_3__material_menu_surface_foundation__["b" /* MDCMenuSurfaceFoundation */].numbers.TRANSITION_CLOSE_DURATION);
  14783. }
  14784. /**
  14785. * Handles toggling the selected classes in a selection group when a
  14786. * selection is made.
  14787. * @param {!HTMLElement} selectionGroup
  14788. * @param {number} index The selected index value
  14789. * @private
  14790. */
  14791. }, {
  14792. key: 'handleSelectionGroup_',
  14793. value: function handleSelectionGroup_(selectionGroup, index) {
  14794. // De-select the previous selection in this group.
  14795. var selectedIndex = this.adapter_.getSelectedElementIndex(selectionGroup);
  14796. if (selectedIndex >= 0) {
  14797. this.adapter_.removeAttributeFromElementAtIndex(selectedIndex, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_SELECTED_ATTR);
  14798. this.adapter_.removeClassFromElementAtIndex(selectedIndex, __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].MENU_SELECTED_LIST_ITEM);
  14799. }
  14800. // Select the new list item in this group.
  14801. this.adapter_.addClassToElementAtIndex(index, __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].MENU_SELECTED_LIST_ITEM);
  14802. this.adapter_.addAttributeToElementAtIndex(index, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_SELECTED_ATTR, 'true');
  14803. }
  14804. /**
  14805. * Returns the parent selection group of an element if one exists.
  14806. * @param listItem
  14807. * @return {?HTMLElement} parent selection group element or null.
  14808. * @private
  14809. */
  14810. }, {
  14811. key: 'getSelectionGroup_',
  14812. value: function getSelectionGroup_(listItem) {
  14813. var parent = this.adapter_.getParentElement(listItem);
  14814. var isGroup = this.adapter_.elementContainsClass(parent, __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].MENU_SELECTION_GROUP);
  14815. // Iterate through ancestors until we find the group or get to the list.
  14816. while (!isGroup && !this.adapter_.elementContainsClass(parent, __WEBPACK_IMPORTED_MODULE_4__material_list_foundation__["a" /* default */].cssClasses.ROOT)) {
  14817. parent = this.adapter_.getParentElement(parent);
  14818. isGroup = this.adapter_.elementContainsClass(parent, __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].MENU_SELECTION_GROUP);
  14819. }
  14820. if (isGroup) {
  14821. return parent;
  14822. } else {
  14823. return null;
  14824. }
  14825. }
  14826. /**
  14827. * Find the first ancestor with the mdc-list-item class.
  14828. * @param {?HTMLElement} target
  14829. * @return {?HTMLElement}
  14830. * @private
  14831. */
  14832. }, {
  14833. key: 'getListItem_',
  14834. value: function getListItem_(target) {
  14835. var isListItem = this.adapter_.elementContainsClass(target, __WEBPACK_IMPORTED_MODULE_4__material_list_foundation__["a" /* default */].cssClasses.LIST_ITEM_CLASS);
  14836. while (!isListItem) {
  14837. target = this.adapter_.getParentElement(target);
  14838. if (target) {
  14839. isListItem = this.adapter_.elementContainsClass(target, __WEBPACK_IMPORTED_MODULE_4__material_list_foundation__["a" /* default */].cssClasses.LIST_ITEM_CLASS);
  14840. } else {
  14841. // target has no parent element.
  14842. return null;
  14843. }
  14844. }
  14845. return target;
  14846. }
  14847. /**
  14848. * Ensures that preventDefault is only called if the containing element doesn't
  14849. * consume the event, and it will cause an unintended scroll.
  14850. * @param {!Event} evt
  14851. * @private
  14852. */
  14853. }, {
  14854. key: 'preventDefaultEvent_',
  14855. value: function preventDefaultEvent_(evt) {
  14856. var target = /** @type {!HTMLElement} */evt.target;
  14857. var tagName = ('' + target.tagName).toLowerCase();
  14858. if (ELEMENTS_KEY_ALLOWED_IN.indexOf(tagName) === -1) {
  14859. evt.preventDefault();
  14860. }
  14861. }
  14862. }]);
  14863. return MDCMenuFoundation;
  14864. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  14865. /***/ }),
  14866. /* 110 */
  14867. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  14868. "use strict";
  14869. /* unused harmony export MDCMenuAdapter */
  14870. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  14871. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14872. /**
  14873. * @license
  14874. * Copyright 2018 Google Inc.
  14875. *
  14876. * Permission is hereby granted, free of charge, to any person obtaining a copy
  14877. * of this software and associated documentation files (the "Software"), to deal
  14878. * in the Software without restriction, including without limitation the rights
  14879. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  14880. * copies of the Software, and to permit persons to whom the Software is
  14881. * furnished to do so, subject to the following conditions:
  14882. *
  14883. * The above copyright notice and this permission notice shall be included in
  14884. * all copies or substantial portions of the Software.
  14885. *
  14886. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14887. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14888. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14889. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  14890. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  14891. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  14892. * THE SOFTWARE.
  14893. */
  14894. /* eslint no-unused-vars: [2, {"args": "none"}] */
  14895. /**
  14896. * Adapter for MDC Menu. Provides an interface for managing
  14897. * - selected element classes
  14898. * - get focused elements
  14899. * - toggling a checkbox inside a list item
  14900. *
  14901. * Additionally, provides type information for the adapter to the Closure
  14902. * compiler.
  14903. *
  14904. * Implement this adapter for your framework of choice to delegate updates to
  14905. * the component in your framework of choice. See architecture documentation
  14906. * for more details.
  14907. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  14908. *
  14909. * @record
  14910. */
  14911. var MDCMenuAdapter = function () {
  14912. function MDCMenuAdapter() {
  14913. _classCallCheck(this, MDCMenuAdapter);
  14914. }
  14915. _createClass(MDCMenuAdapter, [{
  14916. key: "addClassToElementAtIndex",
  14917. /**
  14918. * Adds a class to the element at the index provided.
  14919. * @param {number} index
  14920. * @param {string} className
  14921. */
  14922. value: function addClassToElementAtIndex(index, className) {}
  14923. /**
  14924. * Removes a class from the element at the index provided
  14925. * @param {number} index
  14926. * @param {string} className
  14927. */
  14928. }, {
  14929. key: "removeClassFromElementAtIndex",
  14930. value: function removeClassFromElementAtIndex(index, className) {}
  14931. /**
  14932. * Adds an attribute, with value, to the element at the index provided.
  14933. * @param {number} index
  14934. * @param {string} attr
  14935. * @param {string} value
  14936. */
  14937. }, {
  14938. key: "addAttributeToElementAtIndex",
  14939. value: function addAttributeToElementAtIndex(index, attr, value) {}
  14940. /**
  14941. * Removes an attribute from an element at the index provided.
  14942. * @param {number} index
  14943. * @param {string} attr
  14944. */
  14945. }, {
  14946. key: "removeAttributeFromElementAtIndex",
  14947. value: function removeAttributeFromElementAtIndex(index, attr) {}
  14948. /**
  14949. * Returns true if the element contains the className.
  14950. * @param {?HTMLElement} element
  14951. * @param {string} className
  14952. * @return {boolean} true if the element contains the className
  14953. */
  14954. }, {
  14955. key: "elementContainsClass",
  14956. value: function elementContainsClass(element, className) {}
  14957. /**
  14958. * Closes the menu-surface.
  14959. */
  14960. }, {
  14961. key: "closeSurface",
  14962. value: function closeSurface() {}
  14963. /**
  14964. * Returns the index for the element provided.
  14965. * @param {?HTMLElement} element
  14966. * @return {number} index of the element in the list or -1 if it is not in the list.
  14967. */
  14968. }, {
  14969. key: "getElementIndex",
  14970. value: function getElementIndex(element) {}
  14971. /**
  14972. * Returns the parentElement of the provided element.
  14973. * @param {?HTMLElement} element
  14974. * @return {?HTMLElement} parentElement of the element provided.
  14975. */
  14976. }, {
  14977. key: "getParentElement",
  14978. value: function getParentElement(element) {}
  14979. /**
  14980. * Returns the element within the selectionGroup containing the selected element class.
  14981. * @param {!HTMLElement} selectionGroup
  14982. * @return {number} element within the selectionGroup that contains the selected element class.
  14983. */
  14984. }, {
  14985. key: "getSelectedElementIndex",
  14986. value: function getSelectedElementIndex(selectionGroup) {}
  14987. /**
  14988. * Emits an event using the evtData.
  14989. * @param {{
  14990. * index: number
  14991. * }} evtData
  14992. */
  14993. }, {
  14994. key: "notifySelected",
  14995. value: function notifySelected(evtData) {}
  14996. }]);
  14997. return MDCMenuAdapter;
  14998. }();
  14999. /***/ }),
  15000. /* 111 */
  15001. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15002. "use strict";
  15003. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  15004. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTransformPropertyName", function() { return getTransformPropertyName; });
  15005. /**
  15006. * @license
  15007. * Copyright 2018 Google Inc.
  15008. *
  15009. * Permission is hereby granted, free of charge, to any person obtaining a copy
  15010. * of this software and associated documentation files (the "Software"), to deal
  15011. * in the Software without restriction, including without limitation the rights
  15012. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  15013. * copies of the Software, and to permit persons to whom the Software is
  15014. * furnished to do so, subject to the following conditions:
  15015. *
  15016. * The above copyright notice and this permission notice shall be included in
  15017. * all copies or substantial portions of the Software.
  15018. *
  15019. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15020. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15021. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15022. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  15023. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  15024. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  15025. * THE SOFTWARE.
  15026. */
  15027. /** @type {string|undefined} */
  15028. var storedTransformPropertyName_ = void 0;
  15029. /**
  15030. * Returns the name of the correct transform property to use on the current browser.
  15031. * @param {!Window} globalObj
  15032. * @param {boolean=} forceRefresh
  15033. * @return {string}
  15034. */
  15035. function getTransformPropertyName(globalObj) {
  15036. var forceRefresh = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  15037. if (storedTransformPropertyName_ === undefined || forceRefresh) {
  15038. var el = globalObj.document.createElement('div');
  15039. var transformPropertyName = 'transform' in el.style ? 'transform' : 'webkitTransform';
  15040. storedTransformPropertyName_ = transformPropertyName;
  15041. }
  15042. return storedTransformPropertyName_;
  15043. }
  15044. /***/ }),
  15045. /* 112 */
  15046. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15047. "use strict";
  15048. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  15049. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(46);
  15050. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(47);
  15051. 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; };
  15052. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  15053. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15054. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  15055. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  15056. /**
  15057. * @license
  15058. * Copyright 2017 Google Inc.
  15059. *
  15060. * Permission is hereby granted, free of charge, to any person obtaining a copy
  15061. * of this software and associated documentation files (the "Software"), to deal
  15062. * in the Software without restriction, including without limitation the rights
  15063. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  15064. * copies of the Software, and to permit persons to whom the Software is
  15065. * furnished to do so, subject to the following conditions:
  15066. *
  15067. * The above copyright notice and this permission notice shall be included in
  15068. * all copies or substantial portions of the Software.
  15069. *
  15070. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15071. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15072. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15073. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  15074. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  15075. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  15076. * THE SOFTWARE.
  15077. */
  15078. /**
  15079. * @extends {MDCFoundation<!MDCNotchedOutlineAdapter>}
  15080. * @final
  15081. */
  15082. var MDCNotchedOutlineFoundation = function (_MDCFoundation) {
  15083. _inherits(MDCNotchedOutlineFoundation, _MDCFoundation);
  15084. _createClass(MDCNotchedOutlineFoundation, null, [{
  15085. key: 'strings',
  15086. /** @return enum {string} */
  15087. get: function get() {
  15088. return __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */];
  15089. }
  15090. /** @return enum {string} */
  15091. }, {
  15092. key: 'cssClasses',
  15093. get: function get() {
  15094. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  15095. }
  15096. /** @return enum {number} */
  15097. }, {
  15098. key: 'numbers',
  15099. get: function get() {
  15100. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */];
  15101. }
  15102. /**
  15103. * {@see MDCNotchedOutlineAdapter} for typing information on parameters and return
  15104. * types.
  15105. * @return {!MDCNotchedOutlineAdapter}
  15106. */
  15107. }, {
  15108. key: 'defaultAdapter',
  15109. get: function get() {
  15110. return (/** @type {!MDCNotchedOutlineAdapter} */{
  15111. addClass: function addClass() {},
  15112. removeClass: function removeClass() {},
  15113. setNotchWidthProperty: function setNotchWidthProperty() {}
  15114. }
  15115. );
  15116. }
  15117. /**
  15118. * @param {!MDCNotchedOutlineAdapter} adapter
  15119. */
  15120. }]);
  15121. function MDCNotchedOutlineFoundation(adapter) {
  15122. _classCallCheck(this, MDCNotchedOutlineFoundation);
  15123. return _possibleConstructorReturn(this, (MDCNotchedOutlineFoundation.__proto__ || Object.getPrototypeOf(MDCNotchedOutlineFoundation)).call(this, _extends(MDCNotchedOutlineFoundation.defaultAdapter, adapter)));
  15124. }
  15125. /**
  15126. * Adds the outline notched selector and updates the notch width
  15127. * calculated based off of notchWidth.
  15128. * @param {number} notchWidth
  15129. */
  15130. _createClass(MDCNotchedOutlineFoundation, [{
  15131. key: 'notch',
  15132. value: function notch(notchWidth) {
  15133. var OUTLINE_NOTCHED = MDCNotchedOutlineFoundation.cssClasses.OUTLINE_NOTCHED;
  15134. if (notchWidth > 0) {
  15135. notchWidth += __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].NOTCH_ELEMENT_PADDING; // Add padding from left/right.
  15136. }
  15137. this.adapter_.setNotchWidthProperty(notchWidth);
  15138. this.adapter_.addClass(OUTLINE_NOTCHED);
  15139. }
  15140. /**
  15141. * Removes notched outline selector to close the notch in the outline.
  15142. */
  15143. }, {
  15144. key: 'closeNotch',
  15145. value: function closeNotch() {
  15146. var OUTLINE_NOTCHED = MDCNotchedOutlineFoundation.cssClasses.OUTLINE_NOTCHED;
  15147. this.adapter_.removeClass(OUTLINE_NOTCHED);
  15148. this.adapter_.setNotchWidthProperty(0);
  15149. }
  15150. }]);
  15151. return MDCNotchedOutlineFoundation;
  15152. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  15153. /* harmony default export */ __webpack_exports__["a"] = (MDCNotchedOutlineFoundation);
  15154. /***/ }),
  15155. /* 113 */
  15156. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15157. "use strict";
  15158. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  15159. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCRadio", function() { return MDCRadio; });
  15160. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  15161. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_selection_control_index__ = __webpack_require__(4);
  15162. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(114);
  15163. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_ripple_index__ = __webpack_require__(2);
  15164. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCRadioFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  15165. 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; };
  15166. 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); } };
  15167. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  15168. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15169. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  15170. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  15171. /**
  15172. * @license
  15173. * Copyright 2016 Google Inc.
  15174. *
  15175. * Permission is hereby granted, free of charge, to any person obtaining a copy
  15176. * of this software and associated documentation files (the "Software"), to deal
  15177. * in the Software without restriction, including without limitation the rights
  15178. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  15179. * copies of the Software, and to permit persons to whom the Software is
  15180. * furnished to do so, subject to the following conditions:
  15181. *
  15182. * The above copyright notice and this permission notice shall be included in
  15183. * all copies or substantial portions of the Software.
  15184. *
  15185. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15186. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15187. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15188. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  15189. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  15190. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  15191. * THE SOFTWARE.
  15192. */
  15193. /* eslint-disable no-unused-vars */
  15194. /* eslint-enable no-unused-vars */
  15195. /**
  15196. * @extends MDCComponent<!MDCRadioFoundation>
  15197. * @implements {MDCSelectionControl}
  15198. */
  15199. var MDCRadio = function (_MDCComponent) {
  15200. _inherits(MDCRadio, _MDCComponent);
  15201. _createClass(MDCRadio, [{
  15202. key: 'checked',
  15203. /** @return {boolean} */
  15204. get: function get() {
  15205. return this.nativeControl_.checked;
  15206. }
  15207. /** @param {boolean} checked */
  15208. ,
  15209. set: function set(checked) {
  15210. this.nativeControl_.checked = checked;
  15211. }
  15212. /** @return {boolean} */
  15213. }, {
  15214. key: 'disabled',
  15215. get: function get() {
  15216. return this.nativeControl_.disabled;
  15217. }
  15218. /** @param {boolean} disabled */
  15219. ,
  15220. set: function set(disabled) {
  15221. this.foundation_.setDisabled(disabled);
  15222. }
  15223. /** @return {?string} */
  15224. }, {
  15225. key: 'value',
  15226. get: function get() {
  15227. return this.nativeControl_.value;
  15228. }
  15229. /** @param {?string} value */
  15230. ,
  15231. set: function set(value) {
  15232. this.nativeControl_.value = value;
  15233. }
  15234. /** @return {!MDCRipple} */
  15235. }, {
  15236. key: 'ripple',
  15237. get: function get() {
  15238. return this.ripple_;
  15239. }
  15240. }], [{
  15241. key: 'attachTo',
  15242. value: function attachTo(root) {
  15243. return new MDCRadio(root);
  15244. }
  15245. }]);
  15246. function MDCRadio() {
  15247. var _ref;
  15248. _classCallCheck(this, MDCRadio);
  15249. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  15250. args[_key] = arguments[_key];
  15251. }
  15252. /** @private {!MDCRipple} */
  15253. var _this = _possibleConstructorReturn(this, (_ref = MDCRadio.__proto__ || Object.getPrototypeOf(MDCRadio)).call.apply(_ref, [this].concat(args)));
  15254. _this.ripple_ = _this.initRipple_();
  15255. return _this;
  15256. }
  15257. /**
  15258. * @return {!MDCRipple}
  15259. * @private
  15260. */
  15261. _createClass(MDCRadio, [{
  15262. key: 'initRipple_',
  15263. value: function initRipple_() {
  15264. var _this2 = this;
  15265. var adapter = _extends(__WEBPACK_IMPORTED_MODULE_3__material_ripple_index__["MDCRipple"].createAdapter(this), {
  15266. isUnbounded: function isUnbounded() {
  15267. return true;
  15268. },
  15269. // Radio buttons technically go "active" whenever there is *any* keyboard interaction. This is not the
  15270. // UI we desire.
  15271. isSurfaceActive: function isSurfaceActive() {
  15272. return false;
  15273. },
  15274. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  15275. return _this2.nativeControl_.addEventListener(type, handler);
  15276. },
  15277. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  15278. return _this2.nativeControl_.removeEventListener(type, handler);
  15279. }
  15280. });
  15281. var foundation = new __WEBPACK_IMPORTED_MODULE_3__material_ripple_index__["MDCRippleFoundation"](adapter);
  15282. return new __WEBPACK_IMPORTED_MODULE_3__material_ripple_index__["MDCRipple"](this.root_, foundation);
  15283. }
  15284. /**
  15285. * Returns the state of the native control element, or null if the native control element is not present.
  15286. * @return {?MDCSelectionControlState}
  15287. * @private
  15288. */
  15289. }, {
  15290. key: 'destroy',
  15291. value: function destroy() {
  15292. this.ripple_.destroy();
  15293. _get(MDCRadio.prototype.__proto__ || Object.getPrototypeOf(MDCRadio.prototype), 'destroy', this).call(this);
  15294. }
  15295. /** @return {!MDCRadioFoundation} */
  15296. }, {
  15297. key: 'getDefaultFoundation',
  15298. value: function getDefaultFoundation() {
  15299. var _this3 = this;
  15300. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]({
  15301. addClass: function addClass(className) {
  15302. return _this3.root_.classList.add(className);
  15303. },
  15304. removeClass: function removeClass(className) {
  15305. return _this3.root_.classList.remove(className);
  15306. },
  15307. setNativeControlDisabled: function setNativeControlDisabled(disabled) {
  15308. return _this3.nativeControl_.disabled = disabled;
  15309. }
  15310. });
  15311. }
  15312. }, {
  15313. key: 'nativeControl_',
  15314. get: function get() {
  15315. var NATIVE_CONTROL_SELECTOR = __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.NATIVE_CONTROL_SELECTOR;
  15316. var el = /** @type {?MDCSelectionControlState} */this.root_.querySelector(NATIVE_CONTROL_SELECTOR);
  15317. return el;
  15318. }
  15319. }]);
  15320. return MDCRadio;
  15321. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  15322. /***/ }),
  15323. /* 114 */
  15324. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15325. "use strict";
  15326. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  15327. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_selection_control_index__ = __webpack_require__(4);
  15328. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__adapter__ = __webpack_require__(115);
  15329. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(116);
  15330. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  15331. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15332. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  15333. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  15334. /**
  15335. * @license
  15336. * Copyright 2016 Google Inc.
  15337. *
  15338. * Permission is hereby granted, free of charge, to any person obtaining a copy
  15339. * of this software and associated documentation files (the "Software"), to deal
  15340. * in the Software without restriction, including without limitation the rights
  15341. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  15342. * copies of the Software, and to permit persons to whom the Software is
  15343. * furnished to do so, subject to the following conditions:
  15344. *
  15345. * The above copyright notice and this permission notice shall be included in
  15346. * all copies or substantial portions of the Software.
  15347. *
  15348. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15349. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15350. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15351. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  15352. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  15353. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  15354. * THE SOFTWARE.
  15355. */
  15356. /* eslint-disable no-unused-vars */
  15357. /* eslint-enable no-unused-vars */
  15358. /**
  15359. * @extends {MDCFoundation<!MDCRadioAdapter>}
  15360. */
  15361. var MDCRadioFoundation = function (_MDCFoundation) {
  15362. _inherits(MDCRadioFoundation, _MDCFoundation);
  15363. function MDCRadioFoundation() {
  15364. _classCallCheck(this, MDCRadioFoundation);
  15365. return _possibleConstructorReturn(this, (MDCRadioFoundation.__proto__ || Object.getPrototypeOf(MDCRadioFoundation)).apply(this, arguments));
  15366. }
  15367. _createClass(MDCRadioFoundation, [{
  15368. key: 'setDisabled',
  15369. /** @param {boolean} disabled */
  15370. value: function setDisabled(disabled) {
  15371. var DISABLED = MDCRadioFoundation.cssClasses.DISABLED;
  15372. this.adapter_.setNativeControlDisabled(disabled);
  15373. if (disabled) {
  15374. this.adapter_.addClass(DISABLED);
  15375. } else {
  15376. this.adapter_.removeClass(DISABLED);
  15377. }
  15378. }
  15379. }], [{
  15380. key: 'cssClasses',
  15381. /** @return enum {cssClasses} */
  15382. get: function get() {
  15383. return __WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */];
  15384. }
  15385. /** @return enum {strings} */
  15386. }, {
  15387. key: 'strings',
  15388. get: function get() {
  15389. return __WEBPACK_IMPORTED_MODULE_3__constants__["b" /* strings */];
  15390. }
  15391. /** @return {!MDCRadioAdapter} */
  15392. }, {
  15393. key: 'defaultAdapter',
  15394. get: function get() {
  15395. return (/** @type {!MDCRadioAdapter} */{
  15396. addClass: function addClass() /* className: string */{},
  15397. removeClass: function removeClass() /* className: string */{},
  15398. setNativeControlDisabled: function setNativeControlDisabled() /* disabled: boolean */{}
  15399. }
  15400. );
  15401. }
  15402. }]);
  15403. return MDCRadioFoundation;
  15404. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  15405. /* harmony default export */ __webpack_exports__["a"] = (MDCRadioFoundation);
  15406. /***/ }),
  15407. /* 115 */
  15408. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15409. "use strict";
  15410. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_selection_control_index__ = __webpack_require__(4);
  15411. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  15412. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15413. /**
  15414. * @license
  15415. * Copyright 2016 Google Inc.
  15416. *
  15417. * Permission is hereby granted, free of charge, to any person obtaining a copy
  15418. * of this software and associated documentation files (the "Software"), to deal
  15419. * in the Software without restriction, including without limitation the rights
  15420. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  15421. * copies of the Software, and to permit persons to whom the Software is
  15422. * furnished to do so, subject to the following conditions:
  15423. *
  15424. * The above copyright notice and this permission notice shall be included in
  15425. * all copies or substantial portions of the Software.
  15426. *
  15427. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15428. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15429. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15430. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  15431. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  15432. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  15433. * THE SOFTWARE.
  15434. */
  15435. /* eslint-disable no-unused-vars */
  15436. /* eslint no-unused-vars: [2, {"args": "none"}] */
  15437. /**
  15438. * Adapter for MDC Radio. Provides an interface for managing
  15439. * - classes
  15440. * - dom
  15441. *
  15442. * Additionally, provides type information for the adapter to the Closure
  15443. * compiler.
  15444. *
  15445. * Implement this adapter for your framework of choice to delegate updates to
  15446. * the component in your framework of choice. See architecture documentation
  15447. * for more details.
  15448. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  15449. *
  15450. * @record
  15451. */
  15452. var MDCRadioAdapter = function () {
  15453. function MDCRadioAdapter() {
  15454. _classCallCheck(this, MDCRadioAdapter);
  15455. }
  15456. _createClass(MDCRadioAdapter, [{
  15457. key: 'addClass',
  15458. /** @param {string} className */
  15459. value: function addClass(className) {}
  15460. /** @param {string} className */
  15461. }, {
  15462. key: 'removeClass',
  15463. value: function removeClass(className) {}
  15464. /** @param {boolean} disabled */
  15465. }, {
  15466. key: 'setNativeControlDisabled',
  15467. value: function setNativeControlDisabled(disabled) {}
  15468. }]);
  15469. return MDCRadioAdapter;
  15470. }();
  15471. /* unused harmony default export */ var _unused_webpack_default_export = (MDCRadioAdapter);
  15472. /***/ }),
  15473. /* 116 */
  15474. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15475. "use strict";
  15476. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  15477. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  15478. /**
  15479. * @license
  15480. * Copyright 2016 Google Inc.
  15481. *
  15482. * Permission is hereby granted, free of charge, to any person obtaining a copy
  15483. * of this software and associated documentation files (the "Software"), to deal
  15484. * in the Software without restriction, including without limitation the rights
  15485. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  15486. * copies of the Software, and to permit persons to whom the Software is
  15487. * furnished to do so, subject to the following conditions:
  15488. *
  15489. * The above copyright notice and this permission notice shall be included in
  15490. * all copies or substantial portions of the Software.
  15491. *
  15492. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15493. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15494. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15495. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  15496. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  15497. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  15498. * THE SOFTWARE.
  15499. */
  15500. /** @enum {string} */
  15501. var strings = {
  15502. NATIVE_CONTROL_SELECTOR: '.mdc-radio__native-control'
  15503. };
  15504. /** @enum {string} */
  15505. var cssClasses = {
  15506. ROOT: 'mdc-radio',
  15507. DISABLED: 'mdc-radio--disabled'
  15508. };
  15509. /***/ }),
  15510. /* 117 */
  15511. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  15512. "use strict";
  15513. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  15514. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSelect", function() { return MDCSelect; });
  15515. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(3);
  15516. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_floating_label_index__ = __webpack_require__(10);
  15517. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_line_ripple_index__ = __webpack_require__(18);
  15518. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_menu_index__ = __webpack_require__(43);
  15519. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_ripple_index__ = __webpack_require__(2);
  15520. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__material_notched_outline_index__ = __webpack_require__(22);
  15521. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__foundation__ = __webpack_require__(118);
  15522. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__constants__ = __webpack_require__(51);
  15523. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__adapter__ = __webpack_require__(48);
  15524. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__icon_index__ = __webpack_require__(23);
  15525. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__helper_text_index__ = __webpack_require__(24);
  15526. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__material_menu_surface_constants__ = __webpack_require__(21);
  15527. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__material_menu_constants__ = __webpack_require__(19);
  15528. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSelectFoundation", function() { return __WEBPACK_IMPORTED_MODULE_6__foundation__["a"]; });
  15529. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSelectHelperText", function() { return __WEBPACK_IMPORTED_MODULE_10__helper_text_index__["a"]; });
  15530. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSelectHelperTextFoundation", function() { return __WEBPACK_IMPORTED_MODULE_10__helper_text_index__["b"]; });
  15531. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSelectIcon", function() { return __WEBPACK_IMPORTED_MODULE_9__icon_index__["a"]; });
  15532. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSelectIconFoundation", function() { return __WEBPACK_IMPORTED_MODULE_9__icon_index__["b"]; });
  15533. 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; };
  15534. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  15535. 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); } };
  15536. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15537. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  15538. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  15539. /**
  15540. * @license
  15541. * Copyright 2016 Google Inc.
  15542. *
  15543. * Permission is hereby granted, free of charge, to any person obtaining a copy
  15544. * of this software and associated documentation files (the "Software"), to deal
  15545. * in the Software without restriction, including without limitation the rights
  15546. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  15547. * copies of the Software, and to permit persons to whom the Software is
  15548. * furnished to do so, subject to the following conditions:
  15549. *
  15550. * The above copyright notice and this permission notice shall be included in
  15551. * all copies or substantial portions of the Software.
  15552. *
  15553. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15554. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15555. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15556. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  15557. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  15558. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  15559. * THE SOFTWARE.
  15560. */
  15561. /* eslint-disable no-unused-vars */
  15562. /* eslint-enable no-unused-vars */
  15563. // Closure has issues with {this as that} syntax.
  15564. var VALIDATION_ATTR_WHITELIST = ['required', 'aria-required'];
  15565. /**
  15566. * @extends MDCComponent<!MDCSelectFoundation>
  15567. */
  15568. var MDCSelect = function (_MDCComponent) {
  15569. _inherits(MDCSelect, _MDCComponent);
  15570. /**
  15571. * @param {...?} args
  15572. */
  15573. function MDCSelect() {
  15574. var _ref;
  15575. _classCallCheck(this, MDCSelect);
  15576. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  15577. args[_key] = arguments[_key];
  15578. }
  15579. /** @private {?Element} */
  15580. var _this = _possibleConstructorReturn(this, (_ref = MDCSelect.__proto__ || Object.getPrototypeOf(MDCSelect)).call.apply(_ref, [this].concat(args)));
  15581. _this.nativeControl_;
  15582. /** @private {?Element} */
  15583. _this.selectedText_;
  15584. /** @private {?Element} */
  15585. _this.hiddenInput_;
  15586. /** @private {?MDCSelectIcon} */
  15587. _this.leadingIcon_;
  15588. /** @private {?MDCSelectHelperText} */
  15589. _this.helperText_;
  15590. /** @private {?Element} */
  15591. _this.menuElement_;
  15592. /** @type {?MDCMenu} */
  15593. _this.menu_;
  15594. /** @type {?MDCRipple} */
  15595. _this.ripple;
  15596. /** @private {?MDCLineRipple} */
  15597. _this.lineRipple_;
  15598. /** @private {?MDCFloatingLabel} */
  15599. _this.label_;
  15600. /** @private {?MDCNotchedOutline} */
  15601. _this.outline_;
  15602. /** @private {!Function} */
  15603. _this.handleChange_;
  15604. /** @private {!Function} */
  15605. _this.handleFocus_;
  15606. /** @private {!Function} */
  15607. _this.handleBlur_;
  15608. /** @private {!Function} */
  15609. _this.handleClick_;
  15610. /** @private {!Function} */
  15611. _this.handleKeydown_;
  15612. /** @private {!Function} */
  15613. _this.handleMenuOpened_;
  15614. /** @private {!Function} */
  15615. _this.handleMenuClosed_;
  15616. /** @private {!Function} */
  15617. _this.handleMenuSelected_;
  15618. /** @private {boolean} */
  15619. _this.menuOpened_ = false;
  15620. /** @private {!MutationObserver} */
  15621. _this.validationObserver_;
  15622. return _this;
  15623. }
  15624. /**
  15625. * @param {!Element} root
  15626. * @return {!MDCSelect}
  15627. */
  15628. _createClass(MDCSelect, [{
  15629. key: 'layout',
  15630. /**
  15631. * Recomputes the outline SVG path for the outline element.
  15632. */
  15633. value: function layout() {
  15634. this.foundation_.layout();
  15635. }
  15636. /**
  15637. * @param {(function(!Element): !MDCLineRipple)=} lineRippleFactory A function which creates a new MDCLineRipple.
  15638. * @param {(function(!Element): !MDCFloatingLabel)=} labelFactory A function which creates a new MDCFloatingLabel.
  15639. * @param {(function(!Element): !MDCNotchedOutline)=} outlineFactory A function which creates a new MDCNotchedOutline.
  15640. * @param {(function(!Element): !MDCMenu)=} menuFactory A function which creates a new MDCMenu.
  15641. * @param {(function(!Element): !MDCSelectIcon)=} iconFactory A function which creates a new MDCSelectIcon.
  15642. * @param {(function(!Element): !MDCSelectHelperText)=} helperTextFactory A function which creates a new
  15643. * MDCSelectHelperText.
  15644. */
  15645. }, {
  15646. key: 'initialize',
  15647. value: function initialize() {
  15648. var labelFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el) {
  15649. return new __WEBPACK_IMPORTED_MODULE_1__material_floating_label_index__["MDCFloatingLabel"](el);
  15650. };
  15651. var lineRippleFactory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (el) {
  15652. return new __WEBPACK_IMPORTED_MODULE_2__material_line_ripple_index__["MDCLineRipple"](el);
  15653. };
  15654. var outlineFactory = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function (el) {
  15655. return new __WEBPACK_IMPORTED_MODULE_5__material_notched_outline_index__["MDCNotchedOutline"](el);
  15656. };
  15657. var menuFactory = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : function (el) {
  15658. return new __WEBPACK_IMPORTED_MODULE_3__material_menu_index__["MDCMenu"](el);
  15659. };
  15660. var iconFactory = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : function (el) {
  15661. return new __WEBPACK_IMPORTED_MODULE_9__icon_index__["a" /* MDCSelectIcon */](el);
  15662. };
  15663. var helperTextFactory = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : function (el) {
  15664. return new __WEBPACK_IMPORTED_MODULE_10__helper_text_index__["a" /* MDCSelectHelperText */](el);
  15665. };
  15666. this.nativeControl_ = /** @type {HTMLElement} */this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].NATIVE_CONTROL_SELECTOR);
  15667. this.selectedText_ = /** @type {HTMLElement} */this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].SELECTED_TEXT_SELECTOR);
  15668. if (this.selectedText_) {
  15669. this.enhancedSelectSetup_(menuFactory);
  15670. }
  15671. var labelElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].LABEL_SELECTOR);
  15672. if (labelElement) {
  15673. this.label_ = labelFactory(labelElement);
  15674. }
  15675. var lineRippleElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].LINE_RIPPLE_SELECTOR);
  15676. if (lineRippleElement) {
  15677. this.lineRipple_ = lineRippleFactory(lineRippleElement);
  15678. }
  15679. var outlineElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].OUTLINE_SELECTOR);
  15680. if (outlineElement) {
  15681. this.outline_ = outlineFactory(outlineElement);
  15682. }
  15683. var leadingIcon = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].LEADING_ICON_SELECTOR);
  15684. if (leadingIcon) {
  15685. this.root_.classList.add(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].WITH_LEADING_ICON);
  15686. this.leadingIcon_ = iconFactory(leadingIcon);
  15687. if (this.menuElement_) {
  15688. this.menuElement_.classList.add(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].WITH_LEADING_ICON);
  15689. }
  15690. }
  15691. var element = this.nativeControl_ ? this.nativeControl_ : this.selectedText_;
  15692. if (element.hasAttribute(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].ARIA_CONTROLS)) {
  15693. var helperTextElement = document.getElementById(element.getAttribute(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].ARIA_CONTROLS));
  15694. if (helperTextElement) {
  15695. this.helperText_ = helperTextFactory(helperTextElement);
  15696. }
  15697. }
  15698. if (!this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].OUTLINED)) {
  15699. this.ripple = this.initRipple_();
  15700. }
  15701. // The required state needs to be sync'd before the mutation observer is added.
  15702. this.initialSyncRequiredState_();
  15703. this.addMutationObserverForRequired_();
  15704. }
  15705. /**
  15706. * Handles setup for the enhanced menu.
  15707. * @private
  15708. */
  15709. }, {
  15710. key: 'enhancedSelectSetup_',
  15711. value: function enhancedSelectSetup_(menuFactory) {
  15712. var isDisabled = this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].DISABLED);
  15713. this.selectedText_.setAttribute('tabindex', isDisabled ? '-1' : '0');
  15714. this.hiddenInput_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].HIDDEN_INPUT_SELECTOR);
  15715. this.menuElement_ = /** @type {HTMLElement} */this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].MENU_SELECTOR);
  15716. this.menu_ = menuFactory(this.menuElement_);
  15717. this.menu_.hoistMenuToBody();
  15718. this.menu_.setAnchorElement( /** @type {!HTMLElement} */this.root_);
  15719. this.menu_.setAnchorCorner(__WEBPACK_IMPORTED_MODULE_11__material_menu_surface_constants__["a" /* Corner */].BOTTOM_START);
  15720. this.menu_.wrapFocus = false;
  15721. }
  15722. /**
  15723. * @private
  15724. * @return {!MDCRipple}
  15725. */
  15726. }, {
  15727. key: 'initRipple_',
  15728. value: function initRipple_() {
  15729. var element = this.nativeControl_ ? this.nativeControl_ : this.selectedText_;
  15730. var adapter = _extends(__WEBPACK_IMPORTED_MODULE_4__material_ripple_index__["MDCRipple"].createAdapter(this), {
  15731. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  15732. return element.addEventListener(type, handler);
  15733. },
  15734. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  15735. return element.removeEventListener(type, handler);
  15736. }
  15737. });
  15738. var foundation = new __WEBPACK_IMPORTED_MODULE_4__material_ripple_index__["MDCRippleFoundation"](adapter);
  15739. return new __WEBPACK_IMPORTED_MODULE_4__material_ripple_index__["MDCRipple"](this.root_, foundation);
  15740. }
  15741. /**
  15742. * Initializes the select's event listeners and internal state based
  15743. * on the environment's state.
  15744. */
  15745. }, {
  15746. key: 'initialSyncWithDOM',
  15747. value: function initialSyncWithDOM() {
  15748. var _this2 = this;
  15749. this.handleChange_ = function () {
  15750. return _this2.foundation_.handleChange( /* didChange */true);
  15751. };
  15752. this.handleFocus_ = function () {
  15753. return _this2.foundation_.handleFocus();
  15754. };
  15755. this.handleBlur_ = function () {
  15756. return _this2.foundation_.handleBlur();
  15757. };
  15758. this.handleClick_ = function (evt) {
  15759. if (_this2.selectedText_) _this2.selectedText_.focus();
  15760. _this2.foundation_.handleClick(_this2.getNormalizedXCoordinate_(evt));
  15761. };
  15762. this.handleKeydown_ = function (evt) {
  15763. return _this2.foundation_.handleKeydown(evt);
  15764. };
  15765. this.handleMenuSelected_ = function (evtData) {
  15766. return _this2.selectedIndex = evtData.detail.index;
  15767. };
  15768. this.handleMenuOpened_ = function () {
  15769. // Menu should open to the last selected element.
  15770. if (_this2.selectedIndex >= 0) {
  15771. _this2.menu_.items[_this2.selectedIndex].focus();
  15772. }
  15773. };
  15774. this.handleMenuClosed_ = function () {
  15775. // menuOpened_ is used to track the state of the menu opening or closing since the menu.open function
  15776. // will return false if the menu is still closing and this method listens to the closed event which
  15777. // occurs after the menu is already closed.
  15778. _this2.menuOpened_ = false;
  15779. _this2.selectedText_.removeAttribute('aria-expanded');
  15780. if (document.activeElement !== _this2.selectedText_) {
  15781. _this2.foundation_.handleBlur();
  15782. }
  15783. };
  15784. var element = this.nativeControl_ ? this.nativeControl_ : this.selectedText_;
  15785. element.addEventListener('change', this.handleChange_);
  15786. element.addEventListener('focus', this.handleFocus_);
  15787. element.addEventListener('blur', this.handleBlur_);
  15788. ['mousedown', 'touchstart'].forEach(function (evtType) {
  15789. element.addEventListener(evtType, _this2.handleClick_);
  15790. });
  15791. if (this.menuElement_) {
  15792. this.selectedText_.addEventListener('keydown', this.handleKeydown_);
  15793. this.menu_.listen(__WEBPACK_IMPORTED_MODULE_11__material_menu_surface_constants__["e" /* strings */].CLOSED_EVENT, this.handleMenuClosed_);
  15794. this.menu_.listen(__WEBPACK_IMPORTED_MODULE_11__material_menu_surface_constants__["e" /* strings */].OPENED_EVENT, this.handleMenuOpened_);
  15795. this.menu_.listen(__WEBPACK_IMPORTED_MODULE_12__material_menu_constants__["b" /* strings */].SELECTED_EVENT, this.handleMenuSelected_);
  15796. if (this.hiddenInput_ && this.hiddenInput_.value) {
  15797. // If the hidden input already has a value, use it to restore the select's value.
  15798. // This can happen e.g. if the user goes back or (in some browsers) refreshes the page.
  15799. var enhancedAdapterMethods = this.getEnhancedSelectAdapterMethods_();
  15800. enhancedAdapterMethods.setValue(this.hiddenInput_.value);
  15801. } else if (this.menuElement_.querySelector(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].SELECTED_ITEM_SELECTOR)) {
  15802. // If an element is selected, the select should set the initial selected text.
  15803. var _enhancedAdapterMethods = this.getEnhancedSelectAdapterMethods_();
  15804. _enhancedAdapterMethods.setValue(_enhancedAdapterMethods.getValue());
  15805. }
  15806. }
  15807. // Initially sync floating label
  15808. this.foundation_.handleChange( /* didChange */false);
  15809. if (this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].DISABLED) || this.nativeControl_ && this.nativeControl_.disabled) {
  15810. this.disabled = true;
  15811. }
  15812. }
  15813. }, {
  15814. key: 'destroy',
  15815. value: function destroy() {
  15816. var _this3 = this;
  15817. var element = this.nativeControl_ ? this.nativeControl_ : this.selectedText_;
  15818. element.removeEventListener('change', this.handleChange_);
  15819. element.removeEventListener('focus', this.handleFocus_);
  15820. element.removeEventListener('blur', this.handleBlur_);
  15821. element.removeEventListener('keydown', this.handleKeydown_);
  15822. ['mousedown', 'touchstart'].forEach(function (evtType) {
  15823. element.removeEventListener(evtType, _this3.handleClick_);
  15824. });
  15825. if (this.menu_) {
  15826. this.menu_.unlisten(__WEBPACK_IMPORTED_MODULE_11__material_menu_surface_constants__["e" /* strings */].CLOSED_EVENT, this.handleMenuClosed_);
  15827. this.menu_.unlisten(__WEBPACK_IMPORTED_MODULE_11__material_menu_surface_constants__["e" /* strings */].OPENED_EVENT, this.handleMenuOpened_);
  15828. this.menu_.unlisten(__WEBPACK_IMPORTED_MODULE_12__material_menu_constants__["b" /* strings */].SELECTED_EVENT, this.handleMenuSelected_);
  15829. this.menu_.destroy();
  15830. }
  15831. if (this.ripple) {
  15832. this.ripple.destroy();
  15833. }
  15834. if (this.outline_) {
  15835. this.outline_.destroy();
  15836. }
  15837. if (this.leadingIcon_) {
  15838. this.leadingIcon_.destroy();
  15839. }
  15840. if (this.helperText_) {
  15841. this.helperText_.destroy();
  15842. }
  15843. if (this.validationObserver_) {
  15844. this.validationObserver_.disconnect();
  15845. }
  15846. _get(MDCSelect.prototype.__proto__ || Object.getPrototypeOf(MDCSelect.prototype), 'destroy', this).call(this);
  15847. }
  15848. /**
  15849. * @return {!MDCSelectFoundation}
  15850. */
  15851. }, {
  15852. key: 'getDefaultFoundation',
  15853. value: function getDefaultFoundation() {
  15854. return new __WEBPACK_IMPORTED_MODULE_6__foundation__["a" /* default */](
  15855. /** @type {!MDCSelectAdapter} */_extends(this.nativeControl_ ? this.getNativeSelectAdapterMethods_() : this.getEnhancedSelectAdapterMethods_(), this.getCommonAdapterMethods_(), this.getOutlineAdapterMethods_(), this.getLabelAdapterMethods_()), this.getFoundationMap_());
  15856. }
  15857. /**
  15858. * @return {!{
  15859. * getValue: function(): string,
  15860. * setValue: function(string): string,
  15861. * openMenu: function(): void,
  15862. * closeMenu: function(): void,
  15863. * isMenuOpen: function(): boolean,
  15864. * setSelectedIndex: function(number): void,
  15865. * setDisabled: function(boolean): void
  15866. * }}
  15867. * @private
  15868. */
  15869. }, {
  15870. key: 'getNativeSelectAdapterMethods_',
  15871. value: function getNativeSelectAdapterMethods_() {
  15872. var _this4 = this;
  15873. return {
  15874. getValue: function getValue() {
  15875. return _this4.nativeControl_.value;
  15876. },
  15877. setValue: function setValue(value) {
  15878. return _this4.nativeControl_.value = value;
  15879. },
  15880. openMenu: function openMenu() {},
  15881. closeMenu: function closeMenu() {},
  15882. isMenuOpen: function isMenuOpen() {
  15883. return false;
  15884. },
  15885. setSelectedIndex: function setSelectedIndex(index) {
  15886. _this4.nativeControl_.selectedIndex = index;
  15887. },
  15888. setDisabled: function setDisabled(isDisabled) {
  15889. return _this4.nativeControl_.disabled = isDisabled;
  15890. },
  15891. setValid: function setValid(isValid) {
  15892. 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);
  15893. },
  15894. checkValidity: function checkValidity() {
  15895. return _this4.nativeControl_.checkValidity();
  15896. }
  15897. };
  15898. }
  15899. /**
  15900. * @return {!{
  15901. * getValue: function(): string,
  15902. * setValue: function(string): string,
  15903. * openMenu: function(): void,
  15904. * closeMenu: function(): void,
  15905. * isMenuOpen: function(): boolean,
  15906. * setSelectedIndex: function(number): void,
  15907. * setDisabled: function(boolean): void
  15908. * }}
  15909. * @private
  15910. */
  15911. }, {
  15912. key: 'getEnhancedSelectAdapterMethods_',
  15913. value: function getEnhancedSelectAdapterMethods_() {
  15914. var _this5 = this;
  15915. return {
  15916. getValue: function getValue() {
  15917. var listItem = _this5.menuElement_.querySelector(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].SELECTED_ITEM_SELECTOR);
  15918. if (listItem && listItem.hasAttribute(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].ENHANCED_VALUE_ATTR)) {
  15919. return listItem.getAttribute(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].ENHANCED_VALUE_ATTR);
  15920. }
  15921. return '';
  15922. },
  15923. setValue: function setValue(value) {
  15924. var element =
  15925. /** @type {HTMLElement} */_this5.menuElement_.querySelector('[' + __WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].ENHANCED_VALUE_ATTR + '="' + value + '"]');
  15926. _this5.setEnhancedSelectedIndex_(element ? _this5.menu_.items.indexOf(element) : -1);
  15927. },
  15928. openMenu: function openMenu() {
  15929. if (_this5.menu_ && !_this5.menu_.open) {
  15930. _this5.menu_.open = true;
  15931. _this5.menuOpened_ = true;
  15932. _this5.selectedText_.setAttribute('aria-expanded', 'true');
  15933. }
  15934. },
  15935. closeMenu: function closeMenu() {
  15936. if (_this5.menu_ && _this5.menu_.open) {
  15937. _this5.menu_.open = false;
  15938. }
  15939. },
  15940. isMenuOpen: function isMenuOpen() {
  15941. return _this5.menu_ && _this5.menuOpened_;
  15942. },
  15943. setSelectedIndex: function setSelectedIndex(index) {
  15944. _this5.setEnhancedSelectedIndex_(index);
  15945. },
  15946. setDisabled: function setDisabled(isDisabled) {
  15947. _this5.selectedText_.setAttribute('tabindex', isDisabled ? '-1' : '0');
  15948. _this5.selectedText_.setAttribute('aria-disabled', isDisabled.toString());
  15949. if (_this5.hiddenInput_) {
  15950. _this5.hiddenInput_.disabled = isDisabled;
  15951. }
  15952. },
  15953. checkValidity: function checkValidity() {
  15954. var classList = _this5.root_.classList;
  15955. if (classList.contains(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].REQUIRED) && !classList.contains(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].DISABLED)) {
  15956. // See notes for required attribute under https://www.w3.org/TR/html52/sec-forms.html#the-select-element
  15957. // TL;DR: Invalid if no index is selected, or if the first index is selected and has an empty value.
  15958. return _this5.selectedIndex !== -1 && (_this5.selectedIndex !== 0 || _this5.value);
  15959. } else {
  15960. return true;
  15961. }
  15962. },
  15963. setValid: function setValid(isValid) {
  15964. _this5.selectedText_.setAttribute('aria-invalid', (!isValid).toString());
  15965. 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);
  15966. }
  15967. };
  15968. }
  15969. /**
  15970. * @return {!{
  15971. * addClass: function(string): void,
  15972. * removeClass: function(string): void,
  15973. * hasClass: function(string): void,
  15974. * setRippleCenter: function(number): void,
  15975. * activateBottomLine: function(): void,
  15976. * deactivateBottomLine: function(): void,
  15977. * notifyChange: function(string): void
  15978. * }}
  15979. * @private
  15980. */
  15981. }, {
  15982. key: 'getCommonAdapterMethods_',
  15983. value: function getCommonAdapterMethods_() {
  15984. var _this6 = this;
  15985. return {
  15986. addClass: function addClass(className) {
  15987. return _this6.root_.classList.add(className);
  15988. },
  15989. removeClass: function removeClass(className) {
  15990. return _this6.root_.classList.remove(className);
  15991. },
  15992. hasClass: function hasClass(className) {
  15993. return _this6.root_.classList.contains(className);
  15994. },
  15995. setRippleCenter: function setRippleCenter(normalizedX) {
  15996. return _this6.lineRipple_ && _this6.lineRipple_.setRippleCenter(normalizedX);
  15997. },
  15998. activateBottomLine: function activateBottomLine() {
  15999. return _this6.lineRipple_ && _this6.lineRipple_.activate();
  16000. },
  16001. deactivateBottomLine: function deactivateBottomLine() {
  16002. return _this6.lineRipple_ && _this6.lineRipple_.deactivate();
  16003. },
  16004. notifyChange: function notifyChange(value) {
  16005. var index = _this6.selectedIndex;
  16006. _this6.emit(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].CHANGE_EVENT, { value: value, index: index }, true /* shouldBubble */);
  16007. }
  16008. };
  16009. }
  16010. /**
  16011. * @return {!{
  16012. * hasOutline: function(): boolean,
  16013. * notchOutline: function(number, boolean): undefined,
  16014. * closeOutline: function(): undefined,
  16015. * }}
  16016. */
  16017. }, {
  16018. key: 'getOutlineAdapterMethods_',
  16019. value: function getOutlineAdapterMethods_() {
  16020. var _this7 = this;
  16021. return {
  16022. hasOutline: function hasOutline() {
  16023. return !!_this7.outline_;
  16024. },
  16025. notchOutline: function notchOutline(labelWidth) {
  16026. if (_this7.outline_) {
  16027. _this7.outline_.notch(labelWidth);
  16028. }
  16029. },
  16030. closeOutline: function closeOutline() {
  16031. if (_this7.outline_) {
  16032. _this7.outline_.closeNotch();
  16033. }
  16034. }
  16035. };
  16036. }
  16037. /**
  16038. * @return {!{
  16039. * floatLabel: function(boolean): undefined,
  16040. * getLabelWidth: function(): number,
  16041. * }}
  16042. */
  16043. }, {
  16044. key: 'getLabelAdapterMethods_',
  16045. value: function getLabelAdapterMethods_() {
  16046. var _this8 = this;
  16047. return {
  16048. floatLabel: function floatLabel(shouldFloat) {
  16049. if (_this8.label_) {
  16050. _this8.label_.float(shouldFloat);
  16051. }
  16052. },
  16053. getLabelWidth: function getLabelWidth() {
  16054. return _this8.label_ ? _this8.label_.getWidth() : 0;
  16055. }
  16056. };
  16057. }
  16058. /**
  16059. * Calculates where the line ripple should start based on the x coordinate within the component.
  16060. * @param {!(MouseEvent|TouchEvent)} evt
  16061. * @return {number} normalizedX
  16062. */
  16063. }, {
  16064. key: 'getNormalizedXCoordinate_',
  16065. value: function getNormalizedXCoordinate_(evt) {
  16066. var targetClientRect = evt.target.getBoundingClientRect();
  16067. var xCoordinate = evt.clientX;
  16068. return xCoordinate - targetClientRect.left;
  16069. }
  16070. /**
  16071. * Returns a map of all subcomponents to subfoundations.
  16072. * @return {!FoundationMapType}
  16073. */
  16074. }, {
  16075. key: 'getFoundationMap_',
  16076. value: function getFoundationMap_() {
  16077. return {
  16078. leadingIcon: this.leadingIcon_ ? this.leadingIcon_.foundation : undefined,
  16079. helperText: this.helperText_ ? this.helperText_.foundation : undefined
  16080. };
  16081. }
  16082. /**
  16083. * Sets the selected index of the enhanced menu.
  16084. * @param {number} index
  16085. * @private
  16086. */
  16087. }, {
  16088. key: 'setEnhancedSelectedIndex_',
  16089. value: function setEnhancedSelectedIndex_(index) {
  16090. var selectedItem = this.menu_.items[index];
  16091. this.selectedText_.textContent = selectedItem ? selectedItem.textContent.trim() : '';
  16092. var previouslySelected = this.menuElement_.querySelector(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].SELECTED_ITEM_SELECTOR);
  16093. if (previouslySelected) {
  16094. previouslySelected.classList.remove(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].SELECTED_ITEM_CLASS);
  16095. previouslySelected.removeAttribute(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].ARIA_SELECTED_ATTR);
  16096. }
  16097. if (selectedItem) {
  16098. selectedItem.classList.add(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].SELECTED_ITEM_CLASS);
  16099. selectedItem.setAttribute(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].ARIA_SELECTED_ATTR, 'true');
  16100. }
  16101. // Synchronize hidden input's value with data-value attribute of selected item.
  16102. // This code path is also followed when setting value directly, so this covers all cases.
  16103. if (this.hiddenInput_) {
  16104. this.hiddenInput_.value = selectedItem ? selectedItem.getAttribute(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].ENHANCED_VALUE_ATTR) || '' : '';
  16105. }
  16106. this.layout();
  16107. }
  16108. }, {
  16109. key: 'initialSyncRequiredState_',
  16110. value: function initialSyncRequiredState_() {
  16111. var element = this.nativeControl_ ? this.nativeControl_ : this.selectedText_;
  16112. var isRequired = element.required || element.getAttribute('aria-required') === 'true' || this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].REQUIRED);
  16113. if (isRequired) {
  16114. if (this.nativeControl_) {
  16115. this.nativeControl_.required = true;
  16116. } else {
  16117. this.selectedText_.setAttribute('aria-required', 'true');
  16118. }
  16119. this.root_.classList.add(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].REQUIRED);
  16120. }
  16121. }
  16122. }, {
  16123. key: 'addMutationObserverForRequired_',
  16124. value: function addMutationObserverForRequired_() {
  16125. var _this9 = this;
  16126. var observerHandler = function observerHandler(attributesList) {
  16127. attributesList.some(function (attributeName) {
  16128. if (VALIDATION_ATTR_WHITELIST.indexOf(attributeName) > -1) {
  16129. if (_this9.selectedText_) {
  16130. if (_this9.selectedText_.getAttribute('aria-required') === 'true') {
  16131. _this9.root_.classList.add(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].REQUIRED);
  16132. } else {
  16133. _this9.root_.classList.remove(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].REQUIRED);
  16134. }
  16135. } else {
  16136. if (_this9.nativeControl_.required) {
  16137. _this9.root_.classList.add(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].REQUIRED);
  16138. } else {
  16139. _this9.root_.classList.remove(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].REQUIRED);
  16140. }
  16141. }
  16142. return true;
  16143. }
  16144. });
  16145. };
  16146. var getAttributesList = function getAttributesList(mutationsList) {
  16147. return mutationsList.map(function (mutation) {
  16148. return mutation.attributeName;
  16149. });
  16150. };
  16151. var observer = new MutationObserver(function (mutationsList) {
  16152. return observerHandler(getAttributesList(mutationsList));
  16153. });
  16154. var element = this.nativeControl_ ? this.nativeControl_ : this.selectedText_;
  16155. observer.observe(element, { attributes: true });
  16156. this.validationObserver_ = observer;
  16157. }
  16158. }, {
  16159. key: 'value',
  16160. /**
  16161. * @return {string} The value of the select.
  16162. */
  16163. get: function get() {
  16164. return this.foundation_.getValue();
  16165. }
  16166. /**
  16167. * @param {string} value The value to set on the select.
  16168. */
  16169. ,
  16170. set: function set(value) {
  16171. this.foundation_.setValue(value);
  16172. }
  16173. /**
  16174. * @return {number} The selected index of the select.
  16175. */
  16176. }, {
  16177. key: 'selectedIndex',
  16178. get: function get() {
  16179. var selectedIndex = void 0;
  16180. if (this.menuElement_) {
  16181. var selectedEl = /** @type {!HTMLElement} */this.menuElement_.querySelector(__WEBPACK_IMPORTED_MODULE_7__constants__["c" /* strings */].SELECTED_ITEM_SELECTOR);
  16182. selectedIndex = this.menu_.items.indexOf(selectedEl);
  16183. } else {
  16184. selectedIndex = this.nativeControl_.selectedIndex;
  16185. }
  16186. return selectedIndex;
  16187. }
  16188. /**
  16189. * @param {number} selectedIndex The index of the option to be set on the select.
  16190. */
  16191. ,
  16192. set: function set(selectedIndex) {
  16193. this.foundation_.setSelectedIndex(selectedIndex);
  16194. }
  16195. /**
  16196. * @return {boolean} True if the select is disabled.
  16197. */
  16198. }, {
  16199. key: 'disabled',
  16200. get: function get() {
  16201. return this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_7__constants__["a" /* cssClasses */].DISABLED) || (this.nativeControl_ ? this.nativeControl_.disabled : false);
  16202. }
  16203. /**
  16204. * @param {boolean} disabled Sets the select disabled or enabled.
  16205. */
  16206. ,
  16207. set: function set(disabled) {
  16208. this.foundation_.setDisabled(disabled);
  16209. }
  16210. /**
  16211. * Sets the aria label of the leading icon.
  16212. * @param {string} label
  16213. */
  16214. }, {
  16215. key: 'leadingIconAriaLabel',
  16216. set: function set(label) {
  16217. this.foundation_.setLeadingIconAriaLabel(label);
  16218. }
  16219. /**
  16220. * Sets the text content of the leading icon.
  16221. * @param {string} content
  16222. */
  16223. }, {
  16224. key: 'leadingIconContent',
  16225. set: function set(content) {
  16226. this.foundation_.setLeadingIconContent(content);
  16227. }
  16228. /**
  16229. * Sets the text content of the helper text.
  16230. * @param {string} content
  16231. */
  16232. }, {
  16233. key: 'helperTextContent',
  16234. set: function set(content) {
  16235. this.foundation_.setHelperTextContent(content);
  16236. }
  16237. /**
  16238. * Sets the current invalid state of the select.
  16239. * @param {boolean} isValid
  16240. */
  16241. }, {
  16242. key: 'valid',
  16243. set: function set(isValid) {
  16244. this.foundation_.setValid(isValid);
  16245. }
  16246. /**
  16247. * Checks if the select is in a valid state.
  16248. * @return {boolean}
  16249. */
  16250. ,
  16251. get: function get() {
  16252. return this.foundation_.isValid();
  16253. }
  16254. /**
  16255. * Sets the control to the required state.
  16256. * @param {boolean} isRequired
  16257. */
  16258. }, {
  16259. key: 'required',
  16260. set: function set(isRequired) {
  16261. if (this.nativeControl_) {
  16262. this.nativeControl_.required = isRequired;
  16263. } else {
  16264. if (isRequired) {
  16265. this.selectedText_.setAttribute('aria-required', isRequired.toString());
  16266. } else {
  16267. this.selectedText_.removeAttribute('aria-required');
  16268. }
  16269. }
  16270. }
  16271. /**
  16272. * Returns whether the select is required.
  16273. * @return {boolean}
  16274. */
  16275. ,
  16276. get: function get() {
  16277. if (this.nativeControl_) {
  16278. return this.nativeControl_.required;
  16279. } else {
  16280. return this.selectedText_.getAttribute('aria-required') === 'true';
  16281. }
  16282. }
  16283. }], [{
  16284. key: 'attachTo',
  16285. value: function attachTo(root) {
  16286. return new MDCSelect(root);
  16287. }
  16288. }]);
  16289. return MDCSelect;
  16290. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCComponent"]);
  16291. /***/ }),
  16292. /* 118 */
  16293. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16294. "use strict";
  16295. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(3);
  16296. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(48);
  16297. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__icon_index__ = __webpack_require__(23);
  16298. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__helper_text_index__ = __webpack_require__(24);
  16299. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__constants__ = __webpack_require__(51);
  16300. 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; };
  16301. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  16302. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16303. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  16304. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  16305. /**
  16306. * @license
  16307. * Copyright 2016 Google Inc.
  16308. *
  16309. * Permission is hereby granted, free of charge, to any person obtaining a copy
  16310. * of this software and associated documentation files (the "Software"), to deal
  16311. * in the Software without restriction, including without limitation the rights
  16312. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  16313. * copies of the Software, and to permit persons to whom the Software is
  16314. * furnished to do so, subject to the following conditions:
  16315. *
  16316. * The above copyright notice and this permission notice shall be included in
  16317. * all copies or substantial portions of the Software.
  16318. *
  16319. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16320. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16321. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16322. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16323. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  16324. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  16325. * THE SOFTWARE.
  16326. */
  16327. /* eslint-disable no-unused-vars */
  16328. /* eslint-enable no-unused-vars */
  16329. /**
  16330. * @extends {MDCFoundation<!MDCSelectAdapter>}
  16331. * @final
  16332. */
  16333. var MDCSelectFoundation = function (_MDCFoundation) {
  16334. _inherits(MDCSelectFoundation, _MDCFoundation);
  16335. _createClass(MDCSelectFoundation, null, [{
  16336. key: 'cssClasses',
  16337. /** @return enum {string} */
  16338. get: function get() {
  16339. return __WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */];
  16340. }
  16341. /** @return enum {number} */
  16342. }, {
  16343. key: 'numbers',
  16344. get: function get() {
  16345. return __WEBPACK_IMPORTED_MODULE_4__constants__["b" /* numbers */];
  16346. }
  16347. /** @return enum {string} */
  16348. }, {
  16349. key: 'strings',
  16350. get: function get() {
  16351. return __WEBPACK_IMPORTED_MODULE_4__constants__["c" /* strings */];
  16352. }
  16353. /**
  16354. * {@see MDCSelectAdapter} for typing information on parameters and return
  16355. * types.
  16356. * @return {!MDCSelectAdapter}
  16357. */
  16358. }, {
  16359. key: 'defaultAdapter',
  16360. get: function get() {
  16361. return (/** @type {!MDCSelectAdapter} */{
  16362. addClass: function addClass() /* className: string */{},
  16363. removeClass: function removeClass() /* className: string */{},
  16364. hasClass: function hasClass() {
  16365. return (/* className: string */false
  16366. );
  16367. },
  16368. activateBottomLine: function activateBottomLine() {},
  16369. deactivateBottomLine: function deactivateBottomLine() {},
  16370. setValue: function setValue() {},
  16371. getValue: function getValue() {},
  16372. floatLabel: function floatLabel() /* value: boolean */{},
  16373. getLabelWidth: function getLabelWidth() {},
  16374. hasOutline: function hasOutline() {
  16375. return false;
  16376. },
  16377. notchOutline: function notchOutline() /* labelWidth: number, */{},
  16378. closeOutline: function closeOutline() {},
  16379. openMenu: function openMenu() {},
  16380. closeMenu: function closeMenu() {},
  16381. isMenuOpen: function isMenuOpen() {},
  16382. setSelectedIndex: function setSelectedIndex() {},
  16383. setDisabled: function setDisabled() {},
  16384. setRippleCenter: function setRippleCenter() {},
  16385. notifyChange: function notifyChange() {},
  16386. checkValidity: function checkValidity() {},
  16387. setValid: function setValid() {}
  16388. }
  16389. );
  16390. }
  16391. /**
  16392. * @param {!MDCSelectAdapter} adapter
  16393. * @param {!FoundationMapType=} foundationMap Map from subcomponent names to their subfoundations.
  16394. */
  16395. }]);
  16396. function MDCSelectFoundation(adapter) {
  16397. var foundationMap = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : /** @type {!FoundationMapType} */{};
  16398. _classCallCheck(this, MDCSelectFoundation);
  16399. /** @type {!MDCSelectIconFoundation|undefined} */
  16400. var _this = _possibleConstructorReturn(this, (MDCSelectFoundation.__proto__ || Object.getPrototypeOf(MDCSelectFoundation)).call(this, _extends(MDCSelectFoundation.defaultAdapter, adapter)));
  16401. _this.leadingIcon_ = foundationMap.leadingIcon;
  16402. /** @type {!MDCSelectHelperTextFoundation|undefined} */
  16403. _this.helperText_ = foundationMap.helperText;
  16404. return _this;
  16405. }
  16406. _createClass(MDCSelectFoundation, [{
  16407. key: 'setSelectedIndex',
  16408. value: function setSelectedIndex(index) {
  16409. this.adapter_.setSelectedIndex(index);
  16410. this.adapter_.closeMenu();
  16411. var didChange = true;
  16412. this.handleChange(didChange);
  16413. }
  16414. }, {
  16415. key: 'setValue',
  16416. value: function setValue(value) {
  16417. this.adapter_.setValue(value);
  16418. var didChange = true;
  16419. this.handleChange(didChange);
  16420. }
  16421. }, {
  16422. key: 'getValue',
  16423. value: function getValue() {
  16424. return this.adapter_.getValue();
  16425. }
  16426. }, {
  16427. key: 'setDisabled',
  16428. value: function setDisabled(isDisabled) {
  16429. isDisabled ? this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].DISABLED) : this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].DISABLED);
  16430. this.adapter_.setDisabled(isDisabled);
  16431. this.adapter_.closeMenu();
  16432. if (this.leadingIcon_) {
  16433. this.leadingIcon_.setDisabled(isDisabled);
  16434. }
  16435. }
  16436. /**
  16437. * @param {string} content Sets the content of the helper text.
  16438. */
  16439. }, {
  16440. key: 'setHelperTextContent',
  16441. value: function setHelperTextContent(content) {
  16442. if (this.helperText_) {
  16443. this.helperText_.setContent(content);
  16444. }
  16445. }
  16446. }, {
  16447. key: 'layout',
  16448. value: function layout() {
  16449. var openNotch = this.getValue().length > 0;
  16450. this.notchOutline(openNotch);
  16451. }
  16452. /**
  16453. * Handles value changes, via change event or programmatic updates.
  16454. */
  16455. }, {
  16456. key: 'handleChange',
  16457. value: function handleChange() {
  16458. var didChange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
  16459. var value = this.getValue();
  16460. var optionHasValue = value.length > 0;
  16461. var isRequired = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].REQUIRED);
  16462. this.notchOutline(optionHasValue);
  16463. if (!this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].FOCUSED)) {
  16464. this.adapter_.floatLabel(optionHasValue);
  16465. }
  16466. if (didChange) {
  16467. this.adapter_.notifyChange(value);
  16468. if (isRequired) {
  16469. this.setValid(this.isValid());
  16470. if (this.helperText_) {
  16471. this.helperText_.setValidity(this.isValid());
  16472. }
  16473. }
  16474. }
  16475. }
  16476. /**
  16477. * Handles focus events from select element.
  16478. */
  16479. }, {
  16480. key: 'handleFocus',
  16481. value: function handleFocus() {
  16482. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].FOCUSED);
  16483. this.adapter_.floatLabel(true);
  16484. this.notchOutline(true);
  16485. this.adapter_.activateBottomLine();
  16486. if (this.helperText_) {
  16487. this.helperText_.showToScreenReader();
  16488. }
  16489. }
  16490. /**
  16491. * Handles blur events from select element.
  16492. */
  16493. }, {
  16494. key: 'handleBlur',
  16495. value: function handleBlur() {
  16496. if (this.adapter_.isMenuOpen()) return;
  16497. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].FOCUSED);
  16498. this.handleChange(false);
  16499. this.adapter_.deactivateBottomLine();
  16500. var isRequired = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].REQUIRED);
  16501. if (isRequired) {
  16502. this.setValid(this.isValid());
  16503. if (this.helperText_) {
  16504. this.helperText_.setValidity(this.isValid());
  16505. }
  16506. }
  16507. }
  16508. }, {
  16509. key: 'handleClick',
  16510. value: function handleClick(normalizedX) {
  16511. if (this.adapter_.isMenuOpen()) return;
  16512. this.adapter_.setRippleCenter(normalizedX);
  16513. this.adapter_.openMenu();
  16514. }
  16515. }, {
  16516. key: 'handleKeydown',
  16517. value: function handleKeydown(event) {
  16518. if (this.adapter_.isMenuOpen()) return;
  16519. var isEnter = event.key === 'Enter' || event.keyCode === 13;
  16520. var isSpace = event.key === 'Space' || event.keyCode === 32;
  16521. var arrowUp = event.key === 'ArrowUp' || event.keyCode === 38;
  16522. var arrowDown = event.key === 'ArrowDown' || event.keyCode === 40;
  16523. if (this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].FOCUSED) && (isEnter || isSpace || arrowUp || arrowDown)) {
  16524. this.adapter_.openMenu();
  16525. event.preventDefault();
  16526. }
  16527. }
  16528. /**
  16529. * Opens/closes the notched outline.
  16530. * @param {boolean} openNotch
  16531. */
  16532. }, {
  16533. key: 'notchOutline',
  16534. value: function notchOutline(openNotch) {
  16535. if (!this.adapter_.hasOutline()) {
  16536. return;
  16537. }
  16538. var isFocused = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */].FOCUSED);
  16539. if (openNotch) {
  16540. var labelScale = __WEBPACK_IMPORTED_MODULE_4__constants__["b" /* numbers */].LABEL_SCALE;
  16541. var labelWidth = this.adapter_.getLabelWidth() * labelScale;
  16542. this.adapter_.notchOutline(labelWidth);
  16543. } else if (!isFocused) {
  16544. this.adapter_.closeOutline();
  16545. }
  16546. }
  16547. /**
  16548. * Sets the aria label of the leading icon.
  16549. * @param {string} label
  16550. */
  16551. }, {
  16552. key: 'setLeadingIconAriaLabel',
  16553. value: function setLeadingIconAriaLabel(label) {
  16554. if (this.leadingIcon_) {
  16555. this.leadingIcon_.setAriaLabel(label);
  16556. }
  16557. }
  16558. /**
  16559. * Sets the text content of the leading icon.
  16560. * @param {string} content
  16561. */
  16562. }, {
  16563. key: 'setLeadingIconContent',
  16564. value: function setLeadingIconContent(content) {
  16565. if (this.leadingIcon_) {
  16566. this.leadingIcon_.setContent(content);
  16567. }
  16568. }
  16569. }, {
  16570. key: 'setValid',
  16571. value: function setValid(isValid) {
  16572. this.adapter_.setValid(isValid);
  16573. }
  16574. }, {
  16575. key: 'isValid',
  16576. value: function isValid() {
  16577. return this.adapter_.checkValidity();
  16578. }
  16579. }]);
  16580. return MDCSelectFoundation;
  16581. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCFoundation"]);
  16582. /* harmony default export */ __webpack_exports__["a"] = (MDCSelectFoundation);
  16583. /***/ }),
  16584. /* 119 */
  16585. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16586. "use strict";
  16587. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  16588. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(49);
  16589. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(120);
  16590. 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; };
  16591. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  16592. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16593. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  16594. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  16595. /**
  16596. * @license
  16597. * Copyright 2018 Google Inc.
  16598. *
  16599. * Permission is hereby granted, free of charge, to any person obtaining a copy
  16600. * of this software and associated documentation files (the "Software"), to deal
  16601. * in the Software without restriction, including without limitation the rights
  16602. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  16603. * copies of the Software, and to permit persons to whom the Software is
  16604. * furnished to do so, subject to the following conditions:
  16605. *
  16606. * The above copyright notice and this permission notice shall be included in
  16607. * all copies or substantial portions of the Software.
  16608. *
  16609. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16610. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16611. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16612. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16613. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  16614. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  16615. * THE SOFTWARE.
  16616. */
  16617. /**
  16618. * @extends {MDCFoundation<!MDCSelectIconAdapter>}
  16619. * @final
  16620. */
  16621. var MDCSelectIconFoundation = function (_MDCFoundation) {
  16622. _inherits(MDCSelectIconFoundation, _MDCFoundation);
  16623. _createClass(MDCSelectIconFoundation, null, [{
  16624. key: 'strings',
  16625. /** @return enum {string} */
  16626. get: function get() {
  16627. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* strings */];
  16628. }
  16629. /**
  16630. * {@see MDCSelectIconAdapter} for typing information on parameters and return
  16631. * types.
  16632. * @return {!MDCSelectIconAdapter}
  16633. */
  16634. }, {
  16635. key: 'defaultAdapter',
  16636. get: function get() {
  16637. return (/** @type {!MDCSelectIconAdapter} */{
  16638. getAttr: function getAttr() {},
  16639. setAttr: function setAttr() {},
  16640. removeAttr: function removeAttr() {},
  16641. setContent: function setContent() {},
  16642. registerInteractionHandler: function registerInteractionHandler() {},
  16643. deregisterInteractionHandler: function deregisterInteractionHandler() {},
  16644. notifyIconAction: function notifyIconAction() {}
  16645. }
  16646. );
  16647. }
  16648. /**
  16649. * @param {!MDCSelectIconAdapter} adapter
  16650. */
  16651. }]);
  16652. function MDCSelectIconFoundation(adapter) {
  16653. _classCallCheck(this, MDCSelectIconFoundation);
  16654. /** @private {string?} */
  16655. var _this = _possibleConstructorReturn(this, (MDCSelectIconFoundation.__proto__ || Object.getPrototypeOf(MDCSelectIconFoundation)).call(this, _extends(MDCSelectIconFoundation.defaultAdapter, adapter)));
  16656. _this.savedTabIndex_ = null;
  16657. /** @private {function(!Event): undefined} */
  16658. _this.interactionHandler_ = function (evt) {
  16659. return _this.handleInteraction(evt);
  16660. };
  16661. return _this;
  16662. }
  16663. _createClass(MDCSelectIconFoundation, [{
  16664. key: 'init',
  16665. value: function init() {
  16666. var _this2 = this;
  16667. this.savedTabIndex_ = this.adapter_.getAttr('tabindex');
  16668. ['click', 'keydown'].forEach(function (evtType) {
  16669. _this2.adapter_.registerInteractionHandler(evtType, _this2.interactionHandler_);
  16670. });
  16671. }
  16672. }, {
  16673. key: 'destroy',
  16674. value: function destroy() {
  16675. var _this3 = this;
  16676. ['click', 'keydown'].forEach(function (evtType) {
  16677. _this3.adapter_.deregisterInteractionHandler(evtType, _this3.interactionHandler_);
  16678. });
  16679. }
  16680. /** @param {boolean} disabled */
  16681. }, {
  16682. key: 'setDisabled',
  16683. value: function setDisabled(disabled) {
  16684. if (!this.savedTabIndex_) {
  16685. return;
  16686. }
  16687. if (disabled) {
  16688. this.adapter_.setAttr('tabindex', '-1');
  16689. this.adapter_.removeAttr('role');
  16690. } else {
  16691. this.adapter_.setAttr('tabindex', this.savedTabIndex_);
  16692. this.adapter_.setAttr('role', __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* strings */].ICON_ROLE);
  16693. }
  16694. }
  16695. /** @param {string} label */
  16696. }, {
  16697. key: 'setAriaLabel',
  16698. value: function setAriaLabel(label) {
  16699. this.adapter_.setAttr('aria-label', label);
  16700. }
  16701. /** @param {string} content */
  16702. }, {
  16703. key: 'setContent',
  16704. value: function setContent(content) {
  16705. this.adapter_.setContent(content);
  16706. }
  16707. /**
  16708. * Handles an interaction event
  16709. * @param {!Event} evt
  16710. */
  16711. }, {
  16712. key: 'handleInteraction',
  16713. value: function handleInteraction(evt) {
  16714. if (evt.type === 'click' || evt.key === 'Enter' || evt.keyCode === 13) {
  16715. this.adapter_.notifyIconAction();
  16716. }
  16717. }
  16718. }]);
  16719. return MDCSelectIconFoundation;
  16720. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  16721. /* harmony default export */ __webpack_exports__["a"] = (MDCSelectIconFoundation);
  16722. /***/ }),
  16723. /* 120 */
  16724. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16725. "use strict";
  16726. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return strings; });
  16727. /**
  16728. * @license
  16729. * Copyright 2018 Google Inc.
  16730. *
  16731. * Permission is hereby granted, free of charge, to any person obtaining a copy
  16732. * of this software and associated documentation files (the "Software"), to deal
  16733. * in the Software without restriction, including without limitation the rights
  16734. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  16735. * copies of the Software, and to permit persons to whom the Software is
  16736. * furnished to do so, subject to the following conditions:
  16737. *
  16738. * The above copyright notice and this permission notice shall be included in
  16739. * all copies or substantial portions of the Software.
  16740. *
  16741. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16742. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16743. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16744. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16745. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  16746. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  16747. * THE SOFTWARE.
  16748. */
  16749. /** @enum {string} */
  16750. var strings = {
  16751. ICON_EVENT: 'MDCSelect:icon',
  16752. ICON_ROLE: 'button'
  16753. };
  16754. /***/ }),
  16755. /* 121 */
  16756. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16757. "use strict";
  16758. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  16759. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(50);
  16760. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(122);
  16761. 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; };
  16762. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  16763. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16764. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  16765. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  16766. /**
  16767. * @license
  16768. * Copyright 2018 Google Inc.
  16769. *
  16770. * Permission is hereby granted, free of charge, to any person obtaining a copy
  16771. * of this software and associated documentation files (the "Software"), to deal
  16772. * in the Software without restriction, including without limitation the rights
  16773. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  16774. * copies of the Software, and to permit persons to whom the Software is
  16775. * furnished to do so, subject to the following conditions:
  16776. *
  16777. * The above copyright notice and this permission notice shall be included in
  16778. * all copies or substantial portions of the Software.
  16779. *
  16780. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16781. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16782. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16783. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16784. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  16785. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  16786. * THE SOFTWARE.
  16787. */
  16788. /**
  16789. * @extends {MDCFoundation<!MDCSelectHelperTextAdapter>}
  16790. * @final
  16791. */
  16792. var MDCSelectHelperTextFoundation = function (_MDCFoundation) {
  16793. _inherits(MDCSelectHelperTextFoundation, _MDCFoundation);
  16794. _createClass(MDCSelectHelperTextFoundation, null, [{
  16795. key: 'cssClasses',
  16796. /** @return enum {string} */
  16797. get: function get() {
  16798. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  16799. }
  16800. /** @return enum {string} */
  16801. }, {
  16802. key: 'strings',
  16803. get: function get() {
  16804. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  16805. }
  16806. /**
  16807. * {@see MDCSelectHelperTextAdapter} for typing information on parameters and return
  16808. * types.
  16809. * @return {!MDCSelectHelperTextAdapter}
  16810. */
  16811. }, {
  16812. key: 'defaultAdapter',
  16813. get: function get() {
  16814. return (/** @type {!MDCSelectHelperTextAdapter} */{
  16815. addClass: function addClass() {},
  16816. removeClass: function removeClass() {},
  16817. hasClass: function hasClass() {},
  16818. setAttr: function setAttr() {},
  16819. removeAttr: function removeAttr() {},
  16820. setContent: function setContent() {}
  16821. }
  16822. );
  16823. }
  16824. /**
  16825. * @param {!MDCSelectHelperTextAdapter} adapter
  16826. */
  16827. }]);
  16828. function MDCSelectHelperTextFoundation(adapter) {
  16829. _classCallCheck(this, MDCSelectHelperTextFoundation);
  16830. return _possibleConstructorReturn(this, (MDCSelectHelperTextFoundation.__proto__ || Object.getPrototypeOf(MDCSelectHelperTextFoundation)).call(this, _extends(MDCSelectHelperTextFoundation.defaultAdapter, adapter)));
  16831. }
  16832. /**
  16833. * Sets the content of the helper text field.
  16834. * @param {string} content
  16835. */
  16836. _createClass(MDCSelectHelperTextFoundation, [{
  16837. key: 'setContent',
  16838. value: function setContent(content) {
  16839. this.adapter_.setContent(content);
  16840. }
  16841. /** @param {boolean} isPersistent Sets the persistency of the helper text. */
  16842. }, {
  16843. key: 'setPersistent',
  16844. value: function setPersistent(isPersistent) {
  16845. if (isPersistent) {
  16846. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_PERSISTENT);
  16847. } else {
  16848. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_PERSISTENT);
  16849. }
  16850. }
  16851. /**
  16852. * @param {boolean} isValidation True to make the helper text act as an
  16853. * error validation message.
  16854. */
  16855. }, {
  16856. key: 'setValidation',
  16857. value: function setValidation(isValidation) {
  16858. if (isValidation) {
  16859. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_VALIDATION_MSG);
  16860. } else {
  16861. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_VALIDATION_MSG);
  16862. }
  16863. }
  16864. /** Makes the helper text visible to the screen reader. */
  16865. }, {
  16866. key: 'showToScreenReader',
  16867. value: function showToScreenReader() {
  16868. this.adapter_.removeAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_HIDDEN);
  16869. }
  16870. /**
  16871. * Sets the validity of the helper text based on the select validity.
  16872. * @param {boolean} selectIsValid
  16873. */
  16874. }, {
  16875. key: 'setValidity',
  16876. value: function setValidity(selectIsValid) {
  16877. var helperTextIsPersistent = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_PERSISTENT);
  16878. var helperTextIsValidationMsg = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_VALIDATION_MSG);
  16879. var validationMsgNeedsDisplay = helperTextIsValidationMsg && !selectIsValid;
  16880. if (validationMsgNeedsDisplay) {
  16881. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ROLE, 'alert');
  16882. } else {
  16883. this.adapter_.removeAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ROLE);
  16884. }
  16885. if (!helperTextIsPersistent && !validationMsgNeedsDisplay) {
  16886. this.hide_();
  16887. }
  16888. }
  16889. /**
  16890. * Hides the help text from screen readers.
  16891. * @private
  16892. */
  16893. }, {
  16894. key: 'hide_',
  16895. value: function hide_() {
  16896. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_HIDDEN, 'true');
  16897. }
  16898. }]);
  16899. return MDCSelectHelperTextFoundation;
  16900. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  16901. /* harmony default export */ __webpack_exports__["a"] = (MDCSelectHelperTextFoundation);
  16902. /***/ }),
  16903. /* 122 */
  16904. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16905. "use strict";
  16906. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  16907. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  16908. /**
  16909. * @license
  16910. * Copyright 2018 Google Inc.
  16911. *
  16912. * Permission is hereby granted, free of charge, to any person obtaining a copy
  16913. * of this software and associated documentation files (the "Software"), to deal
  16914. * in the Software without restriction, including without limitation the rights
  16915. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  16916. * copies of the Software, and to permit persons to whom the Software is
  16917. * furnished to do so, subject to the following conditions:
  16918. *
  16919. * The above copyright notice and this permission notice shall be included in
  16920. * all copies or substantial portions of the Software.
  16921. *
  16922. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16923. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16924. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16925. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16926. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  16927. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  16928. * THE SOFTWARE.
  16929. */
  16930. /** @enum {string} */
  16931. var strings = {
  16932. ARIA_HIDDEN: 'aria-hidden',
  16933. ROLE: 'role'
  16934. };
  16935. /** @enum {string} */
  16936. var cssClasses = {
  16937. HELPER_TEXT_PERSISTENT: 'mdc-select-helper-text--persistent',
  16938. HELPER_TEXT_VALIDATION_MSG: 'mdc-select-helper-text--validation-msg'
  16939. };
  16940. /***/ }),
  16941. /* 123 */
  16942. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  16943. "use strict";
  16944. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  16945. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSlider", function() { return MDCSlider; });
  16946. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  16947. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(52);
  16948. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__adapter__ = __webpack_require__(53);
  16949. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation__ = __webpack_require__(124);
  16950. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSliderFoundation", function() { return __WEBPACK_IMPORTED_MODULE_3__foundation__["a"]; });
  16951. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  16952. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16953. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  16954. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  16955. /**
  16956. * @license
  16957. * Copyright 2017 Google Inc.
  16958. *
  16959. * Permission is hereby granted, free of charge, to any person obtaining a copy
  16960. * of this software and associated documentation files (the "Software"), to deal
  16961. * in the Software without restriction, including without limitation the rights
  16962. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  16963. * copies of the Software, and to permit persons to whom the Software is
  16964. * furnished to do so, subject to the following conditions:
  16965. *
  16966. * The above copyright notice and this permission notice shall be included in
  16967. * all copies or substantial portions of the Software.
  16968. *
  16969. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16970. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16971. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16972. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16973. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  16974. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  16975. * THE SOFTWARE.
  16976. */
  16977. /**
  16978. * @extends MDCComponent<!MDCSliderFoundation>
  16979. */
  16980. var MDCSlider = function (_MDCComponent) {
  16981. _inherits(MDCSlider, _MDCComponent);
  16982. _createClass(MDCSlider, null, [{
  16983. key: 'attachTo',
  16984. value: function attachTo(root) {
  16985. return new MDCSlider(root);
  16986. }
  16987. }]);
  16988. function MDCSlider() {
  16989. var _ref;
  16990. _classCallCheck(this, MDCSlider);
  16991. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  16992. args[_key] = arguments[_key];
  16993. }
  16994. /** @type {?Element} */
  16995. var _this = _possibleConstructorReturn(this, (_ref = MDCSlider.__proto__ || Object.getPrototypeOf(MDCSlider)).call.apply(_ref, [this].concat(args)));
  16996. _this.thumbContainer_;
  16997. /** @type {?Element} */
  16998. _this.track_;
  16999. /** @type {?Element} */
  17000. _this.pinValueMarker_;
  17001. /** @type {?Element} */
  17002. _this.trackMarkerContainer_;
  17003. return _this;
  17004. }
  17005. /** @return {number} */
  17006. _createClass(MDCSlider, [{
  17007. key: 'initialize',
  17008. value: function initialize() {
  17009. this.thumbContainer_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].THUMB_CONTAINER_SELECTOR);
  17010. this.track_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].TRACK_SELECTOR);
  17011. this.pinValueMarker_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].PIN_VALUE_MARKER_SELECTOR);
  17012. this.trackMarkerContainer_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].TRACK_MARKER_CONTAINER_SELECTOR);
  17013. }
  17014. /**
  17015. * @return {!MDCSliderFoundation}
  17016. */
  17017. }, {
  17018. key: 'getDefaultFoundation',
  17019. value: function getDefaultFoundation() {
  17020. var _this2 = this;
  17021. return new __WEBPACK_IMPORTED_MODULE_3__foundation__["a" /* default */](
  17022. /** @type {!MDCSliderAdapter} */{
  17023. hasClass: function hasClass(className) {
  17024. return _this2.root_.classList.contains(className);
  17025. },
  17026. addClass: function addClass(className) {
  17027. return _this2.root_.classList.add(className);
  17028. },
  17029. removeClass: function removeClass(className) {
  17030. return _this2.root_.classList.remove(className);
  17031. },
  17032. getAttribute: function getAttribute(name) {
  17033. return _this2.root_.getAttribute(name);
  17034. },
  17035. setAttribute: function setAttribute(name, value) {
  17036. return _this2.root_.setAttribute(name, value);
  17037. },
  17038. removeAttribute: function removeAttribute(name) {
  17039. return _this2.root_.removeAttribute(name);
  17040. },
  17041. computeBoundingRect: function computeBoundingRect() {
  17042. return _this2.root_.getBoundingClientRect();
  17043. },
  17044. getTabIndex: function getTabIndex() {
  17045. return _this2.root_.tabIndex;
  17046. },
  17047. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  17048. _this2.root_.addEventListener(type, handler);
  17049. },
  17050. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  17051. _this2.root_.removeEventListener(type, handler);
  17052. },
  17053. registerThumbContainerInteractionHandler: function registerThumbContainerInteractionHandler(type, handler) {
  17054. _this2.thumbContainer_.addEventListener(type, handler);
  17055. },
  17056. deregisterThumbContainerInteractionHandler: function deregisterThumbContainerInteractionHandler(type, handler) {
  17057. _this2.thumbContainer_.removeEventListener(type, handler);
  17058. },
  17059. registerBodyInteractionHandler: function registerBodyInteractionHandler(type, handler) {
  17060. document.body.addEventListener(type, handler);
  17061. },
  17062. deregisterBodyInteractionHandler: function deregisterBodyInteractionHandler(type, handler) {
  17063. document.body.removeEventListener(type, handler);
  17064. },
  17065. registerResizeHandler: function registerResizeHandler(handler) {
  17066. window.addEventListener('resize', handler);
  17067. },
  17068. deregisterResizeHandler: function deregisterResizeHandler(handler) {
  17069. window.removeEventListener('resize', handler);
  17070. },
  17071. notifyInput: function notifyInput() {
  17072. _this2.emit(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].INPUT_EVENT, _this2);
  17073. },
  17074. notifyChange: function notifyChange() {
  17075. _this2.emit(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].CHANGE_EVENT, _this2);
  17076. },
  17077. setThumbContainerStyleProperty: function setThumbContainerStyleProperty(propertyName, value) {
  17078. _this2.thumbContainer_.style.setProperty(propertyName, value);
  17079. },
  17080. setTrackStyleProperty: function setTrackStyleProperty(propertyName, value) {
  17081. _this2.track_.style.setProperty(propertyName, value);
  17082. },
  17083. setMarkerValue: function setMarkerValue(value) {
  17084. _this2.pinValueMarker_.innerText = value;
  17085. },
  17086. appendTrackMarkers: function appendTrackMarkers(numMarkers) {
  17087. var frag = document.createDocumentFragment();
  17088. for (var i = 0; i < numMarkers; i++) {
  17089. var marker = document.createElement('div');
  17090. marker.classList.add('mdc-slider__track-marker');
  17091. frag.appendChild(marker);
  17092. }
  17093. _this2.trackMarkerContainer_.appendChild(frag);
  17094. },
  17095. removeTrackMarkers: function removeTrackMarkers() {
  17096. while (_this2.trackMarkerContainer_.firstChild) {
  17097. _this2.trackMarkerContainer_.removeChild(_this2.trackMarkerContainer_.firstChild);
  17098. }
  17099. },
  17100. setLastTrackMarkersStyleProperty: function setLastTrackMarkersStyleProperty(propertyName, value) {
  17101. // We remove and append new nodes, thus, the last track marker must be dynamically found.
  17102. var lastTrackMarker = _this2.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].LAST_TRACK_MARKER_SELECTOR);
  17103. lastTrackMarker.style.setProperty(propertyName, value);
  17104. },
  17105. isRTL: function isRTL() {
  17106. return getComputedStyle(_this2.root_).direction === 'rtl';
  17107. }
  17108. });
  17109. }
  17110. }, {
  17111. key: 'initialSyncWithDOM',
  17112. value: function initialSyncWithDOM() {
  17113. var origValueNow = parseFloat(this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].ARIA_VALUENOW));
  17114. this.min = parseFloat(this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].ARIA_VALUEMIN)) || this.min;
  17115. this.max = parseFloat(this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].ARIA_VALUEMAX)) || this.max;
  17116. this.step = parseFloat(this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].STEP_DATA_ATTR)) || this.step;
  17117. this.value = origValueNow || this.value;
  17118. 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';
  17119. this.foundation_.setupTrackMarker();
  17120. }
  17121. }, {
  17122. key: 'layout',
  17123. value: function layout() {
  17124. this.foundation_.layout();
  17125. }
  17126. /** @param {number=} amount */
  17127. }, {
  17128. key: 'stepUp',
  17129. value: function stepUp() {
  17130. var amount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.step || 1;
  17131. this.value += amount;
  17132. }
  17133. /** @param {number=} amount */
  17134. }, {
  17135. key: 'stepDown',
  17136. value: function stepDown() {
  17137. var amount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.step || 1;
  17138. this.value -= amount;
  17139. }
  17140. }, {
  17141. key: 'value',
  17142. get: function get() {
  17143. return this.foundation_.getValue();
  17144. }
  17145. /** @param {number} value */
  17146. ,
  17147. set: function set(value) {
  17148. this.foundation_.setValue(value);
  17149. }
  17150. /** @return {number} */
  17151. }, {
  17152. key: 'min',
  17153. get: function get() {
  17154. return this.foundation_.getMin();
  17155. }
  17156. /** @param {number} min */
  17157. ,
  17158. set: function set(min) {
  17159. this.foundation_.setMin(min);
  17160. }
  17161. /** @return {number} */
  17162. }, {
  17163. key: 'max',
  17164. get: function get() {
  17165. return this.foundation_.getMax();
  17166. }
  17167. /** @param {number} max */
  17168. ,
  17169. set: function set(max) {
  17170. this.foundation_.setMax(max);
  17171. }
  17172. /** @return {number} */
  17173. }, {
  17174. key: 'step',
  17175. get: function get() {
  17176. return this.foundation_.getStep();
  17177. }
  17178. /** @param {number} step */
  17179. ,
  17180. set: function set(step) {
  17181. this.foundation_.setStep(step);
  17182. }
  17183. /** @return {boolean} */
  17184. }, {
  17185. key: 'disabled',
  17186. get: function get() {
  17187. return this.foundation_.isDisabled();
  17188. }
  17189. /** @param {boolean} disabled */
  17190. ,
  17191. set: function set(disabled) {
  17192. this.foundation_.setDisabled(disabled);
  17193. }
  17194. }]);
  17195. return MDCSlider;
  17196. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  17197. /***/ }),
  17198. /* 124 */
  17199. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17200. "use strict";
  17201. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__constants__ = __webpack_require__(52);
  17202. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(53);
  17203. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_animation_index__ = __webpack_require__(9);
  17204. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_base_foundation__ = __webpack_require__(0);
  17205. 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; };
  17206. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  17207. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17208. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  17209. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  17210. /**
  17211. * @license
  17212. * Copyright 2017 Google Inc.
  17213. *
  17214. * Permission is hereby granted, free of charge, to any person obtaining a copy
  17215. * of this software and associated documentation files (the "Software"), to deal
  17216. * in the Software without restriction, including without limitation the rights
  17217. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  17218. * copies of the Software, and to permit persons to whom the Software is
  17219. * furnished to do so, subject to the following conditions:
  17220. *
  17221. * The above copyright notice and this permission notice shall be included in
  17222. * all copies or substantial portions of the Software.
  17223. *
  17224. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17225. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17226. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17227. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17228. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  17229. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  17230. * THE SOFTWARE.
  17231. */
  17232. /** @enum {string} */
  17233. var KEY_IDS = {
  17234. ARROW_LEFT: 'ArrowLeft',
  17235. ARROW_RIGHT: 'ArrowRight',
  17236. ARROW_UP: 'ArrowUp',
  17237. ARROW_DOWN: 'ArrowDown',
  17238. HOME: 'Home',
  17239. END: 'End',
  17240. PAGE_UP: 'PageUp',
  17241. PAGE_DOWN: 'PageDown'
  17242. };
  17243. /** @enum {string} */
  17244. var MOVE_EVENT_MAP = {
  17245. 'mousedown': 'mousemove',
  17246. 'touchstart': 'touchmove',
  17247. 'pointerdown': 'pointermove'
  17248. };
  17249. var DOWN_EVENTS = ['mousedown', 'pointerdown', 'touchstart'];
  17250. var UP_EVENTS = ['mouseup', 'pointerup', 'touchend'];
  17251. /**
  17252. * @extends {MDCFoundation<!MDCSliderAdapter>}
  17253. */
  17254. var MDCSliderFoundation = function (_MDCFoundation) {
  17255. _inherits(MDCSliderFoundation, _MDCFoundation);
  17256. _createClass(MDCSliderFoundation, null, [{
  17257. key: 'cssClasses',
  17258. /** @return enum {cssClasses} */
  17259. get: function get() {
  17260. return __WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */];
  17261. }
  17262. /** @return enum {strings} */
  17263. }, {
  17264. key: 'strings',
  17265. get: function get() {
  17266. return __WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */];
  17267. }
  17268. /** @return enum {numbers} */
  17269. }, {
  17270. key: 'numbers',
  17271. get: function get() {
  17272. return __WEBPACK_IMPORTED_MODULE_0__constants__["b" /* numbers */];
  17273. }
  17274. /** @return {!MDCSliderAdapter} */
  17275. }, {
  17276. key: 'defaultAdapter',
  17277. get: function get() {
  17278. return (/** @type {!MDCSliderAdapter} */{
  17279. hasClass: function hasClass() {
  17280. return (/* className: string */ /* boolean */false
  17281. );
  17282. },
  17283. addClass: function addClass() /* className: string */{},
  17284. removeClass: function removeClass() /* className: string */{},
  17285. getAttribute: function getAttribute() {
  17286. return (/* name: string */ /* string|null */null
  17287. );
  17288. },
  17289. setAttribute: function setAttribute() /* name: string, value: string */{},
  17290. removeAttribute: function removeAttribute() /* name: string */{},
  17291. computeBoundingRect: function computeBoundingRect() {
  17292. return (/* ClientRect */{
  17293. top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0
  17294. }
  17295. );
  17296. },
  17297. getTabIndex: function getTabIndex() {
  17298. return (/* number */0
  17299. );
  17300. },
  17301. registerInteractionHandler: function registerInteractionHandler() /* type: string, handler: EventListener */{},
  17302. deregisterInteractionHandler: function deregisterInteractionHandler() /* type: string, handler: EventListener */{},
  17303. registerThumbContainerInteractionHandler: function registerThumbContainerInteractionHandler() /* type: string, handler: EventListener */{},
  17304. deregisterThumbContainerInteractionHandler: function deregisterThumbContainerInteractionHandler() /* type: string, handler: EventListener */{},
  17305. registerBodyInteractionHandler: function registerBodyInteractionHandler() /* type: string, handler: EventListener */{},
  17306. deregisterBodyInteractionHandler: function deregisterBodyInteractionHandler() /* type: string, handler: EventListener */{},
  17307. registerResizeHandler: function registerResizeHandler() /* handler: EventListener */{},
  17308. deregisterResizeHandler: function deregisterResizeHandler() /* handler: EventListener */{},
  17309. notifyInput: function notifyInput() {},
  17310. notifyChange: function notifyChange() {},
  17311. setThumbContainerStyleProperty: function setThumbContainerStyleProperty() /* propertyName: string, value: string */{},
  17312. setTrackStyleProperty: function setTrackStyleProperty() /* propertyName: string, value: string */{},
  17313. setMarkerValue: function setMarkerValue() /* value: number */{},
  17314. appendTrackMarkers: function appendTrackMarkers() /* numMarkers: number */{},
  17315. removeTrackMarkers: function removeTrackMarkers() {},
  17316. setLastTrackMarkersStyleProperty: function setLastTrackMarkersStyleProperty() /* propertyName: string, value: string */{},
  17317. isRTL: function isRTL() {
  17318. return (/* boolean */false
  17319. );
  17320. }
  17321. }
  17322. );
  17323. }
  17324. /**
  17325. * Creates a new instance of MDCSliderFoundation
  17326. * @param {?MDCSliderAdapter} adapter
  17327. */
  17328. }]);
  17329. function MDCSliderFoundation(adapter) {
  17330. _classCallCheck(this, MDCSliderFoundation);
  17331. /** @private {?ClientRect} */
  17332. var _this = _possibleConstructorReturn(this, (MDCSliderFoundation.__proto__ || Object.getPrototypeOf(MDCSliderFoundation)).call(this, _extends(MDCSliderFoundation.defaultAdapter, adapter)));
  17333. _this.rect_ = null;
  17334. // We set this to NaN since we want it to be a number, but we can't use '0' or '-1'
  17335. // because those could be valid tabindices set by the client code.
  17336. _this.savedTabIndex_ = NaN;
  17337. _this.active_ = false;
  17338. _this.inTransit_ = false;
  17339. _this.isDiscrete_ = false;
  17340. _this.hasTrackMarker_ = false;
  17341. _this.handlingThumbTargetEvt_ = false;
  17342. _this.min_ = 0;
  17343. _this.max_ = 100;
  17344. _this.step_ = 0;
  17345. _this.value_ = 0;
  17346. _this.disabled_ = false;
  17347. _this.preventFocusState_ = false;
  17348. _this.updateUIFrame_ = 0;
  17349. _this.thumbContainerPointerHandler_ = function () {
  17350. _this.handlingThumbTargetEvt_ = true;
  17351. };
  17352. _this.interactionStartHandler_ = function (evt) {
  17353. return _this.handleDown_(evt);
  17354. };
  17355. _this.keydownHandler_ = function (evt) {
  17356. return _this.handleKeydown_(evt);
  17357. };
  17358. _this.focusHandler_ = function () {
  17359. return _this.handleFocus_();
  17360. };
  17361. _this.blurHandler_ = function () {
  17362. return _this.handleBlur_();
  17363. };
  17364. _this.resizeHandler_ = function () {
  17365. return _this.layout();
  17366. };
  17367. return _this;
  17368. }
  17369. _createClass(MDCSliderFoundation, [{
  17370. key: 'init',
  17371. value: function init() {
  17372. var _this2 = this;
  17373. this.isDiscrete_ = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].IS_DISCRETE);
  17374. this.hasTrackMarker_ = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].HAS_TRACK_MARKER);
  17375. DOWN_EVENTS.forEach(function (evtName) {
  17376. return _this2.adapter_.registerInteractionHandler(evtName, _this2.interactionStartHandler_);
  17377. });
  17378. this.adapter_.registerInteractionHandler('keydown', this.keydownHandler_);
  17379. this.adapter_.registerInteractionHandler('focus', this.focusHandler_);
  17380. this.adapter_.registerInteractionHandler('blur', this.blurHandler_);
  17381. DOWN_EVENTS.forEach(function (evtName) {
  17382. _this2.adapter_.registerThumbContainerInteractionHandler(evtName, _this2.thumbContainerPointerHandler_);
  17383. });
  17384. this.adapter_.registerResizeHandler(this.resizeHandler_);
  17385. this.layout();
  17386. // At last step, provide a reasonable default value to discrete slider
  17387. if (this.isDiscrete_ && this.getStep() == 0) {
  17388. this.step_ = 1;
  17389. }
  17390. }
  17391. }, {
  17392. key: 'destroy',
  17393. value: function destroy() {
  17394. var _this3 = this;
  17395. DOWN_EVENTS.forEach(function (evtName) {
  17396. _this3.adapter_.deregisterInteractionHandler(evtName, _this3.interactionStartHandler_);
  17397. });
  17398. this.adapter_.deregisterInteractionHandler('keydown', this.keydownHandler_);
  17399. this.adapter_.deregisterInteractionHandler('focus', this.focusHandler_);
  17400. this.adapter_.deregisterInteractionHandler('blur', this.blurHandler_);
  17401. DOWN_EVENTS.forEach(function (evtName) {
  17402. _this3.adapter_.deregisterThumbContainerInteractionHandler(evtName, _this3.thumbContainerPointerHandler_);
  17403. });
  17404. this.adapter_.deregisterResizeHandler(this.resizeHandler_);
  17405. }
  17406. }, {
  17407. key: 'setupTrackMarker',
  17408. value: function setupTrackMarker() {
  17409. if (this.isDiscrete_ && this.hasTrackMarker_ && this.getStep() != 0) {
  17410. var min = this.getMin();
  17411. var max = this.getMax();
  17412. var step = this.getStep();
  17413. var numMarkers = (max - min) / step;
  17414. // In case distance between max & min is indivisible to step,
  17415. // we place the secondary to last marker proportionally at where thumb
  17416. // could reach and place the last marker at max value
  17417. var indivisible = Math.ceil(numMarkers) !== numMarkers;
  17418. if (indivisible) {
  17419. numMarkers = Math.ceil(numMarkers);
  17420. }
  17421. this.adapter_.removeTrackMarkers();
  17422. this.adapter_.appendTrackMarkers(numMarkers);
  17423. if (indivisible) {
  17424. var lastStepRatio = (max - numMarkers * step) / step + 1;
  17425. var flex = Object(__WEBPACK_IMPORTED_MODULE_2__material_animation_index__["b" /* getCorrectPropertyName */])(window, 'flex');
  17426. this.adapter_.setLastTrackMarkersStyleProperty(flex, String(lastStepRatio));
  17427. }
  17428. }
  17429. }
  17430. }, {
  17431. key: 'layout',
  17432. value: function layout() {
  17433. this.rect_ = this.adapter_.computeBoundingRect();
  17434. this.updateUIForCurrentValue_();
  17435. }
  17436. /** @return {number} */
  17437. }, {
  17438. key: 'getValue',
  17439. value: function getValue() {
  17440. return this.value_;
  17441. }
  17442. /** @param {number} value */
  17443. }, {
  17444. key: 'setValue',
  17445. value: function setValue(value) {
  17446. this.setValue_(value, false);
  17447. }
  17448. /** @return {number} */
  17449. }, {
  17450. key: 'getMax',
  17451. value: function getMax() {
  17452. return this.max_;
  17453. }
  17454. /** @param {number} max */
  17455. }, {
  17456. key: 'setMax',
  17457. value: function setMax(max) {
  17458. if (max < this.min_) {
  17459. throw new Error('Cannot set max to be less than the slider\'s minimum value');
  17460. }
  17461. this.max_ = max;
  17462. this.setValue_(this.value_, false, true);
  17463. this.adapter_.setAttribute(__WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */].ARIA_VALUEMAX, String(this.max_));
  17464. this.setupTrackMarker();
  17465. }
  17466. /** @return {number} */
  17467. }, {
  17468. key: 'getMin',
  17469. value: function getMin() {
  17470. return this.min_;
  17471. }
  17472. /** @param {number} min */
  17473. }, {
  17474. key: 'setMin',
  17475. value: function setMin(min) {
  17476. if (min > this.max_) {
  17477. throw new Error('Cannot set min to be greater than the slider\'s maximum value');
  17478. }
  17479. this.min_ = min;
  17480. this.setValue_(this.value_, false, true);
  17481. this.adapter_.setAttribute(__WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */].ARIA_VALUEMIN, String(this.min_));
  17482. this.setupTrackMarker();
  17483. }
  17484. /** @return {number} */
  17485. }, {
  17486. key: 'getStep',
  17487. value: function getStep() {
  17488. return this.step_;
  17489. }
  17490. /** @param {number} step */
  17491. }, {
  17492. key: 'setStep',
  17493. value: function setStep(step) {
  17494. if (step < 0) {
  17495. throw new Error('Step cannot be set to a negative number');
  17496. }
  17497. if (this.isDiscrete_ && (typeof step !== 'number' || step < 1)) {
  17498. step = 1;
  17499. }
  17500. this.step_ = step;
  17501. this.setValue_(this.value_, false, true);
  17502. this.setupTrackMarker();
  17503. }
  17504. /** @return {boolean} */
  17505. }, {
  17506. key: 'isDisabled',
  17507. value: function isDisabled() {
  17508. return this.disabled_;
  17509. }
  17510. /** @param {boolean} disabled */
  17511. }, {
  17512. key: 'setDisabled',
  17513. value: function setDisabled(disabled) {
  17514. this.disabled_ = disabled;
  17515. this.toggleClass_(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].DISABLED, this.disabled_);
  17516. if (this.disabled_) {
  17517. this.savedTabIndex_ = this.adapter_.getTabIndex();
  17518. this.adapter_.setAttribute(__WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */].ARIA_DISABLED, 'true');
  17519. this.adapter_.removeAttribute('tabindex');
  17520. } else {
  17521. this.adapter_.removeAttribute(__WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */].ARIA_DISABLED);
  17522. if (!isNaN(this.savedTabIndex_)) {
  17523. this.adapter_.setAttribute('tabindex', String(this.savedTabIndex_));
  17524. }
  17525. }
  17526. }
  17527. /**
  17528. * Called when the user starts interacting with the slider
  17529. * @param {!Event} evt
  17530. * @private
  17531. */
  17532. }, {
  17533. key: 'handleDown_',
  17534. value: function handleDown_(evt) {
  17535. var _this4 = this;
  17536. if (this.disabled_) {
  17537. return;
  17538. }
  17539. this.preventFocusState_ = true;
  17540. this.setInTransit_(!this.handlingThumbTargetEvt_);
  17541. this.handlingThumbTargetEvt_ = false;
  17542. this.setActive_(true);
  17543. var moveHandler = function moveHandler(evt) {
  17544. _this4.handleMove_(evt);
  17545. };
  17546. // Note: upHandler is [de]registered on ALL potential pointer-related release event types, since some browsers
  17547. // do not always fire these consistently in pairs.
  17548. // (See https://github.com/material-components/material-components-web/issues/1192)
  17549. var upHandler = function upHandler() {
  17550. _this4.handleUp_();
  17551. _this4.adapter_.deregisterBodyInteractionHandler(MOVE_EVENT_MAP[evt.type], moveHandler);
  17552. UP_EVENTS.forEach(function (evtName) {
  17553. return _this4.adapter_.deregisterBodyInteractionHandler(evtName, upHandler);
  17554. });
  17555. };
  17556. this.adapter_.registerBodyInteractionHandler(MOVE_EVENT_MAP[evt.type], moveHandler);
  17557. UP_EVENTS.forEach(function (evtName) {
  17558. return _this4.adapter_.registerBodyInteractionHandler(evtName, upHandler);
  17559. });
  17560. this.setValueFromEvt_(evt);
  17561. }
  17562. /**
  17563. * Called when the user moves the slider
  17564. * @param {!Event} evt
  17565. * @private
  17566. */
  17567. }, {
  17568. key: 'handleMove_',
  17569. value: function handleMove_(evt) {
  17570. evt.preventDefault();
  17571. this.setValueFromEvt_(evt);
  17572. }
  17573. /**
  17574. * Called when the user's interaction with the slider ends
  17575. * @private
  17576. */
  17577. }, {
  17578. key: 'handleUp_',
  17579. value: function handleUp_() {
  17580. this.setActive_(false);
  17581. this.adapter_.notifyChange();
  17582. }
  17583. /**
  17584. * Returns the pageX of the event
  17585. * @param {!Event} evt
  17586. * @return {number}
  17587. * @private
  17588. */
  17589. }, {
  17590. key: 'getPageX_',
  17591. value: function getPageX_(evt) {
  17592. if (evt.targetTouches && evt.targetTouches.length > 0) {
  17593. return evt.targetTouches[0].pageX;
  17594. }
  17595. return evt.pageX;
  17596. }
  17597. /**
  17598. * Sets the slider value from an event
  17599. * @param {!Event} evt
  17600. * @private
  17601. */
  17602. }, {
  17603. key: 'setValueFromEvt_',
  17604. value: function setValueFromEvt_(evt) {
  17605. var pageX = this.getPageX_(evt);
  17606. var value = this.computeValueFromPageX_(pageX);
  17607. this.setValue_(value, true);
  17608. }
  17609. /**
  17610. * Computes the new value from the pageX position
  17611. * @param {number} pageX
  17612. * @return {number}
  17613. */
  17614. }, {
  17615. key: 'computeValueFromPageX_',
  17616. value: function computeValueFromPageX_(pageX) {
  17617. var max = this.max_,
  17618. min = this.min_;
  17619. var xPos = pageX - this.rect_.left;
  17620. var pctComplete = xPos / this.rect_.width;
  17621. if (this.adapter_.isRTL()) {
  17622. pctComplete = 1 - pctComplete;
  17623. }
  17624. // Fit the percentage complete between the range [min,max]
  17625. // by remapping from [0, 1] to [min, min+(max-min)].
  17626. return min + pctComplete * (max - min);
  17627. }
  17628. /**
  17629. * Handles keydown events
  17630. * @param {!Event} evt
  17631. */
  17632. }, {
  17633. key: 'handleKeydown_',
  17634. value: function handleKeydown_(evt) {
  17635. var keyId = this.getKeyId_(evt);
  17636. var value = this.getValueForKeyId_(keyId);
  17637. if (isNaN(value)) {
  17638. return;
  17639. }
  17640. // Prevent page from scrolling due to key presses that would normally scroll the page
  17641. evt.preventDefault();
  17642. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].FOCUS);
  17643. this.setValue_(value, true);
  17644. this.adapter_.notifyChange();
  17645. }
  17646. /**
  17647. * Returns the computed name of the event
  17648. * @param {!Event} kbdEvt
  17649. * @return {string}
  17650. */
  17651. }, {
  17652. key: 'getKeyId_',
  17653. value: function getKeyId_(kbdEvt) {
  17654. if (kbdEvt.key === KEY_IDS.ARROW_LEFT || kbdEvt.keyCode === 37) {
  17655. return KEY_IDS.ARROW_LEFT;
  17656. }
  17657. if (kbdEvt.key === KEY_IDS.ARROW_RIGHT || kbdEvt.keyCode === 39) {
  17658. return KEY_IDS.ARROW_RIGHT;
  17659. }
  17660. if (kbdEvt.key === KEY_IDS.ARROW_UP || kbdEvt.keyCode === 38) {
  17661. return KEY_IDS.ARROW_UP;
  17662. }
  17663. if (kbdEvt.key === KEY_IDS.ARROW_DOWN || kbdEvt.keyCode === 40) {
  17664. return KEY_IDS.ARROW_DOWN;
  17665. }
  17666. if (kbdEvt.key === KEY_IDS.HOME || kbdEvt.keyCode === 36) {
  17667. return KEY_IDS.HOME;
  17668. }
  17669. if (kbdEvt.key === KEY_IDS.END || kbdEvt.keyCode === 35) {
  17670. return KEY_IDS.END;
  17671. }
  17672. if (kbdEvt.key === KEY_IDS.PAGE_UP || kbdEvt.keyCode === 33) {
  17673. return KEY_IDS.PAGE_UP;
  17674. }
  17675. if (kbdEvt.key === KEY_IDS.PAGE_DOWN || kbdEvt.keyCode === 34) {
  17676. return KEY_IDS.PAGE_DOWN;
  17677. }
  17678. return '';
  17679. }
  17680. /**
  17681. * Computes the value given a keyboard key ID
  17682. * @param {string} keyId
  17683. * @return {number}
  17684. */
  17685. }, {
  17686. key: 'getValueForKeyId_',
  17687. value: function getValueForKeyId_(keyId) {
  17688. var max = this.max_,
  17689. min = this.min_,
  17690. step = this.step_;
  17691. var delta = step || (max - min) / 100;
  17692. var valueNeedsToBeFlipped = this.adapter_.isRTL() && (keyId === KEY_IDS.ARROW_LEFT || keyId === KEY_IDS.ARROW_RIGHT);
  17693. if (valueNeedsToBeFlipped) {
  17694. delta = -delta;
  17695. }
  17696. switch (keyId) {
  17697. case KEY_IDS.ARROW_LEFT:
  17698. case KEY_IDS.ARROW_DOWN:
  17699. return this.value_ - delta;
  17700. case KEY_IDS.ARROW_RIGHT:
  17701. case KEY_IDS.ARROW_UP:
  17702. return this.value_ + delta;
  17703. case KEY_IDS.HOME:
  17704. return this.min_;
  17705. case KEY_IDS.END:
  17706. return this.max_;
  17707. case KEY_IDS.PAGE_UP:
  17708. return this.value_ + delta * __WEBPACK_IMPORTED_MODULE_0__constants__["b" /* numbers */].PAGE_FACTOR;
  17709. case KEY_IDS.PAGE_DOWN:
  17710. return this.value_ - delta * __WEBPACK_IMPORTED_MODULE_0__constants__["b" /* numbers */].PAGE_FACTOR;
  17711. default:
  17712. return NaN;
  17713. }
  17714. }
  17715. }, {
  17716. key: 'handleFocus_',
  17717. value: function handleFocus_() {
  17718. if (this.preventFocusState_) {
  17719. return;
  17720. }
  17721. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].FOCUS);
  17722. }
  17723. }, {
  17724. key: 'handleBlur_',
  17725. value: function handleBlur_() {
  17726. this.preventFocusState_ = false;
  17727. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].FOCUS);
  17728. }
  17729. /**
  17730. * Sets the value of the slider
  17731. * @param {number} value
  17732. * @param {boolean} shouldFireInput
  17733. * @param {boolean=} force
  17734. */
  17735. }, {
  17736. key: 'setValue_',
  17737. value: function setValue_(value, shouldFireInput) {
  17738. var force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  17739. if (value === this.value_ && !force) {
  17740. return;
  17741. }
  17742. var min = this.min_,
  17743. max = this.max_;
  17744. var valueSetToBoundary = value === min || value === max;
  17745. if (this.step_ && !valueSetToBoundary) {
  17746. value = this.quantize_(value);
  17747. }
  17748. if (value < min) {
  17749. value = min;
  17750. } else if (value > max) {
  17751. value = max;
  17752. }
  17753. this.value_ = value;
  17754. this.adapter_.setAttribute(__WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */].ARIA_VALUENOW, String(this.value_));
  17755. this.updateUIForCurrentValue_();
  17756. if (shouldFireInput) {
  17757. this.adapter_.notifyInput();
  17758. if (this.isDiscrete_) {
  17759. this.adapter_.setMarkerValue(value);
  17760. }
  17761. }
  17762. }
  17763. /**
  17764. * Calculates the quantized value
  17765. * @param {number} value
  17766. * @return {number}
  17767. */
  17768. }, {
  17769. key: 'quantize_',
  17770. value: function quantize_(value) {
  17771. var numSteps = Math.round(value / this.step_);
  17772. var quantizedVal = numSteps * this.step_;
  17773. return quantizedVal;
  17774. }
  17775. }, {
  17776. key: 'updateUIForCurrentValue_',
  17777. value: function updateUIForCurrentValue_() {
  17778. var _this5 = this;
  17779. var max = this.max_,
  17780. min = this.min_,
  17781. value = this.value_;
  17782. var pctComplete = (value - min) / (max - min);
  17783. var translatePx = pctComplete * this.rect_.width;
  17784. if (this.adapter_.isRTL()) {
  17785. translatePx = this.rect_.width - translatePx;
  17786. }
  17787. var transformProp = Object(__WEBPACK_IMPORTED_MODULE_2__material_animation_index__["b" /* getCorrectPropertyName */])(window, 'transform');
  17788. var transitionendEvtName = Object(__WEBPACK_IMPORTED_MODULE_2__material_animation_index__["a" /* getCorrectEventName */])(window, 'transitionend');
  17789. if (this.inTransit_) {
  17790. var onTransitionEnd = function onTransitionEnd() {
  17791. _this5.setInTransit_(false);
  17792. _this5.adapter_.deregisterThumbContainerInteractionHandler(transitionendEvtName, onTransitionEnd);
  17793. };
  17794. this.adapter_.registerThumbContainerInteractionHandler(transitionendEvtName, onTransitionEnd);
  17795. }
  17796. this.updateUIFrame_ = requestAnimationFrame(function () {
  17797. // NOTE(traviskaufman): It would be nice to use calc() here,
  17798. // but IE cannot handle calcs in transforms correctly.
  17799. // See: https://goo.gl/NC2itk
  17800. // Also note that the -50% offset is used to center the slider thumb.
  17801. _this5.adapter_.setThumbContainerStyleProperty(transformProp, 'translateX(' + translatePx + 'px) translateX(-50%)');
  17802. _this5.adapter_.setTrackStyleProperty(transformProp, 'scaleX(' + pctComplete + ')');
  17803. });
  17804. }
  17805. /**
  17806. * Toggles the active state of the slider
  17807. * @param {boolean} active
  17808. */
  17809. }, {
  17810. key: 'setActive_',
  17811. value: function setActive_(active) {
  17812. this.active_ = active;
  17813. this.toggleClass_(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].ACTIVE, this.active_);
  17814. }
  17815. /**
  17816. * Toggles the inTransit state of the slider
  17817. * @param {boolean} inTransit
  17818. */
  17819. }, {
  17820. key: 'setInTransit_',
  17821. value: function setInTransit_(inTransit) {
  17822. this.inTransit_ = inTransit;
  17823. this.toggleClass_(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].IN_TRANSIT, this.inTransit_);
  17824. }
  17825. /**
  17826. * Conditionally adds or removes a class based on shouldBePresent
  17827. * @param {string} className
  17828. * @param {boolean} shouldBePresent
  17829. */
  17830. }, {
  17831. key: 'toggleClass_',
  17832. value: function toggleClass_(className, shouldBePresent) {
  17833. if (shouldBePresent) {
  17834. this.adapter_.addClass(className);
  17835. } else {
  17836. this.adapter_.removeClass(className);
  17837. }
  17838. }
  17839. }]);
  17840. return MDCSliderFoundation;
  17841. }(__WEBPACK_IMPORTED_MODULE_3__material_base_foundation__["a" /* default */]);
  17842. /* harmony default export */ __webpack_exports__["a"] = (MDCSliderFoundation);
  17843. /***/ }),
  17844. /* 125 */
  17845. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17846. "use strict";
  17847. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  17848. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSnackbar", function() { return MDCSnackbar; });
  17849. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(3);
  17850. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(126);
  17851. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_animation_index__ = __webpack_require__(9);
  17852. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSnackbarFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  17853. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  17854. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17855. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  17856. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  17857. /**
  17858. * @license
  17859. * Copyright 2016 Google Inc.
  17860. *
  17861. * Permission is hereby granted, free of charge, to any person obtaining a copy
  17862. * of this software and associated documentation files (the "Software"), to deal
  17863. * in the Software without restriction, including without limitation the rights
  17864. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  17865. * copies of the Software, and to permit persons to whom the Software is
  17866. * furnished to do so, subject to the following conditions:
  17867. *
  17868. * The above copyright notice and this permission notice shall be included in
  17869. * all copies or substantial portions of the Software.
  17870. *
  17871. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17872. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17873. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17874. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17875. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  17876. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  17877. * THE SOFTWARE.
  17878. */
  17879. var MDCSnackbar = function (_MDCComponent) {
  17880. _inherits(MDCSnackbar, _MDCComponent);
  17881. function MDCSnackbar() {
  17882. _classCallCheck(this, MDCSnackbar);
  17883. return _possibleConstructorReturn(this, (MDCSnackbar.__proto__ || Object.getPrototypeOf(MDCSnackbar)).apply(this, arguments));
  17884. }
  17885. _createClass(MDCSnackbar, [{
  17886. key: 'show',
  17887. value: function show(data) {
  17888. this.foundation_.show(data);
  17889. }
  17890. }, {
  17891. key: 'getDefaultFoundation',
  17892. value: function getDefaultFoundation() {
  17893. var _this2 = this;
  17894. var _MDCSnackbarFoundatio = __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings,
  17895. TEXT_SELECTOR = _MDCSnackbarFoundatio.TEXT_SELECTOR,
  17896. ACTION_BUTTON_SELECTOR = _MDCSnackbarFoundatio.ACTION_BUTTON_SELECTOR;
  17897. var getText = function getText() {
  17898. return _this2.root_.querySelector(TEXT_SELECTOR);
  17899. };
  17900. var getActionButton = function getActionButton() {
  17901. return _this2.root_.querySelector(ACTION_BUTTON_SELECTOR);
  17902. };
  17903. /* eslint brace-style: "off" */
  17904. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]({
  17905. addClass: function addClass(className) {
  17906. return _this2.root_.classList.add(className);
  17907. },
  17908. removeClass: function removeClass(className) {
  17909. return _this2.root_.classList.remove(className);
  17910. },
  17911. setAriaHidden: function setAriaHidden() {
  17912. return _this2.root_.setAttribute('aria-hidden', 'true');
  17913. },
  17914. unsetAriaHidden: function unsetAriaHidden() {
  17915. return _this2.root_.removeAttribute('aria-hidden');
  17916. },
  17917. setActionAriaHidden: function setActionAriaHidden() {
  17918. return getActionButton().setAttribute('aria-hidden', 'true');
  17919. },
  17920. unsetActionAriaHidden: function unsetActionAriaHidden() {
  17921. return getActionButton().removeAttribute('aria-hidden');
  17922. },
  17923. setActionText: function setActionText(text) {
  17924. getActionButton().textContent = text;
  17925. },
  17926. setMessageText: function setMessageText(text) {
  17927. getText().textContent = text;
  17928. },
  17929. setFocus: function setFocus() {
  17930. return getActionButton().focus();
  17931. },
  17932. isFocused: function isFocused() {
  17933. return document.activeElement === getActionButton();
  17934. },
  17935. visibilityIsHidden: function visibilityIsHidden() {
  17936. return document.hidden;
  17937. },
  17938. registerCapturedBlurHandler: function registerCapturedBlurHandler(handler) {
  17939. return getActionButton().addEventListener('blur', handler, true);
  17940. },
  17941. deregisterCapturedBlurHandler: function deregisterCapturedBlurHandler(handler) {
  17942. return getActionButton().removeEventListener('blur', handler, true);
  17943. },
  17944. registerVisibilityChangeHandler: function registerVisibilityChangeHandler(handler) {
  17945. return document.addEventListener('visibilitychange', handler);
  17946. },
  17947. deregisterVisibilityChangeHandler: function deregisterVisibilityChangeHandler(handler) {
  17948. return document.removeEventListener('visibilitychange', handler);
  17949. },
  17950. registerCapturedInteractionHandler: function registerCapturedInteractionHandler(evt, handler) {
  17951. return document.body.addEventListener(evt, handler, true);
  17952. },
  17953. deregisterCapturedInteractionHandler: function deregisterCapturedInteractionHandler(evt, handler) {
  17954. return document.body.removeEventListener(evt, handler, true);
  17955. },
  17956. registerActionClickHandler: function registerActionClickHandler(handler) {
  17957. return getActionButton().addEventListener('click', handler);
  17958. },
  17959. deregisterActionClickHandler: function deregisterActionClickHandler(handler) {
  17960. return getActionButton().removeEventListener('click', handler);
  17961. },
  17962. registerTransitionEndHandler: function registerTransitionEndHandler(handler) {
  17963. return _this2.root_.addEventListener(Object(__WEBPACK_IMPORTED_MODULE_2__material_animation_index__["a" /* getCorrectEventName */])(window, 'transitionend'), handler);
  17964. },
  17965. deregisterTransitionEndHandler: function deregisterTransitionEndHandler(handler) {
  17966. return _this2.root_.removeEventListener(Object(__WEBPACK_IMPORTED_MODULE_2__material_animation_index__["a" /* getCorrectEventName */])(window, 'transitionend'), handler);
  17967. },
  17968. notifyShow: function notifyShow() {
  17969. return _this2.emit(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.SHOW_EVENT);
  17970. },
  17971. notifyHide: function notifyHide() {
  17972. return _this2.emit(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.HIDE_EVENT);
  17973. }
  17974. });
  17975. }
  17976. }, {
  17977. key: 'dismissesOnAction',
  17978. get: function get() {
  17979. return this.foundation_.dismissesOnAction();
  17980. },
  17981. set: function set(dismissesOnAction) {
  17982. this.foundation_.setDismissOnAction(dismissesOnAction);
  17983. }
  17984. }], [{
  17985. key: 'attachTo',
  17986. value: function attachTo(root) {
  17987. return new MDCSnackbar(root);
  17988. }
  17989. }]);
  17990. return MDCSnackbar;
  17991. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCComponent"]);
  17992. /***/ }),
  17993. /* 126 */
  17994. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17995. "use strict";
  17996. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(3);
  17997. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(127);
  17998. 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; };
  17999. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  18000. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18001. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  18002. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  18003. /**
  18004. * @license
  18005. * Copyright 2016 Google Inc.
  18006. *
  18007. * Permission is hereby granted, free of charge, to any person obtaining a copy
  18008. * of this software and associated documentation files (the "Software"), to deal
  18009. * in the Software without restriction, including without limitation the rights
  18010. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18011. * copies of the Software, and to permit persons to whom the Software is
  18012. * furnished to do so, subject to the following conditions:
  18013. *
  18014. * The above copyright notice and this permission notice shall be included in
  18015. * all copies or substantial portions of the Software.
  18016. *
  18017. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18018. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18019. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18020. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18021. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18022. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18023. * THE SOFTWARE.
  18024. */
  18025. var MDCSnackbarFoundation = function (_MDCFoundation) {
  18026. _inherits(MDCSnackbarFoundation, _MDCFoundation);
  18027. _createClass(MDCSnackbarFoundation, [{
  18028. key: 'active',
  18029. get: function get() {
  18030. return this.active_;
  18031. }
  18032. }], [{
  18033. key: 'cssClasses',
  18034. get: function get() {
  18035. return __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */];
  18036. }
  18037. }, {
  18038. key: 'strings',
  18039. get: function get() {
  18040. return __WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */];
  18041. }
  18042. }, {
  18043. key: 'defaultAdapter',
  18044. get: function get() {
  18045. return {
  18046. addClass: function addClass() /* className: string */{},
  18047. removeClass: function removeClass() /* className: string */{},
  18048. setAriaHidden: function setAriaHidden() {},
  18049. unsetAriaHidden: function unsetAriaHidden() {},
  18050. setActionAriaHidden: function setActionAriaHidden() {},
  18051. unsetActionAriaHidden: function unsetActionAriaHidden() {},
  18052. setActionText: function setActionText() /* actionText: string */{},
  18053. setMessageText: function setMessageText() /* message: string */{},
  18054. setFocus: function setFocus() {},
  18055. isFocused: function isFocused() {
  18056. return (/* boolean */false
  18057. );
  18058. },
  18059. visibilityIsHidden: function visibilityIsHidden() {
  18060. return (/* boolean */false
  18061. );
  18062. },
  18063. registerCapturedBlurHandler: function registerCapturedBlurHandler() /* handler: EventListener */{},
  18064. deregisterCapturedBlurHandler: function deregisterCapturedBlurHandler() /* handler: EventListener */{},
  18065. registerVisibilityChangeHandler: function registerVisibilityChangeHandler() /* handler: EventListener */{},
  18066. deregisterVisibilityChangeHandler: function deregisterVisibilityChangeHandler() /* handler: EventListener */{},
  18067. registerCapturedInteractionHandler: function registerCapturedInteractionHandler() /* evtType: string, handler: EventListener */{},
  18068. deregisterCapturedInteractionHandler: function deregisterCapturedInteractionHandler() /* evtType: string, handler: EventListener */{},
  18069. registerActionClickHandler: function registerActionClickHandler() /* handler: EventListener */{},
  18070. deregisterActionClickHandler: function deregisterActionClickHandler() /* handler: EventListener */{},
  18071. registerTransitionEndHandler: function registerTransitionEndHandler() /* handler: EventListener */{},
  18072. deregisterTransitionEndHandler: function deregisterTransitionEndHandler() /* handler: EventListener */{},
  18073. notifyShow: function notifyShow() {},
  18074. notifyHide: function notifyHide() {}
  18075. };
  18076. }
  18077. }]);
  18078. function MDCSnackbarFoundation(adapter) {
  18079. _classCallCheck(this, MDCSnackbarFoundation);
  18080. var _this = _possibleConstructorReturn(this, (MDCSnackbarFoundation.__proto__ || Object.getPrototypeOf(MDCSnackbarFoundation)).call(this, _extends(MDCSnackbarFoundation.defaultAdapter, adapter)));
  18081. _this.active_ = false;
  18082. _this.actionWasClicked_ = false;
  18083. _this.dismissOnAction_ = true;
  18084. _this.firstFocus_ = true;
  18085. _this.pointerDownRecognized_ = false;
  18086. _this.snackbarHasFocus_ = false;
  18087. _this.snackbarData_ = null;
  18088. _this.queue_ = [];
  18089. _this.actionClickHandler_ = function () {
  18090. _this.actionWasClicked_ = true;
  18091. _this.invokeAction_();
  18092. };
  18093. _this.visibilitychangeHandler_ = function () {
  18094. clearTimeout(_this.timeoutId_);
  18095. _this.snackbarHasFocus_ = true;
  18096. if (!_this.adapter_.visibilityIsHidden()) {
  18097. setTimeout(_this.cleanup_.bind(_this), _this.snackbarData_.timeout || __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* numbers */].MESSAGE_TIMEOUT);
  18098. }
  18099. };
  18100. _this.interactionHandler_ = function (evt) {
  18101. if (evt.type === 'focus' && !_this.adapter_.isFocused()) {
  18102. return;
  18103. }
  18104. if (evt.type === 'touchstart' || evt.type === 'mousedown') {
  18105. _this.pointerDownRecognized_ = true;
  18106. }
  18107. _this.handlePossibleTabKeyboardFocus_(evt);
  18108. if (evt.type === 'focus') {
  18109. _this.pointerDownRecognized_ = false;
  18110. }
  18111. };
  18112. _this.blurHandler_ = function () {
  18113. clearTimeout(_this.timeoutId_);
  18114. _this.snackbarHasFocus_ = false;
  18115. _this.timeoutId_ = setTimeout(_this.cleanup_.bind(_this), _this.snackbarData_.timeout || __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* numbers */].MESSAGE_TIMEOUT);
  18116. };
  18117. return _this;
  18118. }
  18119. _createClass(MDCSnackbarFoundation, [{
  18120. key: 'init',
  18121. value: function init() {
  18122. this.adapter_.registerActionClickHandler(this.actionClickHandler_);
  18123. this.adapter_.setAriaHidden();
  18124. this.adapter_.setActionAriaHidden();
  18125. }
  18126. }, {
  18127. key: 'destroy',
  18128. value: function destroy() {
  18129. var _this2 = this;
  18130. this.adapter_.deregisterActionClickHandler(this.actionClickHandler_);
  18131. this.adapter_.deregisterCapturedBlurHandler(this.blurHandler_);
  18132. this.adapter_.deregisterVisibilityChangeHandler(this.visibilitychangeHandler_);
  18133. ['touchstart', 'mousedown', 'focus'].forEach(function (evtType) {
  18134. _this2.adapter_.deregisterCapturedInteractionHandler(evtType, _this2.interactionHandler_);
  18135. });
  18136. }
  18137. }, {
  18138. key: 'dismissesOnAction',
  18139. value: function dismissesOnAction() {
  18140. return this.dismissOnAction_;
  18141. }
  18142. }, {
  18143. key: 'setDismissOnAction',
  18144. value: function setDismissOnAction(dismissOnAction) {
  18145. this.dismissOnAction_ = !!dismissOnAction;
  18146. }
  18147. }, {
  18148. key: 'show',
  18149. value: function show(data) {
  18150. var _this3 = this;
  18151. if (!data) {
  18152. throw new Error('Please provide a data object with at least a message to display.');
  18153. }
  18154. if (!data.message) {
  18155. throw new Error('Please provide a message to be displayed.');
  18156. }
  18157. if (data.actionHandler && !data.actionText) {
  18158. throw new Error('Please provide action text with the handler.');
  18159. }
  18160. if (this.active) {
  18161. this.queue_.push(data);
  18162. return;
  18163. }
  18164. clearTimeout(this.timeoutId_);
  18165. this.snackbarData_ = data;
  18166. this.firstFocus_ = true;
  18167. this.adapter_.registerVisibilityChangeHandler(this.visibilitychangeHandler_);
  18168. this.adapter_.registerCapturedBlurHandler(this.blurHandler_);
  18169. ['touchstart', 'mousedown', 'focus'].forEach(function (evtType) {
  18170. _this3.adapter_.registerCapturedInteractionHandler(evtType, _this3.interactionHandler_);
  18171. });
  18172. var ACTIVE = __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].ACTIVE,
  18173. MULTILINE = __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].MULTILINE,
  18174. ACTION_ON_BOTTOM = __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].ACTION_ON_BOTTOM;
  18175. this.adapter_.setMessageText(this.snackbarData_.message);
  18176. if (this.snackbarData_.multiline) {
  18177. this.adapter_.addClass(MULTILINE);
  18178. if (this.snackbarData_.actionOnBottom) {
  18179. this.adapter_.addClass(ACTION_ON_BOTTOM);
  18180. }
  18181. }
  18182. if (this.snackbarData_.actionHandler) {
  18183. this.adapter_.setActionText(this.snackbarData_.actionText);
  18184. this.actionHandler_ = this.snackbarData_.actionHandler;
  18185. this.setActionHidden_(false);
  18186. } else {
  18187. this.setActionHidden_(true);
  18188. this.actionHandler_ = null;
  18189. this.adapter_.setActionText(null);
  18190. }
  18191. this.active_ = true;
  18192. this.adapter_.addClass(ACTIVE);
  18193. this.adapter_.unsetAriaHidden();
  18194. this.adapter_.notifyShow();
  18195. this.timeoutId_ = setTimeout(this.cleanup_.bind(this), this.snackbarData_.timeout || __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* numbers */].MESSAGE_TIMEOUT);
  18196. }
  18197. }, {
  18198. key: 'handlePossibleTabKeyboardFocus_',
  18199. value: function handlePossibleTabKeyboardFocus_() {
  18200. var hijackFocus = this.firstFocus_ && !this.pointerDownRecognized_;
  18201. if (hijackFocus) {
  18202. this.setFocusOnAction_();
  18203. }
  18204. this.firstFocus_ = false;
  18205. }
  18206. }, {
  18207. key: 'setFocusOnAction_',
  18208. value: function setFocusOnAction_() {
  18209. this.adapter_.setFocus();
  18210. this.snackbarHasFocus_ = true;
  18211. this.firstFocus_ = false;
  18212. }
  18213. }, {
  18214. key: 'invokeAction_',
  18215. value: function invokeAction_() {
  18216. try {
  18217. if (!this.actionHandler_) {
  18218. return;
  18219. }
  18220. this.actionHandler_();
  18221. } finally {
  18222. if (this.dismissOnAction_) {
  18223. this.cleanup_();
  18224. }
  18225. }
  18226. }
  18227. }, {
  18228. key: 'cleanup_',
  18229. value: function cleanup_() {
  18230. var _this4 = this;
  18231. var allowDismissal = !this.snackbarHasFocus_ || this.actionWasClicked_;
  18232. if (allowDismissal) {
  18233. var ACTIVE = __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].ACTIVE,
  18234. MULTILINE = __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].MULTILINE,
  18235. ACTION_ON_BOTTOM = __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].ACTION_ON_BOTTOM;
  18236. this.adapter_.removeClass(ACTIVE);
  18237. var handler = function handler() {
  18238. clearTimeout(_this4.timeoutId_);
  18239. _this4.adapter_.deregisterTransitionEndHandler(handler);
  18240. _this4.adapter_.removeClass(MULTILINE);
  18241. _this4.adapter_.removeClass(ACTION_ON_BOTTOM);
  18242. _this4.setActionHidden_(true);
  18243. _this4.adapter_.setAriaHidden();
  18244. _this4.active_ = false;
  18245. _this4.snackbarHasFocus_ = false;
  18246. _this4.adapter_.notifyHide();
  18247. _this4.showNext_();
  18248. };
  18249. this.adapter_.registerTransitionEndHandler(handler);
  18250. }
  18251. }
  18252. }, {
  18253. key: 'showNext_',
  18254. value: function showNext_() {
  18255. if (!this.queue_.length) {
  18256. return;
  18257. }
  18258. this.show(this.queue_.shift());
  18259. }
  18260. }, {
  18261. key: 'setActionHidden_',
  18262. value: function setActionHidden_(isHidden) {
  18263. if (isHidden) {
  18264. this.adapter_.setActionAriaHidden();
  18265. } else {
  18266. this.adapter_.unsetActionAriaHidden();
  18267. }
  18268. }
  18269. }]);
  18270. return MDCSnackbarFoundation;
  18271. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCFoundation"]);
  18272. /* harmony default export */ __webpack_exports__["a"] = (MDCSnackbarFoundation);
  18273. /***/ }),
  18274. /* 127 */
  18275. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18276. "use strict";
  18277. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  18278. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  18279. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  18280. /**
  18281. * @license
  18282. * Copyright 2016 Google Inc.
  18283. *
  18284. * Permission is hereby granted, free of charge, to any person obtaining a copy
  18285. * of this software and associated documentation files (the "Software"), to deal
  18286. * in the Software without restriction, including without limitation the rights
  18287. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18288. * copies of the Software, and to permit persons to whom the Software is
  18289. * furnished to do so, subject to the following conditions:
  18290. *
  18291. * The above copyright notice and this permission notice shall be included in
  18292. * all copies or substantial portions of the Software.
  18293. *
  18294. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18295. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18296. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18297. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18298. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18299. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18300. * THE SOFTWARE.
  18301. */
  18302. var cssClasses = {
  18303. ROOT: 'mdc-snackbar',
  18304. TEXT: 'mdc-snackbar__text',
  18305. ACTION_WRAPPER: 'mdc-snackbar__action-wrapper',
  18306. ACTION_BUTTON: 'mdc-snackbar__action-button',
  18307. ACTIVE: 'mdc-snackbar--active',
  18308. MULTILINE: 'mdc-snackbar--multiline',
  18309. ACTION_ON_BOTTOM: 'mdc-snackbar--action-on-bottom'
  18310. };
  18311. var strings = {
  18312. TEXT_SELECTOR: '.mdc-snackbar__text',
  18313. ACTION_WRAPPER_SELECTOR: '.mdc-snackbar__action-wrapper',
  18314. ACTION_BUTTON_SELECTOR: '.mdc-snackbar__action-button',
  18315. SHOW_EVENT: 'MDCSnackbar:show',
  18316. HIDE_EVENT: 'MDCSnackbar:hide'
  18317. };
  18318. var numbers = {
  18319. MESSAGE_TIMEOUT: 2750
  18320. };
  18321. /***/ }),
  18322. /* 128 */
  18323. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18324. "use strict";
  18325. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  18326. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSwitch", function() { return MDCSwitch; });
  18327. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  18328. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_selection_control_index__ = __webpack_require__(4);
  18329. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(129);
  18330. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_ripple_index__ = __webpack_require__(2);
  18331. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_ripple_util__ = __webpack_require__(6);
  18332. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSwitchFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  18333. 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; };
  18334. 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); } };
  18335. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  18336. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18337. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  18338. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  18339. /**
  18340. * @license
  18341. * Copyright 2018 Google Inc.
  18342. *
  18343. * Permission is hereby granted, free of charge, to any person obtaining a copy
  18344. * of this software and associated documentation files (the "Software"), to deal
  18345. * in the Software without restriction, including without limitation the rights
  18346. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18347. * copies of the Software, and to permit persons to whom the Software is
  18348. * furnished to do so, subject to the following conditions:
  18349. *
  18350. * The above copyright notice and this permission notice shall be included in
  18351. * all copies or substantial portions of the Software.
  18352. *
  18353. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18354. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18355. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18356. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18357. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18358. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18359. * THE SOFTWARE.
  18360. */
  18361. /* eslint-disable no-unused-vars */
  18362. /* eslint-enable no-unused-vars */
  18363. /**
  18364. * @extends MDCComponent<!MDCSwitchFoundation>
  18365. * @implements {MDCSelectionControl}
  18366. */
  18367. var MDCSwitch = function (_MDCComponent) {
  18368. _inherits(MDCSwitch, _MDCComponent);
  18369. _createClass(MDCSwitch, null, [{
  18370. key: 'attachTo',
  18371. value: function attachTo(root) {
  18372. return new MDCSwitch(root);
  18373. }
  18374. }]);
  18375. function MDCSwitch() {
  18376. var _ref;
  18377. _classCallCheck(this, MDCSwitch);
  18378. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  18379. args[_key] = arguments[_key];
  18380. }
  18381. /** @private {!MDCRipple} */
  18382. var _this = _possibleConstructorReturn(this, (_ref = MDCSwitch.__proto__ || Object.getPrototypeOf(MDCSwitch)).call.apply(_ref, [this].concat(args)));
  18383. _this.ripple_ = _this.initRipple_();
  18384. /** @private {!Function} */
  18385. _this.changeHandler_;
  18386. return _this;
  18387. }
  18388. _createClass(MDCSwitch, [{
  18389. key: 'destroy',
  18390. value: function destroy() {
  18391. _get(MDCSwitch.prototype.__proto__ || Object.getPrototypeOf(MDCSwitch.prototype), 'destroy', this).call(this);
  18392. this.ripple_.destroy();
  18393. this.nativeControl_.removeEventListener('change', this.changeHandler_);
  18394. }
  18395. }, {
  18396. key: 'initialSyncWithDOM',
  18397. value: function initialSyncWithDOM() {
  18398. this.changeHandler_ = this.foundation_.handleChange.bind(this.foundation_);
  18399. this.nativeControl_.addEventListener('change', this.changeHandler_);
  18400. // Sometimes the checked state of the input element is saved in the history.
  18401. // The switch styling should match the checked state of the input element.
  18402. // Do an initial sync between the native control and the foundation.
  18403. this.checked = this.checked;
  18404. }
  18405. /**
  18406. * Returns the state of the native control element, or null if the native control element is not present.
  18407. * @return {?MDCSelectionControlState}
  18408. * @private
  18409. */
  18410. }, {
  18411. key: 'initRipple_',
  18412. /**
  18413. * @return {!MDCRipple}
  18414. * @private
  18415. */
  18416. value: function initRipple_() {
  18417. var _this2 = this;
  18418. var RIPPLE_SURFACE_SELECTOR = __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.RIPPLE_SURFACE_SELECTOR;
  18419. var rippleSurface = /** @type {!Element} */this.root_.querySelector(RIPPLE_SURFACE_SELECTOR);
  18420. var MATCHES = Object(__WEBPACK_IMPORTED_MODULE_4__material_ripple_util__["getMatchesProperty"])(HTMLElement.prototype);
  18421. var adapter = _extends(__WEBPACK_IMPORTED_MODULE_3__material_ripple_index__["MDCRipple"].createAdapter(this), {
  18422. isUnbounded: function isUnbounded() {
  18423. return true;
  18424. },
  18425. isSurfaceActive: function isSurfaceActive() {
  18426. return _this2.nativeControl_[MATCHES](':active');
  18427. },
  18428. addClass: function addClass(className) {
  18429. return rippleSurface.classList.add(className);
  18430. },
  18431. removeClass: function removeClass(className) {
  18432. return rippleSurface.classList.remove(className);
  18433. },
  18434. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  18435. return _this2.nativeControl_.addEventListener(type, handler);
  18436. },
  18437. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  18438. return _this2.nativeControl_.removeEventListener(type, handler);
  18439. },
  18440. updateCssVariable: function updateCssVariable(varName, value) {
  18441. return rippleSurface.style.setProperty(varName, value);
  18442. },
  18443. computeBoundingRect: function computeBoundingRect() {
  18444. return rippleSurface.getBoundingClientRect();
  18445. }
  18446. });
  18447. var foundation = new __WEBPACK_IMPORTED_MODULE_3__material_ripple_index__["MDCRippleFoundation"](adapter);
  18448. return new __WEBPACK_IMPORTED_MODULE_3__material_ripple_index__["MDCRipple"](this.root_, foundation);
  18449. }
  18450. /** @return {!MDCSwitchFoundation} */
  18451. }, {
  18452. key: 'getDefaultFoundation',
  18453. value: function getDefaultFoundation() {
  18454. var _this3 = this;
  18455. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]({
  18456. addClass: function addClass(className) {
  18457. return _this3.root_.classList.add(className);
  18458. },
  18459. removeClass: function removeClass(className) {
  18460. return _this3.root_.classList.remove(className);
  18461. },
  18462. setNativeControlChecked: function setNativeControlChecked(checked) {
  18463. return _this3.nativeControl_.checked = checked;
  18464. },
  18465. setNativeControlDisabled: function setNativeControlDisabled(disabled) {
  18466. return _this3.nativeControl_.disabled = disabled;
  18467. }
  18468. });
  18469. }
  18470. /** @return {!MDCRipple} */
  18471. }, {
  18472. key: 'nativeControl_',
  18473. get: function get() {
  18474. var NATIVE_CONTROL_SELECTOR = __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.NATIVE_CONTROL_SELECTOR;
  18475. var el = /** @type {?MDCSelectionControlState} */this.root_.querySelector(NATIVE_CONTROL_SELECTOR);
  18476. return el;
  18477. }
  18478. }, {
  18479. key: 'ripple',
  18480. get: function get() {
  18481. return this.ripple_;
  18482. }
  18483. /** @return {boolean} */
  18484. }, {
  18485. key: 'checked',
  18486. get: function get() {
  18487. return this.nativeControl_.checked;
  18488. }
  18489. /** @param {boolean} checked */
  18490. ,
  18491. set: function set(checked) {
  18492. this.foundation_.setChecked(checked);
  18493. }
  18494. /** @return {boolean} */
  18495. }, {
  18496. key: 'disabled',
  18497. get: function get() {
  18498. return this.nativeControl_.disabled;
  18499. }
  18500. /** @param {boolean} disabled */
  18501. ,
  18502. set: function set(disabled) {
  18503. this.foundation_.setDisabled(disabled);
  18504. }
  18505. }]);
  18506. return MDCSwitch;
  18507. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  18508. /***/ }),
  18509. /* 129 */
  18510. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18511. "use strict";
  18512. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  18513. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(130);
  18514. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(131);
  18515. 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; };
  18516. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  18517. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18518. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  18519. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  18520. /**
  18521. * @license
  18522. * Copyright 2018 Google Inc.
  18523. *
  18524. * Permission is hereby granted, free of charge, to any person obtaining a copy
  18525. * of this software and associated documentation files (the "Software"), to deal
  18526. * in the Software without restriction, including without limitation the rights
  18527. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18528. * copies of the Software, and to permit persons to whom the Software is
  18529. * furnished to do so, subject to the following conditions:
  18530. *
  18531. * The above copyright notice and this permission notice shall be included in
  18532. * all copies or substantial portions of the Software.
  18533. *
  18534. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18535. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18536. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18537. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18538. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18539. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18540. * THE SOFTWARE.
  18541. */
  18542. /* eslint-enable no-unused-vars */
  18543. /**
  18544. * @extends {MDCFoundation<!MDCSwitchAdapter>}
  18545. */
  18546. var MDCSwitchFoundation = function (_MDCFoundation) {
  18547. _inherits(MDCSwitchFoundation, _MDCFoundation);
  18548. _createClass(MDCSwitchFoundation, null, [{
  18549. key: 'strings',
  18550. /** @return enum {string} */
  18551. get: function get() {
  18552. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  18553. }
  18554. /** @return enum {string} */
  18555. }, {
  18556. key: 'cssClasses',
  18557. get: function get() {
  18558. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  18559. }
  18560. /** @return {!MDCSwitchAdapter} */
  18561. }, {
  18562. key: 'defaultAdapter',
  18563. get: function get() {
  18564. return (/** @type {!MDCSwitchAdapter} */{
  18565. addClass: function addClass() /* className: string */{},
  18566. removeClass: function removeClass() /* className: string */{},
  18567. setNativeControlChecked: function setNativeControlChecked() /* checked: boolean */{},
  18568. setNativeControlDisabled: function setNativeControlDisabled() /* disabled: boolean */{}
  18569. }
  18570. );
  18571. }
  18572. }]);
  18573. function MDCSwitchFoundation(adapter) {
  18574. _classCallCheck(this, MDCSwitchFoundation);
  18575. return _possibleConstructorReturn(this, (MDCSwitchFoundation.__proto__ || Object.getPrototypeOf(MDCSwitchFoundation)).call(this, _extends(MDCSwitchFoundation.defaultAdapter, adapter)));
  18576. }
  18577. /** @param {boolean} checked */
  18578. _createClass(MDCSwitchFoundation, [{
  18579. key: 'setChecked',
  18580. value: function setChecked(checked) {
  18581. this.adapter_.setNativeControlChecked(checked);
  18582. this.updateCheckedStyling_(checked);
  18583. }
  18584. /** @param {boolean} disabled */
  18585. }, {
  18586. key: 'setDisabled',
  18587. value: function setDisabled(disabled) {
  18588. this.adapter_.setNativeControlDisabled(disabled);
  18589. if (disabled) {
  18590. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].DISABLED);
  18591. } else {
  18592. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].DISABLED);
  18593. }
  18594. }
  18595. /**
  18596. * Handles the change event for the switch native control.
  18597. * @param {!Event} evt
  18598. */
  18599. }, {
  18600. key: 'handleChange',
  18601. value: function handleChange(evt) {
  18602. this.updateCheckedStyling_(evt.target.checked);
  18603. }
  18604. /**
  18605. * Updates the styling of the switch based on its checked state.
  18606. * @param {boolean} checked
  18607. * @private
  18608. */
  18609. }, {
  18610. key: 'updateCheckedStyling_',
  18611. value: function updateCheckedStyling_(checked) {
  18612. if (checked) {
  18613. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CHECKED);
  18614. } else {
  18615. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CHECKED);
  18616. }
  18617. }
  18618. }]);
  18619. return MDCSwitchFoundation;
  18620. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  18621. /* harmony default export */ __webpack_exports__["a"] = (MDCSwitchFoundation);
  18622. /***/ }),
  18623. /* 130 */
  18624. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18625. "use strict";
  18626. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  18627. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18628. /**
  18629. * @license
  18630. * Copyright 2018 Google Inc.
  18631. *
  18632. * Permission is hereby granted, free of charge, to any person obtaining a copy
  18633. * of this software and associated documentation files (the "Software"), to deal
  18634. * in the Software without restriction, including without limitation the rights
  18635. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18636. * copies of the Software, and to permit persons to whom the Software is
  18637. * furnished to do so, subject to the following conditions:
  18638. *
  18639. * The above copyright notice and this permission notice shall be included in
  18640. * all copies or substantial portions of the Software.
  18641. *
  18642. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18643. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18644. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18645. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18646. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18647. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18648. * THE SOFTWARE.
  18649. */
  18650. /* eslint no-unused-vars: [2, {"args": "none"}] */
  18651. /**
  18652. * Adapter for MDC Switch. Provides an interface for managing
  18653. * - classes
  18654. * - dom
  18655. *
  18656. * Additionally, provides type information for the adapter to the Closure
  18657. * compiler.
  18658. *
  18659. * Implement this adapter for your framework of choice to delegate updates to
  18660. * the component in your framework of choice. See architecture documentation
  18661. * for more details.
  18662. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  18663. *
  18664. * @record
  18665. */
  18666. var MDCSwitchAdapter = function () {
  18667. function MDCSwitchAdapter() {
  18668. _classCallCheck(this, MDCSwitchAdapter);
  18669. }
  18670. _createClass(MDCSwitchAdapter, [{
  18671. key: "addClass",
  18672. /** @param {string} className */
  18673. value: function addClass(className) {}
  18674. /** @param {string} className */
  18675. }, {
  18676. key: "removeClass",
  18677. value: function removeClass(className) {}
  18678. /** @param {boolean} checked */
  18679. }, {
  18680. key: "setNativeControlChecked",
  18681. value: function setNativeControlChecked(checked) {}
  18682. /** @param {boolean} disabled */
  18683. }, {
  18684. key: "setNativeControlDisabled",
  18685. value: function setNativeControlDisabled(disabled) {}
  18686. }]);
  18687. return MDCSwitchAdapter;
  18688. }();
  18689. /* unused harmony default export */ var _unused_webpack_default_export = (MDCSwitchAdapter);
  18690. /***/ }),
  18691. /* 131 */
  18692. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18693. "use strict";
  18694. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  18695. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  18696. /**
  18697. * @license
  18698. * Copyright 2018 Google Inc.
  18699. *
  18700. * Permission is hereby granted, free of charge, to any person obtaining a copy
  18701. * of this software and associated documentation files (the "Software"), to deal
  18702. * in the Software without restriction, including without limitation the rights
  18703. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18704. * copies of the Software, and to permit persons to whom the Software is
  18705. * furnished to do so, subject to the following conditions:
  18706. *
  18707. * The above copyright notice and this permission notice shall be included in
  18708. * all copies or substantial portions of the Software.
  18709. *
  18710. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18711. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18712. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18713. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18714. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18715. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18716. * THE SOFTWARE.
  18717. */
  18718. /** @enum {string} */
  18719. var cssClasses = {
  18720. CHECKED: 'mdc-switch--checked',
  18721. DISABLED: 'mdc-switch--disabled'
  18722. };
  18723. /** @enum {string} */
  18724. var strings = {
  18725. NATIVE_CONTROL_SELECTOR: '.mdc-switch__native-control',
  18726. RIPPLE_SURFACE_SELECTOR: '.mdc-switch__thumb-underlay'
  18727. };
  18728. /***/ }),
  18729. /* 132 */
  18730. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18731. "use strict";
  18732. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  18733. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  18734. /**
  18735. * @license
  18736. * Copyright 2018 Google Inc.
  18737. *
  18738. * Permission is hereby granted, free of charge, to any person obtaining a copy
  18739. * of this software and associated documentation files (the "Software"), to deal
  18740. * in the Software without restriction, including without limitation the rights
  18741. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18742. * copies of the Software, and to permit persons to whom the Software is
  18743. * furnished to do so, subject to the following conditions:
  18744. *
  18745. * The above copyright notice and this permission notice shall be included in
  18746. * all copies or substantial portions of the Software.
  18747. *
  18748. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18749. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18750. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18751. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18752. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18753. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18754. * THE SOFTWARE.
  18755. */
  18756. /** @enum {string} */
  18757. var cssClasses = {
  18758. ACTIVE: 'mdc-tab-indicator--active',
  18759. FADE: 'mdc-tab-indicator--fade',
  18760. NO_TRANSITION: 'mdc-tab-indicator--no-transition'
  18761. };
  18762. /** @enum {string} */
  18763. var strings = {
  18764. CONTENT_SELECTOR: '.mdc-tab-indicator__content'
  18765. };
  18766. /***/ }),
  18767. /* 133 */
  18768. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18769. "use strict";
  18770. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation__ = __webpack_require__(26);
  18771. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  18772. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18773. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  18774. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  18775. /**
  18776. * @license
  18777. * Copyright 2018 Google Inc.
  18778. *
  18779. * Permission is hereby granted, free of charge, to any person obtaining a copy
  18780. * of this software and associated documentation files (the "Software"), to deal
  18781. * in the Software without restriction, including without limitation the rights
  18782. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18783. * copies of the Software, and to permit persons to whom the Software is
  18784. * furnished to do so, subject to the following conditions:
  18785. *
  18786. * The above copyright notice and this permission notice shall be included in
  18787. * all copies or substantial portions of the Software.
  18788. *
  18789. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18790. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18791. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18792. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18793. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18794. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18795. * THE SOFTWARE.
  18796. */
  18797. /**
  18798. * @extends {MDCTabIndicatorFoundation}
  18799. * @final
  18800. */
  18801. var MDCSlidingTabIndicatorFoundation = function (_MDCTabIndicatorFound) {
  18802. _inherits(MDCSlidingTabIndicatorFoundation, _MDCTabIndicatorFound);
  18803. function MDCSlidingTabIndicatorFoundation() {
  18804. _classCallCheck(this, MDCSlidingTabIndicatorFoundation);
  18805. return _possibleConstructorReturn(this, (MDCSlidingTabIndicatorFoundation.__proto__ || Object.getPrototypeOf(MDCSlidingTabIndicatorFoundation)).apply(this, arguments));
  18806. }
  18807. _createClass(MDCSlidingTabIndicatorFoundation, [{
  18808. key: 'activate',
  18809. /** @param {!ClientRect=} previousIndicatorClientRect */
  18810. value: function activate(previousIndicatorClientRect) {
  18811. // Early exit if no indicator is present to handle cases where an indicator
  18812. // may be activated without a prior indicator state
  18813. if (!previousIndicatorClientRect) {
  18814. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.ACTIVE);
  18815. return;
  18816. }
  18817. // This animation uses the FLIP approach. You can read more about it at the link below:
  18818. // https://aerotwist.com/blog/flip-your-animations/
  18819. // Calculate the dimensions based on the dimensions of the previous indicator
  18820. var currentClientRect = this.computeContentClientRect();
  18821. var widthDelta = previousIndicatorClientRect.width / currentClientRect.width;
  18822. var xPosition = previousIndicatorClientRect.left - currentClientRect.left;
  18823. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.NO_TRANSITION);
  18824. this.adapter_.setContentStyleProperty('transform', 'translateX(' + xPosition + 'px) scaleX(' + widthDelta + ')');
  18825. // Force repaint before updating classes and transform to ensure the transform properly takes effect
  18826. this.computeContentClientRect();
  18827. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.NO_TRANSITION);
  18828. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.ACTIVE);
  18829. this.adapter_.setContentStyleProperty('transform', '');
  18830. }
  18831. }, {
  18832. key: 'deactivate',
  18833. value: function deactivate() {
  18834. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.ACTIVE);
  18835. }
  18836. }]);
  18837. return MDCSlidingTabIndicatorFoundation;
  18838. }(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */]);
  18839. /* harmony default export */ __webpack_exports__["a"] = (MDCSlidingTabIndicatorFoundation);
  18840. /***/ }),
  18841. /* 134 */
  18842. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18843. "use strict";
  18844. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation__ = __webpack_require__(26);
  18845. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  18846. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18847. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  18848. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  18849. /**
  18850. * @license
  18851. * Copyright 2018 Google Inc.
  18852. *
  18853. * Permission is hereby granted, free of charge, to any person obtaining a copy
  18854. * of this software and associated documentation files (the "Software"), to deal
  18855. * in the Software without restriction, including without limitation the rights
  18856. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18857. * copies of the Software, and to permit persons to whom the Software is
  18858. * furnished to do so, subject to the following conditions:
  18859. *
  18860. * The above copyright notice and this permission notice shall be included in
  18861. * all copies or substantial portions of the Software.
  18862. *
  18863. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18864. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18865. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18866. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18867. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18868. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18869. * THE SOFTWARE.
  18870. */
  18871. /**
  18872. * @extends {MDCTabIndicatorFoundation}
  18873. * @final
  18874. */
  18875. var MDCFadingTabIndicatorFoundation = function (_MDCTabIndicatorFound) {
  18876. _inherits(MDCFadingTabIndicatorFoundation, _MDCTabIndicatorFound);
  18877. function MDCFadingTabIndicatorFoundation() {
  18878. _classCallCheck(this, MDCFadingTabIndicatorFoundation);
  18879. return _possibleConstructorReturn(this, (MDCFadingTabIndicatorFoundation.__proto__ || Object.getPrototypeOf(MDCFadingTabIndicatorFoundation)).apply(this, arguments));
  18880. }
  18881. _createClass(MDCFadingTabIndicatorFoundation, [{
  18882. key: 'activate',
  18883. value: function activate() {
  18884. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.ACTIVE);
  18885. }
  18886. }, {
  18887. key: 'deactivate',
  18888. value: function deactivate() {
  18889. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.ACTIVE);
  18890. }
  18891. }]);
  18892. return MDCFadingTabIndicatorFoundation;
  18893. }(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */]);
  18894. /* harmony default export */ __webpack_exports__["a"] = (MDCFadingTabIndicatorFoundation);
  18895. /***/ }),
  18896. /* 135 */
  18897. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18898. "use strict";
  18899. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  18900. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(11);
  18901. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(136);
  18902. 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; };
  18903. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  18904. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18905. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  18906. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  18907. /**
  18908. * @license
  18909. * Copyright 2018 Google Inc.
  18910. *
  18911. * Permission is hereby granted, free of charge, to any person obtaining a copy
  18912. * of this software and associated documentation files (the "Software"), to deal
  18913. * in the Software without restriction, including without limitation the rights
  18914. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18915. * copies of the Software, and to permit persons to whom the Software is
  18916. * furnished to do so, subject to the following conditions:
  18917. *
  18918. * The above copyright notice and this permission notice shall be included in
  18919. * all copies or substantial portions of the Software.
  18920. *
  18921. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18922. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18923. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18924. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18925. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18926. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18927. * THE SOFTWARE.
  18928. */
  18929. /* eslint-disable no-unused-vars */
  18930. /* eslint-enable no-unused-vars */
  18931. /**
  18932. * @extends {MDCFoundation<!MDCTabAdapter>}
  18933. * @final
  18934. */
  18935. var MDCTabFoundation = function (_MDCFoundation) {
  18936. _inherits(MDCTabFoundation, _MDCFoundation);
  18937. _createClass(MDCTabFoundation, null, [{
  18938. key: 'cssClasses',
  18939. /** @return enum {string} */
  18940. get: function get() {
  18941. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  18942. }
  18943. /** @return enum {string} */
  18944. }, {
  18945. key: 'strings',
  18946. get: function get() {
  18947. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  18948. }
  18949. /**
  18950. * @see MDCTabAdapter for typing information
  18951. * @return {!MDCTabAdapter}
  18952. */
  18953. }, {
  18954. key: 'defaultAdapter',
  18955. get: function get() {
  18956. return (/** @type {!MDCTabAdapter} */{
  18957. addClass: function addClass() {},
  18958. removeClass: function removeClass() {},
  18959. hasClass: function hasClass() {},
  18960. setAttr: function setAttr() {},
  18961. activateIndicator: function activateIndicator() {},
  18962. deactivateIndicator: function deactivateIndicator() {},
  18963. notifyInteracted: function notifyInteracted() {},
  18964. getOffsetLeft: function getOffsetLeft() {},
  18965. getOffsetWidth: function getOffsetWidth() {},
  18966. getContentOffsetLeft: function getContentOffsetLeft() {},
  18967. getContentOffsetWidth: function getContentOffsetWidth() {},
  18968. focus: function focus() {}
  18969. }
  18970. );
  18971. }
  18972. /** @param {!MDCTabAdapter} adapter */
  18973. }]);
  18974. function MDCTabFoundation(adapter) {
  18975. _classCallCheck(this, MDCTabFoundation);
  18976. /** @private {boolean} */
  18977. var _this = _possibleConstructorReturn(this, (MDCTabFoundation.__proto__ || Object.getPrototypeOf(MDCTabFoundation)).call(this, _extends(MDCTabFoundation.defaultAdapter, adapter)));
  18978. _this.focusOnActivate_ = true;
  18979. return _this;
  18980. }
  18981. /**
  18982. * Handles the "click" event
  18983. */
  18984. _createClass(MDCTabFoundation, [{
  18985. key: 'handleClick',
  18986. value: function handleClick() {
  18987. // It's up to the parent component to keep track of the active Tab and
  18988. // ensure we don't activate a Tab that's already active.
  18989. this.adapter_.notifyInteracted();
  18990. }
  18991. /**
  18992. * Returns the Tab's active state
  18993. * @return {boolean}
  18994. */
  18995. }, {
  18996. key: 'isActive',
  18997. value: function isActive() {
  18998. return this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ACTIVE);
  18999. }
  19000. /**
  19001. * Sets whether the tab should focus itself when activated
  19002. * @param {boolean} focusOnActivate
  19003. */
  19004. }, {
  19005. key: 'setFocusOnActivate',
  19006. value: function setFocusOnActivate(focusOnActivate) {
  19007. this.focusOnActivate_ = focusOnActivate;
  19008. }
  19009. /**
  19010. * Activates the Tab
  19011. * @param {!ClientRect=} previousIndicatorClientRect
  19012. */
  19013. }, {
  19014. key: 'activate',
  19015. value: function activate(previousIndicatorClientRect) {
  19016. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ACTIVE);
  19017. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_SELECTED, 'true');
  19018. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].TABINDEX, '0');
  19019. this.adapter_.activateIndicator(previousIndicatorClientRect);
  19020. if (this.focusOnActivate_) {
  19021. this.adapter_.focus();
  19022. }
  19023. }
  19024. /**
  19025. * Deactivates the Tab
  19026. */
  19027. }, {
  19028. key: 'deactivate',
  19029. value: function deactivate() {
  19030. // Early exit
  19031. if (!this.isActive()) {
  19032. return;
  19033. }
  19034. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ACTIVE);
  19035. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_SELECTED, 'false');
  19036. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].TABINDEX, '-1');
  19037. this.adapter_.deactivateIndicator();
  19038. }
  19039. /**
  19040. * Returns the dimensions of the Tab
  19041. * @return {!MDCTabDimensions}
  19042. */
  19043. }, {
  19044. key: 'computeDimensions',
  19045. value: function computeDimensions() {
  19046. var rootWidth = this.adapter_.getOffsetWidth();
  19047. var rootLeft = this.adapter_.getOffsetLeft();
  19048. var contentWidth = this.adapter_.getContentOffsetWidth();
  19049. var contentLeft = this.adapter_.getContentOffsetLeft();
  19050. return {
  19051. rootLeft: rootLeft,
  19052. rootRight: rootLeft + rootWidth,
  19053. contentLeft: rootLeft + contentLeft,
  19054. contentRight: rootLeft + contentLeft + contentWidth
  19055. };
  19056. }
  19057. }]);
  19058. return MDCTabFoundation;
  19059. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  19060. /* harmony default export */ __webpack_exports__["a"] = (MDCTabFoundation);
  19061. /***/ }),
  19062. /* 136 */
  19063. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19064. "use strict";
  19065. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  19066. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  19067. /**
  19068. * @license
  19069. * Copyright 2018 Google Inc.
  19070. *
  19071. * Permission is hereby granted, free of charge, to any person obtaining a copy
  19072. * of this software and associated documentation files (the "Software"), to deal
  19073. * in the Software without restriction, including without limitation the rights
  19074. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  19075. * copies of the Software, and to permit persons to whom the Software is
  19076. * furnished to do so, subject to the following conditions:
  19077. *
  19078. * The above copyright notice and this permission notice shall be included in
  19079. * all copies or substantial portions of the Software.
  19080. *
  19081. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19082. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19083. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19084. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19085. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19086. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19087. * THE SOFTWARE.
  19088. */
  19089. /** @enum {string} */
  19090. var cssClasses = {
  19091. ACTIVE: 'mdc-tab--active'
  19092. };
  19093. /** @enum {string} */
  19094. var strings = {
  19095. ARIA_SELECTED: 'aria-selected',
  19096. RIPPLE_SELECTOR: '.mdc-tab__ripple',
  19097. CONTENT_SELECTOR: '.mdc-tab__content',
  19098. TAB_INDICATOR_SELECTOR: '.mdc-tab-indicator',
  19099. TABINDEX: 'tabIndex',
  19100. INTERACTED_EVENT: 'MDCTab:interacted'
  19101. };
  19102. /***/ }),
  19103. /* 137 */
  19104. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19105. "use strict";
  19106. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  19107. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTabBar", function() { return MDCTabBar; });
  19108. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  19109. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_tab_index__ = __webpack_require__(25);
  19110. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_tab_scroller_index__ = __webpack_require__(56);
  19111. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__adapter__ = __webpack_require__(58);
  19112. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation__ = __webpack_require__(143);
  19113. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTabBarFoundation", function() { return __WEBPACK_IMPORTED_MODULE_4__foundation__["a"]; });
  19114. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  19115. 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); } };
  19116. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19117. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  19118. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  19119. /**
  19120. * @license
  19121. * Copyright 2018 Google Inc.
  19122. *
  19123. * Permission is hereby granted, free of charge, to any person obtaining a copy
  19124. * of this software and associated documentation files (the "Software"), to deal
  19125. * in the Software without restriction, including without limitation the rights
  19126. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  19127. * copies of the Software, and to permit persons to whom the Software is
  19128. * furnished to do so, subject to the following conditions:
  19129. *
  19130. * The above copyright notice and this permission notice shall be included in
  19131. * all copies or substantial portions of the Software.
  19132. *
  19133. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19134. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19135. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19136. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19137. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19138. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19139. * THE SOFTWARE.
  19140. */
  19141. /**
  19142. * @extends {MDCComponent<!MDCTabBarFoundation>}
  19143. * @final
  19144. */
  19145. var MDCTabBar = function (_MDCComponent) {
  19146. _inherits(MDCTabBar, _MDCComponent);
  19147. /**
  19148. * @param {...?} args
  19149. */
  19150. function MDCTabBar() {
  19151. var _ref;
  19152. _classCallCheck(this, MDCTabBar);
  19153. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  19154. args[_key] = arguments[_key];
  19155. }
  19156. /** @private {!Array<!MDCTab>} */
  19157. var _this = _possibleConstructorReturn(this, (_ref = MDCTabBar.__proto__ || Object.getPrototypeOf(MDCTabBar)).call.apply(_ref, [this].concat(args)));
  19158. _this.tabList_;
  19159. /** @type {(function(!Element): !MDCTab)} */
  19160. _this.tabFactory_;
  19161. /** @private {?MDCTabScroller} */
  19162. _this.tabScroller_;
  19163. /** @type {(function(!Element): !MDCTabScroller)} */
  19164. _this.tabScrollerFactory_;
  19165. /** @private {?function(?Event): undefined} */
  19166. _this.handleTabInteraction_;
  19167. /** @private {?function(?Event): undefined} */
  19168. _this.handleKeyDown_;
  19169. return _this;
  19170. }
  19171. /**
  19172. * @param {!Element} root
  19173. * @return {!MDCTabBar}
  19174. */
  19175. _createClass(MDCTabBar, [{
  19176. key: 'initialize',
  19177. /**
  19178. * @param {(function(!Element): !MDCTab)=} tabFactory A function which creates a new MDCTab
  19179. * @param {(function(!Element): !MDCTabScroller)=} tabScrollerFactory A function which creates a new MDCTabScroller
  19180. */
  19181. value: function initialize() {
  19182. var _this2 = this;
  19183. var tabFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el) {
  19184. return new __WEBPACK_IMPORTED_MODULE_1__material_tab_index__["MDCTab"](el);
  19185. };
  19186. var tabScrollerFactory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (el) {
  19187. return new __WEBPACK_IMPORTED_MODULE_2__material_tab_scroller_index__["MDCTabScroller"](el);
  19188. };
  19189. this.tabFactory_ = tabFactory;
  19190. this.tabScrollerFactory_ = tabScrollerFactory;
  19191. this.tabList_ = this.getTabElements_().map(function (el) {
  19192. return _this2.tabFactory_(el);
  19193. });
  19194. var tabScrollerElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */].strings.TAB_SCROLLER_SELECTOR);
  19195. if (tabScrollerElement) {
  19196. this.tabScroller_ = this.tabScrollerFactory_(tabScrollerElement);
  19197. }
  19198. }
  19199. }, {
  19200. key: 'initialSyncWithDOM',
  19201. value: function initialSyncWithDOM() {
  19202. var _this3 = this;
  19203. this.handleTabInteraction_ = function (evt) {
  19204. return _this3.foundation_.handleTabInteraction(evt);
  19205. };
  19206. this.handleKeyDown_ = function (evt) {
  19207. return _this3.foundation_.handleKeyDown(evt);
  19208. };
  19209. this.root_.addEventListener(__WEBPACK_IMPORTED_MODULE_1__material_tab_index__["MDCTabFoundation"].strings.INTERACTED_EVENT, this.handleTabInteraction_);
  19210. this.root_.addEventListener('keydown', this.handleKeyDown_);
  19211. for (var i = 0; i < this.tabList_.length; i++) {
  19212. if (this.tabList_[i].active) {
  19213. this.scrollIntoView(i);
  19214. break;
  19215. }
  19216. }
  19217. }
  19218. }, {
  19219. key: 'destroy',
  19220. value: function destroy() {
  19221. _get(MDCTabBar.prototype.__proto__ || Object.getPrototypeOf(MDCTabBar.prototype), 'destroy', this).call(this);
  19222. this.root_.removeEventListener(__WEBPACK_IMPORTED_MODULE_1__material_tab_index__["MDCTabFoundation"].strings.INTERACTED_EVENT, this.handleTabInteraction_);
  19223. this.root_.removeEventListener('keydown', this.handleKeyDown_);
  19224. this.tabList_.forEach(function (tab) {
  19225. return tab.destroy();
  19226. });
  19227. this.tabScroller_.destroy();
  19228. }
  19229. /**
  19230. * @return {!MDCTabBarFoundation}
  19231. */
  19232. }, {
  19233. key: 'getDefaultFoundation',
  19234. value: function getDefaultFoundation() {
  19235. var _this4 = this;
  19236. return new __WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */](
  19237. /** @type {!MDCTabBarAdapter} */{
  19238. scrollTo: function scrollTo(scrollX) {
  19239. return _this4.tabScroller_.scrollTo(scrollX);
  19240. },
  19241. incrementScroll: function incrementScroll(scrollXIncrement) {
  19242. return _this4.tabScroller_.incrementScroll(scrollXIncrement);
  19243. },
  19244. getScrollPosition: function getScrollPosition() {
  19245. return _this4.tabScroller_.getScrollPosition();
  19246. },
  19247. getScrollContentWidth: function getScrollContentWidth() {
  19248. return _this4.tabScroller_.getScrollContentWidth();
  19249. },
  19250. getOffsetWidth: function getOffsetWidth() {
  19251. return _this4.root_.offsetWidth;
  19252. },
  19253. isRTL: function isRTL() {
  19254. return window.getComputedStyle(_this4.root_).getPropertyValue('direction') === 'rtl';
  19255. },
  19256. setActiveTab: function setActiveTab(index) {
  19257. return _this4.foundation_.activateTab(index);
  19258. },
  19259. activateTabAtIndex: function activateTabAtIndex(index, clientRect) {
  19260. return _this4.tabList_[index].activate(clientRect);
  19261. },
  19262. deactivateTabAtIndex: function deactivateTabAtIndex(index) {
  19263. return _this4.tabList_[index].deactivate();
  19264. },
  19265. focusTabAtIndex: function focusTabAtIndex(index) {
  19266. return _this4.tabList_[index].focus();
  19267. },
  19268. getTabIndicatorClientRectAtIndex: function getTabIndicatorClientRectAtIndex(index) {
  19269. return _this4.tabList_[index].computeIndicatorClientRect();
  19270. },
  19271. getTabDimensionsAtIndex: function getTabDimensionsAtIndex(index) {
  19272. return _this4.tabList_[index].computeDimensions();
  19273. },
  19274. getPreviousActiveTabIndex: function getPreviousActiveTabIndex() {
  19275. for (var i = 0; i < _this4.tabList_.length; i++) {
  19276. if (_this4.tabList_[i].active) {
  19277. return i;
  19278. }
  19279. }
  19280. return -1;
  19281. },
  19282. getFocusedTabIndex: function getFocusedTabIndex() {
  19283. var tabElements = _this4.getTabElements_();
  19284. var activeElement = document.activeElement;
  19285. return tabElements.indexOf(activeElement);
  19286. },
  19287. getIndexOfTab: function getIndexOfTab(tabToFind) {
  19288. return _this4.tabList_.indexOf(tabToFind);
  19289. },
  19290. getTabListLength: function getTabListLength() {
  19291. return _this4.tabList_.length;
  19292. },
  19293. notifyTabActivated: function notifyTabActivated(index) {
  19294. return _this4.emit(__WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */].strings.TAB_ACTIVATED_EVENT, { index: index }, true);
  19295. }
  19296. });
  19297. }
  19298. /**
  19299. * Activates the tab at the given index
  19300. * @param {number} index The index of the tab
  19301. */
  19302. }, {
  19303. key: 'activateTab',
  19304. value: function activateTab(index) {
  19305. this.foundation_.activateTab(index);
  19306. }
  19307. /**
  19308. * Scrolls the tab at the given index into view
  19309. * @param {number} index THe index of the tab
  19310. */
  19311. }, {
  19312. key: 'scrollIntoView',
  19313. value: function scrollIntoView(index) {
  19314. this.foundation_.scrollIntoView(index);
  19315. }
  19316. }, {
  19317. key: 'getTabElements_',
  19318. value: function getTabElements_() {
  19319. return [].slice.call(this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */].strings.TAB_SELECTOR));
  19320. }
  19321. }, {
  19322. key: 'focusOnActivate',
  19323. set: function set(focusOnActivate) {
  19324. this.tabList_.forEach(function (tab) {
  19325. return tab.focusOnActivate = focusOnActivate;
  19326. });
  19327. }
  19328. }, {
  19329. key: 'useAutomaticActivation',
  19330. set: function set(useAutomaticActivation) {
  19331. this.foundation_.setUseAutomaticActivation(useAutomaticActivation);
  19332. }
  19333. }], [{
  19334. key: 'attachTo',
  19335. value: function attachTo(root) {
  19336. return new MDCTabBar(root);
  19337. }
  19338. }]);
  19339. return MDCTabBar;
  19340. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  19341. /***/ }),
  19342. /* 138 */
  19343. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19344. "use strict";
  19345. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  19346. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(57);
  19347. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__adapter__ = __webpack_require__(5);
  19348. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__rtl_scroller__ = __webpack_require__(12);
  19349. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__rtl_default_scroller__ = __webpack_require__(139);
  19350. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__rtl_negative_scroller__ = __webpack_require__(140);
  19351. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__rtl_reverse_scroller__ = __webpack_require__(141);
  19352. 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; };
  19353. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  19354. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19355. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  19356. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  19357. /**
  19358. * @license
  19359. * Copyright 2018 Google Inc.
  19360. *
  19361. * Permission is hereby granted, free of charge, to any person obtaining a copy
  19362. * of this software and associated documentation files (the "Software"), to deal
  19363. * in the Software without restriction, including without limitation the rights
  19364. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  19365. * copies of the Software, and to permit persons to whom the Software is
  19366. * furnished to do so, subject to the following conditions:
  19367. *
  19368. * The above copyright notice and this permission notice shall be included in
  19369. * all copies or substantial portions of the Software.
  19370. *
  19371. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19372. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19373. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19374. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19375. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19376. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19377. * THE SOFTWARE.
  19378. */
  19379. /* eslint-disable no-unused-vars */
  19380. /* eslint-enable no-unused-vars */
  19381. /**
  19382. * @extends {MDCFoundation<!MDCTabScrollerAdapter>}
  19383. * @final
  19384. */
  19385. var MDCTabScrollerFoundation = function (_MDCFoundation) {
  19386. _inherits(MDCTabScrollerFoundation, _MDCFoundation);
  19387. _createClass(MDCTabScrollerFoundation, null, [{
  19388. key: 'cssClasses',
  19389. /** @return enum {string} */
  19390. get: function get() {
  19391. return __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */];
  19392. }
  19393. /** @return enum {string} */
  19394. }, {
  19395. key: 'strings',
  19396. get: function get() {
  19397. return __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */];
  19398. }
  19399. /**
  19400. * @see MDCTabScrollerAdapter for typing information
  19401. * @return {!MDCTabScrollerAdapter}
  19402. */
  19403. }, {
  19404. key: 'defaultAdapter',
  19405. get: function get() {
  19406. return (/** @type {!MDCTabScrollerAdapter} */{
  19407. eventTargetMatchesSelector: function eventTargetMatchesSelector() {},
  19408. addClass: function addClass() {},
  19409. removeClass: function removeClass() {},
  19410. addScrollAreaClass: function addScrollAreaClass() {},
  19411. setScrollAreaStyleProperty: function setScrollAreaStyleProperty() {},
  19412. setScrollContentStyleProperty: function setScrollContentStyleProperty() {},
  19413. getScrollContentStyleValue: function getScrollContentStyleValue() {},
  19414. setScrollAreaScrollLeft: function setScrollAreaScrollLeft() {},
  19415. getScrollAreaScrollLeft: function getScrollAreaScrollLeft() {},
  19416. getScrollContentOffsetWidth: function getScrollContentOffsetWidth() {},
  19417. getScrollAreaOffsetWidth: function getScrollAreaOffsetWidth() {},
  19418. computeScrollAreaClientRect: function computeScrollAreaClientRect() {},
  19419. computeScrollContentClientRect: function computeScrollContentClientRect() {},
  19420. computeHorizontalScrollbarHeight: function computeHorizontalScrollbarHeight() {}
  19421. }
  19422. );
  19423. }
  19424. /** @param {!MDCTabScrollerAdapter} adapter */
  19425. }]);
  19426. function MDCTabScrollerFoundation(adapter) {
  19427. _classCallCheck(this, MDCTabScrollerFoundation);
  19428. /**
  19429. * This boolean controls whether we should handle the transitionend and interaction events during the animation.
  19430. * @private {boolean}
  19431. */
  19432. var _this = _possibleConstructorReturn(this, (MDCTabScrollerFoundation.__proto__ || Object.getPrototypeOf(MDCTabScrollerFoundation)).call(this, _extends(MDCTabScrollerFoundation.defaultAdapter, adapter)));
  19433. _this.isAnimating_ = false;
  19434. /**
  19435. * The MDCTabScrollerRTL instance varies per browser and allows us to encapsulate the peculiar browser behavior
  19436. * of RTL scrolling in it's own class.
  19437. * @private {?MDCTabScrollerRTL}
  19438. */
  19439. _this.rtlScrollerInstance_;
  19440. return _this;
  19441. }
  19442. _createClass(MDCTabScrollerFoundation, [{
  19443. key: 'init',
  19444. value: function init() {
  19445. // Compute horizontal scrollbar height on scroller with overflow initially hidden, then update overflow to scroll
  19446. // and immediately adjust bottom margin to avoid the scrollbar initially appearing before JS runs.
  19447. var horizontalScrollbarHeight = this.adapter_.computeHorizontalScrollbarHeight();
  19448. this.adapter_.setScrollAreaStyleProperty('margin-bottom', -horizontalScrollbarHeight + 'px');
  19449. this.adapter_.addScrollAreaClass(MDCTabScrollerFoundation.cssClasses.SCROLL_AREA_SCROLL);
  19450. }
  19451. /**
  19452. * Computes the current visual scroll position
  19453. * @return {number}
  19454. */
  19455. }, {
  19456. key: 'getScrollPosition',
  19457. value: function getScrollPosition() {
  19458. if (this.isRTL_()) {
  19459. return this.computeCurrentScrollPositionRTL_();
  19460. }
  19461. var currentTranslateX = this.calculateCurrentTranslateX_();
  19462. var scrollLeft = this.adapter_.getScrollAreaScrollLeft();
  19463. return scrollLeft - currentTranslateX;
  19464. }
  19465. /**
  19466. * Handles interaction events that occur during transition
  19467. */
  19468. }, {
  19469. key: 'handleInteraction',
  19470. value: function handleInteraction() {
  19471. // Early exit if we aren't animating
  19472. if (!this.isAnimating_) {
  19473. return;
  19474. }
  19475. // Prevent other event listeners from handling this event
  19476. this.stopScrollAnimation_();
  19477. }
  19478. /**
  19479. * Handles the transitionend event
  19480. * @param {!Event} evt
  19481. */
  19482. }, {
  19483. key: 'handleTransitionEnd',
  19484. value: function handleTransitionEnd(evt) {
  19485. // Early exit if we aren't animating or the event was triggered by a different element.
  19486. if (!this.isAnimating_ || !this.adapter_.eventTargetMatchesSelector(evt.target, MDCTabScrollerFoundation.strings.CONTENT_SELECTOR)) {
  19487. return;
  19488. }
  19489. this.isAnimating_ = false;
  19490. this.adapter_.removeClass(MDCTabScrollerFoundation.cssClasses.ANIMATING);
  19491. }
  19492. /**
  19493. * Increment the scroll value by the scrollXIncrement
  19494. * @param {number} scrollXIncrement The value by which to increment the scroll position
  19495. */
  19496. }, {
  19497. key: 'incrementScroll',
  19498. value: function incrementScroll(scrollXIncrement) {
  19499. // Early exit for non-operational increment values
  19500. if (scrollXIncrement === 0) {
  19501. return;
  19502. }
  19503. if (this.isRTL_()) {
  19504. return this.incrementScrollRTL_(scrollXIncrement);
  19505. }
  19506. this.incrementScroll_(scrollXIncrement);
  19507. }
  19508. /**
  19509. * Scrolls to the given scrollX value
  19510. * @param {number} scrollX
  19511. */
  19512. }, {
  19513. key: 'scrollTo',
  19514. value: function scrollTo(scrollX) {
  19515. if (this.isRTL_()) {
  19516. return this.scrollToRTL_(scrollX);
  19517. }
  19518. this.scrollTo_(scrollX);
  19519. }
  19520. /**
  19521. * Returns the appropriate version of the MDCTabScrollerRTL
  19522. * @return {!MDCTabScrollerRTL}
  19523. */
  19524. }, {
  19525. key: 'getRTLScroller',
  19526. value: function getRTLScroller() {
  19527. if (!this.rtlScrollerInstance_) {
  19528. this.rtlScrollerInstance_ = this.rtlScrollerFactory_();
  19529. }
  19530. return this.rtlScrollerInstance_;
  19531. }
  19532. /**
  19533. * Returns the translateX value from a CSS matrix transform function string
  19534. * @return {number}
  19535. * @private
  19536. */
  19537. }, {
  19538. key: 'calculateCurrentTranslateX_',
  19539. value: function calculateCurrentTranslateX_() {
  19540. var transformValue = this.adapter_.getScrollContentStyleValue('transform');
  19541. // Early exit if no transform is present
  19542. if (transformValue === 'none') {
  19543. return 0;
  19544. }
  19545. // The transform value comes back as a matrix transformation in the form
  19546. // of `matrix(a, b, c, d, tx, ty)`. We only care about tx (translateX) so
  19547. // we're going to grab all the parenthesized values, strip out tx, and
  19548. // parse it.
  19549. var results = /\((.+)\)/.exec(transformValue)[1];
  19550. var parts = results.split(',');
  19551. return parseFloat(parts[4]);
  19552. }
  19553. /**
  19554. * Calculates a safe scroll value that is > 0 and < the max scroll value
  19555. * @param {number} scrollX The distance to scroll
  19556. * @return {number}
  19557. * @private
  19558. */
  19559. }, {
  19560. key: 'clampScrollValue_',
  19561. value: function clampScrollValue_(scrollX) {
  19562. var edges = this.calculateScrollEdges_();
  19563. return Math.min(Math.max(edges.left, scrollX), edges.right);
  19564. }
  19565. /**
  19566. * @return {number}
  19567. * @private
  19568. */
  19569. }, {
  19570. key: 'computeCurrentScrollPositionRTL_',
  19571. value: function computeCurrentScrollPositionRTL_() {
  19572. var translateX = this.calculateCurrentTranslateX_();
  19573. return this.getRTLScroller().getScrollPositionRTL(translateX);
  19574. }
  19575. /**
  19576. * @return {!MDCTabScrollerHorizontalEdges}
  19577. * @private
  19578. */
  19579. }, {
  19580. key: 'calculateScrollEdges_',
  19581. value: function calculateScrollEdges_() {
  19582. var contentWidth = this.adapter_.getScrollContentOffsetWidth();
  19583. var rootWidth = this.adapter_.getScrollAreaOffsetWidth();
  19584. return (/** @type {!MDCTabScrollerHorizontalEdges} */{
  19585. left: 0,
  19586. right: contentWidth - rootWidth
  19587. }
  19588. );
  19589. }
  19590. /**
  19591. * Internal scroll method
  19592. * @param {number} scrollX The new scroll position
  19593. * @private
  19594. */
  19595. }, {
  19596. key: 'scrollTo_',
  19597. value: function scrollTo_(scrollX) {
  19598. var currentScrollX = this.getScrollPosition();
  19599. var safeScrollX = this.clampScrollValue_(scrollX);
  19600. var scrollDelta = safeScrollX - currentScrollX;
  19601. this.animate_( /** @type {!MDCTabScrollerAnimation} */{
  19602. finalScrollPosition: safeScrollX,
  19603. scrollDelta: scrollDelta
  19604. });
  19605. }
  19606. /**
  19607. * Internal RTL scroll method
  19608. * @param {number} scrollX The new scroll position
  19609. * @private
  19610. */
  19611. }, {
  19612. key: 'scrollToRTL_',
  19613. value: function scrollToRTL_(scrollX) {
  19614. var animation = this.getRTLScroller().scrollToRTL(scrollX);
  19615. this.animate_(animation);
  19616. }
  19617. /**
  19618. * Internal increment scroll method
  19619. * @param {number} scrollX The new scroll position increment
  19620. * @private
  19621. */
  19622. }, {
  19623. key: 'incrementScroll_',
  19624. value: function incrementScroll_(scrollX) {
  19625. var currentScrollX = this.getScrollPosition();
  19626. var targetScrollX = scrollX + currentScrollX;
  19627. var safeScrollX = this.clampScrollValue_(targetScrollX);
  19628. var scrollDelta = safeScrollX - currentScrollX;
  19629. this.animate_( /** @type {!MDCTabScrollerAnimation} */{
  19630. finalScrollPosition: safeScrollX,
  19631. scrollDelta: scrollDelta
  19632. });
  19633. }
  19634. /**
  19635. * Internal incremenet scroll RTL method
  19636. * @param {number} scrollX The new scroll position RTL increment
  19637. * @private
  19638. */
  19639. }, {
  19640. key: 'incrementScrollRTL_',
  19641. value: function incrementScrollRTL_(scrollX) {
  19642. var animation = this.getRTLScroller().incrementScrollRTL(scrollX);
  19643. this.animate_(animation);
  19644. }
  19645. /**
  19646. * Animates the tab scrolling
  19647. * @param {!MDCTabScrollerAnimation} animation The animation to apply
  19648. * @private
  19649. */
  19650. }, {
  19651. key: 'animate_',
  19652. value: function animate_(animation) {
  19653. var _this2 = this;
  19654. // Early exit if translateX is 0, which means there's no animation to perform
  19655. if (animation.scrollDelta === 0) {
  19656. return;
  19657. }
  19658. this.stopScrollAnimation_();
  19659. // This animation uses the FLIP approach.
  19660. // Read more here: https://aerotwist.com/blog/flip-your-animations/
  19661. this.adapter_.setScrollAreaScrollLeft(animation.finalScrollPosition);
  19662. this.adapter_.setScrollContentStyleProperty('transform', 'translateX(' + animation.scrollDelta + 'px)');
  19663. // Force repaint
  19664. this.adapter_.computeScrollAreaClientRect();
  19665. requestAnimationFrame(function () {
  19666. _this2.adapter_.addClass(MDCTabScrollerFoundation.cssClasses.ANIMATING);
  19667. _this2.adapter_.setScrollContentStyleProperty('transform', 'none');
  19668. });
  19669. this.isAnimating_ = true;
  19670. }
  19671. /**
  19672. * Stops scroll animation
  19673. * @private
  19674. */
  19675. }, {
  19676. key: 'stopScrollAnimation_',
  19677. value: function stopScrollAnimation_() {
  19678. this.isAnimating_ = false;
  19679. var currentScrollPosition = this.getAnimatingScrollPosition_();
  19680. this.adapter_.removeClass(MDCTabScrollerFoundation.cssClasses.ANIMATING);
  19681. this.adapter_.setScrollContentStyleProperty('transform', 'translateX(0px)');
  19682. this.adapter_.setScrollAreaScrollLeft(currentScrollPosition);
  19683. }
  19684. /**
  19685. * Gets the current scroll position during animation
  19686. * @return {number}
  19687. * @private
  19688. */
  19689. }, {
  19690. key: 'getAnimatingScrollPosition_',
  19691. value: function getAnimatingScrollPosition_() {
  19692. var currentTranslateX = this.calculateCurrentTranslateX_();
  19693. var scrollLeft = this.adapter_.getScrollAreaScrollLeft();
  19694. if (this.isRTL_()) {
  19695. return this.getRTLScroller().getAnimatingScrollPosition(scrollLeft, currentTranslateX);
  19696. }
  19697. return scrollLeft - currentTranslateX;
  19698. }
  19699. /**
  19700. * Determines the RTL Scroller to use
  19701. * @return {!MDCTabScrollerRTL}
  19702. * @private
  19703. */
  19704. }, {
  19705. key: 'rtlScrollerFactory_',
  19706. value: function rtlScrollerFactory_() {
  19707. // Browsers have three different implementations of scrollLeft in RTL mode,
  19708. // dependent on the browser. The behavior is based off the max LTR
  19709. // scrollleft value and 0.
  19710. //
  19711. // * Default scrolling in RTL *
  19712. // - Left-most value: 0
  19713. // - Right-most value: Max LTR scrollLeft value
  19714. //
  19715. // * Negative scrolling in RTL *
  19716. // - Left-most value: Negated max LTR scrollLeft value
  19717. // - Right-most value: 0
  19718. //
  19719. // * Reverse scrolling in RTL *
  19720. // - Left-most value: Max LTR scrollLeft value
  19721. // - Right-most value: 0
  19722. //
  19723. // We use those principles below to determine which RTL scrollLeft
  19724. // behavior is implemented in the current browser.
  19725. var initialScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  19726. this.adapter_.setScrollAreaScrollLeft(initialScrollLeft - 1);
  19727. var newScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  19728. // If the newScrollLeft value is negative,then we know that the browser has
  19729. // implemented negative RTL scrolling, since all other implementations have
  19730. // only positive values.
  19731. if (newScrollLeft < 0) {
  19732. // Undo the scrollLeft test check
  19733. this.adapter_.setScrollAreaScrollLeft(initialScrollLeft);
  19734. return new __WEBPACK_IMPORTED_MODULE_5__rtl_negative_scroller__["a" /* default */](this.adapter_);
  19735. }
  19736. var rootClientRect = this.adapter_.computeScrollAreaClientRect();
  19737. var contentClientRect = this.adapter_.computeScrollContentClientRect();
  19738. var rightEdgeDelta = Math.round(contentClientRect.right - rootClientRect.right);
  19739. // Undo the scrollLeft test check
  19740. this.adapter_.setScrollAreaScrollLeft(initialScrollLeft);
  19741. // By calculating the clientRect of the root element and the clientRect of
  19742. // the content element, we can determine how much the scroll value changed
  19743. // when we performed the scrollLeft subtraction above.
  19744. if (rightEdgeDelta === newScrollLeft) {
  19745. return new __WEBPACK_IMPORTED_MODULE_6__rtl_reverse_scroller__["a" /* default */](this.adapter_);
  19746. }
  19747. return new __WEBPACK_IMPORTED_MODULE_4__rtl_default_scroller__["a" /* default */](this.adapter_);
  19748. }
  19749. /**
  19750. * @return {boolean}
  19751. * @private
  19752. */
  19753. }, {
  19754. key: 'isRTL_',
  19755. value: function isRTL_() {
  19756. return this.adapter_.getScrollContentStyleValue('direction') === 'rtl';
  19757. }
  19758. }]);
  19759. return MDCTabScrollerFoundation;
  19760. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  19761. /* harmony default export */ __webpack_exports__["a"] = (MDCTabScrollerFoundation);
  19762. /***/ }),
  19763. /* 139 */
  19764. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19765. "use strict";
  19766. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__rtl_scroller__ = __webpack_require__(12);
  19767. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(5);
  19768. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  19769. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19770. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  19771. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  19772. /**
  19773. * @license
  19774. * Copyright 2018 Google Inc.
  19775. *
  19776. * Permission is hereby granted, free of charge, to any person obtaining a copy
  19777. * of this software and associated documentation files (the "Software"), to deal
  19778. * in the Software without restriction, including without limitation the rights
  19779. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  19780. * copies of the Software, and to permit persons to whom the Software is
  19781. * furnished to do so, subject to the following conditions:
  19782. *
  19783. * The above copyright notice and this permission notice shall be included in
  19784. * all copies or substantial portions of the Software.
  19785. *
  19786. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19787. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19788. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19789. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19790. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19791. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19792. * THE SOFTWARE.
  19793. */
  19794. /* eslint-disable no-unused-vars */
  19795. /* eslint-enable no-unused-vars */
  19796. /**
  19797. * @extends {MDCTabScrollerRTL}
  19798. * @final
  19799. */
  19800. var MDCTabScrollerRTLDefault = function (_MDCTabScrollerRTL) {
  19801. _inherits(MDCTabScrollerRTLDefault, _MDCTabScrollerRTL);
  19802. function MDCTabScrollerRTLDefault() {
  19803. _classCallCheck(this, MDCTabScrollerRTLDefault);
  19804. return _possibleConstructorReturn(this, (MDCTabScrollerRTLDefault.__proto__ || Object.getPrototypeOf(MDCTabScrollerRTLDefault)).apply(this, arguments));
  19805. }
  19806. _createClass(MDCTabScrollerRTLDefault, [{
  19807. key: 'getScrollPositionRTL',
  19808. /**
  19809. * @return {number}
  19810. */
  19811. value: function getScrollPositionRTL() {
  19812. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  19813. var _calculateScrollEdges = this.calculateScrollEdges_(),
  19814. right = _calculateScrollEdges.right;
  19815. // Scroll values on most browsers are ints instead of floats so we round
  19816. return Math.round(right - currentScrollLeft);
  19817. }
  19818. /**
  19819. * @param {number} scrollX
  19820. * @return {!MDCTabScrollerAnimation}
  19821. */
  19822. }, {
  19823. key: 'scrollToRTL',
  19824. value: function scrollToRTL(scrollX) {
  19825. var edges = this.calculateScrollEdges_();
  19826. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  19827. var clampedScrollLeft = this.clampScrollValue_(edges.right - scrollX);
  19828. return (/** @type {!MDCTabScrollerAnimation} */{
  19829. finalScrollPosition: clampedScrollLeft,
  19830. scrollDelta: clampedScrollLeft - currentScrollLeft
  19831. }
  19832. );
  19833. }
  19834. /**
  19835. * @param {number} scrollX
  19836. * @return {!MDCTabScrollerAnimation}
  19837. */
  19838. }, {
  19839. key: 'incrementScrollRTL',
  19840. value: function incrementScrollRTL(scrollX) {
  19841. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  19842. var clampedScrollLeft = this.clampScrollValue_(currentScrollLeft - scrollX);
  19843. return (/** @type {!MDCTabScrollerAnimation} */{
  19844. finalScrollPosition: clampedScrollLeft,
  19845. scrollDelta: clampedScrollLeft - currentScrollLeft
  19846. }
  19847. );
  19848. }
  19849. /**
  19850. * @param {number} scrollX
  19851. * @return {number}
  19852. */
  19853. }, {
  19854. key: 'getAnimatingScrollPosition',
  19855. value: function getAnimatingScrollPosition(scrollX) {
  19856. return scrollX;
  19857. }
  19858. /**
  19859. * @return {!MDCTabScrollerHorizontalEdges}
  19860. * @private
  19861. */
  19862. }, {
  19863. key: 'calculateScrollEdges_',
  19864. value: function calculateScrollEdges_() {
  19865. var contentWidth = this.adapter_.getScrollContentOffsetWidth();
  19866. var rootWidth = this.adapter_.getScrollAreaOffsetWidth();
  19867. return (/** @type {!MDCTabScrollerHorizontalEdges} */{
  19868. left: 0,
  19869. right: contentWidth - rootWidth
  19870. }
  19871. );
  19872. }
  19873. /**
  19874. * @param {number} scrollX
  19875. * @return {number}
  19876. * @private
  19877. */
  19878. }, {
  19879. key: 'clampScrollValue_',
  19880. value: function clampScrollValue_(scrollX) {
  19881. var edges = this.calculateScrollEdges_();
  19882. return Math.min(Math.max(edges.left, scrollX), edges.right);
  19883. }
  19884. }]);
  19885. return MDCTabScrollerRTLDefault;
  19886. }(__WEBPACK_IMPORTED_MODULE_0__rtl_scroller__["a" /* default */]);
  19887. /* harmony default export */ __webpack_exports__["a"] = (MDCTabScrollerRTLDefault);
  19888. /***/ }),
  19889. /* 140 */
  19890. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19891. "use strict";
  19892. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__rtl_scroller__ = __webpack_require__(12);
  19893. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(5);
  19894. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  19895. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19896. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  19897. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  19898. /**
  19899. * @license
  19900. * Copyright 2018 Google Inc.
  19901. *
  19902. * Permission is hereby granted, free of charge, to any person obtaining a copy
  19903. * of this software and associated documentation files (the "Software"), to deal
  19904. * in the Software without restriction, including without limitation the rights
  19905. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  19906. * copies of the Software, and to permit persons to whom the Software is
  19907. * furnished to do so, subject to the following conditions:
  19908. *
  19909. * The above copyright notice and this permission notice shall be included in
  19910. * all copies or substantial portions of the Software.
  19911. *
  19912. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19913. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19914. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19915. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19916. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19917. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19918. * THE SOFTWARE.
  19919. */
  19920. /* eslint-disable no-unused-vars */
  19921. /* eslint-enable no-unused-vars */
  19922. /**
  19923. * @extends {MDCTabScrollerRTL}
  19924. * @final
  19925. */
  19926. var MDCTabScrollerRTLNegative = function (_MDCTabScrollerRTL) {
  19927. _inherits(MDCTabScrollerRTLNegative, _MDCTabScrollerRTL);
  19928. function MDCTabScrollerRTLNegative() {
  19929. _classCallCheck(this, MDCTabScrollerRTLNegative);
  19930. return _possibleConstructorReturn(this, (MDCTabScrollerRTLNegative.__proto__ || Object.getPrototypeOf(MDCTabScrollerRTLNegative)).apply(this, arguments));
  19931. }
  19932. _createClass(MDCTabScrollerRTLNegative, [{
  19933. key: 'getScrollPositionRTL',
  19934. /**
  19935. * @param {number} translateX The current translateX position
  19936. * @return {number}
  19937. */
  19938. value: function getScrollPositionRTL(translateX) {
  19939. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  19940. return Math.round(translateX - currentScrollLeft);
  19941. }
  19942. /**
  19943. * @param {number} scrollX
  19944. * @return {!MDCTabScrollerAnimation}
  19945. */
  19946. }, {
  19947. key: 'scrollToRTL',
  19948. value: function scrollToRTL(scrollX) {
  19949. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  19950. var clampedScrollLeft = this.clampScrollValue_(-scrollX);
  19951. return (/** @type {!MDCTabScrollerAnimation} */{
  19952. finalScrollPosition: clampedScrollLeft,
  19953. scrollDelta: clampedScrollLeft - currentScrollLeft
  19954. }
  19955. );
  19956. }
  19957. /**
  19958. * @param {number} scrollX
  19959. * @return {!MDCTabScrollerAnimation}
  19960. */
  19961. }, {
  19962. key: 'incrementScrollRTL',
  19963. value: function incrementScrollRTL(scrollX) {
  19964. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  19965. var clampedScrollLeft = this.clampScrollValue_(currentScrollLeft - scrollX);
  19966. return (/** @type {!MDCTabScrollerAnimation} */{
  19967. finalScrollPosition: clampedScrollLeft,
  19968. scrollDelta: clampedScrollLeft - currentScrollLeft
  19969. }
  19970. );
  19971. }
  19972. /**
  19973. * @param {number} scrollX
  19974. * @param {number} translateX
  19975. * @return {number}
  19976. */
  19977. }, {
  19978. key: 'getAnimatingScrollPosition',
  19979. value: function getAnimatingScrollPosition(scrollX, translateX) {
  19980. return scrollX - translateX;
  19981. }
  19982. /**
  19983. * @return {!MDCTabScrollerHorizontalEdges}
  19984. * @private
  19985. */
  19986. }, {
  19987. key: 'calculateScrollEdges_',
  19988. value: function calculateScrollEdges_() {
  19989. var contentWidth = this.adapter_.getScrollContentOffsetWidth();
  19990. var rootWidth = this.adapter_.getScrollAreaOffsetWidth();
  19991. return (/** @type {!MDCTabScrollerHorizontalEdges} */{
  19992. left: rootWidth - contentWidth,
  19993. right: 0
  19994. }
  19995. );
  19996. }
  19997. /**
  19998. * @param {number} scrollX
  19999. * @return {number}
  20000. * @private
  20001. */
  20002. }, {
  20003. key: 'clampScrollValue_',
  20004. value: function clampScrollValue_(scrollX) {
  20005. var edges = this.calculateScrollEdges_();
  20006. return Math.max(Math.min(edges.right, scrollX), edges.left);
  20007. }
  20008. }]);
  20009. return MDCTabScrollerRTLNegative;
  20010. }(__WEBPACK_IMPORTED_MODULE_0__rtl_scroller__["a" /* default */]);
  20011. /* harmony default export */ __webpack_exports__["a"] = (MDCTabScrollerRTLNegative);
  20012. /***/ }),
  20013. /* 141 */
  20014. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20015. "use strict";
  20016. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__rtl_scroller__ = __webpack_require__(12);
  20017. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(5);
  20018. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  20019. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20020. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  20021. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  20022. /**
  20023. * @license
  20024. * Copyright 2018 Google Inc.
  20025. *
  20026. * Permission is hereby granted, free of charge, to any person obtaining a copy
  20027. * of this software and associated documentation files (the "Software"), to deal
  20028. * in the Software without restriction, including without limitation the rights
  20029. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  20030. * copies of the Software, and to permit persons to whom the Software is
  20031. * furnished to do so, subject to the following conditions:
  20032. *
  20033. * The above copyright notice and this permission notice shall be included in
  20034. * all copies or substantial portions of the Software.
  20035. *
  20036. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20037. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20038. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  20039. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20040. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20041. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20042. * THE SOFTWARE.
  20043. */
  20044. /* eslint-disable no-unused-vars */
  20045. /* eslint-enable no-unused-vars */
  20046. /**
  20047. * @extends {MDCTabScrollerRTL}
  20048. * @final
  20049. */
  20050. var MDCTabScrollerRTLReverse = function (_MDCTabScrollerRTL) {
  20051. _inherits(MDCTabScrollerRTLReverse, _MDCTabScrollerRTL);
  20052. function MDCTabScrollerRTLReverse() {
  20053. _classCallCheck(this, MDCTabScrollerRTLReverse);
  20054. return _possibleConstructorReturn(this, (MDCTabScrollerRTLReverse.__proto__ || Object.getPrototypeOf(MDCTabScrollerRTLReverse)).apply(this, arguments));
  20055. }
  20056. _createClass(MDCTabScrollerRTLReverse, [{
  20057. key: 'getScrollPositionRTL',
  20058. /**
  20059. * @param {number} translateX
  20060. * @return {number}
  20061. */
  20062. value: function getScrollPositionRTL(translateX) {
  20063. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  20064. // Scroll values on most browsers are ints instead of floats so we round
  20065. return Math.round(currentScrollLeft - translateX);
  20066. }
  20067. /**
  20068. * @param {number} scrollX
  20069. * @return {!MDCTabScrollerAnimation}
  20070. */
  20071. }, {
  20072. key: 'scrollToRTL',
  20073. value: function scrollToRTL(scrollX) {
  20074. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  20075. var clampedScrollLeft = this.clampScrollValue_(scrollX);
  20076. return (/** @type {!MDCTabScrollerAnimation} */{
  20077. finalScrollPosition: clampedScrollLeft,
  20078. scrollDelta: currentScrollLeft - clampedScrollLeft
  20079. }
  20080. );
  20081. }
  20082. /**
  20083. * @param {number} scrollX
  20084. * @return {!MDCTabScrollerAnimation}
  20085. */
  20086. }, {
  20087. key: 'incrementScrollRTL',
  20088. value: function incrementScrollRTL(scrollX) {
  20089. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  20090. var clampedScrollLeft = this.clampScrollValue_(currentScrollLeft + scrollX);
  20091. return (/** @type {!MDCTabScrollerAnimation} */{
  20092. finalScrollPosition: clampedScrollLeft,
  20093. scrollDelta: currentScrollLeft - clampedScrollLeft
  20094. }
  20095. );
  20096. }
  20097. /**
  20098. * @param {number} scrollX
  20099. * @return {number}
  20100. */
  20101. }, {
  20102. key: 'getAnimatingScrollPosition',
  20103. value: function getAnimatingScrollPosition(scrollX, translateX) {
  20104. return scrollX + translateX;
  20105. }
  20106. /**
  20107. * @return {!MDCTabScrollerHorizontalEdges}
  20108. * @private
  20109. */
  20110. }, {
  20111. key: 'calculateScrollEdges_',
  20112. value: function calculateScrollEdges_() {
  20113. var contentWidth = this.adapter_.getScrollContentOffsetWidth();
  20114. var rootWidth = this.adapter_.getScrollAreaOffsetWidth();
  20115. return (/** @type {!MDCTabScrollerHorizontalEdges} */{
  20116. left: contentWidth - rootWidth,
  20117. right: 0
  20118. }
  20119. );
  20120. }
  20121. /**
  20122. * @param {number} scrollX
  20123. * @return {number}
  20124. * @private
  20125. */
  20126. }, {
  20127. key: 'clampScrollValue_',
  20128. value: function clampScrollValue_(scrollX) {
  20129. var edges = this.calculateScrollEdges_();
  20130. return Math.min(Math.max(edges.right, scrollX), edges.left);
  20131. }
  20132. }]);
  20133. return MDCTabScrollerRTLReverse;
  20134. }(__WEBPACK_IMPORTED_MODULE_0__rtl_scroller__["a" /* default */]);
  20135. /* harmony default export */ __webpack_exports__["a"] = (MDCTabScrollerRTLReverse);
  20136. /***/ }),
  20137. /* 142 */
  20138. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20139. "use strict";
  20140. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  20141. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "computeHorizontalScrollbarHeight", function() { return computeHorizontalScrollbarHeight; });
  20142. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMatchesProperty", function() { return getMatchesProperty; });
  20143. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__constants__ = __webpack_require__(57);
  20144. /**
  20145. * @license
  20146. * Copyright 2018 Google Inc.
  20147. *
  20148. * Permission is hereby granted, free of charge, to any person obtaining a copy
  20149. * of this software and associated documentation files (the "Software"), to deal
  20150. * in the Software without restriction, including without limitation the rights
  20151. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  20152. * copies of the Software, and to permit persons to whom the Software is
  20153. * furnished to do so, subject to the following conditions:
  20154. *
  20155. * The above copyright notice and this permission notice shall be included in
  20156. * all copies or substantial portions of the Software.
  20157. *
  20158. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20159. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20160. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  20161. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20162. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20163. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20164. * THE SOFTWARE.
  20165. */
  20166. /**
  20167. * Stores result from computeHorizontalScrollbarHeight to avoid redundant processing.
  20168. * @private {number|undefined}
  20169. */
  20170. var horizontalScrollbarHeight_ = void 0;
  20171. /**
  20172. * Computes the height of browser-rendered horizontal scrollbars using a self-created test element.
  20173. * May return 0 (e.g. on OS X browsers under default configuration).
  20174. * @param {!Document} documentObj
  20175. * @param {boolean=} shouldCacheResult
  20176. * @return {number}
  20177. */
  20178. function computeHorizontalScrollbarHeight(documentObj) {
  20179. var shouldCacheResult = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  20180. if (shouldCacheResult && typeof horizontalScrollbarHeight_ !== 'undefined') {
  20181. return horizontalScrollbarHeight_;
  20182. }
  20183. var el = documentObj.createElement('div');
  20184. el.classList.add(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].SCROLL_TEST);
  20185. documentObj.body.appendChild(el);
  20186. var horizontalScrollbarHeight = el.offsetHeight - el.clientHeight;
  20187. documentObj.body.removeChild(el);
  20188. if (shouldCacheResult) {
  20189. horizontalScrollbarHeight_ = horizontalScrollbarHeight;
  20190. }
  20191. return horizontalScrollbarHeight;
  20192. }
  20193. /**
  20194. * @param {!Object} HTMLElementPrototype
  20195. * @return {!Array<string>}
  20196. */
  20197. function getMatchesProperty(HTMLElementPrototype) {
  20198. return ['msMatchesSelector', 'matches'].filter(function (p) {
  20199. return p in HTMLElementPrototype;
  20200. }).pop();
  20201. }
  20202. /***/ }),
  20203. /* 143 */
  20204. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20205. "use strict";
  20206. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  20207. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(144);
  20208. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__adapter__ = __webpack_require__(58);
  20209. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_tab_adapter__ = __webpack_require__(11);
  20210. 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; };
  20211. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  20212. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20213. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  20214. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  20215. /**
  20216. * @license
  20217. * Copyright 2018 Google Inc.
  20218. *
  20219. * Permission is hereby granted, free of charge, to any person obtaining a copy
  20220. * of this software and associated documentation files (the "Software"), to deal
  20221. * in the Software without restriction, including without limitation the rights
  20222. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  20223. * copies of the Software, and to permit persons to whom the Software is
  20224. * furnished to do so, subject to the following conditions:
  20225. *
  20226. * The above copyright notice and this permission notice shall be included in
  20227. * all copies or substantial portions of the Software.
  20228. *
  20229. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20230. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20231. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  20232. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20233. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20234. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20235. * THE SOFTWARE.
  20236. */
  20237. /* eslint-disable no-unused-vars */
  20238. /* eslint-enable no-unused-vars */
  20239. /**
  20240. * @type {Set<string>}
  20241. */
  20242. var ACCEPTABLE_KEYS = new Set();
  20243. // IE11 has no support for new Set with iterable so we need to initialize this by hand
  20244. ACCEPTABLE_KEYS.add(__WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ARROW_LEFT_KEY);
  20245. ACCEPTABLE_KEYS.add(__WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ARROW_RIGHT_KEY);
  20246. ACCEPTABLE_KEYS.add(__WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].END_KEY);
  20247. ACCEPTABLE_KEYS.add(__WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].HOME_KEY);
  20248. ACCEPTABLE_KEYS.add(__WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ENTER_KEY);
  20249. ACCEPTABLE_KEYS.add(__WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].SPACE_KEY);
  20250. /**
  20251. * @type {Map<number, string>}
  20252. */
  20253. var KEYCODE_MAP = new Map();
  20254. // IE11 has no support for new Map with iterable so we need to initialize this by hand
  20255. KEYCODE_MAP.set(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].ARROW_LEFT_KEYCODE, __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ARROW_LEFT_KEY);
  20256. KEYCODE_MAP.set(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].ARROW_RIGHT_KEYCODE, __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ARROW_RIGHT_KEY);
  20257. KEYCODE_MAP.set(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].END_KEYCODE, __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].END_KEY);
  20258. KEYCODE_MAP.set(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].HOME_KEYCODE, __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].HOME_KEY);
  20259. KEYCODE_MAP.set(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].ENTER_KEYCODE, __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ENTER_KEY);
  20260. KEYCODE_MAP.set(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].SPACE_KEYCODE, __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].SPACE_KEY);
  20261. /**
  20262. * @extends {MDCFoundation<!MDCTabBarAdapter>}
  20263. * @final
  20264. */
  20265. var MDCTabBarFoundation = function (_MDCFoundation) {
  20266. _inherits(MDCTabBarFoundation, _MDCFoundation);
  20267. _createClass(MDCTabBarFoundation, null, [{
  20268. key: 'strings',
  20269. /** @return enum {string} */
  20270. get: function get() {
  20271. return __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */];
  20272. }
  20273. /** @return enum {number} */
  20274. }, {
  20275. key: 'numbers',
  20276. get: function get() {
  20277. return __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */];
  20278. }
  20279. /**
  20280. * @see MDCTabBarAdapter for typing information
  20281. * @return {!MDCTabBarAdapter}
  20282. */
  20283. }, {
  20284. key: 'defaultAdapter',
  20285. get: function get() {
  20286. return (/** @type {!MDCTabBarAdapter} */{
  20287. scrollTo: function scrollTo() {},
  20288. incrementScroll: function incrementScroll() {},
  20289. getScrollPosition: function getScrollPosition() {},
  20290. getScrollContentWidth: function getScrollContentWidth() {},
  20291. getOffsetWidth: function getOffsetWidth() {},
  20292. isRTL: function isRTL() {},
  20293. setActiveTab: function setActiveTab() {},
  20294. activateTabAtIndex: function activateTabAtIndex() {},
  20295. deactivateTabAtIndex: function deactivateTabAtIndex() {},
  20296. focusTabAtIndex: function focusTabAtIndex() {},
  20297. getTabIndicatorClientRectAtIndex: function getTabIndicatorClientRectAtIndex() {},
  20298. getTabDimensionsAtIndex: function getTabDimensionsAtIndex() {},
  20299. getPreviousActiveTabIndex: function getPreviousActiveTabIndex() {},
  20300. getFocusedTabIndex: function getFocusedTabIndex() {},
  20301. getIndexOfTab: function getIndexOfTab() {},
  20302. getTabListLength: function getTabListLength() {},
  20303. notifyTabActivated: function notifyTabActivated() {}
  20304. }
  20305. );
  20306. }
  20307. /**
  20308. * @param {!MDCTabBarAdapter} adapter
  20309. * */
  20310. }]);
  20311. function MDCTabBarFoundation(adapter) {
  20312. _classCallCheck(this, MDCTabBarFoundation);
  20313. /** @private {boolean} */
  20314. var _this = _possibleConstructorReturn(this, (MDCTabBarFoundation.__proto__ || Object.getPrototypeOf(MDCTabBarFoundation)).call(this, _extends(MDCTabBarFoundation.defaultAdapter, adapter)));
  20315. _this.useAutomaticActivation_ = false;
  20316. return _this;
  20317. }
  20318. /**
  20319. * Switches between automatic and manual activation modes.
  20320. * See https://www.w3.org/TR/wai-aria-practices/#tabpanel for examples.
  20321. * @param {boolean} useAutomaticActivation
  20322. */
  20323. _createClass(MDCTabBarFoundation, [{
  20324. key: 'setUseAutomaticActivation',
  20325. value: function setUseAutomaticActivation(useAutomaticActivation) {
  20326. this.useAutomaticActivation_ = useAutomaticActivation;
  20327. }
  20328. /**
  20329. * Activates the tab at the given index
  20330. * @param {number} index
  20331. */
  20332. }, {
  20333. key: 'activateTab',
  20334. value: function activateTab(index) {
  20335. var previousActiveIndex = this.adapter_.getPreviousActiveTabIndex();
  20336. if (!this.indexIsInRange_(index) || index === previousActiveIndex) {
  20337. return;
  20338. }
  20339. this.adapter_.deactivateTabAtIndex(previousActiveIndex);
  20340. this.adapter_.activateTabAtIndex(index, this.adapter_.getTabIndicatorClientRectAtIndex(previousActiveIndex));
  20341. this.scrollIntoView(index);
  20342. this.adapter_.notifyTabActivated(index);
  20343. }
  20344. /**
  20345. * Handles the keydown event
  20346. * @param {!Event} evt
  20347. */
  20348. }, {
  20349. key: 'handleKeyDown',
  20350. value: function handleKeyDown(evt) {
  20351. // Get the key from the event
  20352. var key = this.getKeyFromEvent_(evt);
  20353. // Early exit if the event key isn't one of the keyboard navigation keys
  20354. if (key === undefined) {
  20355. return;
  20356. }
  20357. // Prevent default behavior for movement keys, but not for activation keys, since :active is used to apply ripple
  20358. if (!this.isActivationKey_(key)) {
  20359. evt.preventDefault();
  20360. }
  20361. if (this.useAutomaticActivation_) {
  20362. if (this.isActivationKey_(key)) {
  20363. return;
  20364. }
  20365. var index = this.determineTargetFromKey_(this.adapter_.getPreviousActiveTabIndex(), key);
  20366. this.adapter_.setActiveTab(index);
  20367. this.scrollIntoView(index);
  20368. } else {
  20369. var focusedTabIndex = this.adapter_.getFocusedTabIndex();
  20370. if (this.isActivationKey_(key)) {
  20371. this.adapter_.setActiveTab(focusedTabIndex);
  20372. } else {
  20373. var _index = this.determineTargetFromKey_(focusedTabIndex, key);
  20374. this.adapter_.focusTabAtIndex(_index);
  20375. this.scrollIntoView(_index);
  20376. }
  20377. }
  20378. }
  20379. /**
  20380. * Handles the MDCTab:interacted event
  20381. * @param {!Event} evt
  20382. */
  20383. }, {
  20384. key: 'handleTabInteraction',
  20385. value: function handleTabInteraction(evt) {
  20386. this.adapter_.setActiveTab(this.adapter_.getIndexOfTab(evt.detail.tab));
  20387. }
  20388. /**
  20389. * Scrolls the tab at the given index into view
  20390. * @param {number} index The tab index to make visible
  20391. */
  20392. }, {
  20393. key: 'scrollIntoView',
  20394. value: function scrollIntoView(index) {
  20395. // Early exit if the index is out of range
  20396. if (!this.indexIsInRange_(index)) {
  20397. return;
  20398. }
  20399. // Always scroll to 0 if scrolling to the 0th index
  20400. if (index === 0) {
  20401. return this.adapter_.scrollTo(0);
  20402. }
  20403. // Always scroll to the max value if scrolling to the Nth index
  20404. // MDCTabScroller.scrollTo() will never scroll past the max possible value
  20405. if (index === this.adapter_.getTabListLength() - 1) {
  20406. return this.adapter_.scrollTo(this.adapter_.getScrollContentWidth());
  20407. }
  20408. if (this.isRTL_()) {
  20409. return this.scrollIntoViewRTL_(index);
  20410. }
  20411. this.scrollIntoView_(index);
  20412. }
  20413. /**
  20414. * Private method for determining the index of the destination tab based on what key was pressed
  20415. * @param {number} origin The original index from which to determine the destination
  20416. * @param {string} key The name of the key
  20417. * @return {number}
  20418. * @private
  20419. */
  20420. }, {
  20421. key: 'determineTargetFromKey_',
  20422. value: function determineTargetFromKey_(origin, key) {
  20423. var isRTL = this.isRTL_();
  20424. var maxIndex = this.adapter_.getTabListLength() - 1;
  20425. var shouldGoToEnd = key === __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].END_KEY;
  20426. 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;
  20427. 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;
  20428. var index = origin;
  20429. if (shouldGoToEnd) {
  20430. index = maxIndex;
  20431. } else if (shouldDecrement) {
  20432. index -= 1;
  20433. } else if (shouldIncrement) {
  20434. index += 1;
  20435. } else {
  20436. index = 0;
  20437. }
  20438. if (index < 0) {
  20439. index = maxIndex;
  20440. } else if (index > maxIndex) {
  20441. index = 0;
  20442. }
  20443. return index;
  20444. }
  20445. /**
  20446. * Calculates the scroll increment that will make the tab at the given index visible
  20447. * @param {number} index The index of the tab
  20448. * @param {number} nextIndex The index of the next tab
  20449. * @param {number} scrollPosition The current scroll position
  20450. * @param {number} barWidth The width of the Tab Bar
  20451. * @return {number}
  20452. * @private
  20453. */
  20454. }, {
  20455. key: 'calculateScrollIncrement_',
  20456. value: function calculateScrollIncrement_(index, nextIndex, scrollPosition, barWidth) {
  20457. var nextTabDimensions = this.adapter_.getTabDimensionsAtIndex(nextIndex);
  20458. var relativeContentLeft = nextTabDimensions.contentLeft - scrollPosition - barWidth;
  20459. var relativeContentRight = nextTabDimensions.contentRight - scrollPosition;
  20460. var leftIncrement = relativeContentRight - __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].EXTRA_SCROLL_AMOUNT;
  20461. var rightIncrement = relativeContentLeft + __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].EXTRA_SCROLL_AMOUNT;
  20462. if (nextIndex < index) {
  20463. return Math.min(leftIncrement, 0);
  20464. }
  20465. return Math.max(rightIncrement, 0);
  20466. }
  20467. /**
  20468. * Calculates the scroll increment that will make the tab at the given index visible in RTL
  20469. * @param {number} index The index of the tab
  20470. * @param {number} nextIndex The index of the next tab
  20471. * @param {number} scrollPosition The current scroll position
  20472. * @param {number} barWidth The width of the Tab Bar
  20473. * @param {number} scrollContentWidth The width of the scroll content
  20474. * @return {number}
  20475. * @private
  20476. */
  20477. }, {
  20478. key: 'calculateScrollIncrementRTL_',
  20479. value: function calculateScrollIncrementRTL_(index, nextIndex, scrollPosition, barWidth, scrollContentWidth) {
  20480. var nextTabDimensions = this.adapter_.getTabDimensionsAtIndex(nextIndex);
  20481. var relativeContentLeft = scrollContentWidth - nextTabDimensions.contentLeft - scrollPosition;
  20482. var relativeContentRight = scrollContentWidth - nextTabDimensions.contentRight - scrollPosition - barWidth;
  20483. var leftIncrement = relativeContentRight + __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].EXTRA_SCROLL_AMOUNT;
  20484. var rightIncrement = relativeContentLeft - __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].EXTRA_SCROLL_AMOUNT;
  20485. if (nextIndex > index) {
  20486. return Math.max(leftIncrement, 0);
  20487. }
  20488. return Math.min(rightIncrement, 0);
  20489. }
  20490. /**
  20491. * Determines the index of the adjacent tab closest to either edge of the Tab Bar
  20492. * @param {number} index The index of the tab
  20493. * @param {!MDCTabDimensions} tabDimensions The dimensions of the tab
  20494. * @param {number} scrollPosition The current scroll position
  20495. * @param {number} barWidth The width of the tab bar
  20496. * @return {number}
  20497. * @private
  20498. */
  20499. }, {
  20500. key: 'findAdjacentTabIndexClosestToEdge_',
  20501. value: function findAdjacentTabIndexClosestToEdge_(index, tabDimensions, scrollPosition, barWidth) {
  20502. /**
  20503. * Tabs are laid out in the Tab Scroller like this:
  20504. *
  20505. * Scroll Position
  20506. * +---+
  20507. * | | Bar Width
  20508. * | +-----------------------------------+
  20509. * | | |
  20510. * | V V
  20511. * | +-----------------------------------+
  20512. * V | Tab Scroller |
  20513. * +------------+--------------+-------------------+
  20514. * | Tab | Tab | Tab |
  20515. * +------------+--------------+-------------------+
  20516. * | |
  20517. * +-----------------------------------+
  20518. *
  20519. * To determine the next adjacent index, we look at the Tab root left and
  20520. * Tab root right, both relative to the scroll position. If the Tab root
  20521. * left is less than 0, then we know it's out of view to the left. If the
  20522. * Tab root right minus the bar width is greater than 0, we know the Tab is
  20523. * out of view to the right. From there, we either increment or decrement
  20524. * the index.
  20525. */
  20526. var relativeRootLeft = tabDimensions.rootLeft - scrollPosition;
  20527. var relativeRootRight = tabDimensions.rootRight - scrollPosition - barWidth;
  20528. var relativeRootDelta = relativeRootLeft + relativeRootRight;
  20529. var leftEdgeIsCloser = relativeRootLeft < 0 || relativeRootDelta < 0;
  20530. var rightEdgeIsCloser = relativeRootRight > 0 || relativeRootDelta > 0;
  20531. if (leftEdgeIsCloser) {
  20532. return index - 1;
  20533. }
  20534. if (rightEdgeIsCloser) {
  20535. return index + 1;
  20536. }
  20537. return -1;
  20538. }
  20539. /**
  20540. * Determines the index of the adjacent tab closest to either edge of the Tab Bar in RTL
  20541. * @param {number} index The index of the tab
  20542. * @param {!MDCTabDimensions} tabDimensions The dimensions of the tab
  20543. * @param {number} scrollPosition The current scroll position
  20544. * @param {number} barWidth The width of the tab bar
  20545. * @param {number} scrollContentWidth The width of the scroller content
  20546. * @return {number}
  20547. * @private
  20548. */
  20549. }, {
  20550. key: 'findAdjacentTabIndexClosestToEdgeRTL_',
  20551. value: function findAdjacentTabIndexClosestToEdgeRTL_(index, tabDimensions, scrollPosition, barWidth, scrollContentWidth) {
  20552. var rootLeft = scrollContentWidth - tabDimensions.rootLeft - barWidth - scrollPosition;
  20553. var rootRight = scrollContentWidth - tabDimensions.rootRight - scrollPosition;
  20554. var rootDelta = rootLeft + rootRight;
  20555. var leftEdgeIsCloser = rootLeft > 0 || rootDelta > 0;
  20556. var rightEdgeIsCloser = rootRight < 0 || rootDelta < 0;
  20557. if (leftEdgeIsCloser) {
  20558. return index + 1;
  20559. }
  20560. if (rightEdgeIsCloser) {
  20561. return index - 1;
  20562. }
  20563. return -1;
  20564. }
  20565. /**
  20566. * Returns the key associated with a keydown event
  20567. * @param {!Event} evt The keydown event
  20568. * @return {string}
  20569. * @private
  20570. */
  20571. }, {
  20572. key: 'getKeyFromEvent_',
  20573. value: function getKeyFromEvent_(evt) {
  20574. if (ACCEPTABLE_KEYS.has(evt.key)) {
  20575. return evt.key;
  20576. }
  20577. return KEYCODE_MAP.get(evt.keyCode);
  20578. }
  20579. }, {
  20580. key: 'isActivationKey_',
  20581. value: function isActivationKey_(key) {
  20582. return key === __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].SPACE_KEY || key === __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ENTER_KEY;
  20583. }
  20584. /**
  20585. * Returns whether a given index is inclusively between the ends
  20586. * @param {number} index The index to test
  20587. * @private
  20588. */
  20589. }, {
  20590. key: 'indexIsInRange_',
  20591. value: function indexIsInRange_(index) {
  20592. return index >= 0 && index < this.adapter_.getTabListLength();
  20593. }
  20594. /**
  20595. * Returns the view's RTL property
  20596. * @return {boolean}
  20597. * @private
  20598. */
  20599. }, {
  20600. key: 'isRTL_',
  20601. value: function isRTL_() {
  20602. return this.adapter_.isRTL();
  20603. }
  20604. /**
  20605. * Scrolls the tab at the given index into view for left-to-right useragents
  20606. * @param {number} index The index of the tab to scroll into view
  20607. * @private
  20608. */
  20609. }, {
  20610. key: 'scrollIntoView_',
  20611. value: function scrollIntoView_(index) {
  20612. var scrollPosition = this.adapter_.getScrollPosition();
  20613. var barWidth = this.adapter_.getOffsetWidth();
  20614. var tabDimensions = this.adapter_.getTabDimensionsAtIndex(index);
  20615. var nextIndex = this.findAdjacentTabIndexClosestToEdge_(index, tabDimensions, scrollPosition, barWidth);
  20616. if (!this.indexIsInRange_(nextIndex)) {
  20617. return;
  20618. }
  20619. var scrollIncrement = this.calculateScrollIncrement_(index, nextIndex, scrollPosition, barWidth);
  20620. this.adapter_.incrementScroll(scrollIncrement);
  20621. }
  20622. /**
  20623. * Scrolls the tab at the given index into view in RTL
  20624. * @param {number} index The tab index to make visible
  20625. * @private
  20626. */
  20627. }, {
  20628. key: 'scrollIntoViewRTL_',
  20629. value: function scrollIntoViewRTL_(index) {
  20630. var scrollPosition = this.adapter_.getScrollPosition();
  20631. var barWidth = this.adapter_.getOffsetWidth();
  20632. var tabDimensions = this.adapter_.getTabDimensionsAtIndex(index);
  20633. var scrollWidth = this.adapter_.getScrollContentWidth();
  20634. var nextIndex = this.findAdjacentTabIndexClosestToEdgeRTL_(index, tabDimensions, scrollPosition, barWidth, scrollWidth);
  20635. if (!this.indexIsInRange_(nextIndex)) {
  20636. return;
  20637. }
  20638. var scrollIncrement = this.calculateScrollIncrementRTL_(index, nextIndex, scrollPosition, barWidth, scrollWidth);
  20639. this.adapter_.incrementScroll(scrollIncrement);
  20640. }
  20641. }]);
  20642. return MDCTabBarFoundation;
  20643. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  20644. /* harmony default export */ __webpack_exports__["a"] = (MDCTabBarFoundation);
  20645. /***/ }),
  20646. /* 144 */
  20647. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20648. "use strict";
  20649. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return numbers; });
  20650. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  20651. /**
  20652. * @license
  20653. * Copyright 2018 Google Inc.
  20654. *
  20655. * Permission is hereby granted, free of charge, to any person obtaining a copy
  20656. * of this software and associated documentation files (the "Software"), to deal
  20657. * in the Software without restriction, including without limitation the rights
  20658. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  20659. * copies of the Software, and to permit persons to whom the Software is
  20660. * furnished to do so, subject to the following conditions:
  20661. *
  20662. * The above copyright notice and this permission notice shall be included in
  20663. * all copies or substantial portions of the Software.
  20664. *
  20665. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20666. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20667. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  20668. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20669. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20670. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20671. * THE SOFTWARE.
  20672. */
  20673. /** @enum {string} */
  20674. var strings = {
  20675. TAB_ACTIVATED_EVENT: 'MDCTabBar:activated',
  20676. TAB_SCROLLER_SELECTOR: '.mdc-tab-scroller',
  20677. TAB_SELECTOR: '.mdc-tab',
  20678. ARROW_LEFT_KEY: 'ArrowLeft',
  20679. ARROW_RIGHT_KEY: 'ArrowRight',
  20680. END_KEY: 'End',
  20681. HOME_KEY: 'Home',
  20682. ENTER_KEY: 'Enter',
  20683. SPACE_KEY: 'Space'
  20684. };
  20685. /** @enum {number} */
  20686. var numbers = {
  20687. EXTRA_SCROLL_AMOUNT: 20,
  20688. ARROW_LEFT_KEYCODE: 37,
  20689. ARROW_RIGHT_KEYCODE: 39,
  20690. END_KEYCODE: 35,
  20691. HOME_KEYCODE: 36,
  20692. ENTER_KEYCODE: 13,
  20693. SPACE_KEYCODE: 32
  20694. };
  20695. /***/ }),
  20696. /* 145 */
  20697. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20698. "use strict";
  20699. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  20700. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextField", function() { return MDCTextField; });
  20701. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  20702. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__ = __webpack_require__(2);
  20703. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_ripple_util__ = __webpack_require__(6);
  20704. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(59);
  20705. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__adapter__ = __webpack_require__(60);
  20706. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__foundation__ = __webpack_require__(148);
  20707. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__material_line_ripple_index__ = __webpack_require__(18);
  20708. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__helper_text_index__ = __webpack_require__(149);
  20709. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__icon_index__ = __webpack_require__(150);
  20710. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__material_floating_label_index__ = __webpack_require__(10);
  20711. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__material_notched_outline_index__ = __webpack_require__(22);
  20712. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextFieldFoundation", function() { return __WEBPACK_IMPORTED_MODULE_5__foundation__["a"]; });
  20713. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextFieldHelperText", function() { return __WEBPACK_IMPORTED_MODULE_7__helper_text_index__["a"]; });
  20714. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextFieldHelperTextFoundation", function() { return __WEBPACK_IMPORTED_MODULE_7__helper_text_index__["b"]; });
  20715. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextFieldIcon", function() { return __WEBPACK_IMPORTED_MODULE_8__icon_index__["a"]; });
  20716. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextFieldIconFoundation", function() { return __WEBPACK_IMPORTED_MODULE_8__icon_index__["b"]; });
  20717. 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; };
  20718. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  20719. 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); } };
  20720. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20721. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  20722. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  20723. /**
  20724. * @license
  20725. * Copyright 2016 Google Inc.
  20726. *
  20727. * Permission is hereby granted, free of charge, to any person obtaining a copy
  20728. * of this software and associated documentation files (the "Software"), to deal
  20729. * in the Software without restriction, including without limitation the rights
  20730. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  20731. * copies of the Software, and to permit persons to whom the Software is
  20732. * furnished to do so, subject to the following conditions:
  20733. *
  20734. * The above copyright notice and this permission notice shall be included in
  20735. * all copies or substantial portions of the Software.
  20736. *
  20737. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20738. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20739. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  20740. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20741. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20742. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20743. * THE SOFTWARE.
  20744. */
  20745. /* eslint-disable no-unused-vars */
  20746. /* eslint-enable no-unused-vars */
  20747. /* eslint-disable no-unused-vars */
  20748. /* eslint-enable no-unused-vars */
  20749. /**
  20750. * @extends {MDCComponent<!MDCTextFieldFoundation>}
  20751. * @final
  20752. */
  20753. var MDCTextField = function (_MDCComponent) {
  20754. _inherits(MDCTextField, _MDCComponent);
  20755. /**
  20756. * @param {...?} args
  20757. */
  20758. function MDCTextField() {
  20759. var _ref;
  20760. _classCallCheck(this, MDCTextField);
  20761. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  20762. args[_key] = arguments[_key];
  20763. }
  20764. /** @private {?Element} */
  20765. var _this = _possibleConstructorReturn(this, (_ref = MDCTextField.__proto__ || Object.getPrototypeOf(MDCTextField)).call.apply(_ref, [this].concat(args)));
  20766. _this.input_;
  20767. /** @type {?MDCRipple} */
  20768. _this.ripple;
  20769. /** @private {?MDCLineRipple} */
  20770. _this.lineRipple_;
  20771. /** @private {?MDCTextFieldHelperText} */
  20772. _this.helperText_;
  20773. /** @private {?MDCTextFieldIcon} */
  20774. _this.leadingIcon_;
  20775. /** @private {?MDCTextFieldIcon} */
  20776. _this.trailingIcon_;
  20777. /** @private {?MDCFloatingLabel} */
  20778. _this.label_;
  20779. /** @private {?MDCNotchedOutline} */
  20780. _this.outline_;
  20781. return _this;
  20782. }
  20783. /**
  20784. * @param {!Element} root
  20785. * @return {!MDCTextField}
  20786. */
  20787. _createClass(MDCTextField, [{
  20788. key: 'initialize',
  20789. /**
  20790. * @param {(function(!Element): !MDCRipple)=} rippleFactory A function which
  20791. * creates a new MDCRipple.
  20792. * @param {(function(!Element): !MDCLineRipple)=} lineRippleFactory A function which
  20793. * creates a new MDCLineRipple.
  20794. * @param {(function(!Element): !MDCTextFieldHelperText)=} helperTextFactory A function which
  20795. * creates a new MDCTextFieldHelperText.
  20796. * @param {(function(!Element): !MDCTextFieldIcon)=} iconFactory A function which
  20797. * creates a new MDCTextFieldIcon.
  20798. * @param {(function(!Element): !MDCFloatingLabel)=} labelFactory A function which
  20799. * creates a new MDCFloatingLabel.
  20800. * @param {(function(!Element): !MDCNotchedOutline)=} outlineFactory A function which
  20801. * creates a new MDCNotchedOutline.
  20802. */
  20803. value: function initialize() {
  20804. var rippleFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el, foundation) {
  20805. return new __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"](el, foundation);
  20806. };
  20807. var lineRippleFactory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (el) {
  20808. return new __WEBPACK_IMPORTED_MODULE_6__material_line_ripple_index__["MDCLineRipple"](el);
  20809. };
  20810. var helperTextFactory = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function (el) {
  20811. return new __WEBPACK_IMPORTED_MODULE_7__helper_text_index__["a" /* MDCTextFieldHelperText */](el);
  20812. };
  20813. var iconFactory = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : function (el) {
  20814. return new __WEBPACK_IMPORTED_MODULE_8__icon_index__["a" /* MDCTextFieldIcon */](el);
  20815. };
  20816. var _this2 = this;
  20817. var labelFactory = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : function (el) {
  20818. return new __WEBPACK_IMPORTED_MODULE_9__material_floating_label_index__["MDCFloatingLabel"](el);
  20819. };
  20820. var outlineFactory = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : function (el) {
  20821. return new __WEBPACK_IMPORTED_MODULE_10__material_notched_outline_index__["MDCNotchedOutline"](el);
  20822. };
  20823. this.input_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].INPUT_SELECTOR);
  20824. var labelElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].LABEL_SELECTOR);
  20825. if (labelElement) {
  20826. this.label_ = labelFactory(labelElement);
  20827. }
  20828. var lineRippleElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].LINE_RIPPLE_SELECTOR);
  20829. if (lineRippleElement) {
  20830. this.lineRipple_ = lineRippleFactory(lineRippleElement);
  20831. }
  20832. var outlineElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].OUTLINE_SELECTOR);
  20833. if (outlineElement) {
  20834. this.outline_ = outlineFactory(outlineElement);
  20835. }
  20836. if (this.input_.hasAttribute(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].ARIA_CONTROLS)) {
  20837. var helperTextElement = document.getElementById(this.input_.getAttribute(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].ARIA_CONTROLS));
  20838. if (helperTextElement) {
  20839. this.helperText_ = helperTextFactory(helperTextElement);
  20840. }
  20841. }
  20842. var iconElements = this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].ICON_SELECTOR);
  20843. if (iconElements.length > 0) {
  20844. if (iconElements.length > 1) {
  20845. // Has both icons.
  20846. this.leadingIcon_ = iconFactory(iconElements[0]);
  20847. this.trailingIcon_ = iconFactory(iconElements[1]);
  20848. } else {
  20849. if (this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* cssClasses */].WITH_LEADING_ICON)) {
  20850. this.leadingIcon_ = iconFactory(iconElements[0]);
  20851. } else {
  20852. this.trailingIcon_ = iconFactory(iconElements[0]);
  20853. }
  20854. }
  20855. }
  20856. this.ripple = null;
  20857. 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)) {
  20858. var MATCHES = Object(__WEBPACK_IMPORTED_MODULE_2__material_ripple_util__["getMatchesProperty"])(HTMLElement.prototype);
  20859. var adapter = _extends(__WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"].createAdapter( /** @type {!RippleCapableSurface} */this), {
  20860. isSurfaceActive: function isSurfaceActive() {
  20861. return _this2.input_[MATCHES](':active');
  20862. },
  20863. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  20864. return _this2.input_.addEventListener(type, handler);
  20865. },
  20866. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  20867. return _this2.input_.removeEventListener(type, handler);
  20868. }
  20869. });
  20870. var foundation = new __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRippleFoundation"](adapter);
  20871. this.ripple = rippleFactory(this.root_, foundation);
  20872. }
  20873. }
  20874. }, {
  20875. key: 'destroy',
  20876. value: function destroy() {
  20877. if (this.ripple) {
  20878. this.ripple.destroy();
  20879. }
  20880. if (this.lineRipple_) {
  20881. this.lineRipple_.destroy();
  20882. }
  20883. if (this.helperText_) {
  20884. this.helperText_.destroy();
  20885. }
  20886. if (this.leadingIcon_) {
  20887. this.leadingIcon_.destroy();
  20888. }
  20889. if (this.trailingIcon_) {
  20890. this.trailingIcon_.destroy();
  20891. }
  20892. if (this.label_) {
  20893. this.label_.destroy();
  20894. }
  20895. if (this.outline_) {
  20896. this.outline_.destroy();
  20897. }
  20898. _get(MDCTextField.prototype.__proto__ || Object.getPrototypeOf(MDCTextField.prototype), 'destroy', this).call(this);
  20899. }
  20900. /**
  20901. * Initiliazes the Text Field's internal state based on the environment's
  20902. * state.
  20903. */
  20904. }, {
  20905. key: 'initialSyncWithDom',
  20906. value: function initialSyncWithDom() {
  20907. this.disabled = this.input_.disabled;
  20908. }
  20909. /**
  20910. * @return {string} The value of the input.
  20911. */
  20912. }, {
  20913. key: 'focus',
  20914. /**
  20915. * Focuses the input element.
  20916. */
  20917. value: function focus() {
  20918. this.input_.focus();
  20919. }
  20920. /**
  20921. * Recomputes the outline SVG path for the outline element.
  20922. */
  20923. }, {
  20924. key: 'layout',
  20925. value: function layout() {
  20926. var openNotch = this.foundation_.shouldFloat;
  20927. this.foundation_.notchOutline(openNotch);
  20928. }
  20929. /**
  20930. * @return {!MDCTextFieldFoundation}
  20931. */
  20932. }, {
  20933. key: 'getDefaultFoundation',
  20934. value: function getDefaultFoundation() {
  20935. var _this3 = this;
  20936. return new __WEBPACK_IMPORTED_MODULE_5__foundation__["a" /* default */](
  20937. /** @type {!MDCTextFieldAdapter} */_extends({
  20938. addClass: function addClass(className) {
  20939. return _this3.root_.classList.add(className);
  20940. },
  20941. removeClass: function removeClass(className) {
  20942. return _this3.root_.classList.remove(className);
  20943. },
  20944. hasClass: function hasClass(className) {
  20945. return _this3.root_.classList.contains(className);
  20946. },
  20947. registerTextFieldInteractionHandler: function registerTextFieldInteractionHandler(evtType, handler) {
  20948. return _this3.root_.addEventListener(evtType, handler);
  20949. },
  20950. deregisterTextFieldInteractionHandler: function deregisterTextFieldInteractionHandler(evtType, handler) {
  20951. return _this3.root_.removeEventListener(evtType, handler);
  20952. },
  20953. registerValidationAttributeChangeHandler: function registerValidationAttributeChangeHandler(handler) {
  20954. var getAttributesList = function getAttributesList(mutationsList) {
  20955. return mutationsList.map(function (mutation) {
  20956. return mutation.attributeName;
  20957. });
  20958. };
  20959. var observer = new MutationObserver(function (mutationsList) {
  20960. return handler(getAttributesList(mutationsList));
  20961. });
  20962. var targetNode = _this3.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].INPUT_SELECTOR);
  20963. var config = { attributes: true };
  20964. observer.observe(targetNode, config);
  20965. return observer;
  20966. },
  20967. deregisterValidationAttributeChangeHandler: function deregisterValidationAttributeChangeHandler(observer) {
  20968. return observer.disconnect();
  20969. },
  20970. isFocused: function isFocused() {
  20971. return document.activeElement === _this3.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].INPUT_SELECTOR);
  20972. }
  20973. }, this.getInputAdapterMethods_(), this.getLabelAdapterMethods_(), this.getLineRippleAdapterMethods_(), this.getOutlineAdapterMethods_()), this.getFoundationMap_());
  20974. }
  20975. /**
  20976. * @return {!{
  20977. * shakeLabel: function(boolean): undefined,
  20978. * floatLabel: function(boolean): undefined,
  20979. * hasLabel: function(): boolean,
  20980. * getLabelWidth: function(): number,
  20981. * }}
  20982. */
  20983. }, {
  20984. key: 'getLabelAdapterMethods_',
  20985. value: function getLabelAdapterMethods_() {
  20986. var _this4 = this;
  20987. return {
  20988. shakeLabel: function shakeLabel(shouldShake) {
  20989. return _this4.label_.shake(shouldShake);
  20990. },
  20991. floatLabel: function floatLabel(shouldFloat) {
  20992. return _this4.label_.float(shouldFloat);
  20993. },
  20994. hasLabel: function hasLabel() {
  20995. return !!_this4.label_;
  20996. },
  20997. getLabelWidth: function getLabelWidth() {
  20998. return _this4.label_ ? _this4.label_.getWidth() : 0;
  20999. }
  21000. };
  21001. }
  21002. /**
  21003. * @return {!{
  21004. * activateLineRipple: function(): undefined,
  21005. * deactivateLineRipple: function(): undefined,
  21006. * setLineRippleTransformOrigin: function(number): undefined,
  21007. * }}
  21008. */
  21009. }, {
  21010. key: 'getLineRippleAdapterMethods_',
  21011. value: function getLineRippleAdapterMethods_() {
  21012. var _this5 = this;
  21013. return {
  21014. activateLineRipple: function activateLineRipple() {
  21015. if (_this5.lineRipple_) {
  21016. _this5.lineRipple_.activate();
  21017. }
  21018. },
  21019. deactivateLineRipple: function deactivateLineRipple() {
  21020. if (_this5.lineRipple_) {
  21021. _this5.lineRipple_.deactivate();
  21022. }
  21023. },
  21024. setLineRippleTransformOrigin: function setLineRippleTransformOrigin(normalizedX) {
  21025. if (_this5.lineRipple_) {
  21026. _this5.lineRipple_.setRippleCenter(normalizedX);
  21027. }
  21028. }
  21029. };
  21030. }
  21031. /**
  21032. * @return {!{
  21033. * notchOutline: function(number, boolean): undefined,
  21034. * hasOutline: function(): boolean,
  21035. * }}
  21036. */
  21037. }, {
  21038. key: 'getOutlineAdapterMethods_',
  21039. value: function getOutlineAdapterMethods_() {
  21040. var _this6 = this;
  21041. return {
  21042. notchOutline: function notchOutline(labelWidth) {
  21043. return _this6.outline_.notch(labelWidth);
  21044. },
  21045. closeOutline: function closeOutline() {
  21046. return _this6.outline_.closeNotch();
  21047. },
  21048. hasOutline: function hasOutline() {
  21049. return !!_this6.outline_;
  21050. }
  21051. };
  21052. }
  21053. /**
  21054. * @return {!{
  21055. * registerInputInteractionHandler: function(string, function()): undefined,
  21056. * deregisterInputInteractionHandler: function(string, function()): undefined,
  21057. * getNativeInput: function(): ?Element,
  21058. * }}
  21059. */
  21060. }, {
  21061. key: 'getInputAdapterMethods_',
  21062. value: function getInputAdapterMethods_() {
  21063. var _this7 = this;
  21064. return {
  21065. registerInputInteractionHandler: function registerInputInteractionHandler(evtType, handler) {
  21066. return _this7.input_.addEventListener(evtType, handler);
  21067. },
  21068. deregisterInputInteractionHandler: function deregisterInputInteractionHandler(evtType, handler) {
  21069. return _this7.input_.removeEventListener(evtType, handler);
  21070. },
  21071. getNativeInput: function getNativeInput() {
  21072. return _this7.input_;
  21073. }
  21074. };
  21075. }
  21076. /**
  21077. * Returns a map of all subcomponents to subfoundations.
  21078. * @return {!FoundationMapType}
  21079. */
  21080. }, {
  21081. key: 'getFoundationMap_',
  21082. value: function getFoundationMap_() {
  21083. return {
  21084. helperText: this.helperText_ ? this.helperText_.foundation : undefined,
  21085. leadingIcon: this.leadingIcon_ ? this.leadingIcon_.foundation : undefined,
  21086. trailingIcon: this.trailingIcon_ ? this.trailingIcon_.foundation : undefined
  21087. };
  21088. }
  21089. }, {
  21090. key: 'value',
  21091. get: function get() {
  21092. return this.foundation_.getValue();
  21093. }
  21094. /**
  21095. * @param {string} value The value to set on the input.
  21096. */
  21097. ,
  21098. set: function set(value) {
  21099. this.foundation_.setValue(value);
  21100. }
  21101. /**
  21102. * @return {boolean} True if the Text Field is disabled.
  21103. */
  21104. }, {
  21105. key: 'disabled',
  21106. get: function get() {
  21107. return this.foundation_.isDisabled();
  21108. }
  21109. /**
  21110. * @param {boolean} disabled Sets the Text Field disabled or enabled.
  21111. */
  21112. ,
  21113. set: function set(disabled) {
  21114. this.foundation_.setDisabled(disabled);
  21115. }
  21116. /**
  21117. * @return {boolean} valid True if the Text Field is valid.
  21118. */
  21119. }, {
  21120. key: 'valid',
  21121. get: function get() {
  21122. return this.foundation_.isValid();
  21123. }
  21124. /**
  21125. * @param {boolean} valid Sets the Text Field valid or invalid.
  21126. */
  21127. ,
  21128. set: function set(valid) {
  21129. this.foundation_.setValid(valid);
  21130. }
  21131. /**
  21132. * @return {boolean} True if the Text Field is required.
  21133. */
  21134. }, {
  21135. key: 'required',
  21136. get: function get() {
  21137. return this.input_.required;
  21138. }
  21139. /**
  21140. * @param {boolean} required Sets the Text Field to required.
  21141. */
  21142. ,
  21143. set: function set(required) {
  21144. this.input_.required = required;
  21145. }
  21146. /**
  21147. * @return {string} The input element's validation pattern.
  21148. */
  21149. }, {
  21150. key: 'pattern',
  21151. get: function get() {
  21152. return this.input_.pattern;
  21153. }
  21154. /**
  21155. * @param {string} pattern Sets the input element's validation pattern.
  21156. */
  21157. ,
  21158. set: function set(pattern) {
  21159. this.input_.pattern = pattern;
  21160. }
  21161. /**
  21162. * @return {number} The input element's minLength.
  21163. */
  21164. }, {
  21165. key: 'minLength',
  21166. get: function get() {
  21167. return this.input_.minLength;
  21168. }
  21169. /**
  21170. * @param {number} minLength Sets the input element's minLength.
  21171. */
  21172. ,
  21173. set: function set(minLength) {
  21174. this.input_.minLength = minLength;
  21175. }
  21176. /**
  21177. * @return {number} The input element's maxLength.
  21178. */
  21179. }, {
  21180. key: 'maxLength',
  21181. get: function get() {
  21182. return this.input_.maxLength;
  21183. }
  21184. /**
  21185. * @param {number} maxLength Sets the input element's maxLength.
  21186. */
  21187. ,
  21188. set: function set(maxLength) {
  21189. // Chrome throws exception if maxLength is set < 0
  21190. if (maxLength < 0) {
  21191. this.input_.removeAttribute('maxLength');
  21192. } else {
  21193. this.input_.maxLength = maxLength;
  21194. }
  21195. }
  21196. /**
  21197. * @return {string} The input element's min.
  21198. */
  21199. }, {
  21200. key: 'min',
  21201. get: function get() {
  21202. return this.input_.min;
  21203. }
  21204. /**
  21205. * @param {string} min Sets the input element's min.
  21206. */
  21207. ,
  21208. set: function set(min) {
  21209. this.input_.min = min;
  21210. }
  21211. /**
  21212. * @return {string} The input element's max.
  21213. */
  21214. }, {
  21215. key: 'max',
  21216. get: function get() {
  21217. return this.input_.max;
  21218. }
  21219. /**
  21220. * @param {string} max Sets the input element's max.
  21221. */
  21222. ,
  21223. set: function set(max) {
  21224. this.input_.max = max;
  21225. }
  21226. /**
  21227. * @return {string} The input element's step.
  21228. */
  21229. }, {
  21230. key: 'step',
  21231. get: function get() {
  21232. return this.input_.step;
  21233. }
  21234. /**
  21235. * @param {string} step Sets the input element's step.
  21236. */
  21237. ,
  21238. set: function set(step) {
  21239. this.input_.step = step;
  21240. }
  21241. /**
  21242. * Sets the helper text element content.
  21243. * @param {string} content
  21244. */
  21245. }, {
  21246. key: 'helperTextContent',
  21247. set: function set(content) {
  21248. this.foundation_.setHelperTextContent(content);
  21249. }
  21250. /**
  21251. * Sets the aria label of the leading icon.
  21252. * @param {string} label
  21253. */
  21254. }, {
  21255. key: 'leadingIconAriaLabel',
  21256. set: function set(label) {
  21257. this.foundation_.setLeadingIconAriaLabel(label);
  21258. }
  21259. /**
  21260. * Sets the text content of the leading icon.
  21261. * @param {string} content
  21262. */
  21263. }, {
  21264. key: 'leadingIconContent',
  21265. set: function set(content) {
  21266. this.foundation_.setLeadingIconContent(content);
  21267. }
  21268. /**
  21269. * Sets the aria label of the trailing icon.
  21270. * @param {string} label
  21271. */
  21272. }, {
  21273. key: 'trailingIconAriaLabel',
  21274. set: function set(label) {
  21275. this.foundation_.setTrailingIconAriaLabel(label);
  21276. }
  21277. /**
  21278. * Sets the text content of the trailing icon.
  21279. * @param {string} content
  21280. */
  21281. }, {
  21282. key: 'trailingIconContent',
  21283. set: function set(content) {
  21284. this.foundation_.setTrailingIconContent(content);
  21285. }
  21286. /**
  21287. * Enables or disables the use of native validation. Use this for custom validation.
  21288. * @param {boolean} useNativeValidation Set this to false to ignore native input validation.
  21289. */
  21290. }, {
  21291. key: 'useNativeValidation',
  21292. set: function set(useNativeValidation) {
  21293. this.foundation_.setUseNativeValidation(useNativeValidation);
  21294. }
  21295. }], [{
  21296. key: 'attachTo',
  21297. value: function attachTo(root) {
  21298. return new MDCTextField(root);
  21299. }
  21300. }]);
  21301. return MDCTextField;
  21302. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  21303. /***/ }),
  21304. /* 146 */
  21305. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  21306. "use strict";
  21307. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  21308. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  21309. /**
  21310. * @license
  21311. * Copyright 2016 Google Inc.
  21312. *
  21313. * Permission is hereby granted, free of charge, to any person obtaining a copy
  21314. * of this software and associated documentation files (the "Software"), to deal
  21315. * in the Software without restriction, including without limitation the rights
  21316. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  21317. * copies of the Software, and to permit persons to whom the Software is
  21318. * furnished to do so, subject to the following conditions:
  21319. *
  21320. * The above copyright notice and this permission notice shall be included in
  21321. * all copies or substantial portions of the Software.
  21322. *
  21323. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  21324. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  21325. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  21326. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  21327. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21328. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  21329. * THE SOFTWARE.
  21330. */
  21331. /** @enum {string} */
  21332. var strings = {
  21333. ARIA_HIDDEN: 'aria-hidden',
  21334. ROLE: 'role'
  21335. };
  21336. /** @enum {string} */
  21337. var cssClasses = {
  21338. HELPER_TEXT_PERSISTENT: 'mdc-text-field-helper-text--persistent',
  21339. HELPER_TEXT_VALIDATION_MSG: 'mdc-text-field-helper-text--validation-msg'
  21340. };
  21341. /***/ }),
  21342. /* 147 */
  21343. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  21344. "use strict";
  21345. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return strings; });
  21346. /**
  21347. * @license
  21348. * Copyright 2016 Google Inc.
  21349. *
  21350. * Permission is hereby granted, free of charge, to any person obtaining a copy
  21351. * of this software and associated documentation files (the "Software"), to deal
  21352. * in the Software without restriction, including without limitation the rights
  21353. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  21354. * copies of the Software, and to permit persons to whom the Software is
  21355. * furnished to do so, subject to the following conditions:
  21356. *
  21357. * The above copyright notice and this permission notice shall be included in
  21358. * all copies or substantial portions of the Software.
  21359. *
  21360. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  21361. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  21362. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  21363. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  21364. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21365. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  21366. * THE SOFTWARE.
  21367. */
  21368. /** @enum {string} */
  21369. var strings = {
  21370. ICON_EVENT: 'MDCTextField:icon',
  21371. ICON_ROLE: 'button'
  21372. };
  21373. /***/ }),
  21374. /* 148 */
  21375. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  21376. "use strict";
  21377. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  21378. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__helper_text_foundation__ = __webpack_require__(27);
  21379. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__icon_foundation__ = __webpack_require__(28);
  21380. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__adapter__ = __webpack_require__(60);
  21381. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__constants__ = __webpack_require__(59);
  21382. 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; };
  21383. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  21384. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21385. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  21386. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  21387. /**
  21388. * @license
  21389. * Copyright 2016 Google Inc.
  21390. *
  21391. * Permission is hereby granted, free of charge, to any person obtaining a copy
  21392. * of this software and associated documentation files (the "Software"), to deal
  21393. * in the Software without restriction, including without limitation the rights
  21394. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  21395. * copies of the Software, and to permit persons to whom the Software is
  21396. * furnished to do so, subject to the following conditions:
  21397. *
  21398. * The above copyright notice and this permission notice shall be included in
  21399. * all copies or substantial portions of the Software.
  21400. *
  21401. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  21402. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  21403. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  21404. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  21405. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21406. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  21407. * THE SOFTWARE.
  21408. */
  21409. /* eslint-disable no-unused-vars */
  21410. /* eslint-enable no-unused-vars */
  21411. /**
  21412. * @extends {MDCFoundation<!MDCTextFieldAdapter>}
  21413. * @final
  21414. */
  21415. var MDCTextFieldFoundation = function (_MDCFoundation) {
  21416. _inherits(MDCTextFieldFoundation, _MDCFoundation);
  21417. _createClass(MDCTextFieldFoundation, [{
  21418. key: 'shouldShake',
  21419. /** @return {boolean} */
  21420. get: function get() {
  21421. return !this.isValid() && !this.isFocused_ && !!this.getValue();
  21422. }
  21423. /**
  21424. * @return {boolean}
  21425. * @private
  21426. */
  21427. }, {
  21428. key: 'shouldAlwaysFloat_',
  21429. get: function get() {
  21430. var type = this.getNativeInput_().type;
  21431. return __WEBPACK_IMPORTED_MODULE_4__constants__["a" /* ALWAYS_FLOAT_TYPES */].indexOf(type) >= 0;
  21432. }
  21433. /** @return {boolean} */
  21434. }, {
  21435. key: 'shouldFloat',
  21436. get: function get() {
  21437. return this.shouldAlwaysFloat_ || this.isFocused_ || !!this.getValue() || this.isBadInput_();
  21438. }
  21439. /**
  21440. * {@see MDCTextFieldAdapter} for typing information on parameters and return
  21441. * types.
  21442. * @return {!MDCTextFieldAdapter}
  21443. */
  21444. }], [{
  21445. key: 'cssClasses',
  21446. /** @return enum {string} */
  21447. get: function get() {
  21448. return __WEBPACK_IMPORTED_MODULE_4__constants__["c" /* cssClasses */];
  21449. }
  21450. /** @return enum {string} */
  21451. }, {
  21452. key: 'strings',
  21453. get: function get() {
  21454. return __WEBPACK_IMPORTED_MODULE_4__constants__["e" /* strings */];
  21455. }
  21456. /** @return enum {string} */
  21457. }, {
  21458. key: 'numbers',
  21459. get: function get() {
  21460. return __WEBPACK_IMPORTED_MODULE_4__constants__["d" /* numbers */];
  21461. }
  21462. }, {
  21463. key: 'defaultAdapter',
  21464. get: function get() {
  21465. return (/** @type {!MDCTextFieldAdapter} */{
  21466. addClass: function addClass() {},
  21467. removeClass: function removeClass() {},
  21468. hasClass: function hasClass() {},
  21469. registerTextFieldInteractionHandler: function registerTextFieldInteractionHandler() {},
  21470. deregisterTextFieldInteractionHandler: function deregisterTextFieldInteractionHandler() {},
  21471. registerInputInteractionHandler: function registerInputInteractionHandler() {},
  21472. deregisterInputInteractionHandler: function deregisterInputInteractionHandler() {},
  21473. registerValidationAttributeChangeHandler: function registerValidationAttributeChangeHandler() {},
  21474. deregisterValidationAttributeChangeHandler: function deregisterValidationAttributeChangeHandler() {},
  21475. getNativeInput: function getNativeInput() {},
  21476. isFocused: function isFocused() {},
  21477. activateLineRipple: function activateLineRipple() {},
  21478. deactivateLineRipple: function deactivateLineRipple() {},
  21479. setLineRippleTransformOrigin: function setLineRippleTransformOrigin() {},
  21480. shakeLabel: function shakeLabel() {},
  21481. floatLabel: function floatLabel() {},
  21482. hasLabel: function hasLabel() {},
  21483. getLabelWidth: function getLabelWidth() {},
  21484. hasOutline: function hasOutline() {},
  21485. notchOutline: function notchOutline() {},
  21486. closeOutline: function closeOutline() {}
  21487. }
  21488. );
  21489. }
  21490. /**
  21491. * @param {!MDCTextFieldAdapter} adapter
  21492. * @param {!FoundationMapType=} foundationMap Map from subcomponent names to their subfoundations.
  21493. */
  21494. }]);
  21495. function MDCTextFieldFoundation(adapter) {
  21496. var foundationMap = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : /** @type {!FoundationMapType} */{};
  21497. _classCallCheck(this, MDCTextFieldFoundation);
  21498. /** @type {!MDCTextFieldHelperTextFoundation|undefined} */
  21499. var _this = _possibleConstructorReturn(this, (MDCTextFieldFoundation.__proto__ || Object.getPrototypeOf(MDCTextFieldFoundation)).call(this, _extends(MDCTextFieldFoundation.defaultAdapter, adapter)));
  21500. _this.helperText_ = foundationMap.helperText;
  21501. /** @type {!MDCTextFieldIconFoundation|undefined} */
  21502. _this.leadingIcon_ = foundationMap.leadingIcon;
  21503. /** @type {!MDCTextFieldIconFoundation|undefined} */
  21504. _this.trailingIcon_ = foundationMap.trailingIcon;
  21505. /** @private {boolean} */
  21506. _this.isFocused_ = false;
  21507. /** @private {boolean} */
  21508. _this.receivedUserInput_ = false;
  21509. /** @private {boolean} */
  21510. _this.useCustomValidityChecking_ = false;
  21511. /** @private {boolean} */
  21512. _this.isValid_ = true;
  21513. /** @private {boolean} */
  21514. _this.useNativeValidation_ = true;
  21515. /** @private {function(): undefined} */
  21516. _this.inputFocusHandler_ = function () {
  21517. return _this.activateFocus();
  21518. };
  21519. /** @private {function(): undefined} */
  21520. _this.inputBlurHandler_ = function () {
  21521. return _this.deactivateFocus();
  21522. };
  21523. /** @private {function(): undefined} */
  21524. _this.inputInputHandler_ = function () {
  21525. return _this.autoCompleteFocus();
  21526. };
  21527. /** @private {function(!Event): undefined} */
  21528. _this.setPointerXOffset_ = function (evt) {
  21529. return _this.setTransformOrigin(evt);
  21530. };
  21531. /** @private {function(!Event): undefined} */
  21532. _this.textFieldInteractionHandler_ = function () {
  21533. return _this.handleTextFieldInteraction();
  21534. };
  21535. /** @private {function(!Array): undefined} */
  21536. _this.validationAttributeChangeHandler_ = function (attributesList) {
  21537. return _this.handleValidationAttributeChange(attributesList);
  21538. };
  21539. /** @private {!MutationObserver} */
  21540. _this.validationObserver_;
  21541. return _this;
  21542. }
  21543. _createClass(MDCTextFieldFoundation, [{
  21544. key: 'init',
  21545. value: function init() {
  21546. var _this2 = this;
  21547. if (this.adapter_.isFocused()) {
  21548. this.inputFocusHandler_();
  21549. } else if (this.adapter_.hasLabel() && this.shouldFloat) {
  21550. this.notchOutline(true);
  21551. this.adapter_.floatLabel(true);
  21552. }
  21553. this.adapter_.registerInputInteractionHandler('focus', this.inputFocusHandler_);
  21554. this.adapter_.registerInputInteractionHandler('blur', this.inputBlurHandler_);
  21555. this.adapter_.registerInputInteractionHandler('input', this.inputInputHandler_);
  21556. ['mousedown', 'touchstart'].forEach(function (evtType) {
  21557. _this2.adapter_.registerInputInteractionHandler(evtType, _this2.setPointerXOffset_);
  21558. });
  21559. ['click', 'keydown'].forEach(function (evtType) {
  21560. _this2.adapter_.registerTextFieldInteractionHandler(evtType, _this2.textFieldInteractionHandler_);
  21561. });
  21562. this.validationObserver_ = this.adapter_.registerValidationAttributeChangeHandler(this.validationAttributeChangeHandler_);
  21563. }
  21564. }, {
  21565. key: 'destroy',
  21566. value: function destroy() {
  21567. var _this3 = this;
  21568. this.adapter_.deregisterInputInteractionHandler('focus', this.inputFocusHandler_);
  21569. this.adapter_.deregisterInputInteractionHandler('blur', this.inputBlurHandler_);
  21570. this.adapter_.deregisterInputInteractionHandler('input', this.inputInputHandler_);
  21571. ['mousedown', 'touchstart'].forEach(function (evtType) {
  21572. _this3.adapter_.deregisterInputInteractionHandler(evtType, _this3.setPointerXOffset_);
  21573. });
  21574. ['click', 'keydown'].forEach(function (evtType) {
  21575. _this3.adapter_.deregisterTextFieldInteractionHandler(evtType, _this3.textFieldInteractionHandler_);
  21576. });
  21577. this.adapter_.deregisterValidationAttributeChangeHandler(this.validationObserver_);
  21578. }
  21579. /**
  21580. * Handles user interactions with the Text Field.
  21581. */
  21582. }, {
  21583. key: 'handleTextFieldInteraction',
  21584. value: function handleTextFieldInteraction() {
  21585. if (this.adapter_.getNativeInput().disabled) {
  21586. return;
  21587. }
  21588. this.receivedUserInput_ = true;
  21589. }
  21590. /**
  21591. * Handles validation attribute changes
  21592. * @param {!Array<string>} attributesList
  21593. */
  21594. }, {
  21595. key: 'handleValidationAttributeChange',
  21596. value: function handleValidationAttributeChange(attributesList) {
  21597. var _this4 = this;
  21598. attributesList.some(function (attributeName) {
  21599. if (__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* VALIDATION_ATTR_WHITELIST */].indexOf(attributeName) > -1) {
  21600. _this4.styleValidity_(true);
  21601. return true;
  21602. }
  21603. });
  21604. }
  21605. /**
  21606. * Opens/closes the notched outline.
  21607. * @param {boolean} openNotch
  21608. */
  21609. }, {
  21610. key: 'notchOutline',
  21611. value: function notchOutline(openNotch) {
  21612. if (!this.adapter_.hasOutline()) {
  21613. return;
  21614. }
  21615. if (openNotch) {
  21616. var isDense = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_4__constants__["c" /* cssClasses */].DENSE);
  21617. var labelScale = isDense ? __WEBPACK_IMPORTED_MODULE_4__constants__["d" /* numbers */].DENSE_LABEL_SCALE : __WEBPACK_IMPORTED_MODULE_4__constants__["d" /* numbers */].LABEL_SCALE;
  21618. var labelWidth = this.adapter_.getLabelWidth() * labelScale;
  21619. this.adapter_.notchOutline(labelWidth);
  21620. } else {
  21621. this.adapter_.closeOutline();
  21622. }
  21623. }
  21624. /**
  21625. * Activates the text field focus state.
  21626. */
  21627. }, {
  21628. key: 'activateFocus',
  21629. value: function activateFocus() {
  21630. this.isFocused_ = true;
  21631. this.styleFocused_(this.isFocused_);
  21632. this.adapter_.activateLineRipple();
  21633. if (this.adapter_.hasLabel()) {
  21634. this.notchOutline(this.shouldFloat);
  21635. this.adapter_.floatLabel(this.shouldFloat);
  21636. this.adapter_.shakeLabel(this.shouldShake);
  21637. }
  21638. if (this.helperText_) {
  21639. this.helperText_.showToScreenReader();
  21640. }
  21641. }
  21642. /**
  21643. * Sets the line ripple's transform origin, so that the line ripple activate
  21644. * animation will animate out from the user's click location.
  21645. * @param {!Event} evt
  21646. */
  21647. }, {
  21648. key: 'setTransformOrigin',
  21649. value: function setTransformOrigin(evt) {
  21650. var targetEvent = void 0;
  21651. if (evt.touches) {
  21652. targetEvent = evt.touches[0];
  21653. } else {
  21654. targetEvent = evt;
  21655. }
  21656. var targetClientRect = targetEvent.target.getBoundingClientRect();
  21657. var normalizedX = targetEvent.clientX - targetClientRect.left;
  21658. this.adapter_.setLineRippleTransformOrigin(normalizedX);
  21659. }
  21660. /**
  21661. * Activates the Text Field's focus state in cases when the input value
  21662. * changes without user input (e.g. programatically).
  21663. */
  21664. }, {
  21665. key: 'autoCompleteFocus',
  21666. value: function autoCompleteFocus() {
  21667. if (!this.receivedUserInput_) {
  21668. this.activateFocus();
  21669. }
  21670. }
  21671. /**
  21672. * Deactivates the Text Field's focus state.
  21673. */
  21674. }, {
  21675. key: 'deactivateFocus',
  21676. value: function deactivateFocus() {
  21677. this.isFocused_ = false;
  21678. this.adapter_.deactivateLineRipple();
  21679. var isValid = this.isValid();
  21680. this.styleValidity_(isValid);
  21681. this.styleFocused_(this.isFocused_);
  21682. if (this.adapter_.hasLabel()) {
  21683. this.notchOutline(this.shouldFloat);
  21684. this.adapter_.floatLabel(this.shouldFloat);
  21685. this.adapter_.shakeLabel(this.shouldShake);
  21686. }
  21687. if (!this.shouldFloat) {
  21688. this.receivedUserInput_ = false;
  21689. }
  21690. }
  21691. /**
  21692. * @return {string} The value of the input Element.
  21693. */
  21694. }, {
  21695. key: 'getValue',
  21696. value: function getValue() {
  21697. return this.getNativeInput_().value;
  21698. }
  21699. /**
  21700. * @param {string} value The value to set on the input Element.
  21701. */
  21702. }, {
  21703. key: 'setValue',
  21704. value: function setValue(value) {
  21705. this.getNativeInput_().value = value;
  21706. var isValid = this.isValid();
  21707. this.styleValidity_(isValid);
  21708. if (this.adapter_.hasLabel()) {
  21709. this.notchOutline(this.shouldFloat);
  21710. this.adapter_.floatLabel(this.shouldFloat);
  21711. this.adapter_.shakeLabel(this.shouldShake);
  21712. }
  21713. }
  21714. /**
  21715. * @return {boolean} If a custom validity is set, returns that value.
  21716. * Otherwise, returns the result of native validity checks.
  21717. */
  21718. }, {
  21719. key: 'isValid',
  21720. value: function isValid() {
  21721. return this.useNativeValidation_ ? this.isNativeInputValid_() : this.isValid_;
  21722. }
  21723. /**
  21724. * @param {boolean} isValid Sets the validity state of the Text Field.
  21725. */
  21726. }, {
  21727. key: 'setValid',
  21728. value: function setValid(isValid) {
  21729. this.isValid_ = isValid;
  21730. this.styleValidity_(isValid);
  21731. var shouldShake = !isValid && !this.isFocused_;
  21732. if (this.adapter_.hasLabel()) {
  21733. this.adapter_.shakeLabel(shouldShake);
  21734. }
  21735. }
  21736. /**
  21737. * Enables or disables the use of native validation. Use this for custom validation.
  21738. * @param {boolean} useNativeValidation Set this to false to ignore native input validation.
  21739. */
  21740. }, {
  21741. key: 'setUseNativeValidation',
  21742. value: function setUseNativeValidation(useNativeValidation) {
  21743. this.useNativeValidation_ = useNativeValidation;
  21744. }
  21745. /**
  21746. * @return {boolean} True if the Text Field is disabled.
  21747. */
  21748. }, {
  21749. key: 'isDisabled',
  21750. value: function isDisabled() {
  21751. return this.getNativeInput_().disabled;
  21752. }
  21753. /**
  21754. * @param {boolean} disabled Sets the text-field disabled or enabled.
  21755. */
  21756. }, {
  21757. key: 'setDisabled',
  21758. value: function setDisabled(disabled) {
  21759. this.getNativeInput_().disabled = disabled;
  21760. this.styleDisabled_(disabled);
  21761. }
  21762. /**
  21763. * @param {string} content Sets the content of the helper text.
  21764. */
  21765. }, {
  21766. key: 'setHelperTextContent',
  21767. value: function setHelperTextContent(content) {
  21768. if (this.helperText_) {
  21769. this.helperText_.setContent(content);
  21770. }
  21771. }
  21772. /**
  21773. * Sets the aria label of the leading icon.
  21774. * @param {string} label
  21775. */
  21776. }, {
  21777. key: 'setLeadingIconAriaLabel',
  21778. value: function setLeadingIconAriaLabel(label) {
  21779. if (this.leadingIcon_) {
  21780. this.leadingIcon_.setAriaLabel(label);
  21781. }
  21782. }
  21783. /**
  21784. * Sets the text content of the leading icon.
  21785. * @param {string} content
  21786. */
  21787. }, {
  21788. key: 'setLeadingIconContent',
  21789. value: function setLeadingIconContent(content) {
  21790. if (this.leadingIcon_) {
  21791. this.leadingIcon_.setContent(content);
  21792. }
  21793. }
  21794. /**
  21795. * Sets the aria label of the trailing icon.
  21796. * @param {string} label
  21797. */
  21798. }, {
  21799. key: 'setTrailingIconAriaLabel',
  21800. value: function setTrailingIconAriaLabel(label) {
  21801. if (this.trailingIcon_) {
  21802. this.trailingIcon_.setAriaLabel(label);
  21803. }
  21804. }
  21805. /**
  21806. * Sets the text content of the trailing icon.
  21807. * @param {string} content
  21808. */
  21809. }, {
  21810. key: 'setTrailingIconContent',
  21811. value: function setTrailingIconContent(content) {
  21812. if (this.trailingIcon_) {
  21813. this.trailingIcon_.setContent(content);
  21814. }
  21815. }
  21816. /**
  21817. * @return {boolean} True if the Text Field input fails in converting the
  21818. * user-supplied value.
  21819. * @private
  21820. */
  21821. }, {
  21822. key: 'isBadInput_',
  21823. value: function isBadInput_() {
  21824. return this.getNativeInput_().validity.badInput;
  21825. }
  21826. /**
  21827. * @return {boolean} The result of native validity checking
  21828. * (ValidityState.valid).
  21829. */
  21830. }, {
  21831. key: 'isNativeInputValid_',
  21832. value: function isNativeInputValid_() {
  21833. return this.getNativeInput_().validity.valid;
  21834. }
  21835. /**
  21836. * Styles the component based on the validity state.
  21837. * @param {boolean} isValid
  21838. * @private
  21839. */
  21840. }, {
  21841. key: 'styleValidity_',
  21842. value: function styleValidity_(isValid) {
  21843. var INVALID = MDCTextFieldFoundation.cssClasses.INVALID;
  21844. if (isValid) {
  21845. this.adapter_.removeClass(INVALID);
  21846. } else {
  21847. this.adapter_.addClass(INVALID);
  21848. }
  21849. if (this.helperText_) {
  21850. this.helperText_.setValidity(isValid);
  21851. }
  21852. }
  21853. /**
  21854. * Styles the component based on the focused state.
  21855. * @param {boolean} isFocused
  21856. * @private
  21857. */
  21858. }, {
  21859. key: 'styleFocused_',
  21860. value: function styleFocused_(isFocused) {
  21861. var FOCUSED = MDCTextFieldFoundation.cssClasses.FOCUSED;
  21862. if (isFocused) {
  21863. this.adapter_.addClass(FOCUSED);
  21864. } else {
  21865. this.adapter_.removeClass(FOCUSED);
  21866. }
  21867. }
  21868. /**
  21869. * Styles the component based on the disabled state.
  21870. * @param {boolean} isDisabled
  21871. * @private
  21872. */
  21873. }, {
  21874. key: 'styleDisabled_',
  21875. value: function styleDisabled_(isDisabled) {
  21876. var _MDCTextFieldFoundati = MDCTextFieldFoundation.cssClasses,
  21877. DISABLED = _MDCTextFieldFoundati.DISABLED,
  21878. INVALID = _MDCTextFieldFoundati.INVALID;
  21879. if (isDisabled) {
  21880. this.adapter_.addClass(DISABLED);
  21881. this.adapter_.removeClass(INVALID);
  21882. } else {
  21883. this.adapter_.removeClass(DISABLED);
  21884. }
  21885. if (this.leadingIcon_) {
  21886. this.leadingIcon_.setDisabled(isDisabled);
  21887. }
  21888. if (this.trailingIcon_) {
  21889. this.trailingIcon_.setDisabled(isDisabled);
  21890. }
  21891. }
  21892. /**
  21893. * @return {!Element|!NativeInputType} The native text input from the
  21894. * host environment, or a dummy if none exists.
  21895. * @private
  21896. */
  21897. }, {
  21898. key: 'getNativeInput_',
  21899. value: function getNativeInput_() {
  21900. return this.adapter_.getNativeInput() ||
  21901. /** @type {!NativeInputType} */{
  21902. value: '',
  21903. disabled: false,
  21904. validity: {
  21905. badInput: false,
  21906. valid: true
  21907. }
  21908. };
  21909. }
  21910. }]);
  21911. return MDCTextFieldFoundation;
  21912. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  21913. /* harmony default export */ __webpack_exports__["a"] = (MDCTextFieldFoundation);
  21914. /***/ }),
  21915. /* 149 */
  21916. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  21917. "use strict";
  21918. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTextFieldHelperText; });
  21919. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  21920. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(61);
  21921. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(27);
  21922. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  21923. 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; };
  21924. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  21925. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21926. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  21927. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  21928. /**
  21929. * @license
  21930. * Copyright 2017 Google Inc.
  21931. *
  21932. * Permission is hereby granted, free of charge, to any person obtaining a copy
  21933. * of this software and associated documentation files (the "Software"), to deal
  21934. * in the Software without restriction, including without limitation the rights
  21935. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  21936. * copies of the Software, and to permit persons to whom the Software is
  21937. * furnished to do so, subject to the following conditions:
  21938. *
  21939. * The above copyright notice and this permission notice shall be included in
  21940. * all copies or substantial portions of the Software.
  21941. *
  21942. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  21943. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  21944. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  21945. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  21946. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21947. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  21948. * THE SOFTWARE.
  21949. */
  21950. /**
  21951. * @extends {MDCComponent<!MDCTextFieldHelperTextFoundation>}
  21952. * @final
  21953. */
  21954. var MDCTextFieldHelperText = function (_MDCComponent) {
  21955. _inherits(MDCTextFieldHelperText, _MDCComponent);
  21956. function MDCTextFieldHelperText() {
  21957. _classCallCheck(this, MDCTextFieldHelperText);
  21958. return _possibleConstructorReturn(this, (MDCTextFieldHelperText.__proto__ || Object.getPrototypeOf(MDCTextFieldHelperText)).apply(this, arguments));
  21959. }
  21960. _createClass(MDCTextFieldHelperText, [{
  21961. key: 'getDefaultFoundation',
  21962. /**
  21963. * @return {!MDCTextFieldHelperTextFoundation}
  21964. */
  21965. value: function getDefaultFoundation() {
  21966. var _this2 = this;
  21967. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]( /** @type {!MDCTextFieldHelperTextAdapter} */_extends({
  21968. addClass: function addClass(className) {
  21969. return _this2.root_.classList.add(className);
  21970. },
  21971. removeClass: function removeClass(className) {
  21972. return _this2.root_.classList.remove(className);
  21973. },
  21974. hasClass: function hasClass(className) {
  21975. return _this2.root_.classList.contains(className);
  21976. },
  21977. setAttr: function setAttr(attr, value) {
  21978. return _this2.root_.setAttribute(attr, value);
  21979. },
  21980. removeAttr: function removeAttr(attr) {
  21981. return _this2.root_.removeAttribute(attr);
  21982. },
  21983. setContent: function setContent(content) {
  21984. _this2.root_.textContent = content;
  21985. }
  21986. }));
  21987. }
  21988. }, {
  21989. key: 'foundation',
  21990. /**
  21991. * @return {!MDCTextFieldHelperTextFoundation}
  21992. */
  21993. get: function get() {
  21994. return this.foundation_;
  21995. }
  21996. }], [{
  21997. key: 'attachTo',
  21998. /**
  21999. * @param {!Element} root
  22000. * @return {!MDCTextFieldHelperText}
  22001. */
  22002. value: function attachTo(root) {
  22003. return new MDCTextFieldHelperText(root);
  22004. }
  22005. }]);
  22006. return MDCTextFieldHelperText;
  22007. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  22008. /***/ }),
  22009. /* 150 */
  22010. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22011. "use strict";
  22012. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTextFieldIcon; });
  22013. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  22014. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(62);
  22015. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(28);
  22016. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  22017. 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; };
  22018. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  22019. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22020. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  22021. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  22022. /**
  22023. * @license
  22024. * Copyright 2017 Google Inc.
  22025. *
  22026. * Permission is hereby granted, free of charge, to any person obtaining a copy
  22027. * of this software and associated documentation files (the "Software"), to deal
  22028. * in the Software without restriction, including without limitation the rights
  22029. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  22030. * copies of the Software, and to permit persons to whom the Software is
  22031. * furnished to do so, subject to the following conditions:
  22032. *
  22033. * The above copyright notice and this permission notice shall be included in
  22034. * all copies or substantial portions of the Software.
  22035. *
  22036. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  22037. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  22038. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22039. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22040. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  22041. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22042. * THE SOFTWARE.
  22043. */
  22044. /**
  22045. * @extends {MDCComponent<!MDCTextFieldIconFoundation>}
  22046. * @final
  22047. */
  22048. var MDCTextFieldIcon = function (_MDCComponent) {
  22049. _inherits(MDCTextFieldIcon, _MDCComponent);
  22050. function MDCTextFieldIcon() {
  22051. _classCallCheck(this, MDCTextFieldIcon);
  22052. return _possibleConstructorReturn(this, (MDCTextFieldIcon.__proto__ || Object.getPrototypeOf(MDCTextFieldIcon)).apply(this, arguments));
  22053. }
  22054. _createClass(MDCTextFieldIcon, [{
  22055. key: 'getDefaultFoundation',
  22056. /**
  22057. * @return {!MDCTextFieldIconFoundation}
  22058. */
  22059. value: function getDefaultFoundation() {
  22060. var _this2 = this;
  22061. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]( /** @type {!MDCTextFieldIconAdapter} */_extends({
  22062. getAttr: function getAttr(attr) {
  22063. return _this2.root_.getAttribute(attr);
  22064. },
  22065. setAttr: function setAttr(attr, value) {
  22066. return _this2.root_.setAttribute(attr, value);
  22067. },
  22068. removeAttr: function removeAttr(attr) {
  22069. return _this2.root_.removeAttribute(attr);
  22070. },
  22071. setContent: function setContent(content) {
  22072. _this2.root_.textContent = content;
  22073. },
  22074. registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
  22075. return _this2.root_.addEventListener(evtType, handler);
  22076. },
  22077. deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
  22078. return _this2.root_.removeEventListener(evtType, handler);
  22079. },
  22080. notifyIconAction: function notifyIconAction() {
  22081. return _this2.emit(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.ICON_EVENT, {} /* evtData */, true /* shouldBubble */);
  22082. }
  22083. }));
  22084. }
  22085. }, {
  22086. key: 'foundation',
  22087. /**
  22088. * @return {!MDCTextFieldIconFoundation}
  22089. */
  22090. get: function get() {
  22091. return this.foundation_;
  22092. }
  22093. }], [{
  22094. key: 'attachTo',
  22095. /**
  22096. * @param {!Element} root
  22097. * @return {!MDCTextFieldIcon}
  22098. */
  22099. value: function attachTo(root) {
  22100. return new MDCTextFieldIcon(root);
  22101. }
  22102. }]);
  22103. return MDCTextFieldIcon;
  22104. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  22105. /***/ }),
  22106. /* 151 */
  22107. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22108. "use strict";
  22109. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  22110. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCToolbar", function() { return MDCToolbar; });
  22111. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(3);
  22112. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__ = __webpack_require__(2);
  22113. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(152);
  22114. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCToolbarFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  22115. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  22116. 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); } };
  22117. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22118. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  22119. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  22120. /**
  22121. * @license
  22122. * Copyright 2017 Google Inc.
  22123. *
  22124. * Permission is hereby granted, free of charge, to any person obtaining a copy
  22125. * of this software and associated documentation files (the "Software"), to deal
  22126. * in the Software without restriction, including without limitation the rights
  22127. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  22128. * copies of the Software, and to permit persons to whom the Software is
  22129. * furnished to do so, subject to the following conditions:
  22130. *
  22131. * The above copyright notice and this permission notice shall be included in
  22132. * all copies or substantial portions of the Software.
  22133. *
  22134. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  22135. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  22136. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22137. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22138. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  22139. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22140. * THE SOFTWARE.
  22141. */
  22142. var MDCToolbar = function (_MDCComponent) {
  22143. _inherits(MDCToolbar, _MDCComponent);
  22144. function MDCToolbar() {
  22145. _classCallCheck(this, MDCToolbar);
  22146. return _possibleConstructorReturn(this, (MDCToolbar.__proto__ || Object.getPrototypeOf(MDCToolbar)).apply(this, arguments));
  22147. }
  22148. _createClass(MDCToolbar, [{
  22149. key: 'initialize',
  22150. value: function initialize() {
  22151. this.ripples_ = [].map.call(this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.ICON_SELECTOR), function (icon) {
  22152. var ripple = __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"].attachTo(icon);
  22153. ripple.unbounded = true;
  22154. return ripple;
  22155. });
  22156. }
  22157. }, {
  22158. key: 'destroy',
  22159. value: function destroy() {
  22160. this.ripples_.forEach(function (ripple) {
  22161. ripple.destroy();
  22162. });
  22163. _get(MDCToolbar.prototype.__proto__ || Object.getPrototypeOf(MDCToolbar.prototype), 'destroy', this).call(this);
  22164. }
  22165. }, {
  22166. key: 'getDefaultFoundation',
  22167. value: function getDefaultFoundation() {
  22168. var _this2 = this;
  22169. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]({
  22170. hasClass: function hasClass(className) {
  22171. return _this2.root_.classList.contains(className);
  22172. },
  22173. addClass: function addClass(className) {
  22174. return _this2.root_.classList.add(className);
  22175. },
  22176. removeClass: function removeClass(className) {
  22177. return _this2.root_.classList.remove(className);
  22178. },
  22179. registerScrollHandler: function registerScrollHandler(handler) {
  22180. return window.addEventListener('scroll', handler);
  22181. },
  22182. deregisterScrollHandler: function deregisterScrollHandler(handler) {
  22183. return window.removeEventListener('scroll', handler);
  22184. },
  22185. registerResizeHandler: function registerResizeHandler(handler) {
  22186. return window.addEventListener('resize', handler);
  22187. },
  22188. deregisterResizeHandler: function deregisterResizeHandler(handler) {
  22189. return window.removeEventListener('resize', handler);
  22190. },
  22191. getViewportWidth: function getViewportWidth() {
  22192. return window.innerWidth;
  22193. },
  22194. getViewportScrollY: function getViewportScrollY() {
  22195. return window.pageYOffset;
  22196. },
  22197. getOffsetHeight: function getOffsetHeight() {
  22198. return _this2.root_.offsetHeight;
  22199. },
  22200. getFirstRowElementOffsetHeight: function getFirstRowElementOffsetHeight() {
  22201. return _this2.firstRowElement_.offsetHeight;
  22202. },
  22203. notifyChange: function notifyChange(evtData) {
  22204. return _this2.emit(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.CHANGE_EVENT, evtData);
  22205. },
  22206. setStyle: function setStyle(property, value) {
  22207. return _this2.root_.style.setProperty(property, value);
  22208. },
  22209. setStyleForTitleElement: function setStyleForTitleElement(property, value) {
  22210. return _this2.titleElement_.style.setProperty(property, value);
  22211. },
  22212. setStyleForFlexibleRowElement: function setStyleForFlexibleRowElement(property, value) {
  22213. return _this2.firstRowElement_.style.setProperty(property, value);
  22214. },
  22215. setStyleForFixedAdjustElement: function setStyleForFixedAdjustElement(property, value) {
  22216. if (_this2.fixedAdjustElement) {
  22217. _this2.fixedAdjustElement.style.setProperty(property, value);
  22218. }
  22219. }
  22220. });
  22221. }
  22222. }, {
  22223. key: 'firstRowElement_',
  22224. get: function get() {
  22225. return this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.FIRST_ROW_SELECTOR);
  22226. }
  22227. }, {
  22228. key: 'titleElement_',
  22229. get: function get() {
  22230. return this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.TITLE_SELECTOR);
  22231. }
  22232. }, {
  22233. key: 'fixedAdjustElement',
  22234. set: function set(fixedAdjustElement) {
  22235. this.fixedAdjustElement_ = fixedAdjustElement;
  22236. this.foundation_.updateAdjustElementStyles();
  22237. },
  22238. get: function get() {
  22239. return this.fixedAdjustElement_;
  22240. }
  22241. }], [{
  22242. key: 'attachTo',
  22243. value: function attachTo(root) {
  22244. return new MDCToolbar(root);
  22245. }
  22246. }]);
  22247. return MDCToolbar;
  22248. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCComponent"]);
  22249. /***/ }),
  22250. /* 152 */
  22251. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22252. "use strict";
  22253. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  22254. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(153);
  22255. 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; };
  22256. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  22257. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22258. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  22259. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  22260. /**
  22261. * @license
  22262. * Copyright 2017 Google Inc.
  22263. *
  22264. * Permission is hereby granted, free of charge, to any person obtaining a copy
  22265. * of this software and associated documentation files (the "Software"), to deal
  22266. * in the Software without restriction, including without limitation the rights
  22267. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  22268. * copies of the Software, and to permit persons to whom the Software is
  22269. * furnished to do so, subject to the following conditions:
  22270. *
  22271. * The above copyright notice and this permission notice shall be included in
  22272. * all copies or substantial portions of the Software.
  22273. *
  22274. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  22275. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  22276. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22277. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22278. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  22279. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22280. * THE SOFTWARE.
  22281. */
  22282. var MDCToolbarFoundation = function (_MDCFoundation) {
  22283. _inherits(MDCToolbarFoundation, _MDCFoundation);
  22284. _createClass(MDCToolbarFoundation, null, [{
  22285. key: 'cssClasses',
  22286. get: function get() {
  22287. return __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */];
  22288. }
  22289. }, {
  22290. key: 'strings',
  22291. get: function get() {
  22292. return __WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */];
  22293. }
  22294. }, {
  22295. key: 'numbers',
  22296. get: function get() {
  22297. return __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* numbers */];
  22298. }
  22299. }, {
  22300. key: 'defaultAdapter',
  22301. get: function get() {
  22302. return {
  22303. hasClass: function hasClass() {
  22304. return (/* className: string */ /* boolean */false
  22305. );
  22306. },
  22307. addClass: function addClass() /* className: string */{},
  22308. removeClass: function removeClass() /* className: string */{},
  22309. registerScrollHandler: function registerScrollHandler() /* handler: EventListener */{},
  22310. deregisterScrollHandler: function deregisterScrollHandler() /* handler: EventListener */{},
  22311. registerResizeHandler: function registerResizeHandler() /* handler: EventListener */{},
  22312. deregisterResizeHandler: function deregisterResizeHandler() /* handler: EventListener */{},
  22313. getViewportWidth: function getViewportWidth() {
  22314. return (/* number */0
  22315. );
  22316. },
  22317. getViewportScrollY: function getViewportScrollY() {
  22318. return (/* number */0
  22319. );
  22320. },
  22321. getOffsetHeight: function getOffsetHeight() {
  22322. return (/* number */0
  22323. );
  22324. },
  22325. getFirstRowElementOffsetHeight: function getFirstRowElementOffsetHeight() {
  22326. return (/* number */0
  22327. );
  22328. },
  22329. notifyChange: function notifyChange() /* evtData: {flexibleExpansionRatio: number} */{},
  22330. setStyle: function setStyle() /* property: string, value: string */{},
  22331. setStyleForTitleElement: function setStyleForTitleElement() /* property: string, value: string */{},
  22332. setStyleForFlexibleRowElement: function setStyleForFlexibleRowElement() /* property: string, value: string */{},
  22333. setStyleForFixedAdjustElement: function setStyleForFixedAdjustElement() /* property: string, value: string */{}
  22334. };
  22335. }
  22336. }]);
  22337. function MDCToolbarFoundation(adapter) {
  22338. _classCallCheck(this, MDCToolbarFoundation);
  22339. var _this = _possibleConstructorReturn(this, (MDCToolbarFoundation.__proto__ || Object.getPrototypeOf(MDCToolbarFoundation)).call(this, _extends(MDCToolbarFoundation.defaultAdapter, adapter)));
  22340. _this.resizeHandler_ = function () {
  22341. return _this.checkRowHeight_();
  22342. };
  22343. _this.scrollHandler_ = function () {
  22344. return _this.updateToolbarStyles_();
  22345. };
  22346. _this.checkRowHeightFrame_ = 0;
  22347. _this.scrollFrame_ = 0;
  22348. _this.executedLastChange_ = false;
  22349. _this.calculations_ = {
  22350. toolbarRowHeight: 0,
  22351. // Calculated Height ratio. We use ratio to calculate corresponding heights in resize event.
  22352. toolbarRatio: 0, // The ratio of toolbar height to row height
  22353. flexibleExpansionRatio: 0, // The ratio of flexible space height to row height
  22354. maxTranslateYRatio: 0, // The ratio of max toolbar move up distance to row height
  22355. scrollThresholdRatio: 0, // The ratio of max scrollTop that we should listen to to row height
  22356. // Derived Heights based on the above key ratios.
  22357. toolbarHeight: 0,
  22358. flexibleExpansionHeight: 0, // Flexible row minus toolbar height (derived)
  22359. maxTranslateYDistance: 0, // When toolbar only fix last row (derived)
  22360. scrollThreshold: 0
  22361. };
  22362. // Toolbar fixed behavior
  22363. // If toolbar is fixed
  22364. _this.fixed_ = false;
  22365. // If fixed is targeted only at the last row
  22366. _this.fixedLastrow_ = false;
  22367. // Toolbar flexible behavior
  22368. // If the first row is flexible
  22369. _this.hasFlexibleRow_ = false;
  22370. // If use the default behavior
  22371. _this.useFlexDefaultBehavior_ = false;
  22372. return _this;
  22373. }
  22374. _createClass(MDCToolbarFoundation, [{
  22375. key: 'init',
  22376. value: function init() {
  22377. this.fixed_ = this.adapter_.hasClass(MDCToolbarFoundation.cssClasses.FIXED);
  22378. this.fixedLastrow_ = this.adapter_.hasClass(MDCToolbarFoundation.cssClasses.FIXED_LASTROW) & this.fixed_;
  22379. this.hasFlexibleRow_ = this.adapter_.hasClass(MDCToolbarFoundation.cssClasses.TOOLBAR_ROW_FLEXIBLE);
  22380. if (this.hasFlexibleRow_) {
  22381. this.useFlexDefaultBehavior_ = this.adapter_.hasClass(MDCToolbarFoundation.cssClasses.FLEXIBLE_DEFAULT_BEHAVIOR);
  22382. }
  22383. this.initKeyRatio_();
  22384. this.setKeyHeights_();
  22385. this.adapter_.registerResizeHandler(this.resizeHandler_);
  22386. this.adapter_.registerScrollHandler(this.scrollHandler_);
  22387. }
  22388. }, {
  22389. key: 'destroy',
  22390. value: function destroy() {
  22391. this.adapter_.deregisterResizeHandler(this.resizeHandler_);
  22392. this.adapter_.deregisterScrollHandler(this.scrollHandler_);
  22393. }
  22394. }, {
  22395. key: 'updateAdjustElementStyles',
  22396. value: function updateAdjustElementStyles() {
  22397. if (this.fixed_) {
  22398. this.adapter_.setStyleForFixedAdjustElement('margin-top', this.calculations_.toolbarHeight + 'px');
  22399. }
  22400. }
  22401. }, {
  22402. key: 'getFlexibleExpansionRatio_',
  22403. value: function getFlexibleExpansionRatio_(scrollTop) {
  22404. // To prevent division by zero when there is no flexibleExpansionHeight
  22405. var delta = 0.0001;
  22406. return Math.max(0, 1 - scrollTop / (this.calculations_.flexibleExpansionHeight + delta));
  22407. }
  22408. }, {
  22409. key: 'checkRowHeight_',
  22410. value: function checkRowHeight_() {
  22411. var _this2 = this;
  22412. cancelAnimationFrame(this.checkRowHeightFrame_);
  22413. this.checkRowHeightFrame_ = requestAnimationFrame(function () {
  22414. return _this2.setKeyHeights_();
  22415. });
  22416. }
  22417. }, {
  22418. key: 'setKeyHeights_',
  22419. value: function setKeyHeights_() {
  22420. var newToolbarRowHeight = this.getRowHeight_();
  22421. if (newToolbarRowHeight !== this.calculations_.toolbarRowHeight) {
  22422. this.calculations_.toolbarRowHeight = newToolbarRowHeight;
  22423. this.calculations_.toolbarHeight = this.calculations_.toolbarRatio * this.calculations_.toolbarRowHeight;
  22424. this.calculations_.flexibleExpansionHeight = this.calculations_.flexibleExpansionRatio * this.calculations_.toolbarRowHeight;
  22425. this.calculations_.maxTranslateYDistance = this.calculations_.maxTranslateYRatio * this.calculations_.toolbarRowHeight;
  22426. this.calculations_.scrollThreshold = this.calculations_.scrollThresholdRatio * this.calculations_.toolbarRowHeight;
  22427. this.updateAdjustElementStyles();
  22428. this.updateToolbarStyles_();
  22429. }
  22430. }
  22431. }, {
  22432. key: 'updateToolbarStyles_',
  22433. value: function updateToolbarStyles_() {
  22434. var _this3 = this;
  22435. cancelAnimationFrame(this.scrollFrame_);
  22436. this.scrollFrame_ = requestAnimationFrame(function () {
  22437. var scrollTop = _this3.adapter_.getViewportScrollY();
  22438. var hasScrolledOutOfThreshold = _this3.scrolledOutOfThreshold_(scrollTop);
  22439. if (hasScrolledOutOfThreshold && _this3.executedLastChange_) {
  22440. return;
  22441. }
  22442. var flexibleExpansionRatio = _this3.getFlexibleExpansionRatio_(scrollTop);
  22443. _this3.updateToolbarFlexibleState_(flexibleExpansionRatio);
  22444. if (_this3.fixedLastrow_) {
  22445. _this3.updateToolbarFixedState_(scrollTop);
  22446. }
  22447. if (_this3.hasFlexibleRow_) {
  22448. _this3.updateFlexibleRowElementStyles_(flexibleExpansionRatio);
  22449. }
  22450. _this3.executedLastChange_ = hasScrolledOutOfThreshold;
  22451. _this3.adapter_.notifyChange({ flexibleExpansionRatio: flexibleExpansionRatio });
  22452. });
  22453. }
  22454. }, {
  22455. key: 'scrolledOutOfThreshold_',
  22456. value: function scrolledOutOfThreshold_(scrollTop) {
  22457. return scrollTop > this.calculations_.scrollThreshold;
  22458. }
  22459. }, {
  22460. key: 'initKeyRatio_',
  22461. value: function initKeyRatio_() {
  22462. var toolbarRowHeight = this.getRowHeight_();
  22463. var firstRowMaxRatio = this.adapter_.getFirstRowElementOffsetHeight() / toolbarRowHeight;
  22464. this.calculations_.toolbarRatio = this.adapter_.getOffsetHeight() / toolbarRowHeight;
  22465. this.calculations_.flexibleExpansionRatio = firstRowMaxRatio - 1;
  22466. this.calculations_.maxTranslateYRatio = this.fixedLastrow_ ? this.calculations_.toolbarRatio - firstRowMaxRatio : 0;
  22467. this.calculations_.scrollThresholdRatio = (this.fixedLastrow_ ? this.calculations_.toolbarRatio : firstRowMaxRatio) - 1;
  22468. }
  22469. }, {
  22470. key: 'getRowHeight_',
  22471. value: function getRowHeight_() {
  22472. var breakpoint = MDCToolbarFoundation.numbers.TOOLBAR_MOBILE_BREAKPOINT;
  22473. return this.adapter_.getViewportWidth() < breakpoint ? MDCToolbarFoundation.numbers.TOOLBAR_ROW_MOBILE_HEIGHT : MDCToolbarFoundation.numbers.TOOLBAR_ROW_HEIGHT;
  22474. }
  22475. }, {
  22476. key: 'updateToolbarFlexibleState_',
  22477. value: function updateToolbarFlexibleState_(flexibleExpansionRatio) {
  22478. this.adapter_.removeClass(MDCToolbarFoundation.cssClasses.FLEXIBLE_MAX);
  22479. this.adapter_.removeClass(MDCToolbarFoundation.cssClasses.FLEXIBLE_MIN);
  22480. if (flexibleExpansionRatio === 1) {
  22481. this.adapter_.addClass(MDCToolbarFoundation.cssClasses.FLEXIBLE_MAX);
  22482. } else if (flexibleExpansionRatio === 0) {
  22483. this.adapter_.addClass(MDCToolbarFoundation.cssClasses.FLEXIBLE_MIN);
  22484. }
  22485. }
  22486. }, {
  22487. key: 'updateToolbarFixedState_',
  22488. value: function updateToolbarFixedState_(scrollTop) {
  22489. var translateDistance = Math.max(0, Math.min(scrollTop - this.calculations_.flexibleExpansionHeight, this.calculations_.maxTranslateYDistance));
  22490. this.adapter_.setStyle('transform', 'translateY(' + -translateDistance + 'px)');
  22491. if (translateDistance === this.calculations_.maxTranslateYDistance) {
  22492. this.adapter_.addClass(MDCToolbarFoundation.cssClasses.FIXED_AT_LAST_ROW);
  22493. } else {
  22494. this.adapter_.removeClass(MDCToolbarFoundation.cssClasses.FIXED_AT_LAST_ROW);
  22495. }
  22496. }
  22497. }, {
  22498. key: 'updateFlexibleRowElementStyles_',
  22499. value: function updateFlexibleRowElementStyles_(flexibleExpansionRatio) {
  22500. if (this.fixed_) {
  22501. var height = this.calculations_.flexibleExpansionHeight * flexibleExpansionRatio;
  22502. this.adapter_.setStyleForFlexibleRowElement('height', height + this.calculations_.toolbarRowHeight + 'px');
  22503. }
  22504. if (this.useFlexDefaultBehavior_) {
  22505. this.updateElementStylesDefaultBehavior_(flexibleExpansionRatio);
  22506. }
  22507. }
  22508. }, {
  22509. key: 'updateElementStylesDefaultBehavior_',
  22510. value: function updateElementStylesDefaultBehavior_(flexibleExpansionRatio) {
  22511. var maxTitleSize = MDCToolbarFoundation.numbers.MAX_TITLE_SIZE;
  22512. var minTitleSize = MDCToolbarFoundation.numbers.MIN_TITLE_SIZE;
  22513. var currentTitleSize = (maxTitleSize - minTitleSize) * flexibleExpansionRatio + minTitleSize;
  22514. this.adapter_.setStyleForTitleElement('font-size', currentTitleSize + 'rem');
  22515. }
  22516. }]);
  22517. return MDCToolbarFoundation;
  22518. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  22519. /* harmony default export */ __webpack_exports__["a"] = (MDCToolbarFoundation);
  22520. /***/ }),
  22521. /* 153 */
  22522. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22523. "use strict";
  22524. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  22525. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  22526. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  22527. /**
  22528. * @license
  22529. * Copyright 2017 Google Inc.
  22530. *
  22531. * Permission is hereby granted, free of charge, to any person obtaining a copy
  22532. * of this software and associated documentation files (the "Software"), to deal
  22533. * in the Software without restriction, including without limitation the rights
  22534. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  22535. * copies of the Software, and to permit persons to whom the Software is
  22536. * furnished to do so, subject to the following conditions:
  22537. *
  22538. * The above copyright notice and this permission notice shall be included in
  22539. * all copies or substantial portions of the Software.
  22540. *
  22541. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  22542. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  22543. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22544. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22545. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  22546. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22547. * THE SOFTWARE.
  22548. */
  22549. var cssClasses = {
  22550. FIXED: 'mdc-toolbar--fixed',
  22551. FIXED_LASTROW: 'mdc-toolbar--fixed-lastrow-only',
  22552. FIXED_AT_LAST_ROW: 'mdc-toolbar--fixed-at-last-row',
  22553. TOOLBAR_ROW_FLEXIBLE: 'mdc-toolbar--flexible',
  22554. FLEXIBLE_DEFAULT_BEHAVIOR: 'mdc-toolbar--flexible-default-behavior',
  22555. FLEXIBLE_MAX: 'mdc-toolbar--flexible-space-maximized',
  22556. FLEXIBLE_MIN: 'mdc-toolbar--flexible-space-minimized'
  22557. };
  22558. var strings = {
  22559. TITLE_SELECTOR: '.mdc-toolbar__title',
  22560. ICON_SELECTOR: '.mdc-toolbar__icon',
  22561. FIRST_ROW_SELECTOR: '.mdc-toolbar__row:first-child',
  22562. CHANGE_EVENT: 'MDCToolbar:change'
  22563. };
  22564. var numbers = {
  22565. MAX_TITLE_SIZE: 2.125,
  22566. MIN_TITLE_SIZE: 1.25,
  22567. TOOLBAR_ROW_HEIGHT: 64,
  22568. TOOLBAR_ROW_MOBILE_HEIGHT: 56,
  22569. TOOLBAR_MOBILE_BREAKPOINT: 600
  22570. };
  22571. /***/ }),
  22572. /* 154 */
  22573. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22574. "use strict";
  22575. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  22576. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTopAppBar", function() { return MDCTopAppBar; });
  22577. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__adapter__ = __webpack_require__(7);
  22578. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(1);
  22579. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_ripple_index__ = __webpack_require__(2);
  22580. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(8);
  22581. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation__ = __webpack_require__(13);
  22582. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__fixed_foundation__ = __webpack_require__(155);
  22583. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__short_foundation__ = __webpack_require__(156);
  22584. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__standard_foundation__ = __webpack_require__(157);
  22585. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTopAppBarBaseFoundation", function() { return __WEBPACK_IMPORTED_MODULE_4__foundation__["a"]; });
  22586. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTopAppBarFoundation", function() { return __WEBPACK_IMPORTED_MODULE_7__standard_foundation__["a"]; });
  22587. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFixedTopAppBarFoundation", function() { return __WEBPACK_IMPORTED_MODULE_5__fixed_foundation__["a"]; });
  22588. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCShortTopAppBarFoundation", function() { return __WEBPACK_IMPORTED_MODULE_6__short_foundation__["a"]; });
  22589. 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; };
  22590. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  22591. 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); } };
  22592. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22593. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  22594. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  22595. /**
  22596. * @license
  22597. * Copyright 2018 Google Inc.
  22598. *
  22599. * Permission is hereby granted, free of charge, to any person obtaining a copy
  22600. * of this software and associated documentation files (the "Software"), to deal
  22601. * in the Software without restriction, including without limitation the rights
  22602. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  22603. * copies of the Software, and to permit persons to whom the Software is
  22604. * furnished to do so, subject to the following conditions:
  22605. *
  22606. * The above copyright notice and this permission notice shall be included in
  22607. * all copies or substantial portions of the Software.
  22608. *
  22609. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  22610. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  22611. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22612. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22613. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  22614. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22615. * THE SOFTWARE.
  22616. */
  22617. /**
  22618. * @extends {MDCComponent<!MDCTopAppBarBaseFoundation>}
  22619. * @final
  22620. */
  22621. var MDCTopAppBar = function (_MDCComponent) {
  22622. _inherits(MDCTopAppBar, _MDCComponent);
  22623. /**
  22624. * @param {...?} args
  22625. */
  22626. function MDCTopAppBar() {
  22627. var _ref;
  22628. _classCallCheck(this, MDCTopAppBar);
  22629. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  22630. args[_key] = arguments[_key];
  22631. }
  22632. /** @private {?Element} */
  22633. var _this = _possibleConstructorReturn(this, (_ref = MDCTopAppBar.__proto__ || Object.getPrototypeOf(MDCTopAppBar)).call.apply(_ref, [this].concat(args)));
  22634. _this.navIcon_;
  22635. /** @type {?Array<MDCRipple>} */
  22636. _this.iconRipples_;
  22637. /** @type {Object} */
  22638. _this.scrollTarget_;
  22639. return _this;
  22640. }
  22641. _createClass(MDCTopAppBar, [{
  22642. key: 'initialize',
  22643. value: function initialize() {
  22644. var rippleFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el) {
  22645. return __WEBPACK_IMPORTED_MODULE_2__material_ripple_index__["MDCRipple"].attachTo(el);
  22646. };
  22647. this.navIcon_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].NAVIGATION_ICON_SELECTOR);
  22648. // Get all icons in the toolbar and instantiate the ripples
  22649. var icons = [].slice.call(this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ACTION_ITEM_SELECTOR));
  22650. if (this.navIcon_) {
  22651. icons.push(this.navIcon_);
  22652. }
  22653. this.iconRipples_ = icons.map(function (icon) {
  22654. var ripple = rippleFactory(icon);
  22655. ripple.unbounded = true;
  22656. return ripple;
  22657. });
  22658. this.scrollTarget_ = window;
  22659. }
  22660. }, {
  22661. key: 'destroy',
  22662. value: function destroy() {
  22663. this.iconRipples_.forEach(function (iconRipple) {
  22664. return iconRipple.destroy();
  22665. });
  22666. _get(MDCTopAppBar.prototype.__proto__ || Object.getPrototypeOf(MDCTopAppBar.prototype), 'destroy', this).call(this);
  22667. }
  22668. }, {
  22669. key: 'setScrollTarget',
  22670. value: function setScrollTarget(target) {
  22671. this.foundation_.destroyScrollHandler();
  22672. this.scrollTarget_ = target;
  22673. this.foundation_.initScrollHandler();
  22674. }
  22675. /**
  22676. * @param {!Element} root
  22677. * @return {!MDCTopAppBar}
  22678. */
  22679. }, {
  22680. key: 'getDefaultFoundation',
  22681. /**
  22682. * @return {!MDCTopAppBarBaseFoundation}
  22683. */
  22684. value: function getDefaultFoundation() {
  22685. var _this2 = this;
  22686. /** @type {!MDCTopAppBarAdapter} */
  22687. var adapter = /** @type {!MDCTopAppBarAdapter} */_extends({
  22688. hasClass: function hasClass(className) {
  22689. return _this2.root_.classList.contains(className);
  22690. },
  22691. addClass: function addClass(className) {
  22692. return _this2.root_.classList.add(className);
  22693. },
  22694. removeClass: function removeClass(className) {
  22695. return _this2.root_.classList.remove(className);
  22696. },
  22697. setStyle: function setStyle(property, value) {
  22698. return _this2.root_.style.setProperty(property, value);
  22699. },
  22700. getTopAppBarHeight: function getTopAppBarHeight() {
  22701. return _this2.root_.clientHeight;
  22702. },
  22703. registerNavigationIconInteractionHandler: function registerNavigationIconInteractionHandler(evtType, handler) {
  22704. if (_this2.navIcon_) {
  22705. _this2.navIcon_.addEventListener(evtType, handler);
  22706. }
  22707. },
  22708. deregisterNavigationIconInteractionHandler: function deregisterNavigationIconInteractionHandler(evtType, handler) {
  22709. if (_this2.navIcon_) {
  22710. _this2.navIcon_.removeEventListener(evtType, handler);
  22711. }
  22712. },
  22713. notifyNavigationIconClicked: function notifyNavigationIconClicked() {
  22714. _this2.emit(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].NAVIGATION_EVENT, {});
  22715. },
  22716. registerScrollHandler: function registerScrollHandler(handler) {
  22717. return _this2.scrollTarget_.addEventListener('scroll', handler);
  22718. },
  22719. deregisterScrollHandler: function deregisterScrollHandler(handler) {
  22720. return _this2.scrollTarget_.removeEventListener('scroll', handler);
  22721. },
  22722. registerResizeHandler: function registerResizeHandler(handler) {
  22723. return window.addEventListener('resize', handler);
  22724. },
  22725. deregisterResizeHandler: function deregisterResizeHandler(handler) {
  22726. return window.removeEventListener('resize', handler);
  22727. },
  22728. getViewportScrollY: function getViewportScrollY() {
  22729. return _this2.scrollTarget_[_this2.scrollTarget_ === window ? 'pageYOffset' : 'scrollTop'];
  22730. },
  22731. getTotalActionItems: function getTotalActionItems() {
  22732. return _this2.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ACTION_ITEM_SELECTOR).length;
  22733. }
  22734. });
  22735. /** @type {!MDCTopAppBarBaseFoundation} */
  22736. var foundation = void 0;
  22737. if (this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].SHORT_CLASS)) {
  22738. foundation = new __WEBPACK_IMPORTED_MODULE_6__short_foundation__["a" /* default */](adapter);
  22739. } else if (this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].FIXED_CLASS)) {
  22740. foundation = new __WEBPACK_IMPORTED_MODULE_5__fixed_foundation__["a" /* default */](adapter);
  22741. } else {
  22742. foundation = new __WEBPACK_IMPORTED_MODULE_7__standard_foundation__["a" /* default */](adapter);
  22743. }
  22744. return foundation;
  22745. }
  22746. }], [{
  22747. key: 'attachTo',
  22748. value: function attachTo(root) {
  22749. return new MDCTopAppBar(root);
  22750. }
  22751. }]);
  22752. return MDCTopAppBar;
  22753. }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* default */]);
  22754. /***/ }),
  22755. /* 155 */
  22756. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22757. "use strict";
  22758. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__constants__ = __webpack_require__(8);
  22759. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(7);
  22760. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(13);
  22761. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  22762. 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); } };
  22763. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22764. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  22765. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  22766. /**
  22767. * @license
  22768. * Copyright 2018 Google Inc.
  22769. *
  22770. * Permission is hereby granted, free of charge, to any person obtaining a copy
  22771. * of this software and associated documentation files (the "Software"), to deal
  22772. * in the Software without restriction, including without limitation the rights
  22773. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  22774. * copies of the Software, and to permit persons to whom the Software is
  22775. * furnished to do so, subject to the following conditions:
  22776. *
  22777. * The above copyright notice and this permission notice shall be included in
  22778. * all copies or substantial portions of the Software.
  22779. *
  22780. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  22781. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  22782. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22783. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22784. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  22785. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22786. * THE SOFTWARE.
  22787. */
  22788. /**
  22789. * @extends {MDCTopAppBarFoundation<!MDCFixedTopAppBarFoundation>}
  22790. * @final
  22791. */
  22792. var MDCFixedTopAppBarFoundation = function (_MDCTopAppBarFoundati) {
  22793. _inherits(MDCFixedTopAppBarFoundation, _MDCTopAppBarFoundati);
  22794. /**
  22795. * @param {!MDCTopAppBarAdapter} adapter
  22796. */
  22797. function MDCFixedTopAppBarFoundation(adapter) {
  22798. _classCallCheck(this, MDCFixedTopAppBarFoundation);
  22799. /** State variable for the previous scroll iteration top app bar state */
  22800. var _this = _possibleConstructorReturn(this, (MDCFixedTopAppBarFoundation.__proto__ || Object.getPrototypeOf(MDCFixedTopAppBarFoundation)).call(this, adapter));
  22801. _this.wasScrolled_ = false;
  22802. _this.scrollHandler_ = function () {
  22803. return _this.fixedScrollHandler_();
  22804. };
  22805. return _this;
  22806. }
  22807. _createClass(MDCFixedTopAppBarFoundation, [{
  22808. key: 'init',
  22809. value: function init() {
  22810. _get(MDCFixedTopAppBarFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCFixedTopAppBarFoundation.prototype), 'init', this).call(this);
  22811. this.adapter_.registerScrollHandler(this.scrollHandler_);
  22812. }
  22813. }, {
  22814. key: 'destroy',
  22815. value: function destroy() {
  22816. _get(MDCFixedTopAppBarFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCFixedTopAppBarFoundation.prototype), 'destroy', this).call(this);
  22817. this.adapter_.deregisterScrollHandler(this.scrollHandler_);
  22818. }
  22819. /**
  22820. * Scroll handler for applying/removing the modifier class
  22821. * on the fixed top app bar.
  22822. */
  22823. }, {
  22824. key: 'fixedScrollHandler_',
  22825. value: function fixedScrollHandler_() {
  22826. var currentScroll = this.adapter_.getViewportScrollY();
  22827. if (currentScroll <= 0) {
  22828. if (this.wasScrolled_) {
  22829. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].FIXED_SCROLLED_CLASS);
  22830. this.wasScrolled_ = false;
  22831. }
  22832. } else {
  22833. if (!this.wasScrolled_) {
  22834. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].FIXED_SCROLLED_CLASS);
  22835. this.wasScrolled_ = true;
  22836. }
  22837. }
  22838. }
  22839. }]);
  22840. return MDCFixedTopAppBarFoundation;
  22841. }(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]);
  22842. /* harmony default export */ __webpack_exports__["a"] = (MDCFixedTopAppBarFoundation);
  22843. /***/ }),
  22844. /* 156 */
  22845. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22846. "use strict";
  22847. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__adapter__ = __webpack_require__(7);
  22848. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(13);
  22849. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(8);
  22850. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  22851. 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); } };
  22852. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22853. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  22854. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  22855. /**
  22856. * @license
  22857. * Copyright 2018 Google Inc.
  22858. *
  22859. * Permission is hereby granted, free of charge, to any person obtaining a copy
  22860. * of this software and associated documentation files (the "Software"), to deal
  22861. * in the Software without restriction, including without limitation the rights
  22862. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  22863. * copies of the Software, and to permit persons to whom the Software is
  22864. * furnished to do so, subject to the following conditions:
  22865. *
  22866. * The above copyright notice and this permission notice shall be included in
  22867. * all copies or substantial portions of the Software.
  22868. *
  22869. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  22870. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  22871. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22872. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22873. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  22874. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22875. * THE SOFTWARE.
  22876. */
  22877. /**
  22878. * @extends {MDCTopAppBarBaseFoundation<!MDCShortTopAppBarFoundation>}
  22879. * @final
  22880. */
  22881. var MDCShortTopAppBarFoundation = function (_MDCTopAppBarBaseFoun) {
  22882. _inherits(MDCShortTopAppBarFoundation, _MDCTopAppBarBaseFoun);
  22883. /**
  22884. * @param {!MDCTopAppBarAdapter} adapter
  22885. */
  22886. function MDCShortTopAppBarFoundation(adapter) {
  22887. _classCallCheck(this, MDCShortTopAppBarFoundation);
  22888. // State variable for the current top app bar state
  22889. var _this = _possibleConstructorReturn(this, (MDCShortTopAppBarFoundation.__proto__ || Object.getPrototypeOf(MDCShortTopAppBarFoundation)).call(this, adapter));
  22890. _this.isCollapsed = false;
  22891. _this.scrollHandler_ = function () {
  22892. return _this.shortAppBarScrollHandler_();
  22893. };
  22894. return _this;
  22895. }
  22896. _createClass(MDCShortTopAppBarFoundation, [{
  22897. key: 'init',
  22898. value: function init() {
  22899. _get(MDCShortTopAppBarFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCShortTopAppBarFoundation.prototype), 'init', this).call(this);
  22900. var isAlwaysCollapsed = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SHORT_COLLAPSED_CLASS);
  22901. if (this.adapter_.getTotalActionItems() > 0) {
  22902. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SHORT_HAS_ACTION_ITEM_CLASS);
  22903. }
  22904. if (!isAlwaysCollapsed) {
  22905. this.adapter_.registerScrollHandler(this.scrollHandler_);
  22906. this.shortAppBarScrollHandler_();
  22907. }
  22908. }
  22909. }, {
  22910. key: 'destroy',
  22911. value: function destroy() {
  22912. _get(MDCShortTopAppBarFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCShortTopAppBarFoundation.prototype), 'destroy', this).call(this);
  22913. this.adapter_.deregisterScrollHandler(this.scrollHandler_);
  22914. }
  22915. /**
  22916. * Scroll handler for applying/removing the collapsed modifier class
  22917. * on the short top app bar.
  22918. * @private
  22919. */
  22920. }, {
  22921. key: 'shortAppBarScrollHandler_',
  22922. value: function shortAppBarScrollHandler_() {
  22923. var currentScroll = this.adapter_.getViewportScrollY();
  22924. if (currentScroll <= 0) {
  22925. if (this.isCollapsed) {
  22926. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SHORT_COLLAPSED_CLASS);
  22927. this.isCollapsed = false;
  22928. }
  22929. } else {
  22930. if (!this.isCollapsed) {
  22931. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SHORT_COLLAPSED_CLASS);
  22932. this.isCollapsed = true;
  22933. }
  22934. }
  22935. }
  22936. }]);
  22937. return MDCShortTopAppBarFoundation;
  22938. }(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]);
  22939. /* harmony default export */ __webpack_exports__["a"] = (MDCShortTopAppBarFoundation);
  22940. /***/ }),
  22941. /* 157 */
  22942. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22943. "use strict";
  22944. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__adapter__ = __webpack_require__(7);
  22945. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(13);
  22946. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(8);
  22947. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  22948. 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); } };
  22949. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22950. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  22951. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  22952. /**
  22953. * @license
  22954. * Copyright 2018 Google Inc.
  22955. *
  22956. * Permission is hereby granted, free of charge, to any person obtaining a copy
  22957. * of this software and associated documentation files (the "Software"), to deal
  22958. * in the Software without restriction, including without limitation the rights
  22959. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  22960. * copies of the Software, and to permit persons to whom the Software is
  22961. * furnished to do so, subject to the following conditions:
  22962. *
  22963. * The above copyright notice and this permission notice shall be included in
  22964. * all copies or substantial portions of the Software.
  22965. *
  22966. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  22967. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  22968. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22969. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22970. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  22971. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22972. * THE SOFTWARE.
  22973. */
  22974. var INITIAL_VALUE = 0;
  22975. /**
  22976. * @extends {MDCTopAppBarBaseFoundation<!MDCTopAppBarFoundation>}
  22977. * @final
  22978. */
  22979. var MDCTopAppBarFoundation = function (_MDCTopAppBarBaseFoun) {
  22980. _inherits(MDCTopAppBarFoundation, _MDCTopAppBarBaseFoun);
  22981. /**
  22982. * @param {!MDCTopAppBarAdapter} adapter
  22983. */
  22984. function MDCTopAppBarFoundation(adapter) {
  22985. _classCallCheck(this, MDCTopAppBarFoundation);
  22986. /**
  22987. * Used for diffs of current scroll position vs previous scroll position
  22988. * @private {number}
  22989. */
  22990. var _this = _possibleConstructorReturn(this, (MDCTopAppBarFoundation.__proto__ || Object.getPrototypeOf(MDCTopAppBarFoundation)).call(this, adapter));
  22991. _this.lastScrollPosition_ = _this.adapter_.getViewportScrollY();
  22992. /**
  22993. * Used to verify when the top app bar is completely showing or completely hidden
  22994. * @private {number}
  22995. */
  22996. _this.topAppBarHeight_ = _this.adapter_.getTopAppBarHeight();
  22997. /**
  22998. * wasDocked_ is used to indicate if the top app bar was docked in the previous
  22999. * scroll handler iteration.
  23000. * @private {boolean}
  23001. */
  23002. _this.wasDocked_ = true;
  23003. /**
  23004. * isDockedShowing_ is used to indicate if the top app bar is docked in the fully
  23005. * shown position.
  23006. * @private {boolean}
  23007. */
  23008. _this.isDockedShowing_ = true;
  23009. /**
  23010. * Variable for current scroll position of the top app bar
  23011. * @private {number}
  23012. */
  23013. _this.currentAppBarOffsetTop_ = 0;
  23014. /**
  23015. * Used to prevent the top app bar from being scrolled out of view during resize events
  23016. * @private {boolean} */
  23017. _this.isCurrentlyBeingResized_ = false;
  23018. /**
  23019. * The timeout that's used to throttle the resize events
  23020. * @private {number}
  23021. */
  23022. _this.resizeThrottleId_ = INITIAL_VALUE;
  23023. /**
  23024. * The timeout that's used to debounce toggling the isCurrentlyBeingResized_ variable after a resize
  23025. * @private {number}
  23026. */
  23027. _this.resizeDebounceId_ = INITIAL_VALUE;
  23028. _this.scrollHandler_ = function () {
  23029. return _this.topAppBarScrollHandler_();
  23030. };
  23031. _this.resizeHandler_ = function () {
  23032. return _this.topAppBarResizeHandler_();
  23033. };
  23034. return _this;
  23035. }
  23036. _createClass(MDCTopAppBarFoundation, [{
  23037. key: 'init',
  23038. value: function init() {
  23039. _get(MDCTopAppBarFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCTopAppBarFoundation.prototype), 'init', this).call(this);
  23040. this.adapter_.registerScrollHandler(this.scrollHandler_);
  23041. this.adapter_.registerResizeHandler(this.resizeHandler_);
  23042. }
  23043. }, {
  23044. key: 'destroy',
  23045. value: function destroy() {
  23046. _get(MDCTopAppBarFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCTopAppBarFoundation.prototype), 'destroy', this).call(this);
  23047. this.adapter_.deregisterScrollHandler(this.scrollHandler_);
  23048. this.adapter_.deregisterResizeHandler(this.resizeHandler_);
  23049. this.adapter_.setStyle('top', '');
  23050. }
  23051. /**
  23052. * Function to determine if the DOM needs to update.
  23053. * @return {boolean}
  23054. * @private
  23055. */
  23056. }, {
  23057. key: 'checkForUpdate_',
  23058. value: function checkForUpdate_() {
  23059. var offscreenBoundaryTop = -this.topAppBarHeight_;
  23060. var hasAnyPixelsOffscreen = this.currentAppBarOffsetTop_ < 0;
  23061. var hasAnyPixelsOnscreen = this.currentAppBarOffsetTop_ > offscreenBoundaryTop;
  23062. var partiallyShowing = hasAnyPixelsOffscreen && hasAnyPixelsOnscreen;
  23063. // If it's partially showing, it can't be docked.
  23064. if (partiallyShowing) {
  23065. this.wasDocked_ = false;
  23066. } else {
  23067. // Not previously docked and not partially showing, it's now docked.
  23068. if (!this.wasDocked_) {
  23069. this.wasDocked_ = true;
  23070. return true;
  23071. } else if (this.isDockedShowing_ !== hasAnyPixelsOnscreen) {
  23072. this.isDockedShowing_ = hasAnyPixelsOnscreen;
  23073. return true;
  23074. }
  23075. }
  23076. return partiallyShowing;
  23077. }
  23078. /**
  23079. * Function to move the top app bar if needed.
  23080. * @private
  23081. */
  23082. }, {
  23083. key: 'moveTopAppBar_',
  23084. value: function moveTopAppBar_() {
  23085. if (this.checkForUpdate_()) {
  23086. // Once the top app bar is fully hidden we use the max potential top app bar height as our offset
  23087. // so the top app bar doesn't show if the window resizes and the new height > the old height.
  23088. var offset = this.currentAppBarOffsetTop_;
  23089. if (Math.abs(offset) >= this.topAppBarHeight_) {
  23090. offset = -__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].MAX_TOP_APP_BAR_HEIGHT;
  23091. }
  23092. this.adapter_.setStyle('top', offset + 'px');
  23093. }
  23094. }
  23095. /**
  23096. * Scroll handler for the default scroll behavior of the top app bar.
  23097. * @private
  23098. */
  23099. }, {
  23100. key: 'topAppBarScrollHandler_',
  23101. value: function topAppBarScrollHandler_() {
  23102. var currentScrollPosition = Math.max(this.adapter_.getViewportScrollY(), 0);
  23103. var diff = currentScrollPosition - this.lastScrollPosition_;
  23104. this.lastScrollPosition_ = currentScrollPosition;
  23105. // If the window is being resized the lastScrollPosition_ needs to be updated but the
  23106. // current scroll of the top app bar should stay in the same position.
  23107. if (!this.isCurrentlyBeingResized_) {
  23108. this.currentAppBarOffsetTop_ -= diff;
  23109. if (this.currentAppBarOffsetTop_ > 0) {
  23110. this.currentAppBarOffsetTop_ = 0;
  23111. } else if (Math.abs(this.currentAppBarOffsetTop_) > this.topAppBarHeight_) {
  23112. this.currentAppBarOffsetTop_ = -this.topAppBarHeight_;
  23113. }
  23114. this.moveTopAppBar_();
  23115. }
  23116. }
  23117. /**
  23118. * Top app bar resize handler that throttle/debounce functions that execute updates.
  23119. * @private
  23120. */
  23121. }, {
  23122. key: 'topAppBarResizeHandler_',
  23123. value: function topAppBarResizeHandler_() {
  23124. var _this2 = this;
  23125. // Throttle resize events 10 p/s
  23126. if (!this.resizeThrottleId_) {
  23127. this.resizeThrottleId_ = setTimeout(function () {
  23128. _this2.resizeThrottleId_ = INITIAL_VALUE;
  23129. _this2.throttledResizeHandler_();
  23130. }, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].DEBOUNCE_THROTTLE_RESIZE_TIME_MS);
  23131. }
  23132. this.isCurrentlyBeingResized_ = true;
  23133. if (this.resizeDebounceId_) {
  23134. clearTimeout(this.resizeDebounceId_);
  23135. }
  23136. this.resizeDebounceId_ = setTimeout(function () {
  23137. _this2.topAppBarScrollHandler_();
  23138. _this2.isCurrentlyBeingResized_ = false;
  23139. _this2.resizeDebounceId_ = INITIAL_VALUE;
  23140. }, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].DEBOUNCE_THROTTLE_RESIZE_TIME_MS);
  23141. }
  23142. /**
  23143. * Throttled function that updates the top app bar scrolled values if the
  23144. * top app bar height changes.
  23145. * @private
  23146. */
  23147. }, {
  23148. key: 'throttledResizeHandler_',
  23149. value: function throttledResizeHandler_() {
  23150. var currentHeight = this.adapter_.getTopAppBarHeight();
  23151. if (this.topAppBarHeight_ !== currentHeight) {
  23152. this.wasDocked_ = false;
  23153. // Since the top app bar has a different height depending on the screen width, this
  23154. // will ensure that the top app bar remains in the correct location if
  23155. // completely hidden and a resize makes the top app bar a different height.
  23156. this.currentAppBarOffsetTop_ -= this.topAppBarHeight_ - currentHeight;
  23157. this.topAppBarHeight_ = currentHeight;
  23158. }
  23159. this.topAppBarScrollHandler_();
  23160. }
  23161. }]);
  23162. return MDCTopAppBarFoundation;
  23163. }(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]);
  23164. /* harmony default export */ __webpack_exports__["a"] = (MDCTopAppBarFoundation);
  23165. /***/ })
  23166. /******/ ]);
  23167. });
  23168. //# sourceMappingURL=material-components-web.js.map