material-components-web.js 1.0 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156
  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 classes and styles to open the notch to the specified width.
  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 classes and styles to close the notch.
  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. var min = parseFloat(this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].ARIA_VALUEMIN)) || this.min;
  17115. var max = parseFloat(this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].ARIA_VALUEMAX)) || this.max;
  17116. // min and max need to be set in the right order to avoid throwing an error
  17117. // when the new min is greater than the default max.
  17118. if (min >= this.max) {
  17119. this.max = max;
  17120. this.min = min;
  17121. } else {
  17122. this.min = min;
  17123. this.max = max;
  17124. }
  17125. this.step = parseFloat(this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].STEP_DATA_ATTR)) || this.step;
  17126. this.value = origValueNow || this.value;
  17127. 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';
  17128. this.foundation_.setupTrackMarker();
  17129. }
  17130. }, {
  17131. key: 'layout',
  17132. value: function layout() {
  17133. this.foundation_.layout();
  17134. }
  17135. /** @param {number=} amount */
  17136. }, {
  17137. key: 'stepUp',
  17138. value: function stepUp() {
  17139. var amount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.step || 1;
  17140. this.value += amount;
  17141. }
  17142. /** @param {number=} amount */
  17143. }, {
  17144. key: 'stepDown',
  17145. value: function stepDown() {
  17146. var amount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.step || 1;
  17147. this.value -= amount;
  17148. }
  17149. }, {
  17150. key: 'value',
  17151. get: function get() {
  17152. return this.foundation_.getValue();
  17153. }
  17154. /** @param {number} value */
  17155. ,
  17156. set: function set(value) {
  17157. this.foundation_.setValue(value);
  17158. }
  17159. /** @return {number} */
  17160. }, {
  17161. key: 'min',
  17162. get: function get() {
  17163. return this.foundation_.getMin();
  17164. }
  17165. /** @param {number} min */
  17166. ,
  17167. set: function set(min) {
  17168. this.foundation_.setMin(min);
  17169. }
  17170. /** @return {number} */
  17171. }, {
  17172. key: 'max',
  17173. get: function get() {
  17174. return this.foundation_.getMax();
  17175. }
  17176. /** @param {number} max */
  17177. ,
  17178. set: function set(max) {
  17179. this.foundation_.setMax(max);
  17180. }
  17181. /** @return {number} */
  17182. }, {
  17183. key: 'step',
  17184. get: function get() {
  17185. return this.foundation_.getStep();
  17186. }
  17187. /** @param {number} step */
  17188. ,
  17189. set: function set(step) {
  17190. this.foundation_.setStep(step);
  17191. }
  17192. /** @return {boolean} */
  17193. }, {
  17194. key: 'disabled',
  17195. get: function get() {
  17196. return this.foundation_.isDisabled();
  17197. }
  17198. /** @param {boolean} disabled */
  17199. ,
  17200. set: function set(disabled) {
  17201. this.foundation_.setDisabled(disabled);
  17202. }
  17203. }]);
  17204. return MDCSlider;
  17205. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  17206. /***/ }),
  17207. /* 124 */
  17208. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17209. "use strict";
  17210. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__constants__ = __webpack_require__(52);
  17211. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(53);
  17212. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_animation_index__ = __webpack_require__(9);
  17213. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_base_foundation__ = __webpack_require__(0);
  17214. 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; };
  17215. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  17216. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17217. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  17218. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  17219. /**
  17220. * @license
  17221. * Copyright 2017 Google Inc.
  17222. *
  17223. * Permission is hereby granted, free of charge, to any person obtaining a copy
  17224. * of this software and associated documentation files (the "Software"), to deal
  17225. * in the Software without restriction, including without limitation the rights
  17226. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  17227. * copies of the Software, and to permit persons to whom the Software is
  17228. * furnished to do so, subject to the following conditions:
  17229. *
  17230. * The above copyright notice and this permission notice shall be included in
  17231. * all copies or substantial portions of the Software.
  17232. *
  17233. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17234. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17235. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17236. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17237. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  17238. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  17239. * THE SOFTWARE.
  17240. */
  17241. /** @enum {string} */
  17242. var KEY_IDS = {
  17243. ARROW_LEFT: 'ArrowLeft',
  17244. ARROW_RIGHT: 'ArrowRight',
  17245. ARROW_UP: 'ArrowUp',
  17246. ARROW_DOWN: 'ArrowDown',
  17247. HOME: 'Home',
  17248. END: 'End',
  17249. PAGE_UP: 'PageUp',
  17250. PAGE_DOWN: 'PageDown'
  17251. };
  17252. /** @enum {string} */
  17253. var MOVE_EVENT_MAP = {
  17254. 'mousedown': 'mousemove',
  17255. 'touchstart': 'touchmove',
  17256. 'pointerdown': 'pointermove'
  17257. };
  17258. var DOWN_EVENTS = ['mousedown', 'pointerdown', 'touchstart'];
  17259. var UP_EVENTS = ['mouseup', 'pointerup', 'touchend'];
  17260. /**
  17261. * @extends {MDCFoundation<!MDCSliderAdapter>}
  17262. */
  17263. var MDCSliderFoundation = function (_MDCFoundation) {
  17264. _inherits(MDCSliderFoundation, _MDCFoundation);
  17265. _createClass(MDCSliderFoundation, null, [{
  17266. key: 'cssClasses',
  17267. /** @return enum {cssClasses} */
  17268. get: function get() {
  17269. return __WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */];
  17270. }
  17271. /** @return enum {strings} */
  17272. }, {
  17273. key: 'strings',
  17274. get: function get() {
  17275. return __WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */];
  17276. }
  17277. /** @return enum {numbers} */
  17278. }, {
  17279. key: 'numbers',
  17280. get: function get() {
  17281. return __WEBPACK_IMPORTED_MODULE_0__constants__["b" /* numbers */];
  17282. }
  17283. /** @return {!MDCSliderAdapter} */
  17284. }, {
  17285. key: 'defaultAdapter',
  17286. get: function get() {
  17287. return (/** @type {!MDCSliderAdapter} */{
  17288. hasClass: function hasClass() {
  17289. return (/* className: string */ /* boolean */false
  17290. );
  17291. },
  17292. addClass: function addClass() /* className: string */{},
  17293. removeClass: function removeClass() /* className: string */{},
  17294. getAttribute: function getAttribute() {
  17295. return (/* name: string */ /* string|null */null
  17296. );
  17297. },
  17298. setAttribute: function setAttribute() /* name: string, value: string */{},
  17299. removeAttribute: function removeAttribute() /* name: string */{},
  17300. computeBoundingRect: function computeBoundingRect() {
  17301. return (/* ClientRect */{
  17302. top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0
  17303. }
  17304. );
  17305. },
  17306. getTabIndex: function getTabIndex() {
  17307. return (/* number */0
  17308. );
  17309. },
  17310. registerInteractionHandler: function registerInteractionHandler() /* type: string, handler: EventListener */{},
  17311. deregisterInteractionHandler: function deregisterInteractionHandler() /* type: string, handler: EventListener */{},
  17312. registerThumbContainerInteractionHandler: function registerThumbContainerInteractionHandler() /* type: string, handler: EventListener */{},
  17313. deregisterThumbContainerInteractionHandler: function deregisterThumbContainerInteractionHandler() /* type: string, handler: EventListener */{},
  17314. registerBodyInteractionHandler: function registerBodyInteractionHandler() /* type: string, handler: EventListener */{},
  17315. deregisterBodyInteractionHandler: function deregisterBodyInteractionHandler() /* type: string, handler: EventListener */{},
  17316. registerResizeHandler: function registerResizeHandler() /* handler: EventListener */{},
  17317. deregisterResizeHandler: function deregisterResizeHandler() /* handler: EventListener */{},
  17318. notifyInput: function notifyInput() {},
  17319. notifyChange: function notifyChange() {},
  17320. setThumbContainerStyleProperty: function setThumbContainerStyleProperty() /* propertyName: string, value: string */{},
  17321. setTrackStyleProperty: function setTrackStyleProperty() /* propertyName: string, value: string */{},
  17322. setMarkerValue: function setMarkerValue() /* value: number */{},
  17323. appendTrackMarkers: function appendTrackMarkers() /* numMarkers: number */{},
  17324. removeTrackMarkers: function removeTrackMarkers() {},
  17325. setLastTrackMarkersStyleProperty: function setLastTrackMarkersStyleProperty() /* propertyName: string, value: string */{},
  17326. isRTL: function isRTL() {
  17327. return (/* boolean */false
  17328. );
  17329. }
  17330. }
  17331. );
  17332. }
  17333. /**
  17334. * Creates a new instance of MDCSliderFoundation
  17335. * @param {?MDCSliderAdapter} adapter
  17336. */
  17337. }]);
  17338. function MDCSliderFoundation(adapter) {
  17339. _classCallCheck(this, MDCSliderFoundation);
  17340. /** @private {?ClientRect} */
  17341. var _this = _possibleConstructorReturn(this, (MDCSliderFoundation.__proto__ || Object.getPrototypeOf(MDCSliderFoundation)).call(this, _extends(MDCSliderFoundation.defaultAdapter, adapter)));
  17342. _this.rect_ = null;
  17343. // We set this to NaN since we want it to be a number, but we can't use '0' or '-1'
  17344. // because those could be valid tabindices set by the client code.
  17345. _this.savedTabIndex_ = NaN;
  17346. _this.active_ = false;
  17347. _this.inTransit_ = false;
  17348. _this.isDiscrete_ = false;
  17349. _this.hasTrackMarker_ = false;
  17350. _this.handlingThumbTargetEvt_ = false;
  17351. _this.min_ = 0;
  17352. _this.max_ = 100;
  17353. _this.step_ = 0;
  17354. _this.value_ = 0;
  17355. _this.disabled_ = false;
  17356. _this.preventFocusState_ = false;
  17357. _this.updateUIFrame_ = 0;
  17358. _this.thumbContainerPointerHandler_ = function () {
  17359. _this.handlingThumbTargetEvt_ = true;
  17360. };
  17361. _this.interactionStartHandler_ = function (evt) {
  17362. return _this.handleDown_(evt);
  17363. };
  17364. _this.keydownHandler_ = function (evt) {
  17365. return _this.handleKeydown_(evt);
  17366. };
  17367. _this.focusHandler_ = function () {
  17368. return _this.handleFocus_();
  17369. };
  17370. _this.blurHandler_ = function () {
  17371. return _this.handleBlur_();
  17372. };
  17373. _this.resizeHandler_ = function () {
  17374. return _this.layout();
  17375. };
  17376. return _this;
  17377. }
  17378. _createClass(MDCSliderFoundation, [{
  17379. key: 'init',
  17380. value: function init() {
  17381. var _this2 = this;
  17382. this.isDiscrete_ = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].IS_DISCRETE);
  17383. this.hasTrackMarker_ = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].HAS_TRACK_MARKER);
  17384. DOWN_EVENTS.forEach(function (evtName) {
  17385. return _this2.adapter_.registerInteractionHandler(evtName, _this2.interactionStartHandler_);
  17386. });
  17387. this.adapter_.registerInteractionHandler('keydown', this.keydownHandler_);
  17388. this.adapter_.registerInteractionHandler('focus', this.focusHandler_);
  17389. this.adapter_.registerInteractionHandler('blur', this.blurHandler_);
  17390. DOWN_EVENTS.forEach(function (evtName) {
  17391. _this2.adapter_.registerThumbContainerInteractionHandler(evtName, _this2.thumbContainerPointerHandler_);
  17392. });
  17393. this.adapter_.registerResizeHandler(this.resizeHandler_);
  17394. this.layout();
  17395. // At last step, provide a reasonable default value to discrete slider
  17396. if (this.isDiscrete_ && this.getStep() == 0) {
  17397. this.step_ = 1;
  17398. }
  17399. }
  17400. }, {
  17401. key: 'destroy',
  17402. value: function destroy() {
  17403. var _this3 = this;
  17404. DOWN_EVENTS.forEach(function (evtName) {
  17405. _this3.adapter_.deregisterInteractionHandler(evtName, _this3.interactionStartHandler_);
  17406. });
  17407. this.adapter_.deregisterInteractionHandler('keydown', this.keydownHandler_);
  17408. this.adapter_.deregisterInteractionHandler('focus', this.focusHandler_);
  17409. this.adapter_.deregisterInteractionHandler('blur', this.blurHandler_);
  17410. DOWN_EVENTS.forEach(function (evtName) {
  17411. _this3.adapter_.deregisterThumbContainerInteractionHandler(evtName, _this3.thumbContainerPointerHandler_);
  17412. });
  17413. this.adapter_.deregisterResizeHandler(this.resizeHandler_);
  17414. }
  17415. }, {
  17416. key: 'setupTrackMarker',
  17417. value: function setupTrackMarker() {
  17418. if (this.isDiscrete_ && this.hasTrackMarker_ && this.getStep() != 0) {
  17419. var min = this.getMin();
  17420. var max = this.getMax();
  17421. var step = this.getStep();
  17422. var numMarkers = (max - min) / step;
  17423. // In case distance between max & min is indivisible to step,
  17424. // we place the secondary to last marker proportionally at where thumb
  17425. // could reach and place the last marker at max value
  17426. var indivisible = Math.ceil(numMarkers) !== numMarkers;
  17427. if (indivisible) {
  17428. numMarkers = Math.ceil(numMarkers);
  17429. }
  17430. this.adapter_.removeTrackMarkers();
  17431. this.adapter_.appendTrackMarkers(numMarkers);
  17432. if (indivisible) {
  17433. var lastStepRatio = (max - numMarkers * step) / step + 1;
  17434. var flex = Object(__WEBPACK_IMPORTED_MODULE_2__material_animation_index__["b" /* getCorrectPropertyName */])(window, 'flex');
  17435. this.adapter_.setLastTrackMarkersStyleProperty(flex, String(lastStepRatio));
  17436. }
  17437. }
  17438. }
  17439. }, {
  17440. key: 'layout',
  17441. value: function layout() {
  17442. this.rect_ = this.adapter_.computeBoundingRect();
  17443. this.updateUIForCurrentValue_();
  17444. }
  17445. /** @return {number} */
  17446. }, {
  17447. key: 'getValue',
  17448. value: function getValue() {
  17449. return this.value_;
  17450. }
  17451. /** @param {number} value */
  17452. }, {
  17453. key: 'setValue',
  17454. value: function setValue(value) {
  17455. this.setValue_(value, false);
  17456. }
  17457. /** @return {number} */
  17458. }, {
  17459. key: 'getMax',
  17460. value: function getMax() {
  17461. return this.max_;
  17462. }
  17463. /** @param {number} max */
  17464. }, {
  17465. key: 'setMax',
  17466. value: function setMax(max) {
  17467. if (max < this.min_) {
  17468. throw new Error('Cannot set max to be less than the slider\'s minimum value');
  17469. }
  17470. this.max_ = max;
  17471. this.setValue_(this.value_, false, true);
  17472. this.adapter_.setAttribute(__WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */].ARIA_VALUEMAX, String(this.max_));
  17473. this.setupTrackMarker();
  17474. }
  17475. /** @return {number} */
  17476. }, {
  17477. key: 'getMin',
  17478. value: function getMin() {
  17479. return this.min_;
  17480. }
  17481. /** @param {number} min */
  17482. }, {
  17483. key: 'setMin',
  17484. value: function setMin(min) {
  17485. if (min > this.max_) {
  17486. throw new Error('Cannot set min to be greater than the slider\'s maximum value');
  17487. }
  17488. this.min_ = min;
  17489. this.setValue_(this.value_, false, true);
  17490. this.adapter_.setAttribute(__WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */].ARIA_VALUEMIN, String(this.min_));
  17491. this.setupTrackMarker();
  17492. }
  17493. /** @return {number} */
  17494. }, {
  17495. key: 'getStep',
  17496. value: function getStep() {
  17497. return this.step_;
  17498. }
  17499. /** @param {number} step */
  17500. }, {
  17501. key: 'setStep',
  17502. value: function setStep(step) {
  17503. if (step < 0) {
  17504. throw new Error('Step cannot be set to a negative number');
  17505. }
  17506. if (this.isDiscrete_ && (typeof step !== 'number' || step < 1)) {
  17507. step = 1;
  17508. }
  17509. this.step_ = step;
  17510. this.setValue_(this.value_, false, true);
  17511. this.setupTrackMarker();
  17512. }
  17513. /** @return {boolean} */
  17514. }, {
  17515. key: 'isDisabled',
  17516. value: function isDisabled() {
  17517. return this.disabled_;
  17518. }
  17519. /** @param {boolean} disabled */
  17520. }, {
  17521. key: 'setDisabled',
  17522. value: function setDisabled(disabled) {
  17523. this.disabled_ = disabled;
  17524. this.toggleClass_(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].DISABLED, this.disabled_);
  17525. if (this.disabled_) {
  17526. this.savedTabIndex_ = this.adapter_.getTabIndex();
  17527. this.adapter_.setAttribute(__WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */].ARIA_DISABLED, 'true');
  17528. this.adapter_.removeAttribute('tabindex');
  17529. } else {
  17530. this.adapter_.removeAttribute(__WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */].ARIA_DISABLED);
  17531. if (!isNaN(this.savedTabIndex_)) {
  17532. this.adapter_.setAttribute('tabindex', String(this.savedTabIndex_));
  17533. }
  17534. }
  17535. }
  17536. /**
  17537. * Called when the user starts interacting with the slider
  17538. * @param {!Event} evt
  17539. * @private
  17540. */
  17541. }, {
  17542. key: 'handleDown_',
  17543. value: function handleDown_(evt) {
  17544. var _this4 = this;
  17545. if (this.disabled_) {
  17546. return;
  17547. }
  17548. this.preventFocusState_ = true;
  17549. this.setInTransit_(!this.handlingThumbTargetEvt_);
  17550. this.handlingThumbTargetEvt_ = false;
  17551. this.setActive_(true);
  17552. var moveHandler = function moveHandler(evt) {
  17553. _this4.handleMove_(evt);
  17554. };
  17555. // Note: upHandler is [de]registered on ALL potential pointer-related release event types, since some browsers
  17556. // do not always fire these consistently in pairs.
  17557. // (See https://github.com/material-components/material-components-web/issues/1192)
  17558. var upHandler = function upHandler() {
  17559. _this4.handleUp_();
  17560. _this4.adapter_.deregisterBodyInteractionHandler(MOVE_EVENT_MAP[evt.type], moveHandler);
  17561. UP_EVENTS.forEach(function (evtName) {
  17562. return _this4.adapter_.deregisterBodyInteractionHandler(evtName, upHandler);
  17563. });
  17564. };
  17565. this.adapter_.registerBodyInteractionHandler(MOVE_EVENT_MAP[evt.type], moveHandler);
  17566. UP_EVENTS.forEach(function (evtName) {
  17567. return _this4.adapter_.registerBodyInteractionHandler(evtName, upHandler);
  17568. });
  17569. this.setValueFromEvt_(evt);
  17570. }
  17571. /**
  17572. * Called when the user moves the slider
  17573. * @param {!Event} evt
  17574. * @private
  17575. */
  17576. }, {
  17577. key: 'handleMove_',
  17578. value: function handleMove_(evt) {
  17579. evt.preventDefault();
  17580. this.setValueFromEvt_(evt);
  17581. }
  17582. /**
  17583. * Called when the user's interaction with the slider ends
  17584. * @private
  17585. */
  17586. }, {
  17587. key: 'handleUp_',
  17588. value: function handleUp_() {
  17589. this.setActive_(false);
  17590. this.adapter_.notifyChange();
  17591. }
  17592. /**
  17593. * Returns the pageX of the event
  17594. * @param {!Event} evt
  17595. * @return {number}
  17596. * @private
  17597. */
  17598. }, {
  17599. key: 'getPageX_',
  17600. value: function getPageX_(evt) {
  17601. if (evt.targetTouches && evt.targetTouches.length > 0) {
  17602. return evt.targetTouches[0].pageX;
  17603. }
  17604. return evt.pageX;
  17605. }
  17606. /**
  17607. * Sets the slider value from an event
  17608. * @param {!Event} evt
  17609. * @private
  17610. */
  17611. }, {
  17612. key: 'setValueFromEvt_',
  17613. value: function setValueFromEvt_(evt) {
  17614. var pageX = this.getPageX_(evt);
  17615. var value = this.computeValueFromPageX_(pageX);
  17616. this.setValue_(value, true);
  17617. }
  17618. /**
  17619. * Computes the new value from the pageX position
  17620. * @param {number} pageX
  17621. * @return {number}
  17622. */
  17623. }, {
  17624. key: 'computeValueFromPageX_',
  17625. value: function computeValueFromPageX_(pageX) {
  17626. var max = this.max_,
  17627. min = this.min_;
  17628. var xPos = pageX - this.rect_.left;
  17629. var pctComplete = xPos / this.rect_.width;
  17630. if (this.adapter_.isRTL()) {
  17631. pctComplete = 1 - pctComplete;
  17632. }
  17633. // Fit the percentage complete between the range [min,max]
  17634. // by remapping from [0, 1] to [min, min+(max-min)].
  17635. return min + pctComplete * (max - min);
  17636. }
  17637. /**
  17638. * Handles keydown events
  17639. * @param {!Event} evt
  17640. */
  17641. }, {
  17642. key: 'handleKeydown_',
  17643. value: function handleKeydown_(evt) {
  17644. var keyId = this.getKeyId_(evt);
  17645. var value = this.getValueForKeyId_(keyId);
  17646. if (isNaN(value)) {
  17647. return;
  17648. }
  17649. // Prevent page from scrolling due to key presses that would normally scroll the page
  17650. evt.preventDefault();
  17651. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].FOCUS);
  17652. this.setValue_(value, true);
  17653. this.adapter_.notifyChange();
  17654. }
  17655. /**
  17656. * Returns the computed name of the event
  17657. * @param {!Event} kbdEvt
  17658. * @return {string}
  17659. */
  17660. }, {
  17661. key: 'getKeyId_',
  17662. value: function getKeyId_(kbdEvt) {
  17663. if (kbdEvt.key === KEY_IDS.ARROW_LEFT || kbdEvt.keyCode === 37) {
  17664. return KEY_IDS.ARROW_LEFT;
  17665. }
  17666. if (kbdEvt.key === KEY_IDS.ARROW_RIGHT || kbdEvt.keyCode === 39) {
  17667. return KEY_IDS.ARROW_RIGHT;
  17668. }
  17669. if (kbdEvt.key === KEY_IDS.ARROW_UP || kbdEvt.keyCode === 38) {
  17670. return KEY_IDS.ARROW_UP;
  17671. }
  17672. if (kbdEvt.key === KEY_IDS.ARROW_DOWN || kbdEvt.keyCode === 40) {
  17673. return KEY_IDS.ARROW_DOWN;
  17674. }
  17675. if (kbdEvt.key === KEY_IDS.HOME || kbdEvt.keyCode === 36) {
  17676. return KEY_IDS.HOME;
  17677. }
  17678. if (kbdEvt.key === KEY_IDS.END || kbdEvt.keyCode === 35) {
  17679. return KEY_IDS.END;
  17680. }
  17681. if (kbdEvt.key === KEY_IDS.PAGE_UP || kbdEvt.keyCode === 33) {
  17682. return KEY_IDS.PAGE_UP;
  17683. }
  17684. if (kbdEvt.key === KEY_IDS.PAGE_DOWN || kbdEvt.keyCode === 34) {
  17685. return KEY_IDS.PAGE_DOWN;
  17686. }
  17687. return '';
  17688. }
  17689. /**
  17690. * Computes the value given a keyboard key ID
  17691. * @param {string} keyId
  17692. * @return {number}
  17693. */
  17694. }, {
  17695. key: 'getValueForKeyId_',
  17696. value: function getValueForKeyId_(keyId) {
  17697. var max = this.max_,
  17698. min = this.min_,
  17699. step = this.step_;
  17700. var delta = step || (max - min) / 100;
  17701. var valueNeedsToBeFlipped = this.adapter_.isRTL() && (keyId === KEY_IDS.ARROW_LEFT || keyId === KEY_IDS.ARROW_RIGHT);
  17702. if (valueNeedsToBeFlipped) {
  17703. delta = -delta;
  17704. }
  17705. switch (keyId) {
  17706. case KEY_IDS.ARROW_LEFT:
  17707. case KEY_IDS.ARROW_DOWN:
  17708. return this.value_ - delta;
  17709. case KEY_IDS.ARROW_RIGHT:
  17710. case KEY_IDS.ARROW_UP:
  17711. return this.value_ + delta;
  17712. case KEY_IDS.HOME:
  17713. return this.min_;
  17714. case KEY_IDS.END:
  17715. return this.max_;
  17716. case KEY_IDS.PAGE_UP:
  17717. return this.value_ + delta * __WEBPACK_IMPORTED_MODULE_0__constants__["b" /* numbers */].PAGE_FACTOR;
  17718. case KEY_IDS.PAGE_DOWN:
  17719. return this.value_ - delta * __WEBPACK_IMPORTED_MODULE_0__constants__["b" /* numbers */].PAGE_FACTOR;
  17720. default:
  17721. return NaN;
  17722. }
  17723. }
  17724. }, {
  17725. key: 'handleFocus_',
  17726. value: function handleFocus_() {
  17727. if (this.preventFocusState_) {
  17728. return;
  17729. }
  17730. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].FOCUS);
  17731. }
  17732. }, {
  17733. key: 'handleBlur_',
  17734. value: function handleBlur_() {
  17735. this.preventFocusState_ = false;
  17736. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].FOCUS);
  17737. }
  17738. /**
  17739. * Sets the value of the slider
  17740. * @param {number} value
  17741. * @param {boolean} shouldFireInput
  17742. * @param {boolean=} force
  17743. */
  17744. }, {
  17745. key: 'setValue_',
  17746. value: function setValue_(value, shouldFireInput) {
  17747. var force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  17748. if (value === this.value_ && !force) {
  17749. return;
  17750. }
  17751. var min = this.min_,
  17752. max = this.max_;
  17753. var valueSetToBoundary = value === min || value === max;
  17754. if (this.step_ && !valueSetToBoundary) {
  17755. value = this.quantize_(value);
  17756. }
  17757. if (value < min) {
  17758. value = min;
  17759. } else if (value > max) {
  17760. value = max;
  17761. }
  17762. this.value_ = value;
  17763. this.adapter_.setAttribute(__WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */].ARIA_VALUENOW, String(this.value_));
  17764. this.updateUIForCurrentValue_();
  17765. if (shouldFireInput) {
  17766. this.adapter_.notifyInput();
  17767. if (this.isDiscrete_) {
  17768. this.adapter_.setMarkerValue(value);
  17769. }
  17770. }
  17771. }
  17772. /**
  17773. * Calculates the quantized value
  17774. * @param {number} value
  17775. * @return {number}
  17776. */
  17777. }, {
  17778. key: 'quantize_',
  17779. value: function quantize_(value) {
  17780. var numSteps = Math.round(value / this.step_);
  17781. var quantizedVal = numSteps * this.step_;
  17782. return quantizedVal;
  17783. }
  17784. }, {
  17785. key: 'updateUIForCurrentValue_',
  17786. value: function updateUIForCurrentValue_() {
  17787. var _this5 = this;
  17788. var max = this.max_,
  17789. min = this.min_,
  17790. value = this.value_;
  17791. var pctComplete = (value - min) / (max - min);
  17792. var translatePx = pctComplete * this.rect_.width;
  17793. if (this.adapter_.isRTL()) {
  17794. translatePx = this.rect_.width - translatePx;
  17795. }
  17796. var transformProp = Object(__WEBPACK_IMPORTED_MODULE_2__material_animation_index__["b" /* getCorrectPropertyName */])(window, 'transform');
  17797. var transitionendEvtName = Object(__WEBPACK_IMPORTED_MODULE_2__material_animation_index__["a" /* getCorrectEventName */])(window, 'transitionend');
  17798. if (this.inTransit_) {
  17799. var onTransitionEnd = function onTransitionEnd() {
  17800. _this5.setInTransit_(false);
  17801. _this5.adapter_.deregisterThumbContainerInteractionHandler(transitionendEvtName, onTransitionEnd);
  17802. };
  17803. this.adapter_.registerThumbContainerInteractionHandler(transitionendEvtName, onTransitionEnd);
  17804. }
  17805. this.updateUIFrame_ = requestAnimationFrame(function () {
  17806. // NOTE(traviskaufman): It would be nice to use calc() here,
  17807. // but IE cannot handle calcs in transforms correctly.
  17808. // See: https://goo.gl/NC2itk
  17809. // Also note that the -50% offset is used to center the slider thumb.
  17810. _this5.adapter_.setThumbContainerStyleProperty(transformProp, 'translateX(' + translatePx + 'px) translateX(-50%)');
  17811. _this5.adapter_.setTrackStyleProperty(transformProp, 'scaleX(' + pctComplete + ')');
  17812. });
  17813. }
  17814. /**
  17815. * Toggles the active state of the slider
  17816. * @param {boolean} active
  17817. */
  17818. }, {
  17819. key: 'setActive_',
  17820. value: function setActive_(active) {
  17821. this.active_ = active;
  17822. this.toggleClass_(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].ACTIVE, this.active_);
  17823. }
  17824. /**
  17825. * Toggles the inTransit state of the slider
  17826. * @param {boolean} inTransit
  17827. */
  17828. }, {
  17829. key: 'setInTransit_',
  17830. value: function setInTransit_(inTransit) {
  17831. this.inTransit_ = inTransit;
  17832. this.toggleClass_(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].IN_TRANSIT, this.inTransit_);
  17833. }
  17834. /**
  17835. * Conditionally adds or removes a class based on shouldBePresent
  17836. * @param {string} className
  17837. * @param {boolean} shouldBePresent
  17838. */
  17839. }, {
  17840. key: 'toggleClass_',
  17841. value: function toggleClass_(className, shouldBePresent) {
  17842. if (shouldBePresent) {
  17843. this.adapter_.addClass(className);
  17844. } else {
  17845. this.adapter_.removeClass(className);
  17846. }
  17847. }
  17848. }]);
  17849. return MDCSliderFoundation;
  17850. }(__WEBPACK_IMPORTED_MODULE_3__material_base_foundation__["a" /* default */]);
  17851. /* harmony default export */ __webpack_exports__["a"] = (MDCSliderFoundation);
  17852. /***/ }),
  17853. /* 125 */
  17854. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  17855. "use strict";
  17856. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  17857. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSnackbar", function() { return MDCSnackbar; });
  17858. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(3);
  17859. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(126);
  17860. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_animation_index__ = __webpack_require__(9);
  17861. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSnackbarFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  17862. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  17863. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17864. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  17865. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  17866. /**
  17867. * @license
  17868. * Copyright 2016 Google Inc.
  17869. *
  17870. * Permission is hereby granted, free of charge, to any person obtaining a copy
  17871. * of this software and associated documentation files (the "Software"), to deal
  17872. * in the Software without restriction, including without limitation the rights
  17873. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  17874. * copies of the Software, and to permit persons to whom the Software is
  17875. * furnished to do so, subject to the following conditions:
  17876. *
  17877. * The above copyright notice and this permission notice shall be included in
  17878. * all copies or substantial portions of the Software.
  17879. *
  17880. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17881. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17882. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17883. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17884. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  17885. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  17886. * THE SOFTWARE.
  17887. */
  17888. var MDCSnackbar = function (_MDCComponent) {
  17889. _inherits(MDCSnackbar, _MDCComponent);
  17890. function MDCSnackbar() {
  17891. _classCallCheck(this, MDCSnackbar);
  17892. return _possibleConstructorReturn(this, (MDCSnackbar.__proto__ || Object.getPrototypeOf(MDCSnackbar)).apply(this, arguments));
  17893. }
  17894. _createClass(MDCSnackbar, [{
  17895. key: 'show',
  17896. value: function show(data) {
  17897. this.foundation_.show(data);
  17898. }
  17899. }, {
  17900. key: 'getDefaultFoundation',
  17901. value: function getDefaultFoundation() {
  17902. var _this2 = this;
  17903. var _MDCSnackbarFoundatio = __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings,
  17904. TEXT_SELECTOR = _MDCSnackbarFoundatio.TEXT_SELECTOR,
  17905. ACTION_BUTTON_SELECTOR = _MDCSnackbarFoundatio.ACTION_BUTTON_SELECTOR;
  17906. var getText = function getText() {
  17907. return _this2.root_.querySelector(TEXT_SELECTOR);
  17908. };
  17909. var getActionButton = function getActionButton() {
  17910. return _this2.root_.querySelector(ACTION_BUTTON_SELECTOR);
  17911. };
  17912. /* eslint brace-style: "off" */
  17913. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]({
  17914. addClass: function addClass(className) {
  17915. return _this2.root_.classList.add(className);
  17916. },
  17917. removeClass: function removeClass(className) {
  17918. return _this2.root_.classList.remove(className);
  17919. },
  17920. setAriaHidden: function setAriaHidden() {
  17921. return _this2.root_.setAttribute('aria-hidden', 'true');
  17922. },
  17923. unsetAriaHidden: function unsetAriaHidden() {
  17924. return _this2.root_.removeAttribute('aria-hidden');
  17925. },
  17926. setActionAriaHidden: function setActionAriaHidden() {
  17927. return getActionButton().setAttribute('aria-hidden', 'true');
  17928. },
  17929. unsetActionAriaHidden: function unsetActionAriaHidden() {
  17930. return getActionButton().removeAttribute('aria-hidden');
  17931. },
  17932. setActionText: function setActionText(text) {
  17933. getActionButton().textContent = text;
  17934. },
  17935. setMessageText: function setMessageText(text) {
  17936. getText().textContent = text;
  17937. },
  17938. setFocus: function setFocus() {
  17939. return getActionButton().focus();
  17940. },
  17941. isFocused: function isFocused() {
  17942. return document.activeElement === getActionButton();
  17943. },
  17944. visibilityIsHidden: function visibilityIsHidden() {
  17945. return document.hidden;
  17946. },
  17947. registerCapturedBlurHandler: function registerCapturedBlurHandler(handler) {
  17948. return getActionButton().addEventListener('blur', handler, true);
  17949. },
  17950. deregisterCapturedBlurHandler: function deregisterCapturedBlurHandler(handler) {
  17951. return getActionButton().removeEventListener('blur', handler, true);
  17952. },
  17953. registerVisibilityChangeHandler: function registerVisibilityChangeHandler(handler) {
  17954. return document.addEventListener('visibilitychange', handler);
  17955. },
  17956. deregisterVisibilityChangeHandler: function deregisterVisibilityChangeHandler(handler) {
  17957. return document.removeEventListener('visibilitychange', handler);
  17958. },
  17959. registerCapturedInteractionHandler: function registerCapturedInteractionHandler(evt, handler) {
  17960. return document.body.addEventListener(evt, handler, true);
  17961. },
  17962. deregisterCapturedInteractionHandler: function deregisterCapturedInteractionHandler(evt, handler) {
  17963. return document.body.removeEventListener(evt, handler, true);
  17964. },
  17965. registerActionClickHandler: function registerActionClickHandler(handler) {
  17966. return getActionButton().addEventListener('click', handler);
  17967. },
  17968. deregisterActionClickHandler: function deregisterActionClickHandler(handler) {
  17969. return getActionButton().removeEventListener('click', handler);
  17970. },
  17971. registerTransitionEndHandler: function registerTransitionEndHandler(handler) {
  17972. return _this2.root_.addEventListener(Object(__WEBPACK_IMPORTED_MODULE_2__material_animation_index__["a" /* getCorrectEventName */])(window, 'transitionend'), handler);
  17973. },
  17974. deregisterTransitionEndHandler: function deregisterTransitionEndHandler(handler) {
  17975. return _this2.root_.removeEventListener(Object(__WEBPACK_IMPORTED_MODULE_2__material_animation_index__["a" /* getCorrectEventName */])(window, 'transitionend'), handler);
  17976. },
  17977. notifyShow: function notifyShow() {
  17978. return _this2.emit(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.SHOW_EVENT);
  17979. },
  17980. notifyHide: function notifyHide() {
  17981. return _this2.emit(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.HIDE_EVENT);
  17982. }
  17983. });
  17984. }
  17985. }, {
  17986. key: 'dismissesOnAction',
  17987. get: function get() {
  17988. return this.foundation_.dismissesOnAction();
  17989. },
  17990. set: function set(dismissesOnAction) {
  17991. this.foundation_.setDismissOnAction(dismissesOnAction);
  17992. }
  17993. }], [{
  17994. key: 'attachTo',
  17995. value: function attachTo(root) {
  17996. return new MDCSnackbar(root);
  17997. }
  17998. }]);
  17999. return MDCSnackbar;
  18000. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCComponent"]);
  18001. /***/ }),
  18002. /* 126 */
  18003. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18004. "use strict";
  18005. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(3);
  18006. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(127);
  18007. 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; };
  18008. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  18009. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18010. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  18011. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  18012. /**
  18013. * @license
  18014. * Copyright 2016 Google Inc.
  18015. *
  18016. * Permission is hereby granted, free of charge, to any person obtaining a copy
  18017. * of this software and associated documentation files (the "Software"), to deal
  18018. * in the Software without restriction, including without limitation the rights
  18019. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18020. * copies of the Software, and to permit persons to whom the Software is
  18021. * furnished to do so, subject to the following conditions:
  18022. *
  18023. * The above copyright notice and this permission notice shall be included in
  18024. * all copies or substantial portions of the Software.
  18025. *
  18026. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18027. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18028. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18029. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18030. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18031. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18032. * THE SOFTWARE.
  18033. */
  18034. var MDCSnackbarFoundation = function (_MDCFoundation) {
  18035. _inherits(MDCSnackbarFoundation, _MDCFoundation);
  18036. _createClass(MDCSnackbarFoundation, [{
  18037. key: 'active',
  18038. get: function get() {
  18039. return this.active_;
  18040. }
  18041. }], [{
  18042. key: 'cssClasses',
  18043. get: function get() {
  18044. return __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */];
  18045. }
  18046. }, {
  18047. key: 'strings',
  18048. get: function get() {
  18049. return __WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */];
  18050. }
  18051. }, {
  18052. key: 'defaultAdapter',
  18053. get: function get() {
  18054. return {
  18055. addClass: function addClass() /* className: string */{},
  18056. removeClass: function removeClass() /* className: string */{},
  18057. setAriaHidden: function setAriaHidden() {},
  18058. unsetAriaHidden: function unsetAriaHidden() {},
  18059. setActionAriaHidden: function setActionAriaHidden() {},
  18060. unsetActionAriaHidden: function unsetActionAriaHidden() {},
  18061. setActionText: function setActionText() /* actionText: string */{},
  18062. setMessageText: function setMessageText() /* message: string */{},
  18063. setFocus: function setFocus() {},
  18064. isFocused: function isFocused() {
  18065. return (/* boolean */false
  18066. );
  18067. },
  18068. visibilityIsHidden: function visibilityIsHidden() {
  18069. return (/* boolean */false
  18070. );
  18071. },
  18072. registerCapturedBlurHandler: function registerCapturedBlurHandler() /* handler: EventListener */{},
  18073. deregisterCapturedBlurHandler: function deregisterCapturedBlurHandler() /* handler: EventListener */{},
  18074. registerVisibilityChangeHandler: function registerVisibilityChangeHandler() /* handler: EventListener */{},
  18075. deregisterVisibilityChangeHandler: function deregisterVisibilityChangeHandler() /* handler: EventListener */{},
  18076. registerCapturedInteractionHandler: function registerCapturedInteractionHandler() /* evtType: string, handler: EventListener */{},
  18077. deregisterCapturedInteractionHandler: function deregisterCapturedInteractionHandler() /* evtType: string, handler: EventListener */{},
  18078. registerActionClickHandler: function registerActionClickHandler() /* handler: EventListener */{},
  18079. deregisterActionClickHandler: function deregisterActionClickHandler() /* handler: EventListener */{},
  18080. registerTransitionEndHandler: function registerTransitionEndHandler() /* handler: EventListener */{},
  18081. deregisterTransitionEndHandler: function deregisterTransitionEndHandler() /* handler: EventListener */{},
  18082. notifyShow: function notifyShow() {},
  18083. notifyHide: function notifyHide() {}
  18084. };
  18085. }
  18086. }]);
  18087. function MDCSnackbarFoundation(adapter) {
  18088. _classCallCheck(this, MDCSnackbarFoundation);
  18089. var _this = _possibleConstructorReturn(this, (MDCSnackbarFoundation.__proto__ || Object.getPrototypeOf(MDCSnackbarFoundation)).call(this, _extends(MDCSnackbarFoundation.defaultAdapter, adapter)));
  18090. _this.active_ = false;
  18091. _this.actionWasClicked_ = false;
  18092. _this.dismissOnAction_ = true;
  18093. _this.firstFocus_ = true;
  18094. _this.pointerDownRecognized_ = false;
  18095. _this.snackbarHasFocus_ = false;
  18096. _this.snackbarData_ = null;
  18097. _this.queue_ = [];
  18098. _this.actionClickHandler_ = function () {
  18099. _this.actionWasClicked_ = true;
  18100. _this.invokeAction_();
  18101. };
  18102. _this.visibilitychangeHandler_ = function () {
  18103. clearTimeout(_this.timeoutId_);
  18104. _this.snackbarHasFocus_ = true;
  18105. if (!_this.adapter_.visibilityIsHidden()) {
  18106. setTimeout(_this.cleanup_.bind(_this), _this.snackbarData_.timeout || __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* numbers */].MESSAGE_TIMEOUT);
  18107. }
  18108. };
  18109. _this.interactionHandler_ = function (evt) {
  18110. if (evt.type === 'focus' && !_this.adapter_.isFocused()) {
  18111. return;
  18112. }
  18113. if (evt.type === 'touchstart' || evt.type === 'mousedown') {
  18114. _this.pointerDownRecognized_ = true;
  18115. }
  18116. _this.handlePossibleTabKeyboardFocus_(evt);
  18117. if (evt.type === 'focus') {
  18118. _this.pointerDownRecognized_ = false;
  18119. }
  18120. };
  18121. _this.blurHandler_ = function () {
  18122. clearTimeout(_this.timeoutId_);
  18123. _this.snackbarHasFocus_ = false;
  18124. _this.timeoutId_ = setTimeout(_this.cleanup_.bind(_this), _this.snackbarData_.timeout || __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* numbers */].MESSAGE_TIMEOUT);
  18125. };
  18126. return _this;
  18127. }
  18128. _createClass(MDCSnackbarFoundation, [{
  18129. key: 'init',
  18130. value: function init() {
  18131. this.adapter_.registerActionClickHandler(this.actionClickHandler_);
  18132. this.adapter_.setAriaHidden();
  18133. this.adapter_.setActionAriaHidden();
  18134. }
  18135. }, {
  18136. key: 'destroy',
  18137. value: function destroy() {
  18138. var _this2 = this;
  18139. this.adapter_.deregisterActionClickHandler(this.actionClickHandler_);
  18140. this.adapter_.deregisterCapturedBlurHandler(this.blurHandler_);
  18141. this.adapter_.deregisterVisibilityChangeHandler(this.visibilitychangeHandler_);
  18142. ['touchstart', 'mousedown', 'focus'].forEach(function (evtType) {
  18143. _this2.adapter_.deregisterCapturedInteractionHandler(evtType, _this2.interactionHandler_);
  18144. });
  18145. }
  18146. }, {
  18147. key: 'dismissesOnAction',
  18148. value: function dismissesOnAction() {
  18149. return this.dismissOnAction_;
  18150. }
  18151. }, {
  18152. key: 'setDismissOnAction',
  18153. value: function setDismissOnAction(dismissOnAction) {
  18154. this.dismissOnAction_ = !!dismissOnAction;
  18155. }
  18156. }, {
  18157. key: 'show',
  18158. value: function show(data) {
  18159. var _this3 = this;
  18160. if (!data) {
  18161. throw new Error('Please provide a data object with at least a message to display.');
  18162. }
  18163. if (!data.message) {
  18164. throw new Error('Please provide a message to be displayed.');
  18165. }
  18166. if (data.actionHandler && !data.actionText) {
  18167. throw new Error('Please provide action text with the handler.');
  18168. }
  18169. if (this.active) {
  18170. this.queue_.push(data);
  18171. return;
  18172. }
  18173. clearTimeout(this.timeoutId_);
  18174. this.snackbarData_ = data;
  18175. this.firstFocus_ = true;
  18176. this.adapter_.registerVisibilityChangeHandler(this.visibilitychangeHandler_);
  18177. this.adapter_.registerCapturedBlurHandler(this.blurHandler_);
  18178. ['touchstart', 'mousedown', 'focus'].forEach(function (evtType) {
  18179. _this3.adapter_.registerCapturedInteractionHandler(evtType, _this3.interactionHandler_);
  18180. });
  18181. var ACTIVE = __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].ACTIVE,
  18182. MULTILINE = __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].MULTILINE,
  18183. ACTION_ON_BOTTOM = __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].ACTION_ON_BOTTOM;
  18184. this.adapter_.setMessageText(this.snackbarData_.message);
  18185. if (this.snackbarData_.multiline) {
  18186. this.adapter_.addClass(MULTILINE);
  18187. if (this.snackbarData_.actionOnBottom) {
  18188. this.adapter_.addClass(ACTION_ON_BOTTOM);
  18189. }
  18190. }
  18191. if (this.snackbarData_.actionHandler) {
  18192. this.adapter_.setActionText(this.snackbarData_.actionText);
  18193. this.actionHandler_ = this.snackbarData_.actionHandler;
  18194. this.setActionHidden_(false);
  18195. } else {
  18196. this.setActionHidden_(true);
  18197. this.actionHandler_ = null;
  18198. this.adapter_.setActionText(null);
  18199. }
  18200. this.active_ = true;
  18201. this.adapter_.addClass(ACTIVE);
  18202. this.adapter_.unsetAriaHidden();
  18203. this.adapter_.notifyShow();
  18204. this.timeoutId_ = setTimeout(this.cleanup_.bind(this), this.snackbarData_.timeout || __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* numbers */].MESSAGE_TIMEOUT);
  18205. }
  18206. }, {
  18207. key: 'handlePossibleTabKeyboardFocus_',
  18208. value: function handlePossibleTabKeyboardFocus_() {
  18209. var hijackFocus = this.firstFocus_ && !this.pointerDownRecognized_;
  18210. if (hijackFocus) {
  18211. this.setFocusOnAction_();
  18212. }
  18213. this.firstFocus_ = false;
  18214. }
  18215. }, {
  18216. key: 'setFocusOnAction_',
  18217. value: function setFocusOnAction_() {
  18218. this.adapter_.setFocus();
  18219. this.snackbarHasFocus_ = true;
  18220. this.firstFocus_ = false;
  18221. }
  18222. }, {
  18223. key: 'invokeAction_',
  18224. value: function invokeAction_() {
  18225. try {
  18226. if (!this.actionHandler_) {
  18227. return;
  18228. }
  18229. this.actionHandler_();
  18230. } finally {
  18231. if (this.dismissOnAction_) {
  18232. this.cleanup_();
  18233. }
  18234. }
  18235. }
  18236. }, {
  18237. key: 'cleanup_',
  18238. value: function cleanup_() {
  18239. var _this4 = this;
  18240. var allowDismissal = !this.snackbarHasFocus_ || this.actionWasClicked_;
  18241. if (allowDismissal) {
  18242. var ACTIVE = __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].ACTIVE,
  18243. MULTILINE = __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].MULTILINE,
  18244. ACTION_ON_BOTTOM = __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].ACTION_ON_BOTTOM;
  18245. this.adapter_.removeClass(ACTIVE);
  18246. var handler = function handler() {
  18247. clearTimeout(_this4.timeoutId_);
  18248. _this4.adapter_.deregisterTransitionEndHandler(handler);
  18249. _this4.adapter_.removeClass(MULTILINE);
  18250. _this4.adapter_.removeClass(ACTION_ON_BOTTOM);
  18251. _this4.setActionHidden_(true);
  18252. _this4.adapter_.setAriaHidden();
  18253. _this4.active_ = false;
  18254. _this4.snackbarHasFocus_ = false;
  18255. _this4.adapter_.notifyHide();
  18256. _this4.showNext_();
  18257. };
  18258. this.adapter_.registerTransitionEndHandler(handler);
  18259. }
  18260. }
  18261. }, {
  18262. key: 'showNext_',
  18263. value: function showNext_() {
  18264. if (!this.queue_.length) {
  18265. return;
  18266. }
  18267. this.show(this.queue_.shift());
  18268. }
  18269. }, {
  18270. key: 'setActionHidden_',
  18271. value: function setActionHidden_(isHidden) {
  18272. if (isHidden) {
  18273. this.adapter_.setActionAriaHidden();
  18274. } else {
  18275. this.adapter_.unsetActionAriaHidden();
  18276. }
  18277. }
  18278. }]);
  18279. return MDCSnackbarFoundation;
  18280. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCFoundation"]);
  18281. /* harmony default export */ __webpack_exports__["a"] = (MDCSnackbarFoundation);
  18282. /***/ }),
  18283. /* 127 */
  18284. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18285. "use strict";
  18286. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  18287. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  18288. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  18289. /**
  18290. * @license
  18291. * Copyright 2016 Google Inc.
  18292. *
  18293. * Permission is hereby granted, free of charge, to any person obtaining a copy
  18294. * of this software and associated documentation files (the "Software"), to deal
  18295. * in the Software without restriction, including without limitation the rights
  18296. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18297. * copies of the Software, and to permit persons to whom the Software is
  18298. * furnished to do so, subject to the following conditions:
  18299. *
  18300. * The above copyright notice and this permission notice shall be included in
  18301. * all copies or substantial portions of the Software.
  18302. *
  18303. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18304. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18305. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18306. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18307. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18308. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18309. * THE SOFTWARE.
  18310. */
  18311. var cssClasses = {
  18312. ROOT: 'mdc-snackbar',
  18313. TEXT: 'mdc-snackbar__text',
  18314. ACTION_WRAPPER: 'mdc-snackbar__action-wrapper',
  18315. ACTION_BUTTON: 'mdc-snackbar__action-button',
  18316. ACTIVE: 'mdc-snackbar--active',
  18317. MULTILINE: 'mdc-snackbar--multiline',
  18318. ACTION_ON_BOTTOM: 'mdc-snackbar--action-on-bottom'
  18319. };
  18320. var strings = {
  18321. TEXT_SELECTOR: '.mdc-snackbar__text',
  18322. ACTION_WRAPPER_SELECTOR: '.mdc-snackbar__action-wrapper',
  18323. ACTION_BUTTON_SELECTOR: '.mdc-snackbar__action-button',
  18324. SHOW_EVENT: 'MDCSnackbar:show',
  18325. HIDE_EVENT: 'MDCSnackbar:hide'
  18326. };
  18327. var numbers = {
  18328. MESSAGE_TIMEOUT: 2750
  18329. };
  18330. /***/ }),
  18331. /* 128 */
  18332. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18333. "use strict";
  18334. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  18335. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSwitch", function() { return MDCSwitch; });
  18336. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  18337. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_selection_control_index__ = __webpack_require__(4);
  18338. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(129);
  18339. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_ripple_index__ = __webpack_require__(2);
  18340. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_ripple_util__ = __webpack_require__(6);
  18341. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSwitchFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  18342. 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; };
  18343. 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); } };
  18344. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  18345. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18346. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  18347. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  18348. /**
  18349. * @license
  18350. * Copyright 2018 Google Inc.
  18351. *
  18352. * Permission is hereby granted, free of charge, to any person obtaining a copy
  18353. * of this software and associated documentation files (the "Software"), to deal
  18354. * in the Software without restriction, including without limitation the rights
  18355. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18356. * copies of the Software, and to permit persons to whom the Software is
  18357. * furnished to do so, subject to the following conditions:
  18358. *
  18359. * The above copyright notice and this permission notice shall be included in
  18360. * all copies or substantial portions of the Software.
  18361. *
  18362. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18363. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18364. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18365. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18366. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18367. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18368. * THE SOFTWARE.
  18369. */
  18370. /* eslint-disable no-unused-vars */
  18371. /* eslint-enable no-unused-vars */
  18372. /**
  18373. * @extends MDCComponent<!MDCSwitchFoundation>
  18374. * @implements {MDCSelectionControl}
  18375. */
  18376. var MDCSwitch = function (_MDCComponent) {
  18377. _inherits(MDCSwitch, _MDCComponent);
  18378. _createClass(MDCSwitch, null, [{
  18379. key: 'attachTo',
  18380. value: function attachTo(root) {
  18381. return new MDCSwitch(root);
  18382. }
  18383. }]);
  18384. function MDCSwitch() {
  18385. var _ref;
  18386. _classCallCheck(this, MDCSwitch);
  18387. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  18388. args[_key] = arguments[_key];
  18389. }
  18390. /** @private {!MDCRipple} */
  18391. var _this = _possibleConstructorReturn(this, (_ref = MDCSwitch.__proto__ || Object.getPrototypeOf(MDCSwitch)).call.apply(_ref, [this].concat(args)));
  18392. _this.ripple_ = _this.initRipple_();
  18393. /** @private {!Function} */
  18394. _this.changeHandler_;
  18395. return _this;
  18396. }
  18397. _createClass(MDCSwitch, [{
  18398. key: 'destroy',
  18399. value: function destroy() {
  18400. _get(MDCSwitch.prototype.__proto__ || Object.getPrototypeOf(MDCSwitch.prototype), 'destroy', this).call(this);
  18401. this.ripple_.destroy();
  18402. this.nativeControl_.removeEventListener('change', this.changeHandler_);
  18403. }
  18404. }, {
  18405. key: 'initialSyncWithDOM',
  18406. value: function initialSyncWithDOM() {
  18407. this.changeHandler_ = this.foundation_.handleChange.bind(this.foundation_);
  18408. this.nativeControl_.addEventListener('change', this.changeHandler_);
  18409. // Sometimes the checked state of the input element is saved in the history.
  18410. // The switch styling should match the checked state of the input element.
  18411. // Do an initial sync between the native control and the foundation.
  18412. this.checked = this.checked;
  18413. }
  18414. /**
  18415. * Returns the state of the native control element, or null if the native control element is not present.
  18416. * @return {?MDCSelectionControlState}
  18417. * @private
  18418. */
  18419. }, {
  18420. key: 'initRipple_',
  18421. /**
  18422. * @return {!MDCRipple}
  18423. * @private
  18424. */
  18425. value: function initRipple_() {
  18426. var _this2 = this;
  18427. var RIPPLE_SURFACE_SELECTOR = __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.RIPPLE_SURFACE_SELECTOR;
  18428. var rippleSurface = /** @type {!Element} */this.root_.querySelector(RIPPLE_SURFACE_SELECTOR);
  18429. var MATCHES = Object(__WEBPACK_IMPORTED_MODULE_4__material_ripple_util__["getMatchesProperty"])(HTMLElement.prototype);
  18430. var adapter = _extends(__WEBPACK_IMPORTED_MODULE_3__material_ripple_index__["MDCRipple"].createAdapter(this), {
  18431. isUnbounded: function isUnbounded() {
  18432. return true;
  18433. },
  18434. isSurfaceActive: function isSurfaceActive() {
  18435. return _this2.nativeControl_[MATCHES](':active');
  18436. },
  18437. addClass: function addClass(className) {
  18438. return rippleSurface.classList.add(className);
  18439. },
  18440. removeClass: function removeClass(className) {
  18441. return rippleSurface.classList.remove(className);
  18442. },
  18443. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  18444. return _this2.nativeControl_.addEventListener(type, handler);
  18445. },
  18446. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  18447. return _this2.nativeControl_.removeEventListener(type, handler);
  18448. },
  18449. updateCssVariable: function updateCssVariable(varName, value) {
  18450. return rippleSurface.style.setProperty(varName, value);
  18451. },
  18452. computeBoundingRect: function computeBoundingRect() {
  18453. return rippleSurface.getBoundingClientRect();
  18454. }
  18455. });
  18456. var foundation = new __WEBPACK_IMPORTED_MODULE_3__material_ripple_index__["MDCRippleFoundation"](adapter);
  18457. return new __WEBPACK_IMPORTED_MODULE_3__material_ripple_index__["MDCRipple"](this.root_, foundation);
  18458. }
  18459. /** @return {!MDCSwitchFoundation} */
  18460. }, {
  18461. key: 'getDefaultFoundation',
  18462. value: function getDefaultFoundation() {
  18463. var _this3 = this;
  18464. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]({
  18465. addClass: function addClass(className) {
  18466. return _this3.root_.classList.add(className);
  18467. },
  18468. removeClass: function removeClass(className) {
  18469. return _this3.root_.classList.remove(className);
  18470. },
  18471. setNativeControlChecked: function setNativeControlChecked(checked) {
  18472. return _this3.nativeControl_.checked = checked;
  18473. },
  18474. setNativeControlDisabled: function setNativeControlDisabled(disabled) {
  18475. return _this3.nativeControl_.disabled = disabled;
  18476. }
  18477. });
  18478. }
  18479. /** @return {!MDCRipple} */
  18480. }, {
  18481. key: 'nativeControl_',
  18482. get: function get() {
  18483. var NATIVE_CONTROL_SELECTOR = __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.NATIVE_CONTROL_SELECTOR;
  18484. var el = /** @type {?MDCSelectionControlState} */this.root_.querySelector(NATIVE_CONTROL_SELECTOR);
  18485. return el;
  18486. }
  18487. }, {
  18488. key: 'ripple',
  18489. get: function get() {
  18490. return this.ripple_;
  18491. }
  18492. /** @return {boolean} */
  18493. }, {
  18494. key: 'checked',
  18495. get: function get() {
  18496. return this.nativeControl_.checked;
  18497. }
  18498. /** @param {boolean} checked */
  18499. ,
  18500. set: function set(checked) {
  18501. this.foundation_.setChecked(checked);
  18502. }
  18503. /** @return {boolean} */
  18504. }, {
  18505. key: 'disabled',
  18506. get: function get() {
  18507. return this.nativeControl_.disabled;
  18508. }
  18509. /** @param {boolean} disabled */
  18510. ,
  18511. set: function set(disabled) {
  18512. this.foundation_.setDisabled(disabled);
  18513. }
  18514. }]);
  18515. return MDCSwitch;
  18516. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  18517. /***/ }),
  18518. /* 129 */
  18519. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18520. "use strict";
  18521. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  18522. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(130);
  18523. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(131);
  18524. 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; };
  18525. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  18526. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18527. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  18528. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  18529. /**
  18530. * @license
  18531. * Copyright 2018 Google Inc.
  18532. *
  18533. * Permission is hereby granted, free of charge, to any person obtaining a copy
  18534. * of this software and associated documentation files (the "Software"), to deal
  18535. * in the Software without restriction, including without limitation the rights
  18536. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18537. * copies of the Software, and to permit persons to whom the Software is
  18538. * furnished to do so, subject to the following conditions:
  18539. *
  18540. * The above copyright notice and this permission notice shall be included in
  18541. * all copies or substantial portions of the Software.
  18542. *
  18543. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18544. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18545. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18546. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18547. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18548. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18549. * THE SOFTWARE.
  18550. */
  18551. /* eslint-enable no-unused-vars */
  18552. /**
  18553. * @extends {MDCFoundation<!MDCSwitchAdapter>}
  18554. */
  18555. var MDCSwitchFoundation = function (_MDCFoundation) {
  18556. _inherits(MDCSwitchFoundation, _MDCFoundation);
  18557. _createClass(MDCSwitchFoundation, null, [{
  18558. key: 'strings',
  18559. /** @return enum {string} */
  18560. get: function get() {
  18561. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  18562. }
  18563. /** @return enum {string} */
  18564. }, {
  18565. key: 'cssClasses',
  18566. get: function get() {
  18567. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  18568. }
  18569. /** @return {!MDCSwitchAdapter} */
  18570. }, {
  18571. key: 'defaultAdapter',
  18572. get: function get() {
  18573. return (/** @type {!MDCSwitchAdapter} */{
  18574. addClass: function addClass() /* className: string */{},
  18575. removeClass: function removeClass() /* className: string */{},
  18576. setNativeControlChecked: function setNativeControlChecked() /* checked: boolean */{},
  18577. setNativeControlDisabled: function setNativeControlDisabled() /* disabled: boolean */{}
  18578. }
  18579. );
  18580. }
  18581. }]);
  18582. function MDCSwitchFoundation(adapter) {
  18583. _classCallCheck(this, MDCSwitchFoundation);
  18584. return _possibleConstructorReturn(this, (MDCSwitchFoundation.__proto__ || Object.getPrototypeOf(MDCSwitchFoundation)).call(this, _extends(MDCSwitchFoundation.defaultAdapter, adapter)));
  18585. }
  18586. /** @param {boolean} checked */
  18587. _createClass(MDCSwitchFoundation, [{
  18588. key: 'setChecked',
  18589. value: function setChecked(checked) {
  18590. this.adapter_.setNativeControlChecked(checked);
  18591. this.updateCheckedStyling_(checked);
  18592. }
  18593. /** @param {boolean} disabled */
  18594. }, {
  18595. key: 'setDisabled',
  18596. value: function setDisabled(disabled) {
  18597. this.adapter_.setNativeControlDisabled(disabled);
  18598. if (disabled) {
  18599. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].DISABLED);
  18600. } else {
  18601. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].DISABLED);
  18602. }
  18603. }
  18604. /**
  18605. * Handles the change event for the switch native control.
  18606. * @param {!Event} evt
  18607. */
  18608. }, {
  18609. key: 'handleChange',
  18610. value: function handleChange(evt) {
  18611. this.updateCheckedStyling_(evt.target.checked);
  18612. }
  18613. /**
  18614. * Updates the styling of the switch based on its checked state.
  18615. * @param {boolean} checked
  18616. * @private
  18617. */
  18618. }, {
  18619. key: 'updateCheckedStyling_',
  18620. value: function updateCheckedStyling_(checked) {
  18621. if (checked) {
  18622. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CHECKED);
  18623. } else {
  18624. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CHECKED);
  18625. }
  18626. }
  18627. }]);
  18628. return MDCSwitchFoundation;
  18629. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  18630. /* harmony default export */ __webpack_exports__["a"] = (MDCSwitchFoundation);
  18631. /***/ }),
  18632. /* 130 */
  18633. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18634. "use strict";
  18635. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  18636. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18637. /**
  18638. * @license
  18639. * Copyright 2018 Google Inc.
  18640. *
  18641. * Permission is hereby granted, free of charge, to any person obtaining a copy
  18642. * of this software and associated documentation files (the "Software"), to deal
  18643. * in the Software without restriction, including without limitation the rights
  18644. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18645. * copies of the Software, and to permit persons to whom the Software is
  18646. * furnished to do so, subject to the following conditions:
  18647. *
  18648. * The above copyright notice and this permission notice shall be included in
  18649. * all copies or substantial portions of the Software.
  18650. *
  18651. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18652. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18653. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18654. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18655. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18656. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18657. * THE SOFTWARE.
  18658. */
  18659. /* eslint no-unused-vars: [2, {"args": "none"}] */
  18660. /**
  18661. * Adapter for MDC Switch. Provides an interface for managing
  18662. * - classes
  18663. * - dom
  18664. *
  18665. * Additionally, provides type information for the adapter to the Closure
  18666. * compiler.
  18667. *
  18668. * Implement this adapter for your framework of choice to delegate updates to
  18669. * the component in your framework of choice. See architecture documentation
  18670. * for more details.
  18671. * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md
  18672. *
  18673. * @record
  18674. */
  18675. var MDCSwitchAdapter = function () {
  18676. function MDCSwitchAdapter() {
  18677. _classCallCheck(this, MDCSwitchAdapter);
  18678. }
  18679. _createClass(MDCSwitchAdapter, [{
  18680. key: "addClass",
  18681. /** @param {string} className */
  18682. value: function addClass(className) {}
  18683. /** @param {string} className */
  18684. }, {
  18685. key: "removeClass",
  18686. value: function removeClass(className) {}
  18687. /** @param {boolean} checked */
  18688. }, {
  18689. key: "setNativeControlChecked",
  18690. value: function setNativeControlChecked(checked) {}
  18691. /** @param {boolean} disabled */
  18692. }, {
  18693. key: "setNativeControlDisabled",
  18694. value: function setNativeControlDisabled(disabled) {}
  18695. }]);
  18696. return MDCSwitchAdapter;
  18697. }();
  18698. /* unused harmony default export */ var _unused_webpack_default_export = (MDCSwitchAdapter);
  18699. /***/ }),
  18700. /* 131 */
  18701. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18702. "use strict";
  18703. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  18704. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  18705. /**
  18706. * @license
  18707. * Copyright 2018 Google Inc.
  18708. *
  18709. * Permission is hereby granted, free of charge, to any person obtaining a copy
  18710. * of this software and associated documentation files (the "Software"), to deal
  18711. * in the Software without restriction, including without limitation the rights
  18712. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18713. * copies of the Software, and to permit persons to whom the Software is
  18714. * furnished to do so, subject to the following conditions:
  18715. *
  18716. * The above copyright notice and this permission notice shall be included in
  18717. * all copies or substantial portions of the Software.
  18718. *
  18719. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18720. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18721. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18722. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18723. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18724. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18725. * THE SOFTWARE.
  18726. */
  18727. /** @enum {string} */
  18728. var cssClasses = {
  18729. CHECKED: 'mdc-switch--checked',
  18730. DISABLED: 'mdc-switch--disabled'
  18731. };
  18732. /** @enum {string} */
  18733. var strings = {
  18734. NATIVE_CONTROL_SELECTOR: '.mdc-switch__native-control',
  18735. RIPPLE_SURFACE_SELECTOR: '.mdc-switch__thumb-underlay'
  18736. };
  18737. /***/ }),
  18738. /* 132 */
  18739. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18740. "use strict";
  18741. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  18742. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  18743. /**
  18744. * @license
  18745. * Copyright 2018 Google Inc.
  18746. *
  18747. * Permission is hereby granted, free of charge, to any person obtaining a copy
  18748. * of this software and associated documentation files (the "Software"), to deal
  18749. * in the Software without restriction, including without limitation the rights
  18750. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18751. * copies of the Software, and to permit persons to whom the Software is
  18752. * furnished to do so, subject to the following conditions:
  18753. *
  18754. * The above copyright notice and this permission notice shall be included in
  18755. * all copies or substantial portions of the Software.
  18756. *
  18757. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18758. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18759. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18760. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18761. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18762. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18763. * THE SOFTWARE.
  18764. */
  18765. /** @enum {string} */
  18766. var cssClasses = {
  18767. ACTIVE: 'mdc-tab-indicator--active',
  18768. FADE: 'mdc-tab-indicator--fade',
  18769. NO_TRANSITION: 'mdc-tab-indicator--no-transition'
  18770. };
  18771. /** @enum {string} */
  18772. var strings = {
  18773. CONTENT_SELECTOR: '.mdc-tab-indicator__content'
  18774. };
  18775. /***/ }),
  18776. /* 133 */
  18777. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18778. "use strict";
  18779. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation__ = __webpack_require__(26);
  18780. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  18781. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18782. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  18783. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  18784. /**
  18785. * @license
  18786. * Copyright 2018 Google Inc.
  18787. *
  18788. * Permission is hereby granted, free of charge, to any person obtaining a copy
  18789. * of this software and associated documentation files (the "Software"), to deal
  18790. * in the Software without restriction, including without limitation the rights
  18791. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18792. * copies of the Software, and to permit persons to whom the Software is
  18793. * furnished to do so, subject to the following conditions:
  18794. *
  18795. * The above copyright notice and this permission notice shall be included in
  18796. * all copies or substantial portions of the Software.
  18797. *
  18798. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18799. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18800. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18801. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18802. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18803. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18804. * THE SOFTWARE.
  18805. */
  18806. /**
  18807. * @extends {MDCTabIndicatorFoundation}
  18808. * @final
  18809. */
  18810. var MDCSlidingTabIndicatorFoundation = function (_MDCTabIndicatorFound) {
  18811. _inherits(MDCSlidingTabIndicatorFoundation, _MDCTabIndicatorFound);
  18812. function MDCSlidingTabIndicatorFoundation() {
  18813. _classCallCheck(this, MDCSlidingTabIndicatorFoundation);
  18814. return _possibleConstructorReturn(this, (MDCSlidingTabIndicatorFoundation.__proto__ || Object.getPrototypeOf(MDCSlidingTabIndicatorFoundation)).apply(this, arguments));
  18815. }
  18816. _createClass(MDCSlidingTabIndicatorFoundation, [{
  18817. key: 'activate',
  18818. /** @param {!ClientRect=} previousIndicatorClientRect */
  18819. value: function activate(previousIndicatorClientRect) {
  18820. // Early exit if no indicator is present to handle cases where an indicator
  18821. // may be activated without a prior indicator state
  18822. if (!previousIndicatorClientRect) {
  18823. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.ACTIVE);
  18824. return;
  18825. }
  18826. // This animation uses the FLIP approach. You can read more about it at the link below:
  18827. // https://aerotwist.com/blog/flip-your-animations/
  18828. // Calculate the dimensions based on the dimensions of the previous indicator
  18829. var currentClientRect = this.computeContentClientRect();
  18830. var widthDelta = previousIndicatorClientRect.width / currentClientRect.width;
  18831. var xPosition = previousIndicatorClientRect.left - currentClientRect.left;
  18832. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.NO_TRANSITION);
  18833. this.adapter_.setContentStyleProperty('transform', 'translateX(' + xPosition + 'px) scaleX(' + widthDelta + ')');
  18834. // Force repaint before updating classes and transform to ensure the transform properly takes effect
  18835. this.computeContentClientRect();
  18836. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.NO_TRANSITION);
  18837. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.ACTIVE);
  18838. this.adapter_.setContentStyleProperty('transform', '');
  18839. }
  18840. }, {
  18841. key: 'deactivate',
  18842. value: function deactivate() {
  18843. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.ACTIVE);
  18844. }
  18845. }]);
  18846. return MDCSlidingTabIndicatorFoundation;
  18847. }(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */]);
  18848. /* harmony default export */ __webpack_exports__["a"] = (MDCSlidingTabIndicatorFoundation);
  18849. /***/ }),
  18850. /* 134 */
  18851. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18852. "use strict";
  18853. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation__ = __webpack_require__(26);
  18854. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  18855. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18856. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  18857. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  18858. /**
  18859. * @license
  18860. * Copyright 2018 Google Inc.
  18861. *
  18862. * Permission is hereby granted, free of charge, to any person obtaining a copy
  18863. * of this software and associated documentation files (the "Software"), to deal
  18864. * in the Software without restriction, including without limitation the rights
  18865. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18866. * copies of the Software, and to permit persons to whom the Software is
  18867. * furnished to do so, subject to the following conditions:
  18868. *
  18869. * The above copyright notice and this permission notice shall be included in
  18870. * all copies or substantial portions of the Software.
  18871. *
  18872. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18873. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18874. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18875. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18876. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18877. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18878. * THE SOFTWARE.
  18879. */
  18880. /**
  18881. * @extends {MDCTabIndicatorFoundation}
  18882. * @final
  18883. */
  18884. var MDCFadingTabIndicatorFoundation = function (_MDCTabIndicatorFound) {
  18885. _inherits(MDCFadingTabIndicatorFoundation, _MDCTabIndicatorFound);
  18886. function MDCFadingTabIndicatorFoundation() {
  18887. _classCallCheck(this, MDCFadingTabIndicatorFoundation);
  18888. return _possibleConstructorReturn(this, (MDCFadingTabIndicatorFoundation.__proto__ || Object.getPrototypeOf(MDCFadingTabIndicatorFoundation)).apply(this, arguments));
  18889. }
  18890. _createClass(MDCFadingTabIndicatorFoundation, [{
  18891. key: 'activate',
  18892. value: function activate() {
  18893. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.ACTIVE);
  18894. }
  18895. }, {
  18896. key: 'deactivate',
  18897. value: function deactivate() {
  18898. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */].cssClasses.ACTIVE);
  18899. }
  18900. }]);
  18901. return MDCFadingTabIndicatorFoundation;
  18902. }(__WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */]);
  18903. /* harmony default export */ __webpack_exports__["a"] = (MDCFadingTabIndicatorFoundation);
  18904. /***/ }),
  18905. /* 135 */
  18906. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  18907. "use strict";
  18908. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  18909. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(11);
  18910. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(136);
  18911. 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; };
  18912. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  18913. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18914. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  18915. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  18916. /**
  18917. * @license
  18918. * Copyright 2018 Google Inc.
  18919. *
  18920. * Permission is hereby granted, free of charge, to any person obtaining a copy
  18921. * of this software and associated documentation files (the "Software"), to deal
  18922. * in the Software without restriction, including without limitation the rights
  18923. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18924. * copies of the Software, and to permit persons to whom the Software is
  18925. * furnished to do so, subject to the following conditions:
  18926. *
  18927. * The above copyright notice and this permission notice shall be included in
  18928. * all copies or substantial portions of the Software.
  18929. *
  18930. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18931. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18932. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18933. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18934. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18935. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18936. * THE SOFTWARE.
  18937. */
  18938. /* eslint-disable no-unused-vars */
  18939. /* eslint-enable no-unused-vars */
  18940. /**
  18941. * @extends {MDCFoundation<!MDCTabAdapter>}
  18942. * @final
  18943. */
  18944. var MDCTabFoundation = function (_MDCFoundation) {
  18945. _inherits(MDCTabFoundation, _MDCFoundation);
  18946. _createClass(MDCTabFoundation, null, [{
  18947. key: 'cssClasses',
  18948. /** @return enum {string} */
  18949. get: function get() {
  18950. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  18951. }
  18952. /** @return enum {string} */
  18953. }, {
  18954. key: 'strings',
  18955. get: function get() {
  18956. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  18957. }
  18958. /**
  18959. * @see MDCTabAdapter for typing information
  18960. * @return {!MDCTabAdapter}
  18961. */
  18962. }, {
  18963. key: 'defaultAdapter',
  18964. get: function get() {
  18965. return (/** @type {!MDCTabAdapter} */{
  18966. addClass: function addClass() {},
  18967. removeClass: function removeClass() {},
  18968. hasClass: function hasClass() {},
  18969. setAttr: function setAttr() {},
  18970. activateIndicator: function activateIndicator() {},
  18971. deactivateIndicator: function deactivateIndicator() {},
  18972. notifyInteracted: function notifyInteracted() {},
  18973. getOffsetLeft: function getOffsetLeft() {},
  18974. getOffsetWidth: function getOffsetWidth() {},
  18975. getContentOffsetLeft: function getContentOffsetLeft() {},
  18976. getContentOffsetWidth: function getContentOffsetWidth() {},
  18977. focus: function focus() {}
  18978. }
  18979. );
  18980. }
  18981. /** @param {!MDCTabAdapter} adapter */
  18982. }]);
  18983. function MDCTabFoundation(adapter) {
  18984. _classCallCheck(this, MDCTabFoundation);
  18985. /** @private {boolean} */
  18986. var _this = _possibleConstructorReturn(this, (MDCTabFoundation.__proto__ || Object.getPrototypeOf(MDCTabFoundation)).call(this, _extends(MDCTabFoundation.defaultAdapter, adapter)));
  18987. _this.focusOnActivate_ = true;
  18988. return _this;
  18989. }
  18990. /**
  18991. * Handles the "click" event
  18992. */
  18993. _createClass(MDCTabFoundation, [{
  18994. key: 'handleClick',
  18995. value: function handleClick() {
  18996. // It's up to the parent component to keep track of the active Tab and
  18997. // ensure we don't activate a Tab that's already active.
  18998. this.adapter_.notifyInteracted();
  18999. }
  19000. /**
  19001. * Returns the Tab's active state
  19002. * @return {boolean}
  19003. */
  19004. }, {
  19005. key: 'isActive',
  19006. value: function isActive() {
  19007. return this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ACTIVE);
  19008. }
  19009. /**
  19010. * Sets whether the tab should focus itself when activated
  19011. * @param {boolean} focusOnActivate
  19012. */
  19013. }, {
  19014. key: 'setFocusOnActivate',
  19015. value: function setFocusOnActivate(focusOnActivate) {
  19016. this.focusOnActivate_ = focusOnActivate;
  19017. }
  19018. /**
  19019. * Activates the Tab
  19020. * @param {!ClientRect=} previousIndicatorClientRect
  19021. */
  19022. }, {
  19023. key: 'activate',
  19024. value: function activate(previousIndicatorClientRect) {
  19025. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ACTIVE);
  19026. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_SELECTED, 'true');
  19027. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].TABINDEX, '0');
  19028. this.adapter_.activateIndicator(previousIndicatorClientRect);
  19029. if (this.focusOnActivate_) {
  19030. this.adapter_.focus();
  19031. }
  19032. }
  19033. /**
  19034. * Deactivates the Tab
  19035. */
  19036. }, {
  19037. key: 'deactivate',
  19038. value: function deactivate() {
  19039. // Early exit
  19040. if (!this.isActive()) {
  19041. return;
  19042. }
  19043. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ACTIVE);
  19044. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_SELECTED, 'false');
  19045. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].TABINDEX, '-1');
  19046. this.adapter_.deactivateIndicator();
  19047. }
  19048. /**
  19049. * Returns the dimensions of the Tab
  19050. * @return {!MDCTabDimensions}
  19051. */
  19052. }, {
  19053. key: 'computeDimensions',
  19054. value: function computeDimensions() {
  19055. var rootWidth = this.adapter_.getOffsetWidth();
  19056. var rootLeft = this.adapter_.getOffsetLeft();
  19057. var contentWidth = this.adapter_.getContentOffsetWidth();
  19058. var contentLeft = this.adapter_.getContentOffsetLeft();
  19059. return {
  19060. rootLeft: rootLeft,
  19061. rootRight: rootLeft + rootWidth,
  19062. contentLeft: rootLeft + contentLeft,
  19063. contentRight: rootLeft + contentLeft + contentWidth
  19064. };
  19065. }
  19066. }]);
  19067. return MDCTabFoundation;
  19068. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  19069. /* harmony default export */ __webpack_exports__["a"] = (MDCTabFoundation);
  19070. /***/ }),
  19071. /* 136 */
  19072. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19073. "use strict";
  19074. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  19075. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  19076. /**
  19077. * @license
  19078. * Copyright 2018 Google Inc.
  19079. *
  19080. * Permission is hereby granted, free of charge, to any person obtaining a copy
  19081. * of this software and associated documentation files (the "Software"), to deal
  19082. * in the Software without restriction, including without limitation the rights
  19083. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  19084. * copies of the Software, and to permit persons to whom the Software is
  19085. * furnished to do so, subject to the following conditions:
  19086. *
  19087. * The above copyright notice and this permission notice shall be included in
  19088. * all copies or substantial portions of the Software.
  19089. *
  19090. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19091. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19092. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19093. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19094. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19095. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19096. * THE SOFTWARE.
  19097. */
  19098. /** @enum {string} */
  19099. var cssClasses = {
  19100. ACTIVE: 'mdc-tab--active'
  19101. };
  19102. /** @enum {string} */
  19103. var strings = {
  19104. ARIA_SELECTED: 'aria-selected',
  19105. RIPPLE_SELECTOR: '.mdc-tab__ripple',
  19106. CONTENT_SELECTOR: '.mdc-tab__content',
  19107. TAB_INDICATOR_SELECTOR: '.mdc-tab-indicator',
  19108. TABINDEX: 'tabIndex',
  19109. INTERACTED_EVENT: 'MDCTab:interacted'
  19110. };
  19111. /***/ }),
  19112. /* 137 */
  19113. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19114. "use strict";
  19115. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  19116. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTabBar", function() { return MDCTabBar; });
  19117. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  19118. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_tab_index__ = __webpack_require__(25);
  19119. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_tab_scroller_index__ = __webpack_require__(56);
  19120. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__adapter__ = __webpack_require__(58);
  19121. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation__ = __webpack_require__(143);
  19122. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTabBarFoundation", function() { return __WEBPACK_IMPORTED_MODULE_4__foundation__["a"]; });
  19123. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  19124. 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); } };
  19125. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19126. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  19127. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  19128. /**
  19129. * @license
  19130. * Copyright 2018 Google Inc.
  19131. *
  19132. * Permission is hereby granted, free of charge, to any person obtaining a copy
  19133. * of this software and associated documentation files (the "Software"), to deal
  19134. * in the Software without restriction, including without limitation the rights
  19135. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  19136. * copies of the Software, and to permit persons to whom the Software is
  19137. * furnished to do so, subject to the following conditions:
  19138. *
  19139. * The above copyright notice and this permission notice shall be included in
  19140. * all copies or substantial portions of the Software.
  19141. *
  19142. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19143. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19144. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19145. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19146. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19147. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19148. * THE SOFTWARE.
  19149. */
  19150. /**
  19151. * @extends {MDCComponent<!MDCTabBarFoundation>}
  19152. * @final
  19153. */
  19154. var MDCTabBar = function (_MDCComponent) {
  19155. _inherits(MDCTabBar, _MDCComponent);
  19156. /**
  19157. * @param {...?} args
  19158. */
  19159. function MDCTabBar() {
  19160. var _ref;
  19161. _classCallCheck(this, MDCTabBar);
  19162. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  19163. args[_key] = arguments[_key];
  19164. }
  19165. /** @private {!Array<!MDCTab>} */
  19166. var _this = _possibleConstructorReturn(this, (_ref = MDCTabBar.__proto__ || Object.getPrototypeOf(MDCTabBar)).call.apply(_ref, [this].concat(args)));
  19167. _this.tabList_;
  19168. /** @type {(function(!Element): !MDCTab)} */
  19169. _this.tabFactory_;
  19170. /** @private {?MDCTabScroller} */
  19171. _this.tabScroller_;
  19172. /** @type {(function(!Element): !MDCTabScroller)} */
  19173. _this.tabScrollerFactory_;
  19174. /** @private {?function(?Event): undefined} */
  19175. _this.handleTabInteraction_;
  19176. /** @private {?function(?Event): undefined} */
  19177. _this.handleKeyDown_;
  19178. return _this;
  19179. }
  19180. /**
  19181. * @param {!Element} root
  19182. * @return {!MDCTabBar}
  19183. */
  19184. _createClass(MDCTabBar, [{
  19185. key: 'initialize',
  19186. /**
  19187. * @param {(function(!Element): !MDCTab)=} tabFactory A function which creates a new MDCTab
  19188. * @param {(function(!Element): !MDCTabScroller)=} tabScrollerFactory A function which creates a new MDCTabScroller
  19189. */
  19190. value: function initialize() {
  19191. var _this2 = this;
  19192. var tabFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el) {
  19193. return new __WEBPACK_IMPORTED_MODULE_1__material_tab_index__["MDCTab"](el);
  19194. };
  19195. var tabScrollerFactory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (el) {
  19196. return new __WEBPACK_IMPORTED_MODULE_2__material_tab_scroller_index__["MDCTabScroller"](el);
  19197. };
  19198. this.tabFactory_ = tabFactory;
  19199. this.tabScrollerFactory_ = tabScrollerFactory;
  19200. this.tabList_ = this.getTabElements_().map(function (el) {
  19201. return _this2.tabFactory_(el);
  19202. });
  19203. var tabScrollerElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */].strings.TAB_SCROLLER_SELECTOR);
  19204. if (tabScrollerElement) {
  19205. this.tabScroller_ = this.tabScrollerFactory_(tabScrollerElement);
  19206. }
  19207. }
  19208. }, {
  19209. key: 'initialSyncWithDOM',
  19210. value: function initialSyncWithDOM() {
  19211. var _this3 = this;
  19212. this.handleTabInteraction_ = function (evt) {
  19213. return _this3.foundation_.handleTabInteraction(evt);
  19214. };
  19215. this.handleKeyDown_ = function (evt) {
  19216. return _this3.foundation_.handleKeyDown(evt);
  19217. };
  19218. this.root_.addEventListener(__WEBPACK_IMPORTED_MODULE_1__material_tab_index__["MDCTabFoundation"].strings.INTERACTED_EVENT, this.handleTabInteraction_);
  19219. this.root_.addEventListener('keydown', this.handleKeyDown_);
  19220. for (var i = 0; i < this.tabList_.length; i++) {
  19221. if (this.tabList_[i].active) {
  19222. this.scrollIntoView(i);
  19223. break;
  19224. }
  19225. }
  19226. }
  19227. }, {
  19228. key: 'destroy',
  19229. value: function destroy() {
  19230. _get(MDCTabBar.prototype.__proto__ || Object.getPrototypeOf(MDCTabBar.prototype), 'destroy', this).call(this);
  19231. this.root_.removeEventListener(__WEBPACK_IMPORTED_MODULE_1__material_tab_index__["MDCTabFoundation"].strings.INTERACTED_EVENT, this.handleTabInteraction_);
  19232. this.root_.removeEventListener('keydown', this.handleKeyDown_);
  19233. this.tabList_.forEach(function (tab) {
  19234. return tab.destroy();
  19235. });
  19236. this.tabScroller_.destroy();
  19237. }
  19238. /**
  19239. * @return {!MDCTabBarFoundation}
  19240. */
  19241. }, {
  19242. key: 'getDefaultFoundation',
  19243. value: function getDefaultFoundation() {
  19244. var _this4 = this;
  19245. return new __WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */](
  19246. /** @type {!MDCTabBarAdapter} */{
  19247. scrollTo: function scrollTo(scrollX) {
  19248. return _this4.tabScroller_.scrollTo(scrollX);
  19249. },
  19250. incrementScroll: function incrementScroll(scrollXIncrement) {
  19251. return _this4.tabScroller_.incrementScroll(scrollXIncrement);
  19252. },
  19253. getScrollPosition: function getScrollPosition() {
  19254. return _this4.tabScroller_.getScrollPosition();
  19255. },
  19256. getScrollContentWidth: function getScrollContentWidth() {
  19257. return _this4.tabScroller_.getScrollContentWidth();
  19258. },
  19259. getOffsetWidth: function getOffsetWidth() {
  19260. return _this4.root_.offsetWidth;
  19261. },
  19262. isRTL: function isRTL() {
  19263. return window.getComputedStyle(_this4.root_).getPropertyValue('direction') === 'rtl';
  19264. },
  19265. setActiveTab: function setActiveTab(index) {
  19266. return _this4.foundation_.activateTab(index);
  19267. },
  19268. activateTabAtIndex: function activateTabAtIndex(index, clientRect) {
  19269. return _this4.tabList_[index].activate(clientRect);
  19270. },
  19271. deactivateTabAtIndex: function deactivateTabAtIndex(index) {
  19272. return _this4.tabList_[index].deactivate();
  19273. },
  19274. focusTabAtIndex: function focusTabAtIndex(index) {
  19275. return _this4.tabList_[index].focus();
  19276. },
  19277. getTabIndicatorClientRectAtIndex: function getTabIndicatorClientRectAtIndex(index) {
  19278. return _this4.tabList_[index].computeIndicatorClientRect();
  19279. },
  19280. getTabDimensionsAtIndex: function getTabDimensionsAtIndex(index) {
  19281. return _this4.tabList_[index].computeDimensions();
  19282. },
  19283. getPreviousActiveTabIndex: function getPreviousActiveTabIndex() {
  19284. for (var i = 0; i < _this4.tabList_.length; i++) {
  19285. if (_this4.tabList_[i].active) {
  19286. return i;
  19287. }
  19288. }
  19289. return -1;
  19290. },
  19291. getFocusedTabIndex: function getFocusedTabIndex() {
  19292. var tabElements = _this4.getTabElements_();
  19293. var activeElement = document.activeElement;
  19294. return tabElements.indexOf(activeElement);
  19295. },
  19296. getIndexOfTab: function getIndexOfTab(tabToFind) {
  19297. return _this4.tabList_.indexOf(tabToFind);
  19298. },
  19299. getTabListLength: function getTabListLength() {
  19300. return _this4.tabList_.length;
  19301. },
  19302. notifyTabActivated: function notifyTabActivated(index) {
  19303. return _this4.emit(__WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */].strings.TAB_ACTIVATED_EVENT, { index: index }, true);
  19304. }
  19305. });
  19306. }
  19307. /**
  19308. * Activates the tab at the given index
  19309. * @param {number} index The index of the tab
  19310. */
  19311. }, {
  19312. key: 'activateTab',
  19313. value: function activateTab(index) {
  19314. this.foundation_.activateTab(index);
  19315. }
  19316. /**
  19317. * Scrolls the tab at the given index into view
  19318. * @param {number} index THe index of the tab
  19319. */
  19320. }, {
  19321. key: 'scrollIntoView',
  19322. value: function scrollIntoView(index) {
  19323. this.foundation_.scrollIntoView(index);
  19324. }
  19325. }, {
  19326. key: 'getTabElements_',
  19327. value: function getTabElements_() {
  19328. return [].slice.call(this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_4__foundation__["a" /* default */].strings.TAB_SELECTOR));
  19329. }
  19330. }, {
  19331. key: 'focusOnActivate',
  19332. set: function set(focusOnActivate) {
  19333. this.tabList_.forEach(function (tab) {
  19334. return tab.focusOnActivate = focusOnActivate;
  19335. });
  19336. }
  19337. }, {
  19338. key: 'useAutomaticActivation',
  19339. set: function set(useAutomaticActivation) {
  19340. this.foundation_.setUseAutomaticActivation(useAutomaticActivation);
  19341. }
  19342. }], [{
  19343. key: 'attachTo',
  19344. value: function attachTo(root) {
  19345. return new MDCTabBar(root);
  19346. }
  19347. }]);
  19348. return MDCTabBar;
  19349. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  19350. /***/ }),
  19351. /* 138 */
  19352. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19353. "use strict";
  19354. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  19355. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(57);
  19356. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__adapter__ = __webpack_require__(5);
  19357. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__rtl_scroller__ = __webpack_require__(12);
  19358. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__rtl_default_scroller__ = __webpack_require__(139);
  19359. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__rtl_negative_scroller__ = __webpack_require__(140);
  19360. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__rtl_reverse_scroller__ = __webpack_require__(141);
  19361. 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; };
  19362. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  19363. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19364. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  19365. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  19366. /**
  19367. * @license
  19368. * Copyright 2018 Google Inc.
  19369. *
  19370. * Permission is hereby granted, free of charge, to any person obtaining a copy
  19371. * of this software and associated documentation files (the "Software"), to deal
  19372. * in the Software without restriction, including without limitation the rights
  19373. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  19374. * copies of the Software, and to permit persons to whom the Software is
  19375. * furnished to do so, subject to the following conditions:
  19376. *
  19377. * The above copyright notice and this permission notice shall be included in
  19378. * all copies or substantial portions of the Software.
  19379. *
  19380. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19381. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19382. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19383. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19384. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19385. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19386. * THE SOFTWARE.
  19387. */
  19388. /* eslint-disable no-unused-vars */
  19389. /* eslint-enable no-unused-vars */
  19390. /**
  19391. * @extends {MDCFoundation<!MDCTabScrollerAdapter>}
  19392. * @final
  19393. */
  19394. var MDCTabScrollerFoundation = function (_MDCFoundation) {
  19395. _inherits(MDCTabScrollerFoundation, _MDCFoundation);
  19396. _createClass(MDCTabScrollerFoundation, null, [{
  19397. key: 'cssClasses',
  19398. /** @return enum {string} */
  19399. get: function get() {
  19400. return __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */];
  19401. }
  19402. /** @return enum {string} */
  19403. }, {
  19404. key: 'strings',
  19405. get: function get() {
  19406. return __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */];
  19407. }
  19408. /**
  19409. * @see MDCTabScrollerAdapter for typing information
  19410. * @return {!MDCTabScrollerAdapter}
  19411. */
  19412. }, {
  19413. key: 'defaultAdapter',
  19414. get: function get() {
  19415. return (/** @type {!MDCTabScrollerAdapter} */{
  19416. eventTargetMatchesSelector: function eventTargetMatchesSelector() {},
  19417. addClass: function addClass() {},
  19418. removeClass: function removeClass() {},
  19419. addScrollAreaClass: function addScrollAreaClass() {},
  19420. setScrollAreaStyleProperty: function setScrollAreaStyleProperty() {},
  19421. setScrollContentStyleProperty: function setScrollContentStyleProperty() {},
  19422. getScrollContentStyleValue: function getScrollContentStyleValue() {},
  19423. setScrollAreaScrollLeft: function setScrollAreaScrollLeft() {},
  19424. getScrollAreaScrollLeft: function getScrollAreaScrollLeft() {},
  19425. getScrollContentOffsetWidth: function getScrollContentOffsetWidth() {},
  19426. getScrollAreaOffsetWidth: function getScrollAreaOffsetWidth() {},
  19427. computeScrollAreaClientRect: function computeScrollAreaClientRect() {},
  19428. computeScrollContentClientRect: function computeScrollContentClientRect() {},
  19429. computeHorizontalScrollbarHeight: function computeHorizontalScrollbarHeight() {}
  19430. }
  19431. );
  19432. }
  19433. /** @param {!MDCTabScrollerAdapter} adapter */
  19434. }]);
  19435. function MDCTabScrollerFoundation(adapter) {
  19436. _classCallCheck(this, MDCTabScrollerFoundation);
  19437. /**
  19438. * This boolean controls whether we should handle the transitionend and interaction events during the animation.
  19439. * @private {boolean}
  19440. */
  19441. var _this = _possibleConstructorReturn(this, (MDCTabScrollerFoundation.__proto__ || Object.getPrototypeOf(MDCTabScrollerFoundation)).call(this, _extends(MDCTabScrollerFoundation.defaultAdapter, adapter)));
  19442. _this.isAnimating_ = false;
  19443. /**
  19444. * The MDCTabScrollerRTL instance varies per browser and allows us to encapsulate the peculiar browser behavior
  19445. * of RTL scrolling in it's own class.
  19446. * @private {?MDCTabScrollerRTL}
  19447. */
  19448. _this.rtlScrollerInstance_;
  19449. return _this;
  19450. }
  19451. _createClass(MDCTabScrollerFoundation, [{
  19452. key: 'init',
  19453. value: function init() {
  19454. // Compute horizontal scrollbar height on scroller with overflow initially hidden, then update overflow to scroll
  19455. // and immediately adjust bottom margin to avoid the scrollbar initially appearing before JS runs.
  19456. var horizontalScrollbarHeight = this.adapter_.computeHorizontalScrollbarHeight();
  19457. this.adapter_.setScrollAreaStyleProperty('margin-bottom', -horizontalScrollbarHeight + 'px');
  19458. this.adapter_.addScrollAreaClass(MDCTabScrollerFoundation.cssClasses.SCROLL_AREA_SCROLL);
  19459. }
  19460. /**
  19461. * Computes the current visual scroll position
  19462. * @return {number}
  19463. */
  19464. }, {
  19465. key: 'getScrollPosition',
  19466. value: function getScrollPosition() {
  19467. if (this.isRTL_()) {
  19468. return this.computeCurrentScrollPositionRTL_();
  19469. }
  19470. var currentTranslateX = this.calculateCurrentTranslateX_();
  19471. var scrollLeft = this.adapter_.getScrollAreaScrollLeft();
  19472. return scrollLeft - currentTranslateX;
  19473. }
  19474. /**
  19475. * Handles interaction events that occur during transition
  19476. */
  19477. }, {
  19478. key: 'handleInteraction',
  19479. value: function handleInteraction() {
  19480. // Early exit if we aren't animating
  19481. if (!this.isAnimating_) {
  19482. return;
  19483. }
  19484. // Prevent other event listeners from handling this event
  19485. this.stopScrollAnimation_();
  19486. }
  19487. /**
  19488. * Handles the transitionend event
  19489. * @param {!Event} evt
  19490. */
  19491. }, {
  19492. key: 'handleTransitionEnd',
  19493. value: function handleTransitionEnd(evt) {
  19494. // Early exit if we aren't animating or the event was triggered by a different element.
  19495. if (!this.isAnimating_ || !this.adapter_.eventTargetMatchesSelector(evt.target, MDCTabScrollerFoundation.strings.CONTENT_SELECTOR)) {
  19496. return;
  19497. }
  19498. this.isAnimating_ = false;
  19499. this.adapter_.removeClass(MDCTabScrollerFoundation.cssClasses.ANIMATING);
  19500. }
  19501. /**
  19502. * Increment the scroll value by the scrollXIncrement
  19503. * @param {number} scrollXIncrement The value by which to increment the scroll position
  19504. */
  19505. }, {
  19506. key: 'incrementScroll',
  19507. value: function incrementScroll(scrollXIncrement) {
  19508. // Early exit for non-operational increment values
  19509. if (scrollXIncrement === 0) {
  19510. return;
  19511. }
  19512. if (this.isRTL_()) {
  19513. return this.incrementScrollRTL_(scrollXIncrement);
  19514. }
  19515. this.incrementScroll_(scrollXIncrement);
  19516. }
  19517. /**
  19518. * Scrolls to the given scrollX value
  19519. * @param {number} scrollX
  19520. */
  19521. }, {
  19522. key: 'scrollTo',
  19523. value: function scrollTo(scrollX) {
  19524. if (this.isRTL_()) {
  19525. return this.scrollToRTL_(scrollX);
  19526. }
  19527. this.scrollTo_(scrollX);
  19528. }
  19529. /**
  19530. * Returns the appropriate version of the MDCTabScrollerRTL
  19531. * @return {!MDCTabScrollerRTL}
  19532. */
  19533. }, {
  19534. key: 'getRTLScroller',
  19535. value: function getRTLScroller() {
  19536. if (!this.rtlScrollerInstance_) {
  19537. this.rtlScrollerInstance_ = this.rtlScrollerFactory_();
  19538. }
  19539. return this.rtlScrollerInstance_;
  19540. }
  19541. /**
  19542. * Returns the translateX value from a CSS matrix transform function string
  19543. * @return {number}
  19544. * @private
  19545. */
  19546. }, {
  19547. key: 'calculateCurrentTranslateX_',
  19548. value: function calculateCurrentTranslateX_() {
  19549. var transformValue = this.adapter_.getScrollContentStyleValue('transform');
  19550. // Early exit if no transform is present
  19551. if (transformValue === 'none') {
  19552. return 0;
  19553. }
  19554. // The transform value comes back as a matrix transformation in the form
  19555. // of `matrix(a, b, c, d, tx, ty)`. We only care about tx (translateX) so
  19556. // we're going to grab all the parenthesized values, strip out tx, and
  19557. // parse it.
  19558. var results = /\((.+)\)/.exec(transformValue)[1];
  19559. var parts = results.split(',');
  19560. return parseFloat(parts[4]);
  19561. }
  19562. /**
  19563. * Calculates a safe scroll value that is > 0 and < the max scroll value
  19564. * @param {number} scrollX The distance to scroll
  19565. * @return {number}
  19566. * @private
  19567. */
  19568. }, {
  19569. key: 'clampScrollValue_',
  19570. value: function clampScrollValue_(scrollX) {
  19571. var edges = this.calculateScrollEdges_();
  19572. return Math.min(Math.max(edges.left, scrollX), edges.right);
  19573. }
  19574. /**
  19575. * @return {number}
  19576. * @private
  19577. */
  19578. }, {
  19579. key: 'computeCurrentScrollPositionRTL_',
  19580. value: function computeCurrentScrollPositionRTL_() {
  19581. var translateX = this.calculateCurrentTranslateX_();
  19582. return this.getRTLScroller().getScrollPositionRTL(translateX);
  19583. }
  19584. /**
  19585. * @return {!MDCTabScrollerHorizontalEdges}
  19586. * @private
  19587. */
  19588. }, {
  19589. key: 'calculateScrollEdges_',
  19590. value: function calculateScrollEdges_() {
  19591. var contentWidth = this.adapter_.getScrollContentOffsetWidth();
  19592. var rootWidth = this.adapter_.getScrollAreaOffsetWidth();
  19593. return (/** @type {!MDCTabScrollerHorizontalEdges} */{
  19594. left: 0,
  19595. right: contentWidth - rootWidth
  19596. }
  19597. );
  19598. }
  19599. /**
  19600. * Internal scroll method
  19601. * @param {number} scrollX The new scroll position
  19602. * @private
  19603. */
  19604. }, {
  19605. key: 'scrollTo_',
  19606. value: function scrollTo_(scrollX) {
  19607. var currentScrollX = this.getScrollPosition();
  19608. var safeScrollX = this.clampScrollValue_(scrollX);
  19609. var scrollDelta = safeScrollX - currentScrollX;
  19610. this.animate_( /** @type {!MDCTabScrollerAnimation} */{
  19611. finalScrollPosition: safeScrollX,
  19612. scrollDelta: scrollDelta
  19613. });
  19614. }
  19615. /**
  19616. * Internal RTL scroll method
  19617. * @param {number} scrollX The new scroll position
  19618. * @private
  19619. */
  19620. }, {
  19621. key: 'scrollToRTL_',
  19622. value: function scrollToRTL_(scrollX) {
  19623. var animation = this.getRTLScroller().scrollToRTL(scrollX);
  19624. this.animate_(animation);
  19625. }
  19626. /**
  19627. * Internal increment scroll method
  19628. * @param {number} scrollX The new scroll position increment
  19629. * @private
  19630. */
  19631. }, {
  19632. key: 'incrementScroll_',
  19633. value: function incrementScroll_(scrollX) {
  19634. var currentScrollX = this.getScrollPosition();
  19635. var targetScrollX = scrollX + currentScrollX;
  19636. var safeScrollX = this.clampScrollValue_(targetScrollX);
  19637. var scrollDelta = safeScrollX - currentScrollX;
  19638. this.animate_( /** @type {!MDCTabScrollerAnimation} */{
  19639. finalScrollPosition: safeScrollX,
  19640. scrollDelta: scrollDelta
  19641. });
  19642. }
  19643. /**
  19644. * Internal incremenet scroll RTL method
  19645. * @param {number} scrollX The new scroll position RTL increment
  19646. * @private
  19647. */
  19648. }, {
  19649. key: 'incrementScrollRTL_',
  19650. value: function incrementScrollRTL_(scrollX) {
  19651. var animation = this.getRTLScroller().incrementScrollRTL(scrollX);
  19652. this.animate_(animation);
  19653. }
  19654. /**
  19655. * Animates the tab scrolling
  19656. * @param {!MDCTabScrollerAnimation} animation The animation to apply
  19657. * @private
  19658. */
  19659. }, {
  19660. key: 'animate_',
  19661. value: function animate_(animation) {
  19662. var _this2 = this;
  19663. // Early exit if translateX is 0, which means there's no animation to perform
  19664. if (animation.scrollDelta === 0) {
  19665. return;
  19666. }
  19667. this.stopScrollAnimation_();
  19668. // This animation uses the FLIP approach.
  19669. // Read more here: https://aerotwist.com/blog/flip-your-animations/
  19670. this.adapter_.setScrollAreaScrollLeft(animation.finalScrollPosition);
  19671. this.adapter_.setScrollContentStyleProperty('transform', 'translateX(' + animation.scrollDelta + 'px)');
  19672. // Force repaint
  19673. this.adapter_.computeScrollAreaClientRect();
  19674. requestAnimationFrame(function () {
  19675. _this2.adapter_.addClass(MDCTabScrollerFoundation.cssClasses.ANIMATING);
  19676. _this2.adapter_.setScrollContentStyleProperty('transform', 'none');
  19677. });
  19678. this.isAnimating_ = true;
  19679. }
  19680. /**
  19681. * Stops scroll animation
  19682. * @private
  19683. */
  19684. }, {
  19685. key: 'stopScrollAnimation_',
  19686. value: function stopScrollAnimation_() {
  19687. this.isAnimating_ = false;
  19688. var currentScrollPosition = this.getAnimatingScrollPosition_();
  19689. this.adapter_.removeClass(MDCTabScrollerFoundation.cssClasses.ANIMATING);
  19690. this.adapter_.setScrollContentStyleProperty('transform', 'translateX(0px)');
  19691. this.adapter_.setScrollAreaScrollLeft(currentScrollPosition);
  19692. }
  19693. /**
  19694. * Gets the current scroll position during animation
  19695. * @return {number}
  19696. * @private
  19697. */
  19698. }, {
  19699. key: 'getAnimatingScrollPosition_',
  19700. value: function getAnimatingScrollPosition_() {
  19701. var currentTranslateX = this.calculateCurrentTranslateX_();
  19702. var scrollLeft = this.adapter_.getScrollAreaScrollLeft();
  19703. if (this.isRTL_()) {
  19704. return this.getRTLScroller().getAnimatingScrollPosition(scrollLeft, currentTranslateX);
  19705. }
  19706. return scrollLeft - currentTranslateX;
  19707. }
  19708. /**
  19709. * Determines the RTL Scroller to use
  19710. * @return {!MDCTabScrollerRTL}
  19711. * @private
  19712. */
  19713. }, {
  19714. key: 'rtlScrollerFactory_',
  19715. value: function rtlScrollerFactory_() {
  19716. // Browsers have three different implementations of scrollLeft in RTL mode,
  19717. // dependent on the browser. The behavior is based off the max LTR
  19718. // scrollleft value and 0.
  19719. //
  19720. // * Default scrolling in RTL *
  19721. // - Left-most value: 0
  19722. // - Right-most value: Max LTR scrollLeft value
  19723. //
  19724. // * Negative scrolling in RTL *
  19725. // - Left-most value: Negated max LTR scrollLeft value
  19726. // - Right-most value: 0
  19727. //
  19728. // * Reverse scrolling in RTL *
  19729. // - Left-most value: Max LTR scrollLeft value
  19730. // - Right-most value: 0
  19731. //
  19732. // We use those principles below to determine which RTL scrollLeft
  19733. // behavior is implemented in the current browser.
  19734. var initialScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  19735. this.adapter_.setScrollAreaScrollLeft(initialScrollLeft - 1);
  19736. var newScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  19737. // If the newScrollLeft value is negative,then we know that the browser has
  19738. // implemented negative RTL scrolling, since all other implementations have
  19739. // only positive values.
  19740. if (newScrollLeft < 0) {
  19741. // Undo the scrollLeft test check
  19742. this.adapter_.setScrollAreaScrollLeft(initialScrollLeft);
  19743. return new __WEBPACK_IMPORTED_MODULE_5__rtl_negative_scroller__["a" /* default */](this.adapter_);
  19744. }
  19745. var rootClientRect = this.adapter_.computeScrollAreaClientRect();
  19746. var contentClientRect = this.adapter_.computeScrollContentClientRect();
  19747. var rightEdgeDelta = Math.round(contentClientRect.right - rootClientRect.right);
  19748. // Undo the scrollLeft test check
  19749. this.adapter_.setScrollAreaScrollLeft(initialScrollLeft);
  19750. // By calculating the clientRect of the root element and the clientRect of
  19751. // the content element, we can determine how much the scroll value changed
  19752. // when we performed the scrollLeft subtraction above.
  19753. if (rightEdgeDelta === newScrollLeft) {
  19754. return new __WEBPACK_IMPORTED_MODULE_6__rtl_reverse_scroller__["a" /* default */](this.adapter_);
  19755. }
  19756. return new __WEBPACK_IMPORTED_MODULE_4__rtl_default_scroller__["a" /* default */](this.adapter_);
  19757. }
  19758. /**
  19759. * @return {boolean}
  19760. * @private
  19761. */
  19762. }, {
  19763. key: 'isRTL_',
  19764. value: function isRTL_() {
  19765. return this.adapter_.getScrollContentStyleValue('direction') === 'rtl';
  19766. }
  19767. }]);
  19768. return MDCTabScrollerFoundation;
  19769. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  19770. /* harmony default export */ __webpack_exports__["a"] = (MDCTabScrollerFoundation);
  19771. /***/ }),
  19772. /* 139 */
  19773. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19774. "use strict";
  19775. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__rtl_scroller__ = __webpack_require__(12);
  19776. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(5);
  19777. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  19778. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19779. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  19780. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  19781. /**
  19782. * @license
  19783. * Copyright 2018 Google Inc.
  19784. *
  19785. * Permission is hereby granted, free of charge, to any person obtaining a copy
  19786. * of this software and associated documentation files (the "Software"), to deal
  19787. * in the Software without restriction, including without limitation the rights
  19788. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  19789. * copies of the Software, and to permit persons to whom the Software is
  19790. * furnished to do so, subject to the following conditions:
  19791. *
  19792. * The above copyright notice and this permission notice shall be included in
  19793. * all copies or substantial portions of the Software.
  19794. *
  19795. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19796. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19797. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19798. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19799. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19800. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19801. * THE SOFTWARE.
  19802. */
  19803. /* eslint-disable no-unused-vars */
  19804. /* eslint-enable no-unused-vars */
  19805. /**
  19806. * @extends {MDCTabScrollerRTL}
  19807. * @final
  19808. */
  19809. var MDCTabScrollerRTLDefault = function (_MDCTabScrollerRTL) {
  19810. _inherits(MDCTabScrollerRTLDefault, _MDCTabScrollerRTL);
  19811. function MDCTabScrollerRTLDefault() {
  19812. _classCallCheck(this, MDCTabScrollerRTLDefault);
  19813. return _possibleConstructorReturn(this, (MDCTabScrollerRTLDefault.__proto__ || Object.getPrototypeOf(MDCTabScrollerRTLDefault)).apply(this, arguments));
  19814. }
  19815. _createClass(MDCTabScrollerRTLDefault, [{
  19816. key: 'getScrollPositionRTL',
  19817. /**
  19818. * @return {number}
  19819. */
  19820. value: function getScrollPositionRTL() {
  19821. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  19822. var _calculateScrollEdges = this.calculateScrollEdges_(),
  19823. right = _calculateScrollEdges.right;
  19824. // Scroll values on most browsers are ints instead of floats so we round
  19825. return Math.round(right - currentScrollLeft);
  19826. }
  19827. /**
  19828. * @param {number} scrollX
  19829. * @return {!MDCTabScrollerAnimation}
  19830. */
  19831. }, {
  19832. key: 'scrollToRTL',
  19833. value: function scrollToRTL(scrollX) {
  19834. var edges = this.calculateScrollEdges_();
  19835. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  19836. var clampedScrollLeft = this.clampScrollValue_(edges.right - scrollX);
  19837. return (/** @type {!MDCTabScrollerAnimation} */{
  19838. finalScrollPosition: clampedScrollLeft,
  19839. scrollDelta: clampedScrollLeft - currentScrollLeft
  19840. }
  19841. );
  19842. }
  19843. /**
  19844. * @param {number} scrollX
  19845. * @return {!MDCTabScrollerAnimation}
  19846. */
  19847. }, {
  19848. key: 'incrementScrollRTL',
  19849. value: function incrementScrollRTL(scrollX) {
  19850. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  19851. var clampedScrollLeft = this.clampScrollValue_(currentScrollLeft - scrollX);
  19852. return (/** @type {!MDCTabScrollerAnimation} */{
  19853. finalScrollPosition: clampedScrollLeft,
  19854. scrollDelta: clampedScrollLeft - currentScrollLeft
  19855. }
  19856. );
  19857. }
  19858. /**
  19859. * @param {number} scrollX
  19860. * @return {number}
  19861. */
  19862. }, {
  19863. key: 'getAnimatingScrollPosition',
  19864. value: function getAnimatingScrollPosition(scrollX) {
  19865. return scrollX;
  19866. }
  19867. /**
  19868. * @return {!MDCTabScrollerHorizontalEdges}
  19869. * @private
  19870. */
  19871. }, {
  19872. key: 'calculateScrollEdges_',
  19873. value: function calculateScrollEdges_() {
  19874. var contentWidth = this.adapter_.getScrollContentOffsetWidth();
  19875. var rootWidth = this.adapter_.getScrollAreaOffsetWidth();
  19876. return (/** @type {!MDCTabScrollerHorizontalEdges} */{
  19877. left: 0,
  19878. right: contentWidth - rootWidth
  19879. }
  19880. );
  19881. }
  19882. /**
  19883. * @param {number} scrollX
  19884. * @return {number}
  19885. * @private
  19886. */
  19887. }, {
  19888. key: 'clampScrollValue_',
  19889. value: function clampScrollValue_(scrollX) {
  19890. var edges = this.calculateScrollEdges_();
  19891. return Math.min(Math.max(edges.left, scrollX), edges.right);
  19892. }
  19893. }]);
  19894. return MDCTabScrollerRTLDefault;
  19895. }(__WEBPACK_IMPORTED_MODULE_0__rtl_scroller__["a" /* default */]);
  19896. /* harmony default export */ __webpack_exports__["a"] = (MDCTabScrollerRTLDefault);
  19897. /***/ }),
  19898. /* 140 */
  19899. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19900. "use strict";
  19901. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__rtl_scroller__ = __webpack_require__(12);
  19902. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(5);
  19903. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  19904. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19905. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  19906. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  19907. /**
  19908. * @license
  19909. * Copyright 2018 Google Inc.
  19910. *
  19911. * Permission is hereby granted, free of charge, to any person obtaining a copy
  19912. * of this software and associated documentation files (the "Software"), to deal
  19913. * in the Software without restriction, including without limitation the rights
  19914. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  19915. * copies of the Software, and to permit persons to whom the Software is
  19916. * furnished to do so, subject to the following conditions:
  19917. *
  19918. * The above copyright notice and this permission notice shall be included in
  19919. * all copies or substantial portions of the Software.
  19920. *
  19921. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19922. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19923. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19924. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19925. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19926. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19927. * THE SOFTWARE.
  19928. */
  19929. /* eslint-disable no-unused-vars */
  19930. /* eslint-enable no-unused-vars */
  19931. /**
  19932. * @extends {MDCTabScrollerRTL}
  19933. * @final
  19934. */
  19935. var MDCTabScrollerRTLNegative = function (_MDCTabScrollerRTL) {
  19936. _inherits(MDCTabScrollerRTLNegative, _MDCTabScrollerRTL);
  19937. function MDCTabScrollerRTLNegative() {
  19938. _classCallCheck(this, MDCTabScrollerRTLNegative);
  19939. return _possibleConstructorReturn(this, (MDCTabScrollerRTLNegative.__proto__ || Object.getPrototypeOf(MDCTabScrollerRTLNegative)).apply(this, arguments));
  19940. }
  19941. _createClass(MDCTabScrollerRTLNegative, [{
  19942. key: 'getScrollPositionRTL',
  19943. /**
  19944. * @param {number} translateX The current translateX position
  19945. * @return {number}
  19946. */
  19947. value: function getScrollPositionRTL(translateX) {
  19948. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  19949. return Math.round(translateX - currentScrollLeft);
  19950. }
  19951. /**
  19952. * @param {number} scrollX
  19953. * @return {!MDCTabScrollerAnimation}
  19954. */
  19955. }, {
  19956. key: 'scrollToRTL',
  19957. value: function scrollToRTL(scrollX) {
  19958. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  19959. var clampedScrollLeft = this.clampScrollValue_(-scrollX);
  19960. return (/** @type {!MDCTabScrollerAnimation} */{
  19961. finalScrollPosition: clampedScrollLeft,
  19962. scrollDelta: clampedScrollLeft - currentScrollLeft
  19963. }
  19964. );
  19965. }
  19966. /**
  19967. * @param {number} scrollX
  19968. * @return {!MDCTabScrollerAnimation}
  19969. */
  19970. }, {
  19971. key: 'incrementScrollRTL',
  19972. value: function incrementScrollRTL(scrollX) {
  19973. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  19974. var clampedScrollLeft = this.clampScrollValue_(currentScrollLeft - scrollX);
  19975. return (/** @type {!MDCTabScrollerAnimation} */{
  19976. finalScrollPosition: clampedScrollLeft,
  19977. scrollDelta: clampedScrollLeft - currentScrollLeft
  19978. }
  19979. );
  19980. }
  19981. /**
  19982. * @param {number} scrollX
  19983. * @param {number} translateX
  19984. * @return {number}
  19985. */
  19986. }, {
  19987. key: 'getAnimatingScrollPosition',
  19988. value: function getAnimatingScrollPosition(scrollX, translateX) {
  19989. return scrollX - translateX;
  19990. }
  19991. /**
  19992. * @return {!MDCTabScrollerHorizontalEdges}
  19993. * @private
  19994. */
  19995. }, {
  19996. key: 'calculateScrollEdges_',
  19997. value: function calculateScrollEdges_() {
  19998. var contentWidth = this.adapter_.getScrollContentOffsetWidth();
  19999. var rootWidth = this.adapter_.getScrollAreaOffsetWidth();
  20000. return (/** @type {!MDCTabScrollerHorizontalEdges} */{
  20001. left: rootWidth - contentWidth,
  20002. right: 0
  20003. }
  20004. );
  20005. }
  20006. /**
  20007. * @param {number} scrollX
  20008. * @return {number}
  20009. * @private
  20010. */
  20011. }, {
  20012. key: 'clampScrollValue_',
  20013. value: function clampScrollValue_(scrollX) {
  20014. var edges = this.calculateScrollEdges_();
  20015. return Math.max(Math.min(edges.right, scrollX), edges.left);
  20016. }
  20017. }]);
  20018. return MDCTabScrollerRTLNegative;
  20019. }(__WEBPACK_IMPORTED_MODULE_0__rtl_scroller__["a" /* default */]);
  20020. /* harmony default export */ __webpack_exports__["a"] = (MDCTabScrollerRTLNegative);
  20021. /***/ }),
  20022. /* 141 */
  20023. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20024. "use strict";
  20025. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__rtl_scroller__ = __webpack_require__(12);
  20026. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(5);
  20027. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  20028. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20029. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  20030. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  20031. /**
  20032. * @license
  20033. * Copyright 2018 Google Inc.
  20034. *
  20035. * Permission is hereby granted, free of charge, to any person obtaining a copy
  20036. * of this software and associated documentation files (the "Software"), to deal
  20037. * in the Software without restriction, including without limitation the rights
  20038. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  20039. * copies of the Software, and to permit persons to whom the Software is
  20040. * furnished to do so, subject to the following conditions:
  20041. *
  20042. * The above copyright notice and this permission notice shall be included in
  20043. * all copies or substantial portions of the Software.
  20044. *
  20045. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20046. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20047. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  20048. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20049. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20050. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20051. * THE SOFTWARE.
  20052. */
  20053. /* eslint-disable no-unused-vars */
  20054. /* eslint-enable no-unused-vars */
  20055. /**
  20056. * @extends {MDCTabScrollerRTL}
  20057. * @final
  20058. */
  20059. var MDCTabScrollerRTLReverse = function (_MDCTabScrollerRTL) {
  20060. _inherits(MDCTabScrollerRTLReverse, _MDCTabScrollerRTL);
  20061. function MDCTabScrollerRTLReverse() {
  20062. _classCallCheck(this, MDCTabScrollerRTLReverse);
  20063. return _possibleConstructorReturn(this, (MDCTabScrollerRTLReverse.__proto__ || Object.getPrototypeOf(MDCTabScrollerRTLReverse)).apply(this, arguments));
  20064. }
  20065. _createClass(MDCTabScrollerRTLReverse, [{
  20066. key: 'getScrollPositionRTL',
  20067. /**
  20068. * @param {number} translateX
  20069. * @return {number}
  20070. */
  20071. value: function getScrollPositionRTL(translateX) {
  20072. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  20073. // Scroll values on most browsers are ints instead of floats so we round
  20074. return Math.round(currentScrollLeft - translateX);
  20075. }
  20076. /**
  20077. * @param {number} scrollX
  20078. * @return {!MDCTabScrollerAnimation}
  20079. */
  20080. }, {
  20081. key: 'scrollToRTL',
  20082. value: function scrollToRTL(scrollX) {
  20083. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  20084. var clampedScrollLeft = this.clampScrollValue_(scrollX);
  20085. return (/** @type {!MDCTabScrollerAnimation} */{
  20086. finalScrollPosition: clampedScrollLeft,
  20087. scrollDelta: currentScrollLeft - clampedScrollLeft
  20088. }
  20089. );
  20090. }
  20091. /**
  20092. * @param {number} scrollX
  20093. * @return {!MDCTabScrollerAnimation}
  20094. */
  20095. }, {
  20096. key: 'incrementScrollRTL',
  20097. value: function incrementScrollRTL(scrollX) {
  20098. var currentScrollLeft = this.adapter_.getScrollAreaScrollLeft();
  20099. var clampedScrollLeft = this.clampScrollValue_(currentScrollLeft + scrollX);
  20100. return (/** @type {!MDCTabScrollerAnimation} */{
  20101. finalScrollPosition: clampedScrollLeft,
  20102. scrollDelta: currentScrollLeft - clampedScrollLeft
  20103. }
  20104. );
  20105. }
  20106. /**
  20107. * @param {number} scrollX
  20108. * @return {number}
  20109. */
  20110. }, {
  20111. key: 'getAnimatingScrollPosition',
  20112. value: function getAnimatingScrollPosition(scrollX, translateX) {
  20113. return scrollX + translateX;
  20114. }
  20115. /**
  20116. * @return {!MDCTabScrollerHorizontalEdges}
  20117. * @private
  20118. */
  20119. }, {
  20120. key: 'calculateScrollEdges_',
  20121. value: function calculateScrollEdges_() {
  20122. var contentWidth = this.adapter_.getScrollContentOffsetWidth();
  20123. var rootWidth = this.adapter_.getScrollAreaOffsetWidth();
  20124. return (/** @type {!MDCTabScrollerHorizontalEdges} */{
  20125. left: contentWidth - rootWidth,
  20126. right: 0
  20127. }
  20128. );
  20129. }
  20130. /**
  20131. * @param {number} scrollX
  20132. * @return {number}
  20133. * @private
  20134. */
  20135. }, {
  20136. key: 'clampScrollValue_',
  20137. value: function clampScrollValue_(scrollX) {
  20138. var edges = this.calculateScrollEdges_();
  20139. return Math.min(Math.max(edges.right, scrollX), edges.left);
  20140. }
  20141. }]);
  20142. return MDCTabScrollerRTLReverse;
  20143. }(__WEBPACK_IMPORTED_MODULE_0__rtl_scroller__["a" /* default */]);
  20144. /* harmony default export */ __webpack_exports__["a"] = (MDCTabScrollerRTLReverse);
  20145. /***/ }),
  20146. /* 142 */
  20147. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20148. "use strict";
  20149. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  20150. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "computeHorizontalScrollbarHeight", function() { return computeHorizontalScrollbarHeight; });
  20151. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMatchesProperty", function() { return getMatchesProperty; });
  20152. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__constants__ = __webpack_require__(57);
  20153. /**
  20154. * @license
  20155. * Copyright 2018 Google Inc.
  20156. *
  20157. * Permission is hereby granted, free of charge, to any person obtaining a copy
  20158. * of this software and associated documentation files (the "Software"), to deal
  20159. * in the Software without restriction, including without limitation the rights
  20160. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  20161. * copies of the Software, and to permit persons to whom the Software is
  20162. * furnished to do so, subject to the following conditions:
  20163. *
  20164. * The above copyright notice and this permission notice shall be included in
  20165. * all copies or substantial portions of the Software.
  20166. *
  20167. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20168. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20169. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  20170. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20171. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20172. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20173. * THE SOFTWARE.
  20174. */
  20175. /**
  20176. * Stores result from computeHorizontalScrollbarHeight to avoid redundant processing.
  20177. * @private {number|undefined}
  20178. */
  20179. var horizontalScrollbarHeight_ = void 0;
  20180. /**
  20181. * Computes the height of browser-rendered horizontal scrollbars using a self-created test element.
  20182. * May return 0 (e.g. on OS X browsers under default configuration).
  20183. * @param {!Document} documentObj
  20184. * @param {boolean=} shouldCacheResult
  20185. * @return {number}
  20186. */
  20187. function computeHorizontalScrollbarHeight(documentObj) {
  20188. var shouldCacheResult = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  20189. if (shouldCacheResult && typeof horizontalScrollbarHeight_ !== 'undefined') {
  20190. return horizontalScrollbarHeight_;
  20191. }
  20192. var el = documentObj.createElement('div');
  20193. el.classList.add(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].SCROLL_TEST);
  20194. documentObj.body.appendChild(el);
  20195. var horizontalScrollbarHeight = el.offsetHeight - el.clientHeight;
  20196. documentObj.body.removeChild(el);
  20197. if (shouldCacheResult) {
  20198. horizontalScrollbarHeight_ = horizontalScrollbarHeight;
  20199. }
  20200. return horizontalScrollbarHeight;
  20201. }
  20202. /**
  20203. * @param {!Object} HTMLElementPrototype
  20204. * @return {!Array<string>}
  20205. */
  20206. function getMatchesProperty(HTMLElementPrototype) {
  20207. return ['msMatchesSelector', 'matches'].filter(function (p) {
  20208. return p in HTMLElementPrototype;
  20209. }).pop();
  20210. }
  20211. /***/ }),
  20212. /* 143 */
  20213. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20214. "use strict";
  20215. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  20216. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(144);
  20217. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__adapter__ = __webpack_require__(58);
  20218. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_tab_adapter__ = __webpack_require__(11);
  20219. 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; };
  20220. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  20221. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20222. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  20223. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  20224. /**
  20225. * @license
  20226. * Copyright 2018 Google Inc.
  20227. *
  20228. * Permission is hereby granted, free of charge, to any person obtaining a copy
  20229. * of this software and associated documentation files (the "Software"), to deal
  20230. * in the Software without restriction, including without limitation the rights
  20231. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  20232. * copies of the Software, and to permit persons to whom the Software is
  20233. * furnished to do so, subject to the following conditions:
  20234. *
  20235. * The above copyright notice and this permission notice shall be included in
  20236. * all copies or substantial portions of the Software.
  20237. *
  20238. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20239. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20240. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  20241. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20242. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20243. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20244. * THE SOFTWARE.
  20245. */
  20246. /* eslint-disable no-unused-vars */
  20247. /* eslint-enable no-unused-vars */
  20248. /**
  20249. * @type {Set<string>}
  20250. */
  20251. var ACCEPTABLE_KEYS = new Set();
  20252. // IE11 has no support for new Set with iterable so we need to initialize this by hand
  20253. ACCEPTABLE_KEYS.add(__WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ARROW_LEFT_KEY);
  20254. ACCEPTABLE_KEYS.add(__WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ARROW_RIGHT_KEY);
  20255. ACCEPTABLE_KEYS.add(__WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].END_KEY);
  20256. ACCEPTABLE_KEYS.add(__WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].HOME_KEY);
  20257. ACCEPTABLE_KEYS.add(__WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ENTER_KEY);
  20258. ACCEPTABLE_KEYS.add(__WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].SPACE_KEY);
  20259. /**
  20260. * @type {Map<number, string>}
  20261. */
  20262. var KEYCODE_MAP = new Map();
  20263. // IE11 has no support for new Map with iterable so we need to initialize this by hand
  20264. KEYCODE_MAP.set(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].ARROW_LEFT_KEYCODE, __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ARROW_LEFT_KEY);
  20265. KEYCODE_MAP.set(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].ARROW_RIGHT_KEYCODE, __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ARROW_RIGHT_KEY);
  20266. KEYCODE_MAP.set(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].END_KEYCODE, __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].END_KEY);
  20267. KEYCODE_MAP.set(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].HOME_KEYCODE, __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].HOME_KEY);
  20268. KEYCODE_MAP.set(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].ENTER_KEYCODE, __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ENTER_KEY);
  20269. KEYCODE_MAP.set(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].SPACE_KEYCODE, __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].SPACE_KEY);
  20270. /**
  20271. * @extends {MDCFoundation<!MDCTabBarAdapter>}
  20272. * @final
  20273. */
  20274. var MDCTabBarFoundation = function (_MDCFoundation) {
  20275. _inherits(MDCTabBarFoundation, _MDCFoundation);
  20276. _createClass(MDCTabBarFoundation, null, [{
  20277. key: 'strings',
  20278. /** @return enum {string} */
  20279. get: function get() {
  20280. return __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */];
  20281. }
  20282. /** @return enum {number} */
  20283. }, {
  20284. key: 'numbers',
  20285. get: function get() {
  20286. return __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */];
  20287. }
  20288. /**
  20289. * @see MDCTabBarAdapter for typing information
  20290. * @return {!MDCTabBarAdapter}
  20291. */
  20292. }, {
  20293. key: 'defaultAdapter',
  20294. get: function get() {
  20295. return (/** @type {!MDCTabBarAdapter} */{
  20296. scrollTo: function scrollTo() {},
  20297. incrementScroll: function incrementScroll() {},
  20298. getScrollPosition: function getScrollPosition() {},
  20299. getScrollContentWidth: function getScrollContentWidth() {},
  20300. getOffsetWidth: function getOffsetWidth() {},
  20301. isRTL: function isRTL() {},
  20302. setActiveTab: function setActiveTab() {},
  20303. activateTabAtIndex: function activateTabAtIndex() {},
  20304. deactivateTabAtIndex: function deactivateTabAtIndex() {},
  20305. focusTabAtIndex: function focusTabAtIndex() {},
  20306. getTabIndicatorClientRectAtIndex: function getTabIndicatorClientRectAtIndex() {},
  20307. getTabDimensionsAtIndex: function getTabDimensionsAtIndex() {},
  20308. getPreviousActiveTabIndex: function getPreviousActiveTabIndex() {},
  20309. getFocusedTabIndex: function getFocusedTabIndex() {},
  20310. getIndexOfTab: function getIndexOfTab() {},
  20311. getTabListLength: function getTabListLength() {},
  20312. notifyTabActivated: function notifyTabActivated() {}
  20313. }
  20314. );
  20315. }
  20316. /**
  20317. * @param {!MDCTabBarAdapter} adapter
  20318. * */
  20319. }]);
  20320. function MDCTabBarFoundation(adapter) {
  20321. _classCallCheck(this, MDCTabBarFoundation);
  20322. /** @private {boolean} */
  20323. var _this = _possibleConstructorReturn(this, (MDCTabBarFoundation.__proto__ || Object.getPrototypeOf(MDCTabBarFoundation)).call(this, _extends(MDCTabBarFoundation.defaultAdapter, adapter)));
  20324. _this.useAutomaticActivation_ = false;
  20325. return _this;
  20326. }
  20327. /**
  20328. * Switches between automatic and manual activation modes.
  20329. * See https://www.w3.org/TR/wai-aria-practices/#tabpanel for examples.
  20330. * @param {boolean} useAutomaticActivation
  20331. */
  20332. _createClass(MDCTabBarFoundation, [{
  20333. key: 'setUseAutomaticActivation',
  20334. value: function setUseAutomaticActivation(useAutomaticActivation) {
  20335. this.useAutomaticActivation_ = useAutomaticActivation;
  20336. }
  20337. /**
  20338. * Activates the tab at the given index
  20339. * @param {number} index
  20340. */
  20341. }, {
  20342. key: 'activateTab',
  20343. value: function activateTab(index) {
  20344. var previousActiveIndex = this.adapter_.getPreviousActiveTabIndex();
  20345. if (!this.indexIsInRange_(index) || index === previousActiveIndex) {
  20346. return;
  20347. }
  20348. this.adapter_.deactivateTabAtIndex(previousActiveIndex);
  20349. this.adapter_.activateTabAtIndex(index, this.adapter_.getTabIndicatorClientRectAtIndex(previousActiveIndex));
  20350. this.scrollIntoView(index);
  20351. this.adapter_.notifyTabActivated(index);
  20352. }
  20353. /**
  20354. * Handles the keydown event
  20355. * @param {!Event} evt
  20356. */
  20357. }, {
  20358. key: 'handleKeyDown',
  20359. value: function handleKeyDown(evt) {
  20360. // Get the key from the event
  20361. var key = this.getKeyFromEvent_(evt);
  20362. // Early exit if the event key isn't one of the keyboard navigation keys
  20363. if (key === undefined) {
  20364. return;
  20365. }
  20366. // Prevent default behavior for movement keys, but not for activation keys, since :active is used to apply ripple
  20367. if (!this.isActivationKey_(key)) {
  20368. evt.preventDefault();
  20369. }
  20370. if (this.useAutomaticActivation_) {
  20371. if (this.isActivationKey_(key)) {
  20372. return;
  20373. }
  20374. var index = this.determineTargetFromKey_(this.adapter_.getPreviousActiveTabIndex(), key);
  20375. this.adapter_.setActiveTab(index);
  20376. this.scrollIntoView(index);
  20377. } else {
  20378. var focusedTabIndex = this.adapter_.getFocusedTabIndex();
  20379. if (this.isActivationKey_(key)) {
  20380. this.adapter_.setActiveTab(focusedTabIndex);
  20381. } else {
  20382. var _index = this.determineTargetFromKey_(focusedTabIndex, key);
  20383. this.adapter_.focusTabAtIndex(_index);
  20384. this.scrollIntoView(_index);
  20385. }
  20386. }
  20387. }
  20388. /**
  20389. * Handles the MDCTab:interacted event
  20390. * @param {!Event} evt
  20391. */
  20392. }, {
  20393. key: 'handleTabInteraction',
  20394. value: function handleTabInteraction(evt) {
  20395. this.adapter_.setActiveTab(this.adapter_.getIndexOfTab(evt.detail.tab));
  20396. }
  20397. /**
  20398. * Scrolls the tab at the given index into view
  20399. * @param {number} index The tab index to make visible
  20400. */
  20401. }, {
  20402. key: 'scrollIntoView',
  20403. value: function scrollIntoView(index) {
  20404. // Early exit if the index is out of range
  20405. if (!this.indexIsInRange_(index)) {
  20406. return;
  20407. }
  20408. // Always scroll to 0 if scrolling to the 0th index
  20409. if (index === 0) {
  20410. return this.adapter_.scrollTo(0);
  20411. }
  20412. // Always scroll to the max value if scrolling to the Nth index
  20413. // MDCTabScroller.scrollTo() will never scroll past the max possible value
  20414. if (index === this.adapter_.getTabListLength() - 1) {
  20415. return this.adapter_.scrollTo(this.adapter_.getScrollContentWidth());
  20416. }
  20417. if (this.isRTL_()) {
  20418. return this.scrollIntoViewRTL_(index);
  20419. }
  20420. this.scrollIntoView_(index);
  20421. }
  20422. /**
  20423. * Private method for determining the index of the destination tab based on what key was pressed
  20424. * @param {number} origin The original index from which to determine the destination
  20425. * @param {string} key The name of the key
  20426. * @return {number}
  20427. * @private
  20428. */
  20429. }, {
  20430. key: 'determineTargetFromKey_',
  20431. value: function determineTargetFromKey_(origin, key) {
  20432. var isRTL = this.isRTL_();
  20433. var maxIndex = this.adapter_.getTabListLength() - 1;
  20434. var shouldGoToEnd = key === __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].END_KEY;
  20435. 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;
  20436. 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;
  20437. var index = origin;
  20438. if (shouldGoToEnd) {
  20439. index = maxIndex;
  20440. } else if (shouldDecrement) {
  20441. index -= 1;
  20442. } else if (shouldIncrement) {
  20443. index += 1;
  20444. } else {
  20445. index = 0;
  20446. }
  20447. if (index < 0) {
  20448. index = maxIndex;
  20449. } else if (index > maxIndex) {
  20450. index = 0;
  20451. }
  20452. return index;
  20453. }
  20454. /**
  20455. * Calculates the scroll increment that will make the tab at the given index visible
  20456. * @param {number} index The index of the tab
  20457. * @param {number} nextIndex The index of the next tab
  20458. * @param {number} scrollPosition The current scroll position
  20459. * @param {number} barWidth The width of the Tab Bar
  20460. * @return {number}
  20461. * @private
  20462. */
  20463. }, {
  20464. key: 'calculateScrollIncrement_',
  20465. value: function calculateScrollIncrement_(index, nextIndex, scrollPosition, barWidth) {
  20466. var nextTabDimensions = this.adapter_.getTabDimensionsAtIndex(nextIndex);
  20467. var relativeContentLeft = nextTabDimensions.contentLeft - scrollPosition - barWidth;
  20468. var relativeContentRight = nextTabDimensions.contentRight - scrollPosition;
  20469. var leftIncrement = relativeContentRight - __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].EXTRA_SCROLL_AMOUNT;
  20470. var rightIncrement = relativeContentLeft + __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].EXTRA_SCROLL_AMOUNT;
  20471. if (nextIndex < index) {
  20472. return Math.min(leftIncrement, 0);
  20473. }
  20474. return Math.max(rightIncrement, 0);
  20475. }
  20476. /**
  20477. * Calculates the scroll increment that will make the tab at the given index visible in RTL
  20478. * @param {number} index The index of the tab
  20479. * @param {number} nextIndex The index of the next tab
  20480. * @param {number} scrollPosition The current scroll position
  20481. * @param {number} barWidth The width of the Tab Bar
  20482. * @param {number} scrollContentWidth The width of the scroll content
  20483. * @return {number}
  20484. * @private
  20485. */
  20486. }, {
  20487. key: 'calculateScrollIncrementRTL_',
  20488. value: function calculateScrollIncrementRTL_(index, nextIndex, scrollPosition, barWidth, scrollContentWidth) {
  20489. var nextTabDimensions = this.adapter_.getTabDimensionsAtIndex(nextIndex);
  20490. var relativeContentLeft = scrollContentWidth - nextTabDimensions.contentLeft - scrollPosition;
  20491. var relativeContentRight = scrollContentWidth - nextTabDimensions.contentRight - scrollPosition - barWidth;
  20492. var leftIncrement = relativeContentRight + __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].EXTRA_SCROLL_AMOUNT;
  20493. var rightIncrement = relativeContentLeft - __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* numbers */].EXTRA_SCROLL_AMOUNT;
  20494. if (nextIndex > index) {
  20495. return Math.max(leftIncrement, 0);
  20496. }
  20497. return Math.min(rightIncrement, 0);
  20498. }
  20499. /**
  20500. * Determines the index of the adjacent tab closest to either edge of the Tab Bar
  20501. * @param {number} index The index of the tab
  20502. * @param {!MDCTabDimensions} tabDimensions The dimensions of the tab
  20503. * @param {number} scrollPosition The current scroll position
  20504. * @param {number} barWidth The width of the tab bar
  20505. * @return {number}
  20506. * @private
  20507. */
  20508. }, {
  20509. key: 'findAdjacentTabIndexClosestToEdge_',
  20510. value: function findAdjacentTabIndexClosestToEdge_(index, tabDimensions, scrollPosition, barWidth) {
  20511. /**
  20512. * Tabs are laid out in the Tab Scroller like this:
  20513. *
  20514. * Scroll Position
  20515. * +---+
  20516. * | | Bar Width
  20517. * | +-----------------------------------+
  20518. * | | |
  20519. * | V V
  20520. * | +-----------------------------------+
  20521. * V | Tab Scroller |
  20522. * +------------+--------------+-------------------+
  20523. * | Tab | Tab | Tab |
  20524. * +------------+--------------+-------------------+
  20525. * | |
  20526. * +-----------------------------------+
  20527. *
  20528. * To determine the next adjacent index, we look at the Tab root left and
  20529. * Tab root right, both relative to the scroll position. If the Tab root
  20530. * left is less than 0, then we know it's out of view to the left. If the
  20531. * Tab root right minus the bar width is greater than 0, we know the Tab is
  20532. * out of view to the right. From there, we either increment or decrement
  20533. * the index.
  20534. */
  20535. var relativeRootLeft = tabDimensions.rootLeft - scrollPosition;
  20536. var relativeRootRight = tabDimensions.rootRight - scrollPosition - barWidth;
  20537. var relativeRootDelta = relativeRootLeft + relativeRootRight;
  20538. var leftEdgeIsCloser = relativeRootLeft < 0 || relativeRootDelta < 0;
  20539. var rightEdgeIsCloser = relativeRootRight > 0 || relativeRootDelta > 0;
  20540. if (leftEdgeIsCloser) {
  20541. return index - 1;
  20542. }
  20543. if (rightEdgeIsCloser) {
  20544. return index + 1;
  20545. }
  20546. return -1;
  20547. }
  20548. /**
  20549. * Determines the index of the adjacent tab closest to either edge of the Tab Bar in RTL
  20550. * @param {number} index The index of the tab
  20551. * @param {!MDCTabDimensions} tabDimensions The dimensions of the tab
  20552. * @param {number} scrollPosition The current scroll position
  20553. * @param {number} barWidth The width of the tab bar
  20554. * @param {number} scrollContentWidth The width of the scroller content
  20555. * @return {number}
  20556. * @private
  20557. */
  20558. }, {
  20559. key: 'findAdjacentTabIndexClosestToEdgeRTL_',
  20560. value: function findAdjacentTabIndexClosestToEdgeRTL_(index, tabDimensions, scrollPosition, barWidth, scrollContentWidth) {
  20561. var rootLeft = scrollContentWidth - tabDimensions.rootLeft - barWidth - scrollPosition;
  20562. var rootRight = scrollContentWidth - tabDimensions.rootRight - scrollPosition;
  20563. var rootDelta = rootLeft + rootRight;
  20564. var leftEdgeIsCloser = rootLeft > 0 || rootDelta > 0;
  20565. var rightEdgeIsCloser = rootRight < 0 || rootDelta < 0;
  20566. if (leftEdgeIsCloser) {
  20567. return index + 1;
  20568. }
  20569. if (rightEdgeIsCloser) {
  20570. return index - 1;
  20571. }
  20572. return -1;
  20573. }
  20574. /**
  20575. * Returns the key associated with a keydown event
  20576. * @param {!Event} evt The keydown event
  20577. * @return {string}
  20578. * @private
  20579. */
  20580. }, {
  20581. key: 'getKeyFromEvent_',
  20582. value: function getKeyFromEvent_(evt) {
  20583. if (ACCEPTABLE_KEYS.has(evt.key)) {
  20584. return evt.key;
  20585. }
  20586. return KEYCODE_MAP.get(evt.keyCode);
  20587. }
  20588. }, {
  20589. key: 'isActivationKey_',
  20590. value: function isActivationKey_(key) {
  20591. return key === __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].SPACE_KEY || key === __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */].ENTER_KEY;
  20592. }
  20593. /**
  20594. * Returns whether a given index is inclusively between the ends
  20595. * @param {number} index The index to test
  20596. * @private
  20597. */
  20598. }, {
  20599. key: 'indexIsInRange_',
  20600. value: function indexIsInRange_(index) {
  20601. return index >= 0 && index < this.adapter_.getTabListLength();
  20602. }
  20603. /**
  20604. * Returns the view's RTL property
  20605. * @return {boolean}
  20606. * @private
  20607. */
  20608. }, {
  20609. key: 'isRTL_',
  20610. value: function isRTL_() {
  20611. return this.adapter_.isRTL();
  20612. }
  20613. /**
  20614. * Scrolls the tab at the given index into view for left-to-right useragents
  20615. * @param {number} index The index of the tab to scroll into view
  20616. * @private
  20617. */
  20618. }, {
  20619. key: 'scrollIntoView_',
  20620. value: function scrollIntoView_(index) {
  20621. var scrollPosition = this.adapter_.getScrollPosition();
  20622. var barWidth = this.adapter_.getOffsetWidth();
  20623. var tabDimensions = this.adapter_.getTabDimensionsAtIndex(index);
  20624. var nextIndex = this.findAdjacentTabIndexClosestToEdge_(index, tabDimensions, scrollPosition, barWidth);
  20625. if (!this.indexIsInRange_(nextIndex)) {
  20626. return;
  20627. }
  20628. var scrollIncrement = this.calculateScrollIncrement_(index, nextIndex, scrollPosition, barWidth);
  20629. this.adapter_.incrementScroll(scrollIncrement);
  20630. }
  20631. /**
  20632. * Scrolls the tab at the given index into view in RTL
  20633. * @param {number} index The tab index to make visible
  20634. * @private
  20635. */
  20636. }, {
  20637. key: 'scrollIntoViewRTL_',
  20638. value: function scrollIntoViewRTL_(index) {
  20639. var scrollPosition = this.adapter_.getScrollPosition();
  20640. var barWidth = this.adapter_.getOffsetWidth();
  20641. var tabDimensions = this.adapter_.getTabDimensionsAtIndex(index);
  20642. var scrollWidth = this.adapter_.getScrollContentWidth();
  20643. var nextIndex = this.findAdjacentTabIndexClosestToEdgeRTL_(index, tabDimensions, scrollPosition, barWidth, scrollWidth);
  20644. if (!this.indexIsInRange_(nextIndex)) {
  20645. return;
  20646. }
  20647. var scrollIncrement = this.calculateScrollIncrementRTL_(index, nextIndex, scrollPosition, barWidth, scrollWidth);
  20648. this.adapter_.incrementScroll(scrollIncrement);
  20649. }
  20650. }]);
  20651. return MDCTabBarFoundation;
  20652. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  20653. /* harmony default export */ __webpack_exports__["a"] = (MDCTabBarFoundation);
  20654. /***/ }),
  20655. /* 144 */
  20656. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20657. "use strict";
  20658. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return numbers; });
  20659. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  20660. /**
  20661. * @license
  20662. * Copyright 2018 Google Inc.
  20663. *
  20664. * Permission is hereby granted, free of charge, to any person obtaining a copy
  20665. * of this software and associated documentation files (the "Software"), to deal
  20666. * in the Software without restriction, including without limitation the rights
  20667. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  20668. * copies of the Software, and to permit persons to whom the Software is
  20669. * furnished to do so, subject to the following conditions:
  20670. *
  20671. * The above copyright notice and this permission notice shall be included in
  20672. * all copies or substantial portions of the Software.
  20673. *
  20674. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20675. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20676. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  20677. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20678. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20679. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20680. * THE SOFTWARE.
  20681. */
  20682. /** @enum {string} */
  20683. var strings = {
  20684. TAB_ACTIVATED_EVENT: 'MDCTabBar:activated',
  20685. TAB_SCROLLER_SELECTOR: '.mdc-tab-scroller',
  20686. TAB_SELECTOR: '.mdc-tab',
  20687. ARROW_LEFT_KEY: 'ArrowLeft',
  20688. ARROW_RIGHT_KEY: 'ArrowRight',
  20689. END_KEY: 'End',
  20690. HOME_KEY: 'Home',
  20691. ENTER_KEY: 'Enter',
  20692. SPACE_KEY: 'Space'
  20693. };
  20694. /** @enum {number} */
  20695. var numbers = {
  20696. EXTRA_SCROLL_AMOUNT: 20,
  20697. ARROW_LEFT_KEYCODE: 37,
  20698. ARROW_RIGHT_KEYCODE: 39,
  20699. END_KEYCODE: 35,
  20700. HOME_KEYCODE: 36,
  20701. ENTER_KEYCODE: 13,
  20702. SPACE_KEYCODE: 32
  20703. };
  20704. /***/ }),
  20705. /* 145 */
  20706. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  20707. "use strict";
  20708. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  20709. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextField", function() { return MDCTextField; });
  20710. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  20711. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__ = __webpack_require__(2);
  20712. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_ripple_util__ = __webpack_require__(6);
  20713. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(59);
  20714. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__adapter__ = __webpack_require__(60);
  20715. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__foundation__ = __webpack_require__(148);
  20716. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__material_line_ripple_index__ = __webpack_require__(18);
  20717. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__helper_text_index__ = __webpack_require__(149);
  20718. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__icon_index__ = __webpack_require__(150);
  20719. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__material_floating_label_index__ = __webpack_require__(10);
  20720. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__material_notched_outline_index__ = __webpack_require__(22);
  20721. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextFieldFoundation", function() { return __WEBPACK_IMPORTED_MODULE_5__foundation__["a"]; });
  20722. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextFieldHelperText", function() { return __WEBPACK_IMPORTED_MODULE_7__helper_text_index__["a"]; });
  20723. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextFieldHelperTextFoundation", function() { return __WEBPACK_IMPORTED_MODULE_7__helper_text_index__["b"]; });
  20724. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextFieldIcon", function() { return __WEBPACK_IMPORTED_MODULE_8__icon_index__["a"]; });
  20725. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextFieldIconFoundation", function() { return __WEBPACK_IMPORTED_MODULE_8__icon_index__["b"]; });
  20726. 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; };
  20727. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  20728. 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); } };
  20729. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20730. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  20731. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  20732. /**
  20733. * @license
  20734. * Copyright 2016 Google Inc.
  20735. *
  20736. * Permission is hereby granted, free of charge, to any person obtaining a copy
  20737. * of this software and associated documentation files (the "Software"), to deal
  20738. * in the Software without restriction, including without limitation the rights
  20739. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  20740. * copies of the Software, and to permit persons to whom the Software is
  20741. * furnished to do so, subject to the following conditions:
  20742. *
  20743. * The above copyright notice and this permission notice shall be included in
  20744. * all copies or substantial portions of the Software.
  20745. *
  20746. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20747. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20748. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  20749. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20750. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20751. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20752. * THE SOFTWARE.
  20753. */
  20754. /* eslint-disable no-unused-vars */
  20755. /* eslint-enable no-unused-vars */
  20756. /* eslint-disable no-unused-vars */
  20757. /* eslint-enable no-unused-vars */
  20758. /**
  20759. * @extends {MDCComponent<!MDCTextFieldFoundation>}
  20760. * @final
  20761. */
  20762. var MDCTextField = function (_MDCComponent) {
  20763. _inherits(MDCTextField, _MDCComponent);
  20764. /**
  20765. * @param {...?} args
  20766. */
  20767. function MDCTextField() {
  20768. var _ref;
  20769. _classCallCheck(this, MDCTextField);
  20770. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  20771. args[_key] = arguments[_key];
  20772. }
  20773. /** @private {?Element} */
  20774. var _this = _possibleConstructorReturn(this, (_ref = MDCTextField.__proto__ || Object.getPrototypeOf(MDCTextField)).call.apply(_ref, [this].concat(args)));
  20775. _this.input_;
  20776. /** @type {?MDCRipple} */
  20777. _this.ripple;
  20778. /** @private {?MDCLineRipple} */
  20779. _this.lineRipple_;
  20780. /** @private {?MDCTextFieldHelperText} */
  20781. _this.helperText_;
  20782. /** @private {?MDCTextFieldIcon} */
  20783. _this.leadingIcon_;
  20784. /** @private {?MDCTextFieldIcon} */
  20785. _this.trailingIcon_;
  20786. /** @private {?MDCFloatingLabel} */
  20787. _this.label_;
  20788. /** @private {?MDCNotchedOutline} */
  20789. _this.outline_;
  20790. return _this;
  20791. }
  20792. /**
  20793. * @param {!Element} root
  20794. * @return {!MDCTextField}
  20795. */
  20796. _createClass(MDCTextField, [{
  20797. key: 'initialize',
  20798. /**
  20799. * @param {(function(!Element): !MDCRipple)=} rippleFactory A function which
  20800. * creates a new MDCRipple.
  20801. * @param {(function(!Element): !MDCLineRipple)=} lineRippleFactory A function which
  20802. * creates a new MDCLineRipple.
  20803. * @param {(function(!Element): !MDCTextFieldHelperText)=} helperTextFactory A function which
  20804. * creates a new MDCTextFieldHelperText.
  20805. * @param {(function(!Element): !MDCTextFieldIcon)=} iconFactory A function which
  20806. * creates a new MDCTextFieldIcon.
  20807. * @param {(function(!Element): !MDCFloatingLabel)=} labelFactory A function which
  20808. * creates a new MDCFloatingLabel.
  20809. * @param {(function(!Element): !MDCNotchedOutline)=} outlineFactory A function which
  20810. * creates a new MDCNotchedOutline.
  20811. */
  20812. value: function initialize() {
  20813. var rippleFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el, foundation) {
  20814. return new __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"](el, foundation);
  20815. };
  20816. var lineRippleFactory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (el) {
  20817. return new __WEBPACK_IMPORTED_MODULE_6__material_line_ripple_index__["MDCLineRipple"](el);
  20818. };
  20819. var helperTextFactory = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function (el) {
  20820. return new __WEBPACK_IMPORTED_MODULE_7__helper_text_index__["a" /* MDCTextFieldHelperText */](el);
  20821. };
  20822. var iconFactory = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : function (el) {
  20823. return new __WEBPACK_IMPORTED_MODULE_8__icon_index__["a" /* MDCTextFieldIcon */](el);
  20824. };
  20825. var _this2 = this;
  20826. var labelFactory = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : function (el) {
  20827. return new __WEBPACK_IMPORTED_MODULE_9__material_floating_label_index__["MDCFloatingLabel"](el);
  20828. };
  20829. var outlineFactory = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : function (el) {
  20830. return new __WEBPACK_IMPORTED_MODULE_10__material_notched_outline_index__["MDCNotchedOutline"](el);
  20831. };
  20832. this.input_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].INPUT_SELECTOR);
  20833. var labelElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].LABEL_SELECTOR);
  20834. if (labelElement) {
  20835. this.label_ = labelFactory(labelElement);
  20836. }
  20837. var lineRippleElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].LINE_RIPPLE_SELECTOR);
  20838. if (lineRippleElement) {
  20839. this.lineRipple_ = lineRippleFactory(lineRippleElement);
  20840. }
  20841. var outlineElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].OUTLINE_SELECTOR);
  20842. if (outlineElement) {
  20843. this.outline_ = outlineFactory(outlineElement);
  20844. }
  20845. if (this.input_.hasAttribute(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].ARIA_CONTROLS)) {
  20846. var helperTextElement = document.getElementById(this.input_.getAttribute(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].ARIA_CONTROLS));
  20847. if (helperTextElement) {
  20848. this.helperText_ = helperTextFactory(helperTextElement);
  20849. }
  20850. }
  20851. var iconElements = this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].ICON_SELECTOR);
  20852. if (iconElements.length > 0) {
  20853. if (iconElements.length > 1) {
  20854. // Has both icons.
  20855. this.leadingIcon_ = iconFactory(iconElements[0]);
  20856. this.trailingIcon_ = iconFactory(iconElements[1]);
  20857. } else {
  20858. if (this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* cssClasses */].WITH_LEADING_ICON)) {
  20859. this.leadingIcon_ = iconFactory(iconElements[0]);
  20860. } else {
  20861. this.trailingIcon_ = iconFactory(iconElements[0]);
  20862. }
  20863. }
  20864. }
  20865. this.ripple = null;
  20866. 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)) {
  20867. var MATCHES = Object(__WEBPACK_IMPORTED_MODULE_2__material_ripple_util__["getMatchesProperty"])(HTMLElement.prototype);
  20868. var adapter = _extends(__WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"].createAdapter( /** @type {!RippleCapableSurface} */this), {
  20869. isSurfaceActive: function isSurfaceActive() {
  20870. return _this2.input_[MATCHES](':active');
  20871. },
  20872. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  20873. return _this2.input_.addEventListener(type, handler);
  20874. },
  20875. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  20876. return _this2.input_.removeEventListener(type, handler);
  20877. }
  20878. });
  20879. var foundation = new __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRippleFoundation"](adapter);
  20880. this.ripple = rippleFactory(this.root_, foundation);
  20881. }
  20882. }
  20883. }, {
  20884. key: 'destroy',
  20885. value: function destroy() {
  20886. if (this.ripple) {
  20887. this.ripple.destroy();
  20888. }
  20889. if (this.lineRipple_) {
  20890. this.lineRipple_.destroy();
  20891. }
  20892. if (this.helperText_) {
  20893. this.helperText_.destroy();
  20894. }
  20895. if (this.leadingIcon_) {
  20896. this.leadingIcon_.destroy();
  20897. }
  20898. if (this.trailingIcon_) {
  20899. this.trailingIcon_.destroy();
  20900. }
  20901. if (this.label_) {
  20902. this.label_.destroy();
  20903. }
  20904. if (this.outline_) {
  20905. this.outline_.destroy();
  20906. }
  20907. _get(MDCTextField.prototype.__proto__ || Object.getPrototypeOf(MDCTextField.prototype), 'destroy', this).call(this);
  20908. }
  20909. /**
  20910. * Initiliazes the Text Field's internal state based on the environment's
  20911. * state.
  20912. */
  20913. }, {
  20914. key: 'initialSyncWithDom',
  20915. value: function initialSyncWithDom() {
  20916. this.disabled = this.input_.disabled;
  20917. }
  20918. /**
  20919. * @return {string} The value of the input.
  20920. */
  20921. }, {
  20922. key: 'focus',
  20923. /**
  20924. * Focuses the input element.
  20925. */
  20926. value: function focus() {
  20927. this.input_.focus();
  20928. }
  20929. /**
  20930. * Recomputes the outline SVG path for the outline element.
  20931. */
  20932. }, {
  20933. key: 'layout',
  20934. value: function layout() {
  20935. var openNotch = this.foundation_.shouldFloat;
  20936. this.foundation_.notchOutline(openNotch);
  20937. }
  20938. /**
  20939. * @return {!MDCTextFieldFoundation}
  20940. */
  20941. }, {
  20942. key: 'getDefaultFoundation',
  20943. value: function getDefaultFoundation() {
  20944. var _this3 = this;
  20945. return new __WEBPACK_IMPORTED_MODULE_5__foundation__["a" /* default */](
  20946. /** @type {!MDCTextFieldAdapter} */_extends({
  20947. addClass: function addClass(className) {
  20948. return _this3.root_.classList.add(className);
  20949. },
  20950. removeClass: function removeClass(className) {
  20951. return _this3.root_.classList.remove(className);
  20952. },
  20953. hasClass: function hasClass(className) {
  20954. return _this3.root_.classList.contains(className);
  20955. },
  20956. registerTextFieldInteractionHandler: function registerTextFieldInteractionHandler(evtType, handler) {
  20957. return _this3.root_.addEventListener(evtType, handler);
  20958. },
  20959. deregisterTextFieldInteractionHandler: function deregisterTextFieldInteractionHandler(evtType, handler) {
  20960. return _this3.root_.removeEventListener(evtType, handler);
  20961. },
  20962. registerValidationAttributeChangeHandler: function registerValidationAttributeChangeHandler(handler) {
  20963. var getAttributesList = function getAttributesList(mutationsList) {
  20964. return mutationsList.map(function (mutation) {
  20965. return mutation.attributeName;
  20966. });
  20967. };
  20968. var observer = new MutationObserver(function (mutationsList) {
  20969. return handler(getAttributesList(mutationsList));
  20970. });
  20971. var targetNode = _this3.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].INPUT_SELECTOR);
  20972. var config = { attributes: true };
  20973. observer.observe(targetNode, config);
  20974. return observer;
  20975. },
  20976. deregisterValidationAttributeChangeHandler: function deregisterValidationAttributeChangeHandler(observer) {
  20977. return observer.disconnect();
  20978. },
  20979. isFocused: function isFocused() {
  20980. return document.activeElement === _this3.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["e" /* strings */].INPUT_SELECTOR);
  20981. }
  20982. }, this.getInputAdapterMethods_(), this.getLabelAdapterMethods_(), this.getLineRippleAdapterMethods_(), this.getOutlineAdapterMethods_()), this.getFoundationMap_());
  20983. }
  20984. /**
  20985. * @return {!{
  20986. * shakeLabel: function(boolean): undefined,
  20987. * floatLabel: function(boolean): undefined,
  20988. * hasLabel: function(): boolean,
  20989. * getLabelWidth: function(): number,
  20990. * }}
  20991. */
  20992. }, {
  20993. key: 'getLabelAdapterMethods_',
  20994. value: function getLabelAdapterMethods_() {
  20995. var _this4 = this;
  20996. return {
  20997. shakeLabel: function shakeLabel(shouldShake) {
  20998. return _this4.label_.shake(shouldShake);
  20999. },
  21000. floatLabel: function floatLabel(shouldFloat) {
  21001. return _this4.label_.float(shouldFloat);
  21002. },
  21003. hasLabel: function hasLabel() {
  21004. return !!_this4.label_;
  21005. },
  21006. getLabelWidth: function getLabelWidth() {
  21007. return _this4.label_ ? _this4.label_.getWidth() : 0;
  21008. }
  21009. };
  21010. }
  21011. /**
  21012. * @return {!{
  21013. * activateLineRipple: function(): undefined,
  21014. * deactivateLineRipple: function(): undefined,
  21015. * setLineRippleTransformOrigin: function(number): undefined,
  21016. * }}
  21017. */
  21018. }, {
  21019. key: 'getLineRippleAdapterMethods_',
  21020. value: function getLineRippleAdapterMethods_() {
  21021. var _this5 = this;
  21022. return {
  21023. activateLineRipple: function activateLineRipple() {
  21024. if (_this5.lineRipple_) {
  21025. _this5.lineRipple_.activate();
  21026. }
  21027. },
  21028. deactivateLineRipple: function deactivateLineRipple() {
  21029. if (_this5.lineRipple_) {
  21030. _this5.lineRipple_.deactivate();
  21031. }
  21032. },
  21033. setLineRippleTransformOrigin: function setLineRippleTransformOrigin(normalizedX) {
  21034. if (_this5.lineRipple_) {
  21035. _this5.lineRipple_.setRippleCenter(normalizedX);
  21036. }
  21037. }
  21038. };
  21039. }
  21040. /**
  21041. * @return {!{
  21042. * notchOutline: function(number, boolean): undefined,
  21043. * hasOutline: function(): boolean,
  21044. * }}
  21045. */
  21046. }, {
  21047. key: 'getOutlineAdapterMethods_',
  21048. value: function getOutlineAdapterMethods_() {
  21049. var _this6 = this;
  21050. return {
  21051. notchOutline: function notchOutline(labelWidth) {
  21052. return _this6.outline_.notch(labelWidth);
  21053. },
  21054. closeOutline: function closeOutline() {
  21055. return _this6.outline_.closeNotch();
  21056. },
  21057. hasOutline: function hasOutline() {
  21058. return !!_this6.outline_;
  21059. }
  21060. };
  21061. }
  21062. /**
  21063. * @return {!{
  21064. * registerInputInteractionHandler: function(string, function()): undefined,
  21065. * deregisterInputInteractionHandler: function(string, function()): undefined,
  21066. * getNativeInput: function(): ?Element,
  21067. * }}
  21068. */
  21069. }, {
  21070. key: 'getInputAdapterMethods_',
  21071. value: function getInputAdapterMethods_() {
  21072. var _this7 = this;
  21073. return {
  21074. registerInputInteractionHandler: function registerInputInteractionHandler(evtType, handler) {
  21075. return _this7.input_.addEventListener(evtType, handler);
  21076. },
  21077. deregisterInputInteractionHandler: function deregisterInputInteractionHandler(evtType, handler) {
  21078. return _this7.input_.removeEventListener(evtType, handler);
  21079. },
  21080. getNativeInput: function getNativeInput() {
  21081. return _this7.input_;
  21082. }
  21083. };
  21084. }
  21085. /**
  21086. * Returns a map of all subcomponents to subfoundations.
  21087. * @return {!FoundationMapType}
  21088. */
  21089. }, {
  21090. key: 'getFoundationMap_',
  21091. value: function getFoundationMap_() {
  21092. return {
  21093. helperText: this.helperText_ ? this.helperText_.foundation : undefined,
  21094. leadingIcon: this.leadingIcon_ ? this.leadingIcon_.foundation : undefined,
  21095. trailingIcon: this.trailingIcon_ ? this.trailingIcon_.foundation : undefined
  21096. };
  21097. }
  21098. }, {
  21099. key: 'value',
  21100. get: function get() {
  21101. return this.foundation_.getValue();
  21102. }
  21103. /**
  21104. * @param {string} value The value to set on the input.
  21105. */
  21106. ,
  21107. set: function set(value) {
  21108. this.foundation_.setValue(value);
  21109. }
  21110. /**
  21111. * @return {boolean} True if the Text Field is disabled.
  21112. */
  21113. }, {
  21114. key: 'disabled',
  21115. get: function get() {
  21116. return this.foundation_.isDisabled();
  21117. }
  21118. /**
  21119. * @param {boolean} disabled Sets the Text Field disabled or enabled.
  21120. */
  21121. ,
  21122. set: function set(disabled) {
  21123. this.foundation_.setDisabled(disabled);
  21124. }
  21125. /**
  21126. * @return {boolean} valid True if the Text Field is valid.
  21127. */
  21128. }, {
  21129. key: 'valid',
  21130. get: function get() {
  21131. return this.foundation_.isValid();
  21132. }
  21133. /**
  21134. * @param {boolean} valid Sets the Text Field valid or invalid.
  21135. */
  21136. ,
  21137. set: function set(valid) {
  21138. this.foundation_.setValid(valid);
  21139. }
  21140. /**
  21141. * @return {boolean} True if the Text Field is required.
  21142. */
  21143. }, {
  21144. key: 'required',
  21145. get: function get() {
  21146. return this.input_.required;
  21147. }
  21148. /**
  21149. * @param {boolean} required Sets the Text Field to required.
  21150. */
  21151. ,
  21152. set: function set(required) {
  21153. this.input_.required = required;
  21154. }
  21155. /**
  21156. * @return {string} The input element's validation pattern.
  21157. */
  21158. }, {
  21159. key: 'pattern',
  21160. get: function get() {
  21161. return this.input_.pattern;
  21162. }
  21163. /**
  21164. * @param {string} pattern Sets the input element's validation pattern.
  21165. */
  21166. ,
  21167. set: function set(pattern) {
  21168. this.input_.pattern = pattern;
  21169. }
  21170. /**
  21171. * @return {number} The input element's minLength.
  21172. */
  21173. }, {
  21174. key: 'minLength',
  21175. get: function get() {
  21176. return this.input_.minLength;
  21177. }
  21178. /**
  21179. * @param {number} minLength Sets the input element's minLength.
  21180. */
  21181. ,
  21182. set: function set(minLength) {
  21183. this.input_.minLength = minLength;
  21184. }
  21185. /**
  21186. * @return {number} The input element's maxLength.
  21187. */
  21188. }, {
  21189. key: 'maxLength',
  21190. get: function get() {
  21191. return this.input_.maxLength;
  21192. }
  21193. /**
  21194. * @param {number} maxLength Sets the input element's maxLength.
  21195. */
  21196. ,
  21197. set: function set(maxLength) {
  21198. // Chrome throws exception if maxLength is set < 0
  21199. if (maxLength < 0) {
  21200. this.input_.removeAttribute('maxLength');
  21201. } else {
  21202. this.input_.maxLength = maxLength;
  21203. }
  21204. }
  21205. /**
  21206. * @return {string} The input element's min.
  21207. */
  21208. }, {
  21209. key: 'min',
  21210. get: function get() {
  21211. return this.input_.min;
  21212. }
  21213. /**
  21214. * @param {string} min Sets the input element's min.
  21215. */
  21216. ,
  21217. set: function set(min) {
  21218. this.input_.min = min;
  21219. }
  21220. /**
  21221. * @return {string} The input element's max.
  21222. */
  21223. }, {
  21224. key: 'max',
  21225. get: function get() {
  21226. return this.input_.max;
  21227. }
  21228. /**
  21229. * @param {string} max Sets the input element's max.
  21230. */
  21231. ,
  21232. set: function set(max) {
  21233. this.input_.max = max;
  21234. }
  21235. /**
  21236. * @return {string} The input element's step.
  21237. */
  21238. }, {
  21239. key: 'step',
  21240. get: function get() {
  21241. return this.input_.step;
  21242. }
  21243. /**
  21244. * @param {string} step Sets the input element's step.
  21245. */
  21246. ,
  21247. set: function set(step) {
  21248. this.input_.step = step;
  21249. }
  21250. /**
  21251. * Sets the helper text element content.
  21252. * @param {string} content
  21253. */
  21254. }, {
  21255. key: 'helperTextContent',
  21256. set: function set(content) {
  21257. this.foundation_.setHelperTextContent(content);
  21258. }
  21259. /**
  21260. * Sets the aria label of the leading icon.
  21261. * @param {string} label
  21262. */
  21263. }, {
  21264. key: 'leadingIconAriaLabel',
  21265. set: function set(label) {
  21266. this.foundation_.setLeadingIconAriaLabel(label);
  21267. }
  21268. /**
  21269. * Sets the text content of the leading icon.
  21270. * @param {string} content
  21271. */
  21272. }, {
  21273. key: 'leadingIconContent',
  21274. set: function set(content) {
  21275. this.foundation_.setLeadingIconContent(content);
  21276. }
  21277. /**
  21278. * Sets the aria label of the trailing icon.
  21279. * @param {string} label
  21280. */
  21281. }, {
  21282. key: 'trailingIconAriaLabel',
  21283. set: function set(label) {
  21284. this.foundation_.setTrailingIconAriaLabel(label);
  21285. }
  21286. /**
  21287. * Sets the text content of the trailing icon.
  21288. * @param {string} content
  21289. */
  21290. }, {
  21291. key: 'trailingIconContent',
  21292. set: function set(content) {
  21293. this.foundation_.setTrailingIconContent(content);
  21294. }
  21295. /**
  21296. * Enables or disables the use of native validation. Use this for custom validation.
  21297. * @param {boolean} useNativeValidation Set this to false to ignore native input validation.
  21298. */
  21299. }, {
  21300. key: 'useNativeValidation',
  21301. set: function set(useNativeValidation) {
  21302. this.foundation_.setUseNativeValidation(useNativeValidation);
  21303. }
  21304. }], [{
  21305. key: 'attachTo',
  21306. value: function attachTo(root) {
  21307. return new MDCTextField(root);
  21308. }
  21309. }]);
  21310. return MDCTextField;
  21311. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  21312. /***/ }),
  21313. /* 146 */
  21314. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  21315. "use strict";
  21316. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  21317. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  21318. /**
  21319. * @license
  21320. * Copyright 2016 Google Inc.
  21321. *
  21322. * Permission is hereby granted, free of charge, to any person obtaining a copy
  21323. * of this software and associated documentation files (the "Software"), to deal
  21324. * in the Software without restriction, including without limitation the rights
  21325. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  21326. * copies of the Software, and to permit persons to whom the Software is
  21327. * furnished to do so, subject to the following conditions:
  21328. *
  21329. * The above copyright notice and this permission notice shall be included in
  21330. * all copies or substantial portions of the Software.
  21331. *
  21332. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  21333. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  21334. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  21335. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  21336. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21337. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  21338. * THE SOFTWARE.
  21339. */
  21340. /** @enum {string} */
  21341. var strings = {
  21342. ARIA_HIDDEN: 'aria-hidden',
  21343. ROLE: 'role'
  21344. };
  21345. /** @enum {string} */
  21346. var cssClasses = {
  21347. HELPER_TEXT_PERSISTENT: 'mdc-text-field-helper-text--persistent',
  21348. HELPER_TEXT_VALIDATION_MSG: 'mdc-text-field-helper-text--validation-msg'
  21349. };
  21350. /***/ }),
  21351. /* 147 */
  21352. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  21353. "use strict";
  21354. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return strings; });
  21355. /**
  21356. * @license
  21357. * Copyright 2016 Google Inc.
  21358. *
  21359. * Permission is hereby granted, free of charge, to any person obtaining a copy
  21360. * of this software and associated documentation files (the "Software"), to deal
  21361. * in the Software without restriction, including without limitation the rights
  21362. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  21363. * copies of the Software, and to permit persons to whom the Software is
  21364. * furnished to do so, subject to the following conditions:
  21365. *
  21366. * The above copyright notice and this permission notice shall be included in
  21367. * all copies or substantial portions of the Software.
  21368. *
  21369. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  21370. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  21371. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  21372. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  21373. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21374. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  21375. * THE SOFTWARE.
  21376. */
  21377. /** @enum {string} */
  21378. var strings = {
  21379. ICON_EVENT: 'MDCTextField:icon',
  21380. ICON_ROLE: 'button'
  21381. };
  21382. /***/ }),
  21383. /* 148 */
  21384. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  21385. "use strict";
  21386. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  21387. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__helper_text_foundation__ = __webpack_require__(27);
  21388. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__icon_foundation__ = __webpack_require__(28);
  21389. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__adapter__ = __webpack_require__(60);
  21390. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__constants__ = __webpack_require__(59);
  21391. 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; };
  21392. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  21393. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21394. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  21395. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  21396. /**
  21397. * @license
  21398. * Copyright 2016 Google Inc.
  21399. *
  21400. * Permission is hereby granted, free of charge, to any person obtaining a copy
  21401. * of this software and associated documentation files (the "Software"), to deal
  21402. * in the Software without restriction, including without limitation the rights
  21403. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  21404. * copies of the Software, and to permit persons to whom the Software is
  21405. * furnished to do so, subject to the following conditions:
  21406. *
  21407. * The above copyright notice and this permission notice shall be included in
  21408. * all copies or substantial portions of the Software.
  21409. *
  21410. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  21411. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  21412. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  21413. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  21414. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21415. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  21416. * THE SOFTWARE.
  21417. */
  21418. /* eslint-disable no-unused-vars */
  21419. /* eslint-enable no-unused-vars */
  21420. /**
  21421. * @extends {MDCFoundation<!MDCTextFieldAdapter>}
  21422. * @final
  21423. */
  21424. var MDCTextFieldFoundation = function (_MDCFoundation) {
  21425. _inherits(MDCTextFieldFoundation, _MDCFoundation);
  21426. _createClass(MDCTextFieldFoundation, [{
  21427. key: 'shouldShake',
  21428. /** @return {boolean} */
  21429. get: function get() {
  21430. return !this.isValid() && !this.isFocused_ && !!this.getValue();
  21431. }
  21432. /**
  21433. * @return {boolean}
  21434. * @private
  21435. */
  21436. }, {
  21437. key: 'shouldAlwaysFloat_',
  21438. get: function get() {
  21439. var type = this.getNativeInput_().type;
  21440. return __WEBPACK_IMPORTED_MODULE_4__constants__["a" /* ALWAYS_FLOAT_TYPES */].indexOf(type) >= 0;
  21441. }
  21442. /** @return {boolean} */
  21443. }, {
  21444. key: 'shouldFloat',
  21445. get: function get() {
  21446. return this.shouldAlwaysFloat_ || this.isFocused_ || !!this.getValue() || this.isBadInput_();
  21447. }
  21448. /**
  21449. * {@see MDCTextFieldAdapter} for typing information on parameters and return
  21450. * types.
  21451. * @return {!MDCTextFieldAdapter}
  21452. */
  21453. }], [{
  21454. key: 'cssClasses',
  21455. /** @return enum {string} */
  21456. get: function get() {
  21457. return __WEBPACK_IMPORTED_MODULE_4__constants__["c" /* cssClasses */];
  21458. }
  21459. /** @return enum {string} */
  21460. }, {
  21461. key: 'strings',
  21462. get: function get() {
  21463. return __WEBPACK_IMPORTED_MODULE_4__constants__["e" /* strings */];
  21464. }
  21465. /** @return enum {string} */
  21466. }, {
  21467. key: 'numbers',
  21468. get: function get() {
  21469. return __WEBPACK_IMPORTED_MODULE_4__constants__["d" /* numbers */];
  21470. }
  21471. }, {
  21472. key: 'defaultAdapter',
  21473. get: function get() {
  21474. return (/** @type {!MDCTextFieldAdapter} */{
  21475. addClass: function addClass() {},
  21476. removeClass: function removeClass() {},
  21477. hasClass: function hasClass() {},
  21478. registerTextFieldInteractionHandler: function registerTextFieldInteractionHandler() {},
  21479. deregisterTextFieldInteractionHandler: function deregisterTextFieldInteractionHandler() {},
  21480. registerInputInteractionHandler: function registerInputInteractionHandler() {},
  21481. deregisterInputInteractionHandler: function deregisterInputInteractionHandler() {},
  21482. registerValidationAttributeChangeHandler: function registerValidationAttributeChangeHandler() {},
  21483. deregisterValidationAttributeChangeHandler: function deregisterValidationAttributeChangeHandler() {},
  21484. getNativeInput: function getNativeInput() {},
  21485. isFocused: function isFocused() {},
  21486. activateLineRipple: function activateLineRipple() {},
  21487. deactivateLineRipple: function deactivateLineRipple() {},
  21488. setLineRippleTransformOrigin: function setLineRippleTransformOrigin() {},
  21489. shakeLabel: function shakeLabel() {},
  21490. floatLabel: function floatLabel() {},
  21491. hasLabel: function hasLabel() {},
  21492. getLabelWidth: function getLabelWidth() {},
  21493. hasOutline: function hasOutline() {},
  21494. notchOutline: function notchOutline() {},
  21495. closeOutline: function closeOutline() {}
  21496. }
  21497. );
  21498. }
  21499. /**
  21500. * @param {!MDCTextFieldAdapter} adapter
  21501. * @param {!FoundationMapType=} foundationMap Map from subcomponent names to their subfoundations.
  21502. */
  21503. }]);
  21504. function MDCTextFieldFoundation(adapter) {
  21505. var foundationMap = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : /** @type {!FoundationMapType} */{};
  21506. _classCallCheck(this, MDCTextFieldFoundation);
  21507. /** @type {!MDCTextFieldHelperTextFoundation|undefined} */
  21508. var _this = _possibleConstructorReturn(this, (MDCTextFieldFoundation.__proto__ || Object.getPrototypeOf(MDCTextFieldFoundation)).call(this, _extends(MDCTextFieldFoundation.defaultAdapter, adapter)));
  21509. _this.helperText_ = foundationMap.helperText;
  21510. /** @type {!MDCTextFieldIconFoundation|undefined} */
  21511. _this.leadingIcon_ = foundationMap.leadingIcon;
  21512. /** @type {!MDCTextFieldIconFoundation|undefined} */
  21513. _this.trailingIcon_ = foundationMap.trailingIcon;
  21514. /** @private {boolean} */
  21515. _this.isFocused_ = false;
  21516. /** @private {boolean} */
  21517. _this.receivedUserInput_ = false;
  21518. /** @private {boolean} */
  21519. _this.useCustomValidityChecking_ = false;
  21520. /** @private {boolean} */
  21521. _this.isValid_ = true;
  21522. /** @private {boolean} */
  21523. _this.useNativeValidation_ = true;
  21524. /** @private {function(): undefined} */
  21525. _this.inputFocusHandler_ = function () {
  21526. return _this.activateFocus();
  21527. };
  21528. /** @private {function(): undefined} */
  21529. _this.inputBlurHandler_ = function () {
  21530. return _this.deactivateFocus();
  21531. };
  21532. /** @private {function(): undefined} */
  21533. _this.inputInputHandler_ = function () {
  21534. return _this.autoCompleteFocus();
  21535. };
  21536. /** @private {function(!Event): undefined} */
  21537. _this.setPointerXOffset_ = function (evt) {
  21538. return _this.setTransformOrigin(evt);
  21539. };
  21540. /** @private {function(!Event): undefined} */
  21541. _this.textFieldInteractionHandler_ = function () {
  21542. return _this.handleTextFieldInteraction();
  21543. };
  21544. /** @private {function(!Array): undefined} */
  21545. _this.validationAttributeChangeHandler_ = function (attributesList) {
  21546. return _this.handleValidationAttributeChange(attributesList);
  21547. };
  21548. /** @private {!MutationObserver} */
  21549. _this.validationObserver_;
  21550. return _this;
  21551. }
  21552. _createClass(MDCTextFieldFoundation, [{
  21553. key: 'init',
  21554. value: function init() {
  21555. var _this2 = this;
  21556. if (this.adapter_.isFocused()) {
  21557. this.inputFocusHandler_();
  21558. } else if (this.adapter_.hasLabel() && this.shouldFloat) {
  21559. this.notchOutline(true);
  21560. this.adapter_.floatLabel(true);
  21561. }
  21562. this.adapter_.registerInputInteractionHandler('focus', this.inputFocusHandler_);
  21563. this.adapter_.registerInputInteractionHandler('blur', this.inputBlurHandler_);
  21564. this.adapter_.registerInputInteractionHandler('input', this.inputInputHandler_);
  21565. ['mousedown', 'touchstart'].forEach(function (evtType) {
  21566. _this2.adapter_.registerInputInteractionHandler(evtType, _this2.setPointerXOffset_);
  21567. });
  21568. ['click', 'keydown'].forEach(function (evtType) {
  21569. _this2.adapter_.registerTextFieldInteractionHandler(evtType, _this2.textFieldInteractionHandler_);
  21570. });
  21571. this.validationObserver_ = this.adapter_.registerValidationAttributeChangeHandler(this.validationAttributeChangeHandler_);
  21572. }
  21573. }, {
  21574. key: 'destroy',
  21575. value: function destroy() {
  21576. var _this3 = this;
  21577. this.adapter_.deregisterInputInteractionHandler('focus', this.inputFocusHandler_);
  21578. this.adapter_.deregisterInputInteractionHandler('blur', this.inputBlurHandler_);
  21579. this.adapter_.deregisterInputInteractionHandler('input', this.inputInputHandler_);
  21580. ['mousedown', 'touchstart'].forEach(function (evtType) {
  21581. _this3.adapter_.deregisterInputInteractionHandler(evtType, _this3.setPointerXOffset_);
  21582. });
  21583. ['click', 'keydown'].forEach(function (evtType) {
  21584. _this3.adapter_.deregisterTextFieldInteractionHandler(evtType, _this3.textFieldInteractionHandler_);
  21585. });
  21586. this.adapter_.deregisterValidationAttributeChangeHandler(this.validationObserver_);
  21587. }
  21588. /**
  21589. * Handles user interactions with the Text Field.
  21590. */
  21591. }, {
  21592. key: 'handleTextFieldInteraction',
  21593. value: function handleTextFieldInteraction() {
  21594. if (this.adapter_.getNativeInput().disabled) {
  21595. return;
  21596. }
  21597. this.receivedUserInput_ = true;
  21598. }
  21599. /**
  21600. * Handles validation attribute changes
  21601. * @param {!Array<string>} attributesList
  21602. */
  21603. }, {
  21604. key: 'handleValidationAttributeChange',
  21605. value: function handleValidationAttributeChange(attributesList) {
  21606. var _this4 = this;
  21607. attributesList.some(function (attributeName) {
  21608. if (__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* VALIDATION_ATTR_WHITELIST */].indexOf(attributeName) > -1) {
  21609. _this4.styleValidity_(true);
  21610. return true;
  21611. }
  21612. });
  21613. }
  21614. /**
  21615. * Opens/closes the notched outline.
  21616. * @param {boolean} openNotch
  21617. */
  21618. }, {
  21619. key: 'notchOutline',
  21620. value: function notchOutline(openNotch) {
  21621. if (!this.adapter_.hasOutline()) {
  21622. return;
  21623. }
  21624. if (openNotch) {
  21625. var isDense = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_4__constants__["c" /* cssClasses */].DENSE);
  21626. var labelScale = isDense ? __WEBPACK_IMPORTED_MODULE_4__constants__["d" /* numbers */].DENSE_LABEL_SCALE : __WEBPACK_IMPORTED_MODULE_4__constants__["d" /* numbers */].LABEL_SCALE;
  21627. var labelWidth = this.adapter_.getLabelWidth() * labelScale;
  21628. this.adapter_.notchOutline(labelWidth);
  21629. } else {
  21630. this.adapter_.closeOutline();
  21631. }
  21632. }
  21633. /**
  21634. * Activates the text field focus state.
  21635. */
  21636. }, {
  21637. key: 'activateFocus',
  21638. value: function activateFocus() {
  21639. this.isFocused_ = true;
  21640. this.styleFocused_(this.isFocused_);
  21641. this.adapter_.activateLineRipple();
  21642. if (this.adapter_.hasLabel()) {
  21643. this.notchOutline(this.shouldFloat);
  21644. this.adapter_.floatLabel(this.shouldFloat);
  21645. this.adapter_.shakeLabel(this.shouldShake);
  21646. }
  21647. if (this.helperText_) {
  21648. this.helperText_.showToScreenReader();
  21649. }
  21650. }
  21651. /**
  21652. * Sets the line ripple's transform origin, so that the line ripple activate
  21653. * animation will animate out from the user's click location.
  21654. * @param {!Event} evt
  21655. */
  21656. }, {
  21657. key: 'setTransformOrigin',
  21658. value: function setTransformOrigin(evt) {
  21659. var targetEvent = void 0;
  21660. if (evt.touches) {
  21661. targetEvent = evt.touches[0];
  21662. } else {
  21663. targetEvent = evt;
  21664. }
  21665. var targetClientRect = targetEvent.target.getBoundingClientRect();
  21666. var normalizedX = targetEvent.clientX - targetClientRect.left;
  21667. this.adapter_.setLineRippleTransformOrigin(normalizedX);
  21668. }
  21669. /**
  21670. * Activates the Text Field's focus state in cases when the input value
  21671. * changes without user input (e.g. programatically).
  21672. */
  21673. }, {
  21674. key: 'autoCompleteFocus',
  21675. value: function autoCompleteFocus() {
  21676. if (!this.receivedUserInput_) {
  21677. this.activateFocus();
  21678. }
  21679. }
  21680. /**
  21681. * Deactivates the Text Field's focus state.
  21682. */
  21683. }, {
  21684. key: 'deactivateFocus',
  21685. value: function deactivateFocus() {
  21686. this.isFocused_ = false;
  21687. this.adapter_.deactivateLineRipple();
  21688. var isValid = this.isValid();
  21689. this.styleValidity_(isValid);
  21690. this.styleFocused_(this.isFocused_);
  21691. if (this.adapter_.hasLabel()) {
  21692. this.notchOutline(this.shouldFloat);
  21693. this.adapter_.floatLabel(this.shouldFloat);
  21694. this.adapter_.shakeLabel(this.shouldShake);
  21695. }
  21696. if (!this.shouldFloat) {
  21697. this.receivedUserInput_ = false;
  21698. }
  21699. }
  21700. /**
  21701. * @return {string} The value of the input Element.
  21702. */
  21703. }, {
  21704. key: 'getValue',
  21705. value: function getValue() {
  21706. return this.getNativeInput_().value;
  21707. }
  21708. /**
  21709. * @param {string} value The value to set on the input Element.
  21710. */
  21711. }, {
  21712. key: 'setValue',
  21713. value: function setValue(value) {
  21714. // Prevent Safari from moving the caret to the end of the input when the value has not changed.
  21715. if (this.getValue() !== value) {
  21716. this.getNativeInput_().value = value;
  21717. }
  21718. var isValid = this.isValid();
  21719. this.styleValidity_(isValid);
  21720. if (this.adapter_.hasLabel()) {
  21721. this.notchOutline(this.shouldFloat);
  21722. this.adapter_.floatLabel(this.shouldFloat);
  21723. this.adapter_.shakeLabel(this.shouldShake);
  21724. }
  21725. }
  21726. /**
  21727. * @return {boolean} If a custom validity is set, returns that value.
  21728. * Otherwise, returns the result of native validity checks.
  21729. */
  21730. }, {
  21731. key: 'isValid',
  21732. value: function isValid() {
  21733. return this.useNativeValidation_ ? this.isNativeInputValid_() : this.isValid_;
  21734. }
  21735. /**
  21736. * @param {boolean} isValid Sets the validity state of the Text Field.
  21737. */
  21738. }, {
  21739. key: 'setValid',
  21740. value: function setValid(isValid) {
  21741. this.isValid_ = isValid;
  21742. this.styleValidity_(isValid);
  21743. var shouldShake = !isValid && !this.isFocused_;
  21744. if (this.adapter_.hasLabel()) {
  21745. this.adapter_.shakeLabel(shouldShake);
  21746. }
  21747. }
  21748. /**
  21749. * Enables or disables the use of native validation. Use this for custom validation.
  21750. * @param {boolean} useNativeValidation Set this to false to ignore native input validation.
  21751. */
  21752. }, {
  21753. key: 'setUseNativeValidation',
  21754. value: function setUseNativeValidation(useNativeValidation) {
  21755. this.useNativeValidation_ = useNativeValidation;
  21756. }
  21757. /**
  21758. * @return {boolean} True if the Text Field is disabled.
  21759. */
  21760. }, {
  21761. key: 'isDisabled',
  21762. value: function isDisabled() {
  21763. return this.getNativeInput_().disabled;
  21764. }
  21765. /**
  21766. * @param {boolean} disabled Sets the text-field disabled or enabled.
  21767. */
  21768. }, {
  21769. key: 'setDisabled',
  21770. value: function setDisabled(disabled) {
  21771. this.getNativeInput_().disabled = disabled;
  21772. this.styleDisabled_(disabled);
  21773. }
  21774. /**
  21775. * @param {string} content Sets the content of the helper text.
  21776. */
  21777. }, {
  21778. key: 'setHelperTextContent',
  21779. value: function setHelperTextContent(content) {
  21780. if (this.helperText_) {
  21781. this.helperText_.setContent(content);
  21782. }
  21783. }
  21784. /**
  21785. * Sets the aria label of the leading icon.
  21786. * @param {string} label
  21787. */
  21788. }, {
  21789. key: 'setLeadingIconAriaLabel',
  21790. value: function setLeadingIconAriaLabel(label) {
  21791. if (this.leadingIcon_) {
  21792. this.leadingIcon_.setAriaLabel(label);
  21793. }
  21794. }
  21795. /**
  21796. * Sets the text content of the leading icon.
  21797. * @param {string} content
  21798. */
  21799. }, {
  21800. key: 'setLeadingIconContent',
  21801. value: function setLeadingIconContent(content) {
  21802. if (this.leadingIcon_) {
  21803. this.leadingIcon_.setContent(content);
  21804. }
  21805. }
  21806. /**
  21807. * Sets the aria label of the trailing icon.
  21808. * @param {string} label
  21809. */
  21810. }, {
  21811. key: 'setTrailingIconAriaLabel',
  21812. value: function setTrailingIconAriaLabel(label) {
  21813. if (this.trailingIcon_) {
  21814. this.trailingIcon_.setAriaLabel(label);
  21815. }
  21816. }
  21817. /**
  21818. * Sets the text content of the trailing icon.
  21819. * @param {string} content
  21820. */
  21821. }, {
  21822. key: 'setTrailingIconContent',
  21823. value: function setTrailingIconContent(content) {
  21824. if (this.trailingIcon_) {
  21825. this.trailingIcon_.setContent(content);
  21826. }
  21827. }
  21828. /**
  21829. * @return {boolean} True if the Text Field input fails in converting the
  21830. * user-supplied value.
  21831. * @private
  21832. */
  21833. }, {
  21834. key: 'isBadInput_',
  21835. value: function isBadInput_() {
  21836. return this.getNativeInput_().validity.badInput;
  21837. }
  21838. /**
  21839. * @return {boolean} The result of native validity checking
  21840. * (ValidityState.valid).
  21841. */
  21842. }, {
  21843. key: 'isNativeInputValid_',
  21844. value: function isNativeInputValid_() {
  21845. return this.getNativeInput_().validity.valid;
  21846. }
  21847. /**
  21848. * Styles the component based on the validity state.
  21849. * @param {boolean} isValid
  21850. * @private
  21851. */
  21852. }, {
  21853. key: 'styleValidity_',
  21854. value: function styleValidity_(isValid) {
  21855. var INVALID = MDCTextFieldFoundation.cssClasses.INVALID;
  21856. if (isValid) {
  21857. this.adapter_.removeClass(INVALID);
  21858. } else {
  21859. this.adapter_.addClass(INVALID);
  21860. }
  21861. if (this.helperText_) {
  21862. this.helperText_.setValidity(isValid);
  21863. }
  21864. }
  21865. /**
  21866. * Styles the component based on the focused state.
  21867. * @param {boolean} isFocused
  21868. * @private
  21869. */
  21870. }, {
  21871. key: 'styleFocused_',
  21872. value: function styleFocused_(isFocused) {
  21873. var FOCUSED = MDCTextFieldFoundation.cssClasses.FOCUSED;
  21874. if (isFocused) {
  21875. this.adapter_.addClass(FOCUSED);
  21876. } else {
  21877. this.adapter_.removeClass(FOCUSED);
  21878. }
  21879. }
  21880. /**
  21881. * Styles the component based on the disabled state.
  21882. * @param {boolean} isDisabled
  21883. * @private
  21884. */
  21885. }, {
  21886. key: 'styleDisabled_',
  21887. value: function styleDisabled_(isDisabled) {
  21888. var _MDCTextFieldFoundati = MDCTextFieldFoundation.cssClasses,
  21889. DISABLED = _MDCTextFieldFoundati.DISABLED,
  21890. INVALID = _MDCTextFieldFoundati.INVALID;
  21891. if (isDisabled) {
  21892. this.adapter_.addClass(DISABLED);
  21893. this.adapter_.removeClass(INVALID);
  21894. } else {
  21895. this.adapter_.removeClass(DISABLED);
  21896. }
  21897. if (this.leadingIcon_) {
  21898. this.leadingIcon_.setDisabled(isDisabled);
  21899. }
  21900. if (this.trailingIcon_) {
  21901. this.trailingIcon_.setDisabled(isDisabled);
  21902. }
  21903. }
  21904. /**
  21905. * @return {!Element|!NativeInputType} The native text input from the
  21906. * host environment, or a dummy if none exists.
  21907. * @private
  21908. */
  21909. }, {
  21910. key: 'getNativeInput_',
  21911. value: function getNativeInput_() {
  21912. return this.adapter_.getNativeInput() ||
  21913. /** @type {!NativeInputType} */{
  21914. value: '',
  21915. disabled: false,
  21916. validity: {
  21917. badInput: false,
  21918. valid: true
  21919. }
  21920. };
  21921. }
  21922. }]);
  21923. return MDCTextFieldFoundation;
  21924. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  21925. /* harmony default export */ __webpack_exports__["a"] = (MDCTextFieldFoundation);
  21926. /***/ }),
  21927. /* 149 */
  21928. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  21929. "use strict";
  21930. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTextFieldHelperText; });
  21931. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  21932. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(61);
  21933. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(27);
  21934. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  21935. 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; };
  21936. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  21937. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21938. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  21939. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  21940. /**
  21941. * @license
  21942. * Copyright 2017 Google Inc.
  21943. *
  21944. * Permission is hereby granted, free of charge, to any person obtaining a copy
  21945. * of this software and associated documentation files (the "Software"), to deal
  21946. * in the Software without restriction, including without limitation the rights
  21947. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  21948. * copies of the Software, and to permit persons to whom the Software is
  21949. * furnished to do so, subject to the following conditions:
  21950. *
  21951. * The above copyright notice and this permission notice shall be included in
  21952. * all copies or substantial portions of the Software.
  21953. *
  21954. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  21955. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  21956. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  21957. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  21958. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21959. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  21960. * THE SOFTWARE.
  21961. */
  21962. /**
  21963. * @extends {MDCComponent<!MDCTextFieldHelperTextFoundation>}
  21964. * @final
  21965. */
  21966. var MDCTextFieldHelperText = function (_MDCComponent) {
  21967. _inherits(MDCTextFieldHelperText, _MDCComponent);
  21968. function MDCTextFieldHelperText() {
  21969. _classCallCheck(this, MDCTextFieldHelperText);
  21970. return _possibleConstructorReturn(this, (MDCTextFieldHelperText.__proto__ || Object.getPrototypeOf(MDCTextFieldHelperText)).apply(this, arguments));
  21971. }
  21972. _createClass(MDCTextFieldHelperText, [{
  21973. key: 'getDefaultFoundation',
  21974. /**
  21975. * @return {!MDCTextFieldHelperTextFoundation}
  21976. */
  21977. value: function getDefaultFoundation() {
  21978. var _this2 = this;
  21979. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]( /** @type {!MDCTextFieldHelperTextAdapter} */_extends({
  21980. addClass: function addClass(className) {
  21981. return _this2.root_.classList.add(className);
  21982. },
  21983. removeClass: function removeClass(className) {
  21984. return _this2.root_.classList.remove(className);
  21985. },
  21986. hasClass: function hasClass(className) {
  21987. return _this2.root_.classList.contains(className);
  21988. },
  21989. setAttr: function setAttr(attr, value) {
  21990. return _this2.root_.setAttribute(attr, value);
  21991. },
  21992. removeAttr: function removeAttr(attr) {
  21993. return _this2.root_.removeAttribute(attr);
  21994. },
  21995. setContent: function setContent(content) {
  21996. _this2.root_.textContent = content;
  21997. }
  21998. }));
  21999. }
  22000. }, {
  22001. key: 'foundation',
  22002. /**
  22003. * @return {!MDCTextFieldHelperTextFoundation}
  22004. */
  22005. get: function get() {
  22006. return this.foundation_;
  22007. }
  22008. }], [{
  22009. key: 'attachTo',
  22010. /**
  22011. * @param {!Element} root
  22012. * @return {!MDCTextFieldHelperText}
  22013. */
  22014. value: function attachTo(root) {
  22015. return new MDCTextFieldHelperText(root);
  22016. }
  22017. }]);
  22018. return MDCTextFieldHelperText;
  22019. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  22020. /***/ }),
  22021. /* 150 */
  22022. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22023. "use strict";
  22024. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTextFieldIcon; });
  22025. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(1);
  22026. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(62);
  22027. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(28);
  22028. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  22029. 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; };
  22030. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  22031. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22032. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  22033. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  22034. /**
  22035. * @license
  22036. * Copyright 2017 Google Inc.
  22037. *
  22038. * Permission is hereby granted, free of charge, to any person obtaining a copy
  22039. * of this software and associated documentation files (the "Software"), to deal
  22040. * in the Software without restriction, including without limitation the rights
  22041. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  22042. * copies of the Software, and to permit persons to whom the Software is
  22043. * furnished to do so, subject to the following conditions:
  22044. *
  22045. * The above copyright notice and this permission notice shall be included in
  22046. * all copies or substantial portions of the Software.
  22047. *
  22048. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  22049. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  22050. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22051. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22052. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  22053. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22054. * THE SOFTWARE.
  22055. */
  22056. /**
  22057. * @extends {MDCComponent<!MDCTextFieldIconFoundation>}
  22058. * @final
  22059. */
  22060. var MDCTextFieldIcon = function (_MDCComponent) {
  22061. _inherits(MDCTextFieldIcon, _MDCComponent);
  22062. function MDCTextFieldIcon() {
  22063. _classCallCheck(this, MDCTextFieldIcon);
  22064. return _possibleConstructorReturn(this, (MDCTextFieldIcon.__proto__ || Object.getPrototypeOf(MDCTextFieldIcon)).apply(this, arguments));
  22065. }
  22066. _createClass(MDCTextFieldIcon, [{
  22067. key: 'getDefaultFoundation',
  22068. /**
  22069. * @return {!MDCTextFieldIconFoundation}
  22070. */
  22071. value: function getDefaultFoundation() {
  22072. var _this2 = this;
  22073. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]( /** @type {!MDCTextFieldIconAdapter} */_extends({
  22074. getAttr: function getAttr(attr) {
  22075. return _this2.root_.getAttribute(attr);
  22076. },
  22077. setAttr: function setAttr(attr, value) {
  22078. return _this2.root_.setAttribute(attr, value);
  22079. },
  22080. removeAttr: function removeAttr(attr) {
  22081. return _this2.root_.removeAttribute(attr);
  22082. },
  22083. setContent: function setContent(content) {
  22084. _this2.root_.textContent = content;
  22085. },
  22086. registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
  22087. return _this2.root_.addEventListener(evtType, handler);
  22088. },
  22089. deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
  22090. return _this2.root_.removeEventListener(evtType, handler);
  22091. },
  22092. notifyIconAction: function notifyIconAction() {
  22093. return _this2.emit(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.ICON_EVENT, {} /* evtData */, true /* shouldBubble */);
  22094. }
  22095. }));
  22096. }
  22097. }, {
  22098. key: 'foundation',
  22099. /**
  22100. * @return {!MDCTextFieldIconFoundation}
  22101. */
  22102. get: function get() {
  22103. return this.foundation_;
  22104. }
  22105. }], [{
  22106. key: 'attachTo',
  22107. /**
  22108. * @param {!Element} root
  22109. * @return {!MDCTextFieldIcon}
  22110. */
  22111. value: function attachTo(root) {
  22112. return new MDCTextFieldIcon(root);
  22113. }
  22114. }]);
  22115. return MDCTextFieldIcon;
  22116. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  22117. /***/ }),
  22118. /* 151 */
  22119. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22120. "use strict";
  22121. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  22122. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCToolbar", function() { return MDCToolbar; });
  22123. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_index__ = __webpack_require__(3);
  22124. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__ = __webpack_require__(2);
  22125. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(152);
  22126. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCToolbarFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  22127. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  22128. 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); } };
  22129. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22130. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  22131. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  22132. /**
  22133. * @license
  22134. * Copyright 2017 Google Inc.
  22135. *
  22136. * Permission is hereby granted, free of charge, to any person obtaining a copy
  22137. * of this software and associated documentation files (the "Software"), to deal
  22138. * in the Software without restriction, including without limitation the rights
  22139. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  22140. * copies of the Software, and to permit persons to whom the Software is
  22141. * furnished to do so, subject to the following conditions:
  22142. *
  22143. * The above copyright notice and this permission notice shall be included in
  22144. * all copies or substantial portions of the Software.
  22145. *
  22146. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  22147. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  22148. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22149. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22150. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  22151. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22152. * THE SOFTWARE.
  22153. */
  22154. var MDCToolbar = function (_MDCComponent) {
  22155. _inherits(MDCToolbar, _MDCComponent);
  22156. function MDCToolbar() {
  22157. _classCallCheck(this, MDCToolbar);
  22158. return _possibleConstructorReturn(this, (MDCToolbar.__proto__ || Object.getPrototypeOf(MDCToolbar)).apply(this, arguments));
  22159. }
  22160. _createClass(MDCToolbar, [{
  22161. key: 'initialize',
  22162. value: function initialize() {
  22163. this.ripples_ = [].map.call(this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.ICON_SELECTOR), function (icon) {
  22164. var ripple = __WEBPACK_IMPORTED_MODULE_1__material_ripple_index__["MDCRipple"].attachTo(icon);
  22165. ripple.unbounded = true;
  22166. return ripple;
  22167. });
  22168. }
  22169. }, {
  22170. key: 'destroy',
  22171. value: function destroy() {
  22172. this.ripples_.forEach(function (ripple) {
  22173. ripple.destroy();
  22174. });
  22175. _get(MDCToolbar.prototype.__proto__ || Object.getPrototypeOf(MDCToolbar.prototype), 'destroy', this).call(this);
  22176. }
  22177. }, {
  22178. key: 'getDefaultFoundation',
  22179. value: function getDefaultFoundation() {
  22180. var _this2 = this;
  22181. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]({
  22182. hasClass: function hasClass(className) {
  22183. return _this2.root_.classList.contains(className);
  22184. },
  22185. addClass: function addClass(className) {
  22186. return _this2.root_.classList.add(className);
  22187. },
  22188. removeClass: function removeClass(className) {
  22189. return _this2.root_.classList.remove(className);
  22190. },
  22191. registerScrollHandler: function registerScrollHandler(handler) {
  22192. return window.addEventListener('scroll', handler);
  22193. },
  22194. deregisterScrollHandler: function deregisterScrollHandler(handler) {
  22195. return window.removeEventListener('scroll', handler);
  22196. },
  22197. registerResizeHandler: function registerResizeHandler(handler) {
  22198. return window.addEventListener('resize', handler);
  22199. },
  22200. deregisterResizeHandler: function deregisterResizeHandler(handler) {
  22201. return window.removeEventListener('resize', handler);
  22202. },
  22203. getViewportWidth: function getViewportWidth() {
  22204. return window.innerWidth;
  22205. },
  22206. getViewportScrollY: function getViewportScrollY() {
  22207. return window.pageYOffset;
  22208. },
  22209. getOffsetHeight: function getOffsetHeight() {
  22210. return _this2.root_.offsetHeight;
  22211. },
  22212. getFirstRowElementOffsetHeight: function getFirstRowElementOffsetHeight() {
  22213. return _this2.firstRowElement_.offsetHeight;
  22214. },
  22215. notifyChange: function notifyChange(evtData) {
  22216. return _this2.emit(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.CHANGE_EVENT, evtData);
  22217. },
  22218. setStyle: function setStyle(property, value) {
  22219. return _this2.root_.style.setProperty(property, value);
  22220. },
  22221. setStyleForTitleElement: function setStyleForTitleElement(property, value) {
  22222. return _this2.titleElement_.style.setProperty(property, value);
  22223. },
  22224. setStyleForFlexibleRowElement: function setStyleForFlexibleRowElement(property, value) {
  22225. return _this2.firstRowElement_.style.setProperty(property, value);
  22226. },
  22227. setStyleForFixedAdjustElement: function setStyleForFixedAdjustElement(property, value) {
  22228. if (_this2.fixedAdjustElement) {
  22229. _this2.fixedAdjustElement.style.setProperty(property, value);
  22230. }
  22231. }
  22232. });
  22233. }
  22234. }, {
  22235. key: 'firstRowElement_',
  22236. get: function get() {
  22237. return this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.FIRST_ROW_SELECTOR);
  22238. }
  22239. }, {
  22240. key: 'titleElement_',
  22241. get: function get() {
  22242. return this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.TITLE_SELECTOR);
  22243. }
  22244. }, {
  22245. key: 'fixedAdjustElement',
  22246. set: function set(fixedAdjustElement) {
  22247. this.fixedAdjustElement_ = fixedAdjustElement;
  22248. this.foundation_.updateAdjustElementStyles();
  22249. },
  22250. get: function get() {
  22251. return this.fixedAdjustElement_;
  22252. }
  22253. }], [{
  22254. key: 'attachTo',
  22255. value: function attachTo(root) {
  22256. return new MDCToolbar(root);
  22257. }
  22258. }]);
  22259. return MDCToolbar;
  22260. }(__WEBPACK_IMPORTED_MODULE_0__material_base_index__["MDCComponent"]);
  22261. /***/ }),
  22262. /* 152 */
  22263. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22264. "use strict";
  22265. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  22266. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(153);
  22267. 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; };
  22268. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  22269. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22270. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  22271. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  22272. /**
  22273. * @license
  22274. * Copyright 2017 Google Inc.
  22275. *
  22276. * Permission is hereby granted, free of charge, to any person obtaining a copy
  22277. * of this software and associated documentation files (the "Software"), to deal
  22278. * in the Software without restriction, including without limitation the rights
  22279. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  22280. * copies of the Software, and to permit persons to whom the Software is
  22281. * furnished to do so, subject to the following conditions:
  22282. *
  22283. * The above copyright notice and this permission notice shall be included in
  22284. * all copies or substantial portions of the Software.
  22285. *
  22286. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  22287. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  22288. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22289. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22290. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  22291. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22292. * THE SOFTWARE.
  22293. */
  22294. var MDCToolbarFoundation = function (_MDCFoundation) {
  22295. _inherits(MDCToolbarFoundation, _MDCFoundation);
  22296. _createClass(MDCToolbarFoundation, null, [{
  22297. key: 'cssClasses',
  22298. get: function get() {
  22299. return __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */];
  22300. }
  22301. }, {
  22302. key: 'strings',
  22303. get: function get() {
  22304. return __WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */];
  22305. }
  22306. }, {
  22307. key: 'numbers',
  22308. get: function get() {
  22309. return __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* numbers */];
  22310. }
  22311. }, {
  22312. key: 'defaultAdapter',
  22313. get: function get() {
  22314. return {
  22315. hasClass: function hasClass() {
  22316. return (/* className: string */ /* boolean */false
  22317. );
  22318. },
  22319. addClass: function addClass() /* className: string */{},
  22320. removeClass: function removeClass() /* className: string */{},
  22321. registerScrollHandler: function registerScrollHandler() /* handler: EventListener */{},
  22322. deregisterScrollHandler: function deregisterScrollHandler() /* handler: EventListener */{},
  22323. registerResizeHandler: function registerResizeHandler() /* handler: EventListener */{},
  22324. deregisterResizeHandler: function deregisterResizeHandler() /* handler: EventListener */{},
  22325. getViewportWidth: function getViewportWidth() {
  22326. return (/* number */0
  22327. );
  22328. },
  22329. getViewportScrollY: function getViewportScrollY() {
  22330. return (/* number */0
  22331. );
  22332. },
  22333. getOffsetHeight: function getOffsetHeight() {
  22334. return (/* number */0
  22335. );
  22336. },
  22337. getFirstRowElementOffsetHeight: function getFirstRowElementOffsetHeight() {
  22338. return (/* number */0
  22339. );
  22340. },
  22341. notifyChange: function notifyChange() /* evtData: {flexibleExpansionRatio: number} */{},
  22342. setStyle: function setStyle() /* property: string, value: string */{},
  22343. setStyleForTitleElement: function setStyleForTitleElement() /* property: string, value: string */{},
  22344. setStyleForFlexibleRowElement: function setStyleForFlexibleRowElement() /* property: string, value: string */{},
  22345. setStyleForFixedAdjustElement: function setStyleForFixedAdjustElement() /* property: string, value: string */{}
  22346. };
  22347. }
  22348. }]);
  22349. function MDCToolbarFoundation(adapter) {
  22350. _classCallCheck(this, MDCToolbarFoundation);
  22351. var _this = _possibleConstructorReturn(this, (MDCToolbarFoundation.__proto__ || Object.getPrototypeOf(MDCToolbarFoundation)).call(this, _extends(MDCToolbarFoundation.defaultAdapter, adapter)));
  22352. _this.resizeHandler_ = function () {
  22353. return _this.checkRowHeight_();
  22354. };
  22355. _this.scrollHandler_ = function () {
  22356. return _this.updateToolbarStyles_();
  22357. };
  22358. _this.checkRowHeightFrame_ = 0;
  22359. _this.scrollFrame_ = 0;
  22360. _this.executedLastChange_ = false;
  22361. _this.calculations_ = {
  22362. toolbarRowHeight: 0,
  22363. // Calculated Height ratio. We use ratio to calculate corresponding heights in resize event.
  22364. toolbarRatio: 0, // The ratio of toolbar height to row height
  22365. flexibleExpansionRatio: 0, // The ratio of flexible space height to row height
  22366. maxTranslateYRatio: 0, // The ratio of max toolbar move up distance to row height
  22367. scrollThresholdRatio: 0, // The ratio of max scrollTop that we should listen to to row height
  22368. // Derived Heights based on the above key ratios.
  22369. toolbarHeight: 0,
  22370. flexibleExpansionHeight: 0, // Flexible row minus toolbar height (derived)
  22371. maxTranslateYDistance: 0, // When toolbar only fix last row (derived)
  22372. scrollThreshold: 0
  22373. };
  22374. // Toolbar fixed behavior
  22375. // If toolbar is fixed
  22376. _this.fixed_ = false;
  22377. // If fixed is targeted only at the last row
  22378. _this.fixedLastrow_ = false;
  22379. // Toolbar flexible behavior
  22380. // If the first row is flexible
  22381. _this.hasFlexibleRow_ = false;
  22382. // If use the default behavior
  22383. _this.useFlexDefaultBehavior_ = false;
  22384. return _this;
  22385. }
  22386. _createClass(MDCToolbarFoundation, [{
  22387. key: 'init',
  22388. value: function init() {
  22389. this.fixed_ = this.adapter_.hasClass(MDCToolbarFoundation.cssClasses.FIXED);
  22390. this.fixedLastrow_ = this.adapter_.hasClass(MDCToolbarFoundation.cssClasses.FIXED_LASTROW) & this.fixed_;
  22391. this.hasFlexibleRow_ = this.adapter_.hasClass(MDCToolbarFoundation.cssClasses.TOOLBAR_ROW_FLEXIBLE);
  22392. if (this.hasFlexibleRow_) {
  22393. this.useFlexDefaultBehavior_ = this.adapter_.hasClass(MDCToolbarFoundation.cssClasses.FLEXIBLE_DEFAULT_BEHAVIOR);
  22394. }
  22395. this.initKeyRatio_();
  22396. this.setKeyHeights_();
  22397. this.adapter_.registerResizeHandler(this.resizeHandler_);
  22398. this.adapter_.registerScrollHandler(this.scrollHandler_);
  22399. }
  22400. }, {
  22401. key: 'destroy',
  22402. value: function destroy() {
  22403. this.adapter_.deregisterResizeHandler(this.resizeHandler_);
  22404. this.adapter_.deregisterScrollHandler(this.scrollHandler_);
  22405. }
  22406. }, {
  22407. key: 'updateAdjustElementStyles',
  22408. value: function updateAdjustElementStyles() {
  22409. if (this.fixed_) {
  22410. this.adapter_.setStyleForFixedAdjustElement('margin-top', this.calculations_.toolbarHeight + 'px');
  22411. }
  22412. }
  22413. }, {
  22414. key: 'getFlexibleExpansionRatio_',
  22415. value: function getFlexibleExpansionRatio_(scrollTop) {
  22416. // To prevent division by zero when there is no flexibleExpansionHeight
  22417. var delta = 0.0001;
  22418. return Math.max(0, 1 - scrollTop / (this.calculations_.flexibleExpansionHeight + delta));
  22419. }
  22420. }, {
  22421. key: 'checkRowHeight_',
  22422. value: function checkRowHeight_() {
  22423. var _this2 = this;
  22424. cancelAnimationFrame(this.checkRowHeightFrame_);
  22425. this.checkRowHeightFrame_ = requestAnimationFrame(function () {
  22426. return _this2.setKeyHeights_();
  22427. });
  22428. }
  22429. }, {
  22430. key: 'setKeyHeights_',
  22431. value: function setKeyHeights_() {
  22432. var newToolbarRowHeight = this.getRowHeight_();
  22433. if (newToolbarRowHeight !== this.calculations_.toolbarRowHeight) {
  22434. this.calculations_.toolbarRowHeight = newToolbarRowHeight;
  22435. this.calculations_.toolbarHeight = this.calculations_.toolbarRatio * this.calculations_.toolbarRowHeight;
  22436. this.calculations_.flexibleExpansionHeight = this.calculations_.flexibleExpansionRatio * this.calculations_.toolbarRowHeight;
  22437. this.calculations_.maxTranslateYDistance = this.calculations_.maxTranslateYRatio * this.calculations_.toolbarRowHeight;
  22438. this.calculations_.scrollThreshold = this.calculations_.scrollThresholdRatio * this.calculations_.toolbarRowHeight;
  22439. this.updateAdjustElementStyles();
  22440. this.updateToolbarStyles_();
  22441. }
  22442. }
  22443. }, {
  22444. key: 'updateToolbarStyles_',
  22445. value: function updateToolbarStyles_() {
  22446. var _this3 = this;
  22447. cancelAnimationFrame(this.scrollFrame_);
  22448. this.scrollFrame_ = requestAnimationFrame(function () {
  22449. var scrollTop = _this3.adapter_.getViewportScrollY();
  22450. var hasScrolledOutOfThreshold = _this3.scrolledOutOfThreshold_(scrollTop);
  22451. if (hasScrolledOutOfThreshold && _this3.executedLastChange_) {
  22452. return;
  22453. }
  22454. var flexibleExpansionRatio = _this3.getFlexibleExpansionRatio_(scrollTop);
  22455. _this3.updateToolbarFlexibleState_(flexibleExpansionRatio);
  22456. if (_this3.fixedLastrow_) {
  22457. _this3.updateToolbarFixedState_(scrollTop);
  22458. }
  22459. if (_this3.hasFlexibleRow_) {
  22460. _this3.updateFlexibleRowElementStyles_(flexibleExpansionRatio);
  22461. }
  22462. _this3.executedLastChange_ = hasScrolledOutOfThreshold;
  22463. _this3.adapter_.notifyChange({ flexibleExpansionRatio: flexibleExpansionRatio });
  22464. });
  22465. }
  22466. }, {
  22467. key: 'scrolledOutOfThreshold_',
  22468. value: function scrolledOutOfThreshold_(scrollTop) {
  22469. return scrollTop > this.calculations_.scrollThreshold;
  22470. }
  22471. }, {
  22472. key: 'initKeyRatio_',
  22473. value: function initKeyRatio_() {
  22474. var toolbarRowHeight = this.getRowHeight_();
  22475. var firstRowMaxRatio = this.adapter_.getFirstRowElementOffsetHeight() / toolbarRowHeight;
  22476. this.calculations_.toolbarRatio = this.adapter_.getOffsetHeight() / toolbarRowHeight;
  22477. this.calculations_.flexibleExpansionRatio = firstRowMaxRatio - 1;
  22478. this.calculations_.maxTranslateYRatio = this.fixedLastrow_ ? this.calculations_.toolbarRatio - firstRowMaxRatio : 0;
  22479. this.calculations_.scrollThresholdRatio = (this.fixedLastrow_ ? this.calculations_.toolbarRatio : firstRowMaxRatio) - 1;
  22480. }
  22481. }, {
  22482. key: 'getRowHeight_',
  22483. value: function getRowHeight_() {
  22484. var breakpoint = MDCToolbarFoundation.numbers.TOOLBAR_MOBILE_BREAKPOINT;
  22485. return this.adapter_.getViewportWidth() < breakpoint ? MDCToolbarFoundation.numbers.TOOLBAR_ROW_MOBILE_HEIGHT : MDCToolbarFoundation.numbers.TOOLBAR_ROW_HEIGHT;
  22486. }
  22487. }, {
  22488. key: 'updateToolbarFlexibleState_',
  22489. value: function updateToolbarFlexibleState_(flexibleExpansionRatio) {
  22490. this.adapter_.removeClass(MDCToolbarFoundation.cssClasses.FLEXIBLE_MAX);
  22491. this.adapter_.removeClass(MDCToolbarFoundation.cssClasses.FLEXIBLE_MIN);
  22492. if (flexibleExpansionRatio === 1) {
  22493. this.adapter_.addClass(MDCToolbarFoundation.cssClasses.FLEXIBLE_MAX);
  22494. } else if (flexibleExpansionRatio === 0) {
  22495. this.adapter_.addClass(MDCToolbarFoundation.cssClasses.FLEXIBLE_MIN);
  22496. }
  22497. }
  22498. }, {
  22499. key: 'updateToolbarFixedState_',
  22500. value: function updateToolbarFixedState_(scrollTop) {
  22501. var translateDistance = Math.max(0, Math.min(scrollTop - this.calculations_.flexibleExpansionHeight, this.calculations_.maxTranslateYDistance));
  22502. this.adapter_.setStyle('transform', 'translateY(' + -translateDistance + 'px)');
  22503. if (translateDistance === this.calculations_.maxTranslateYDistance) {
  22504. this.adapter_.addClass(MDCToolbarFoundation.cssClasses.FIXED_AT_LAST_ROW);
  22505. } else {
  22506. this.adapter_.removeClass(MDCToolbarFoundation.cssClasses.FIXED_AT_LAST_ROW);
  22507. }
  22508. }
  22509. }, {
  22510. key: 'updateFlexibleRowElementStyles_',
  22511. value: function updateFlexibleRowElementStyles_(flexibleExpansionRatio) {
  22512. if (this.fixed_) {
  22513. var height = this.calculations_.flexibleExpansionHeight * flexibleExpansionRatio;
  22514. this.adapter_.setStyleForFlexibleRowElement('height', height + this.calculations_.toolbarRowHeight + 'px');
  22515. }
  22516. if (this.useFlexDefaultBehavior_) {
  22517. this.updateElementStylesDefaultBehavior_(flexibleExpansionRatio);
  22518. }
  22519. }
  22520. }, {
  22521. key: 'updateElementStylesDefaultBehavior_',
  22522. value: function updateElementStylesDefaultBehavior_(flexibleExpansionRatio) {
  22523. var maxTitleSize = MDCToolbarFoundation.numbers.MAX_TITLE_SIZE;
  22524. var minTitleSize = MDCToolbarFoundation.numbers.MIN_TITLE_SIZE;
  22525. var currentTitleSize = (maxTitleSize - minTitleSize) * flexibleExpansionRatio + minTitleSize;
  22526. this.adapter_.setStyleForTitleElement('font-size', currentTitleSize + 'rem');
  22527. }
  22528. }]);
  22529. return MDCToolbarFoundation;
  22530. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  22531. /* harmony default export */ __webpack_exports__["a"] = (MDCToolbarFoundation);
  22532. /***/ }),
  22533. /* 153 */
  22534. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22535. "use strict";
  22536. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  22537. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  22538. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  22539. /**
  22540. * @license
  22541. * Copyright 2017 Google Inc.
  22542. *
  22543. * Permission is hereby granted, free of charge, to any person obtaining a copy
  22544. * of this software and associated documentation files (the "Software"), to deal
  22545. * in the Software without restriction, including without limitation the rights
  22546. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  22547. * copies of the Software, and to permit persons to whom the Software is
  22548. * furnished to do so, subject to the following conditions:
  22549. *
  22550. * The above copyright notice and this permission notice shall be included in
  22551. * all copies or substantial portions of the Software.
  22552. *
  22553. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  22554. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  22555. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22556. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22557. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  22558. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22559. * THE SOFTWARE.
  22560. */
  22561. var cssClasses = {
  22562. FIXED: 'mdc-toolbar--fixed',
  22563. FIXED_LASTROW: 'mdc-toolbar--fixed-lastrow-only',
  22564. FIXED_AT_LAST_ROW: 'mdc-toolbar--fixed-at-last-row',
  22565. TOOLBAR_ROW_FLEXIBLE: 'mdc-toolbar--flexible',
  22566. FLEXIBLE_DEFAULT_BEHAVIOR: 'mdc-toolbar--flexible-default-behavior',
  22567. FLEXIBLE_MAX: 'mdc-toolbar--flexible-space-maximized',
  22568. FLEXIBLE_MIN: 'mdc-toolbar--flexible-space-minimized'
  22569. };
  22570. var strings = {
  22571. TITLE_SELECTOR: '.mdc-toolbar__title',
  22572. ICON_SELECTOR: '.mdc-toolbar__icon',
  22573. FIRST_ROW_SELECTOR: '.mdc-toolbar__row:first-child',
  22574. CHANGE_EVENT: 'MDCToolbar:change'
  22575. };
  22576. var numbers = {
  22577. MAX_TITLE_SIZE: 2.125,
  22578. MIN_TITLE_SIZE: 1.25,
  22579. TOOLBAR_ROW_HEIGHT: 64,
  22580. TOOLBAR_ROW_MOBILE_HEIGHT: 56,
  22581. TOOLBAR_MOBILE_BREAKPOINT: 600
  22582. };
  22583. /***/ }),
  22584. /* 154 */
  22585. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22586. "use strict";
  22587. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  22588. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTopAppBar", function() { return MDCTopAppBar; });
  22589. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__adapter__ = __webpack_require__(7);
  22590. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(1);
  22591. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_ripple_index__ = __webpack_require__(2);
  22592. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(8);
  22593. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__foundation__ = __webpack_require__(13);
  22594. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__fixed_foundation__ = __webpack_require__(155);
  22595. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__short_foundation__ = __webpack_require__(156);
  22596. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__standard_foundation__ = __webpack_require__(157);
  22597. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTopAppBarBaseFoundation", function() { return __WEBPACK_IMPORTED_MODULE_4__foundation__["a"]; });
  22598. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTopAppBarFoundation", function() { return __WEBPACK_IMPORTED_MODULE_7__standard_foundation__["a"]; });
  22599. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFixedTopAppBarFoundation", function() { return __WEBPACK_IMPORTED_MODULE_5__fixed_foundation__["a"]; });
  22600. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCShortTopAppBarFoundation", function() { return __WEBPACK_IMPORTED_MODULE_6__short_foundation__["a"]; });
  22601. 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; };
  22602. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  22603. 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); } };
  22604. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22605. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  22606. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  22607. /**
  22608. * @license
  22609. * Copyright 2018 Google Inc.
  22610. *
  22611. * Permission is hereby granted, free of charge, to any person obtaining a copy
  22612. * of this software and associated documentation files (the "Software"), to deal
  22613. * in the Software without restriction, including without limitation the rights
  22614. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  22615. * copies of the Software, and to permit persons to whom the Software is
  22616. * furnished to do so, subject to the following conditions:
  22617. *
  22618. * The above copyright notice and this permission notice shall be included in
  22619. * all copies or substantial portions of the Software.
  22620. *
  22621. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  22622. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  22623. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22624. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22625. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  22626. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22627. * THE SOFTWARE.
  22628. */
  22629. /**
  22630. * @extends {MDCComponent<!MDCTopAppBarBaseFoundation>}
  22631. * @final
  22632. */
  22633. var MDCTopAppBar = function (_MDCComponent) {
  22634. _inherits(MDCTopAppBar, _MDCComponent);
  22635. /**
  22636. * @param {...?} args
  22637. */
  22638. function MDCTopAppBar() {
  22639. var _ref;
  22640. _classCallCheck(this, MDCTopAppBar);
  22641. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  22642. args[_key] = arguments[_key];
  22643. }
  22644. /** @private {?Element} */
  22645. var _this = _possibleConstructorReturn(this, (_ref = MDCTopAppBar.__proto__ || Object.getPrototypeOf(MDCTopAppBar)).call.apply(_ref, [this].concat(args)));
  22646. _this.navIcon_;
  22647. /** @type {?Array<MDCRipple>} */
  22648. _this.iconRipples_;
  22649. /** @type {Object} */
  22650. _this.scrollTarget_;
  22651. return _this;
  22652. }
  22653. _createClass(MDCTopAppBar, [{
  22654. key: 'initialize',
  22655. value: function initialize() {
  22656. var rippleFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el) {
  22657. return __WEBPACK_IMPORTED_MODULE_2__material_ripple_index__["MDCRipple"].attachTo(el);
  22658. };
  22659. this.navIcon_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].NAVIGATION_ICON_SELECTOR);
  22660. // Get all icons in the toolbar and instantiate the ripples
  22661. var icons = [].slice.call(this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ACTION_ITEM_SELECTOR));
  22662. if (this.navIcon_) {
  22663. icons.push(this.navIcon_);
  22664. }
  22665. this.iconRipples_ = icons.map(function (icon) {
  22666. var ripple = rippleFactory(icon);
  22667. ripple.unbounded = true;
  22668. return ripple;
  22669. });
  22670. this.scrollTarget_ = window;
  22671. }
  22672. }, {
  22673. key: 'destroy',
  22674. value: function destroy() {
  22675. this.iconRipples_.forEach(function (iconRipple) {
  22676. return iconRipple.destroy();
  22677. });
  22678. _get(MDCTopAppBar.prototype.__proto__ || Object.getPrototypeOf(MDCTopAppBar.prototype), 'destroy', this).call(this);
  22679. }
  22680. }, {
  22681. key: 'setScrollTarget',
  22682. value: function setScrollTarget(target) {
  22683. this.foundation_.destroyScrollHandler();
  22684. this.scrollTarget_ = target;
  22685. this.foundation_.initScrollHandler();
  22686. }
  22687. /**
  22688. * @param {!Element} root
  22689. * @return {!MDCTopAppBar}
  22690. */
  22691. }, {
  22692. key: 'getDefaultFoundation',
  22693. /**
  22694. * @return {!MDCTopAppBarBaseFoundation}
  22695. */
  22696. value: function getDefaultFoundation() {
  22697. var _this2 = this;
  22698. /** @type {!MDCTopAppBarAdapter} */
  22699. var adapter = /** @type {!MDCTopAppBarAdapter} */_extends({
  22700. hasClass: function hasClass(className) {
  22701. return _this2.root_.classList.contains(className);
  22702. },
  22703. addClass: function addClass(className) {
  22704. return _this2.root_.classList.add(className);
  22705. },
  22706. removeClass: function removeClass(className) {
  22707. return _this2.root_.classList.remove(className);
  22708. },
  22709. setStyle: function setStyle(property, value) {
  22710. return _this2.root_.style.setProperty(property, value);
  22711. },
  22712. getTopAppBarHeight: function getTopAppBarHeight() {
  22713. return _this2.root_.clientHeight;
  22714. },
  22715. registerNavigationIconInteractionHandler: function registerNavigationIconInteractionHandler(evtType, handler) {
  22716. if (_this2.navIcon_) {
  22717. _this2.navIcon_.addEventListener(evtType, handler);
  22718. }
  22719. },
  22720. deregisterNavigationIconInteractionHandler: function deregisterNavigationIconInteractionHandler(evtType, handler) {
  22721. if (_this2.navIcon_) {
  22722. _this2.navIcon_.removeEventListener(evtType, handler);
  22723. }
  22724. },
  22725. notifyNavigationIconClicked: function notifyNavigationIconClicked() {
  22726. _this2.emit(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].NAVIGATION_EVENT, {});
  22727. },
  22728. registerScrollHandler: function registerScrollHandler(handler) {
  22729. return _this2.scrollTarget_.addEventListener('scroll', handler);
  22730. },
  22731. deregisterScrollHandler: function deregisterScrollHandler(handler) {
  22732. return _this2.scrollTarget_.removeEventListener('scroll', handler);
  22733. },
  22734. registerResizeHandler: function registerResizeHandler(handler) {
  22735. return window.addEventListener('resize', handler);
  22736. },
  22737. deregisterResizeHandler: function deregisterResizeHandler(handler) {
  22738. return window.removeEventListener('resize', handler);
  22739. },
  22740. getViewportScrollY: function getViewportScrollY() {
  22741. return _this2.scrollTarget_[_this2.scrollTarget_ === window ? 'pageYOffset' : 'scrollTop'];
  22742. },
  22743. getTotalActionItems: function getTotalActionItems() {
  22744. return _this2.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].ACTION_ITEM_SELECTOR).length;
  22745. }
  22746. });
  22747. /** @type {!MDCTopAppBarBaseFoundation} */
  22748. var foundation = void 0;
  22749. if (this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].SHORT_CLASS)) {
  22750. foundation = new __WEBPACK_IMPORTED_MODULE_6__short_foundation__["a" /* default */](adapter);
  22751. } else if (this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].FIXED_CLASS)) {
  22752. foundation = new __WEBPACK_IMPORTED_MODULE_5__fixed_foundation__["a" /* default */](adapter);
  22753. } else {
  22754. foundation = new __WEBPACK_IMPORTED_MODULE_7__standard_foundation__["a" /* default */](adapter);
  22755. }
  22756. return foundation;
  22757. }
  22758. }], [{
  22759. key: 'attachTo',
  22760. value: function attachTo(root) {
  22761. return new MDCTopAppBar(root);
  22762. }
  22763. }]);
  22764. return MDCTopAppBar;
  22765. }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* default */]);
  22766. /***/ }),
  22767. /* 155 */
  22768. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22769. "use strict";
  22770. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__constants__ = __webpack_require__(8);
  22771. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(7);
  22772. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(13);
  22773. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  22774. 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); } };
  22775. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22776. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  22777. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  22778. /**
  22779. * @license
  22780. * Copyright 2018 Google Inc.
  22781. *
  22782. * Permission is hereby granted, free of charge, to any person obtaining a copy
  22783. * of this software and associated documentation files (the "Software"), to deal
  22784. * in the Software without restriction, including without limitation the rights
  22785. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  22786. * copies of the Software, and to permit persons to whom the Software is
  22787. * furnished to do so, subject to the following conditions:
  22788. *
  22789. * The above copyright notice and this permission notice shall be included in
  22790. * all copies or substantial portions of the Software.
  22791. *
  22792. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  22793. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  22794. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22795. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22796. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  22797. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22798. * THE SOFTWARE.
  22799. */
  22800. /**
  22801. * @extends {MDCTopAppBarFoundation<!MDCFixedTopAppBarFoundation>}
  22802. * @final
  22803. */
  22804. var MDCFixedTopAppBarFoundation = function (_MDCTopAppBarFoundati) {
  22805. _inherits(MDCFixedTopAppBarFoundation, _MDCTopAppBarFoundati);
  22806. /**
  22807. * @param {!MDCTopAppBarAdapter} adapter
  22808. */
  22809. function MDCFixedTopAppBarFoundation(adapter) {
  22810. _classCallCheck(this, MDCFixedTopAppBarFoundation);
  22811. /** State variable for the previous scroll iteration top app bar state */
  22812. var _this = _possibleConstructorReturn(this, (MDCFixedTopAppBarFoundation.__proto__ || Object.getPrototypeOf(MDCFixedTopAppBarFoundation)).call(this, adapter));
  22813. _this.wasScrolled_ = false;
  22814. _this.scrollHandler_ = function () {
  22815. return _this.fixedScrollHandler_();
  22816. };
  22817. return _this;
  22818. }
  22819. _createClass(MDCFixedTopAppBarFoundation, [{
  22820. key: 'init',
  22821. value: function init() {
  22822. _get(MDCFixedTopAppBarFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCFixedTopAppBarFoundation.prototype), 'init', this).call(this);
  22823. this.adapter_.registerScrollHandler(this.scrollHandler_);
  22824. }
  22825. }, {
  22826. key: 'destroy',
  22827. value: function destroy() {
  22828. _get(MDCFixedTopAppBarFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCFixedTopAppBarFoundation.prototype), 'destroy', this).call(this);
  22829. this.adapter_.deregisterScrollHandler(this.scrollHandler_);
  22830. }
  22831. /**
  22832. * Scroll handler for applying/removing the modifier class
  22833. * on the fixed top app bar.
  22834. */
  22835. }, {
  22836. key: 'fixedScrollHandler_',
  22837. value: function fixedScrollHandler_() {
  22838. var currentScroll = this.adapter_.getViewportScrollY();
  22839. if (currentScroll <= 0) {
  22840. if (this.wasScrolled_) {
  22841. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].FIXED_SCROLLED_CLASS);
  22842. this.wasScrolled_ = false;
  22843. }
  22844. } else {
  22845. if (!this.wasScrolled_) {
  22846. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].FIXED_SCROLLED_CLASS);
  22847. this.wasScrolled_ = true;
  22848. }
  22849. }
  22850. }
  22851. }]);
  22852. return MDCFixedTopAppBarFoundation;
  22853. }(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]);
  22854. /* harmony default export */ __webpack_exports__["a"] = (MDCFixedTopAppBarFoundation);
  22855. /***/ }),
  22856. /* 156 */
  22857. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22858. "use strict";
  22859. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__adapter__ = __webpack_require__(7);
  22860. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(13);
  22861. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(8);
  22862. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  22863. 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); } };
  22864. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22865. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  22866. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  22867. /**
  22868. * @license
  22869. * Copyright 2018 Google Inc.
  22870. *
  22871. * Permission is hereby granted, free of charge, to any person obtaining a copy
  22872. * of this software and associated documentation files (the "Software"), to deal
  22873. * in the Software without restriction, including without limitation the rights
  22874. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  22875. * copies of the Software, and to permit persons to whom the Software is
  22876. * furnished to do so, subject to the following conditions:
  22877. *
  22878. * The above copyright notice and this permission notice shall be included in
  22879. * all copies or substantial portions of the Software.
  22880. *
  22881. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  22882. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  22883. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22884. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22885. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  22886. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22887. * THE SOFTWARE.
  22888. */
  22889. /**
  22890. * @extends {MDCTopAppBarBaseFoundation<!MDCShortTopAppBarFoundation>}
  22891. * @final
  22892. */
  22893. var MDCShortTopAppBarFoundation = function (_MDCTopAppBarBaseFoun) {
  22894. _inherits(MDCShortTopAppBarFoundation, _MDCTopAppBarBaseFoun);
  22895. /**
  22896. * @param {!MDCTopAppBarAdapter} adapter
  22897. */
  22898. function MDCShortTopAppBarFoundation(adapter) {
  22899. _classCallCheck(this, MDCShortTopAppBarFoundation);
  22900. // State variable for the current top app bar state
  22901. var _this = _possibleConstructorReturn(this, (MDCShortTopAppBarFoundation.__proto__ || Object.getPrototypeOf(MDCShortTopAppBarFoundation)).call(this, adapter));
  22902. _this.isCollapsed = false;
  22903. _this.scrollHandler_ = function () {
  22904. return _this.shortAppBarScrollHandler_();
  22905. };
  22906. return _this;
  22907. }
  22908. _createClass(MDCShortTopAppBarFoundation, [{
  22909. key: 'init',
  22910. value: function init() {
  22911. _get(MDCShortTopAppBarFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCShortTopAppBarFoundation.prototype), 'init', this).call(this);
  22912. var isAlwaysCollapsed = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SHORT_COLLAPSED_CLASS);
  22913. if (this.adapter_.getTotalActionItems() > 0) {
  22914. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SHORT_HAS_ACTION_ITEM_CLASS);
  22915. }
  22916. if (!isAlwaysCollapsed) {
  22917. this.adapter_.registerScrollHandler(this.scrollHandler_);
  22918. this.shortAppBarScrollHandler_();
  22919. }
  22920. }
  22921. }, {
  22922. key: 'destroy',
  22923. value: function destroy() {
  22924. _get(MDCShortTopAppBarFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCShortTopAppBarFoundation.prototype), 'destroy', this).call(this);
  22925. this.adapter_.deregisterScrollHandler(this.scrollHandler_);
  22926. }
  22927. /**
  22928. * Scroll handler for applying/removing the collapsed modifier class
  22929. * on the short top app bar.
  22930. * @private
  22931. */
  22932. }, {
  22933. key: 'shortAppBarScrollHandler_',
  22934. value: function shortAppBarScrollHandler_() {
  22935. var currentScroll = this.adapter_.getViewportScrollY();
  22936. if (currentScroll <= 0) {
  22937. if (this.isCollapsed) {
  22938. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SHORT_COLLAPSED_CLASS);
  22939. this.isCollapsed = false;
  22940. }
  22941. } else {
  22942. if (!this.isCollapsed) {
  22943. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].SHORT_COLLAPSED_CLASS);
  22944. this.isCollapsed = true;
  22945. }
  22946. }
  22947. }
  22948. }]);
  22949. return MDCShortTopAppBarFoundation;
  22950. }(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]);
  22951. /* harmony default export */ __webpack_exports__["a"] = (MDCShortTopAppBarFoundation);
  22952. /***/ }),
  22953. /* 157 */
  22954. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22955. "use strict";
  22956. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__adapter__ = __webpack_require__(7);
  22957. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(13);
  22958. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(8);
  22959. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  22960. 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); } };
  22961. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22962. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  22963. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  22964. /**
  22965. * @license
  22966. * Copyright 2018 Google Inc.
  22967. *
  22968. * Permission is hereby granted, free of charge, to any person obtaining a copy
  22969. * of this software and associated documentation files (the "Software"), to deal
  22970. * in the Software without restriction, including without limitation the rights
  22971. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  22972. * copies of the Software, and to permit persons to whom the Software is
  22973. * furnished to do so, subject to the following conditions:
  22974. *
  22975. * The above copyright notice and this permission notice shall be included in
  22976. * all copies or substantial portions of the Software.
  22977. *
  22978. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  22979. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  22980. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22981. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22982. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  22983. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22984. * THE SOFTWARE.
  22985. */
  22986. var INITIAL_VALUE = 0;
  22987. /**
  22988. * @extends {MDCTopAppBarBaseFoundation<!MDCTopAppBarFoundation>}
  22989. * @final
  22990. */
  22991. var MDCTopAppBarFoundation = function (_MDCTopAppBarBaseFoun) {
  22992. _inherits(MDCTopAppBarFoundation, _MDCTopAppBarBaseFoun);
  22993. /**
  22994. * @param {!MDCTopAppBarAdapter} adapter
  22995. */
  22996. function MDCTopAppBarFoundation(adapter) {
  22997. _classCallCheck(this, MDCTopAppBarFoundation);
  22998. /**
  22999. * Used for diffs of current scroll position vs previous scroll position
  23000. * @private {number}
  23001. */
  23002. var _this = _possibleConstructorReturn(this, (MDCTopAppBarFoundation.__proto__ || Object.getPrototypeOf(MDCTopAppBarFoundation)).call(this, adapter));
  23003. _this.lastScrollPosition_ = _this.adapter_.getViewportScrollY();
  23004. /**
  23005. * Used to verify when the top app bar is completely showing or completely hidden
  23006. * @private {number}
  23007. */
  23008. _this.topAppBarHeight_ = _this.adapter_.getTopAppBarHeight();
  23009. /**
  23010. * wasDocked_ is used to indicate if the top app bar was docked in the previous
  23011. * scroll handler iteration.
  23012. * @private {boolean}
  23013. */
  23014. _this.wasDocked_ = true;
  23015. /**
  23016. * isDockedShowing_ is used to indicate if the top app bar is docked in the fully
  23017. * shown position.
  23018. * @private {boolean}
  23019. */
  23020. _this.isDockedShowing_ = true;
  23021. /**
  23022. * Variable for current scroll position of the top app bar
  23023. * @private {number}
  23024. */
  23025. _this.currentAppBarOffsetTop_ = 0;
  23026. /**
  23027. * Used to prevent the top app bar from being scrolled out of view during resize events
  23028. * @private {boolean} */
  23029. _this.isCurrentlyBeingResized_ = false;
  23030. /**
  23031. * The timeout that's used to throttle the resize events
  23032. * @private {number}
  23033. */
  23034. _this.resizeThrottleId_ = INITIAL_VALUE;
  23035. /**
  23036. * The timeout that's used to debounce toggling the isCurrentlyBeingResized_ variable after a resize
  23037. * @private {number}
  23038. */
  23039. _this.resizeDebounceId_ = INITIAL_VALUE;
  23040. _this.scrollHandler_ = function () {
  23041. return _this.topAppBarScrollHandler_();
  23042. };
  23043. _this.resizeHandler_ = function () {
  23044. return _this.topAppBarResizeHandler_();
  23045. };
  23046. return _this;
  23047. }
  23048. _createClass(MDCTopAppBarFoundation, [{
  23049. key: 'init',
  23050. value: function init() {
  23051. _get(MDCTopAppBarFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCTopAppBarFoundation.prototype), 'init', this).call(this);
  23052. this.adapter_.registerScrollHandler(this.scrollHandler_);
  23053. this.adapter_.registerResizeHandler(this.resizeHandler_);
  23054. }
  23055. }, {
  23056. key: 'destroy',
  23057. value: function destroy() {
  23058. _get(MDCTopAppBarFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCTopAppBarFoundation.prototype), 'destroy', this).call(this);
  23059. this.adapter_.deregisterScrollHandler(this.scrollHandler_);
  23060. this.adapter_.deregisterResizeHandler(this.resizeHandler_);
  23061. this.adapter_.setStyle('top', '');
  23062. }
  23063. /**
  23064. * Function to determine if the DOM needs to update.
  23065. * @return {boolean}
  23066. * @private
  23067. */
  23068. }, {
  23069. key: 'checkForUpdate_',
  23070. value: function checkForUpdate_() {
  23071. var offscreenBoundaryTop = -this.topAppBarHeight_;
  23072. var hasAnyPixelsOffscreen = this.currentAppBarOffsetTop_ < 0;
  23073. var hasAnyPixelsOnscreen = this.currentAppBarOffsetTop_ > offscreenBoundaryTop;
  23074. var partiallyShowing = hasAnyPixelsOffscreen && hasAnyPixelsOnscreen;
  23075. // If it's partially showing, it can't be docked.
  23076. if (partiallyShowing) {
  23077. this.wasDocked_ = false;
  23078. } else {
  23079. // Not previously docked and not partially showing, it's now docked.
  23080. if (!this.wasDocked_) {
  23081. this.wasDocked_ = true;
  23082. return true;
  23083. } else if (this.isDockedShowing_ !== hasAnyPixelsOnscreen) {
  23084. this.isDockedShowing_ = hasAnyPixelsOnscreen;
  23085. return true;
  23086. }
  23087. }
  23088. return partiallyShowing;
  23089. }
  23090. /**
  23091. * Function to move the top app bar if needed.
  23092. * @private
  23093. */
  23094. }, {
  23095. key: 'moveTopAppBar_',
  23096. value: function moveTopAppBar_() {
  23097. if (this.checkForUpdate_()) {
  23098. // Once the top app bar is fully hidden we use the max potential top app bar height as our offset
  23099. // so the top app bar doesn't show if the window resizes and the new height > the old height.
  23100. var offset = this.currentAppBarOffsetTop_;
  23101. if (Math.abs(offset) >= this.topAppBarHeight_) {
  23102. offset = -__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].MAX_TOP_APP_BAR_HEIGHT;
  23103. }
  23104. this.adapter_.setStyle('top', offset + 'px');
  23105. }
  23106. }
  23107. /**
  23108. * Scroll handler for the default scroll behavior of the top app bar.
  23109. * @private
  23110. */
  23111. }, {
  23112. key: 'topAppBarScrollHandler_',
  23113. value: function topAppBarScrollHandler_() {
  23114. var currentScrollPosition = Math.max(this.adapter_.getViewportScrollY(), 0);
  23115. var diff = currentScrollPosition - this.lastScrollPosition_;
  23116. this.lastScrollPosition_ = currentScrollPosition;
  23117. // If the window is being resized the lastScrollPosition_ needs to be updated but the
  23118. // current scroll of the top app bar should stay in the same position.
  23119. if (!this.isCurrentlyBeingResized_) {
  23120. this.currentAppBarOffsetTop_ -= diff;
  23121. if (this.currentAppBarOffsetTop_ > 0) {
  23122. this.currentAppBarOffsetTop_ = 0;
  23123. } else if (Math.abs(this.currentAppBarOffsetTop_) > this.topAppBarHeight_) {
  23124. this.currentAppBarOffsetTop_ = -this.topAppBarHeight_;
  23125. }
  23126. this.moveTopAppBar_();
  23127. }
  23128. }
  23129. /**
  23130. * Top app bar resize handler that throttle/debounce functions that execute updates.
  23131. * @private
  23132. */
  23133. }, {
  23134. key: 'topAppBarResizeHandler_',
  23135. value: function topAppBarResizeHandler_() {
  23136. var _this2 = this;
  23137. // Throttle resize events 10 p/s
  23138. if (!this.resizeThrottleId_) {
  23139. this.resizeThrottleId_ = setTimeout(function () {
  23140. _this2.resizeThrottleId_ = INITIAL_VALUE;
  23141. _this2.throttledResizeHandler_();
  23142. }, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].DEBOUNCE_THROTTLE_RESIZE_TIME_MS);
  23143. }
  23144. this.isCurrentlyBeingResized_ = true;
  23145. if (this.resizeDebounceId_) {
  23146. clearTimeout(this.resizeDebounceId_);
  23147. }
  23148. this.resizeDebounceId_ = setTimeout(function () {
  23149. _this2.topAppBarScrollHandler_();
  23150. _this2.isCurrentlyBeingResized_ = false;
  23151. _this2.resizeDebounceId_ = INITIAL_VALUE;
  23152. }, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].DEBOUNCE_THROTTLE_RESIZE_TIME_MS);
  23153. }
  23154. /**
  23155. * Throttled function that updates the top app bar scrolled values if the
  23156. * top app bar height changes.
  23157. * @private
  23158. */
  23159. }, {
  23160. key: 'throttledResizeHandler_',
  23161. value: function throttledResizeHandler_() {
  23162. var currentHeight = this.adapter_.getTopAppBarHeight();
  23163. if (this.topAppBarHeight_ !== currentHeight) {
  23164. this.wasDocked_ = false;
  23165. // Since the top app bar has a different height depending on the screen width, this
  23166. // will ensure that the top app bar remains in the correct location if
  23167. // completely hidden and a resize makes the top app bar a different height.
  23168. this.currentAppBarOffsetTop_ -= this.topAppBarHeight_ - currentHeight;
  23169. this.topAppBarHeight_ = currentHeight;
  23170. }
  23171. this.topAppBarScrollHandler_();
  23172. }
  23173. }]);
  23174. return MDCTopAppBarFoundation;
  23175. }(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]);
  23176. /* harmony default export */ __webpack_exports__["a"] = (MDCTopAppBarFoundation);
  23177. /***/ })
  23178. /******/ ]);
  23179. });
  23180. //# sourceMappingURL=material-components-web.js.map