material-components-web.js 552 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285
  1. /*!
  2. Material Components for the web
  3. Copyright (c) 2017 Google Inc.
  4. License: Apache-2.0
  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 = "/assets/";
  76. /******/
  77. /******/ // Load entry module and return exports
  78. /******/ return __webpack_require__(__webpack_require__.s = 23);
  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. * Licensed under the Apache License, Version 2.0 (the "License");
  92. * you may not use this file except in compliance with the License.
  93. * You may obtain a copy of the License at
  94. *
  95. * http://www.apache.org/licenses/LICENSE-2.0
  96. *
  97. * Unless required by applicable law or agreed to in writing, software
  98. * distributed under the License is distributed on an "AS IS" BASIS,
  99. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  100. * See the License for the specific language governing permissions and
  101. * limitations under the License.
  102. */
  103. /**
  104. * @template A
  105. */
  106. var MDCFoundation = function () {
  107. _createClass(MDCFoundation, null, [{
  108. key: "cssClasses",
  109. /** @return enum{cssClasses} */
  110. get: function get() {
  111. // Classes extending MDCFoundation should implement this method to return an object which exports every
  112. // CSS class the foundation class needs as a property. e.g. {ACTIVE: 'mdc-component--active'}
  113. return {};
  114. }
  115. /** @return enum{strings} */
  116. }, {
  117. key: "strings",
  118. get: function get() {
  119. // Classes extending MDCFoundation should implement this method to return an object which exports all
  120. // semantic strings as constants. e.g. {ARIA_ROLE: 'tablist'}
  121. return {};
  122. }
  123. /** @return enum{numbers} */
  124. }, {
  125. key: "numbers",
  126. get: function get() {
  127. // Classes extending MDCFoundation should implement this method to return an object which exports all
  128. // of its semantic numbers as constants. e.g. {ANIMATION_DELAY_MS: 350}
  129. return {};
  130. }
  131. /** @return {!Object} */
  132. }, {
  133. key: "defaultAdapter",
  134. get: function get() {
  135. // Classes extending MDCFoundation may choose to implement this getter in order to provide a convenient
  136. // way of viewing the necessary methods of an adapter. In the future, this could also be used for adapter
  137. // validation.
  138. return {};
  139. }
  140. /**
  141. * @param {A=} adapter
  142. */
  143. }]);
  144. function MDCFoundation() {
  145. var adapter = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  146. _classCallCheck(this, MDCFoundation);
  147. /** @protected {!A} */
  148. this.adapter_ = adapter;
  149. }
  150. _createClass(MDCFoundation, [{
  151. key: "init",
  152. value: function init() {
  153. // Subclasses should override this method to perform initialization routines (registering events, etc.)
  154. }
  155. }, {
  156. key: "destroy",
  157. value: function destroy() {
  158. // Subclasses should override this method to perform de-initialization routines (de-registering events, etc.)
  159. }
  160. }]);
  161. return MDCFoundation;
  162. }();
  163. /* harmony default export */ __webpack_exports__["a"] = (MDCFoundation);
  164. /***/ }),
  165. /* 1 */
  166. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  167. "use strict";
  168. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  169. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation__ = __webpack_require__(0);
  170. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__component__ = __webpack_require__(2);
  171. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFoundation", function() { return __WEBPACK_IMPORTED_MODULE_0__foundation__["a"]; });
  172. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCComponent", function() { return __WEBPACK_IMPORTED_MODULE_1__component__["a"]; });
  173. /**
  174. * @license
  175. * Copyright 2016 Google Inc.
  176. *
  177. * Licensed under the Apache License, Version 2.0 (the "License");
  178. * you may not use this file except in compliance with the License.
  179. * You may obtain a copy of the License at
  180. *
  181. * http://www.apache.org/licenses/LICENSE-2.0
  182. *
  183. * Unless required by applicable law or agreed to in writing, software
  184. * distributed under the License is distributed on an "AS IS" BASIS,
  185. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  186. * See the License for the specific language governing permissions and
  187. * limitations under the License.
  188. */
  189. /***/ }),
  190. /* 2 */
  191. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  192. "use strict";
  193. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__foundation__ = __webpack_require__(0);
  194. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  195. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  196. /**
  197. * @license
  198. * Copyright 2016 Google Inc.
  199. *
  200. * Licensed under the Apache License, Version 2.0 (the "License");
  201. * you may not use this file except in compliance with the License.
  202. * You may obtain a copy of the License at
  203. *
  204. * http://www.apache.org/licenses/LICENSE-2.0
  205. *
  206. * Unless required by applicable law or agreed to in writing, software
  207. * distributed under the License is distributed on an "AS IS" BASIS,
  208. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  209. * See the License for the specific language governing permissions and
  210. * limitations under the License.
  211. */
  212. /**
  213. * @template F
  214. */
  215. var MDCComponent = function () {
  216. _createClass(MDCComponent, null, [{
  217. key: 'attachTo',
  218. /**
  219. * @param {!Element} root
  220. * @return {!MDCComponent}
  221. */
  222. value: function attachTo(root) {
  223. // Subclasses which extend MDCBase should provide an attachTo() method that takes a root element and
  224. // returns an instantiated component with its root set to that element. Also note that in the cases of
  225. // subclasses, an explicit foundation class will not have to be passed in; it will simply be initialized
  226. // from getDefaultFoundation().
  227. return new MDCComponent(root, new __WEBPACK_IMPORTED_MODULE_0__foundation__["a" /* default */]());
  228. }
  229. /**
  230. * @param {!Element} root
  231. * @param {F=} foundation
  232. * @param {...?} args
  233. */
  234. }]);
  235. function MDCComponent(root) {
  236. var foundation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
  237. _classCallCheck(this, MDCComponent);
  238. /** @protected {!Element} */
  239. this.root_ = root;
  240. for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
  241. args[_key - 2] = arguments[_key];
  242. }
  243. this.initialize.apply(this, args);
  244. // Note that we initialize foundation here and not within the constructor's default param so that
  245. // this.root_ is defined and can be used within the foundation class.
  246. /** @protected {!F} */
  247. this.foundation_ = foundation === undefined ? this.getDefaultFoundation() : foundation;
  248. this.foundation_.init();
  249. this.initialSyncWithDOM();
  250. }
  251. _createClass(MDCComponent, [{
  252. key: 'initialize',
  253. value: function initialize() /* ...args */{}
  254. // Subclasses can override this to do any additional setup work that would be considered part of a
  255. // "constructor". Essentially, it is a hook into the parent constructor before the foundation is
  256. // initialized. Any additional arguments besides root and foundation will be passed in here.
  257. /**
  258. * @return {!F} foundation
  259. */
  260. }, {
  261. key: 'getDefaultFoundation',
  262. value: function getDefaultFoundation() {
  263. // Subclasses must override this method to return a properly configured foundation class for the
  264. // component.
  265. throw new Error('Subclasses must override getDefaultFoundation to return a properly configured ' + 'foundation class');
  266. }
  267. }, {
  268. key: 'initialSyncWithDOM',
  269. value: function initialSyncWithDOM() {
  270. // Subclasses should override this method if they need to perform work to synchronize with a host DOM
  271. // object. An example of this would be a form control wrapper that needs to synchronize its internal state
  272. // to some property or attribute of the host DOM. Please note: this is *not* the place to perform DOM
  273. // reads/writes that would cause layout / paint, as this is called synchronously from within the constructor.
  274. }
  275. }, {
  276. key: 'destroy',
  277. value: function destroy() {
  278. // Subclasses may implement this method to release any resources / deregister any listeners they have
  279. // attached. An example of this might be deregistering a resize event from the window object.
  280. this.foundation_.destroy();
  281. }
  282. /**
  283. * Wrapper method to add an event listener to the component's root element. This is most useful when
  284. * listening for custom events.
  285. * @param {string} evtType
  286. * @param {!Function} handler
  287. */
  288. }, {
  289. key: 'listen',
  290. value: function listen(evtType, handler) {
  291. this.root_.addEventListener(evtType, handler);
  292. }
  293. /**
  294. * Wrapper method to remove an event listener to the component's root element. This is most useful when
  295. * unlistening for custom events.
  296. * @param {string} evtType
  297. * @param {!Function} handler
  298. */
  299. }, {
  300. key: 'unlisten',
  301. value: function unlisten(evtType, handler) {
  302. this.root_.removeEventListener(evtType, handler);
  303. }
  304. /**
  305. * Fires a cross-browser-compatible custom event from the component root of the given type,
  306. * with the given data.
  307. * @param {string} evtType
  308. * @param {!Object} evtData
  309. * @param {boolean=} shouldBubble
  310. */
  311. }, {
  312. key: 'emit',
  313. value: function emit(evtType, evtData) {
  314. var shouldBubble = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  315. var evt = void 0;
  316. if (typeof CustomEvent === 'function') {
  317. evt = new CustomEvent(evtType, {
  318. detail: evtData,
  319. bubbles: shouldBubble
  320. });
  321. } else {
  322. evt = document.createEvent('CustomEvent');
  323. evt.initCustomEvent(evtType, shouldBubble, false, evtData);
  324. }
  325. this.root_.dispatchEvent(evt);
  326. }
  327. }]);
  328. return MDCComponent;
  329. }();
  330. /* harmony default export */ __webpack_exports__["a"] = (MDCComponent);
  331. /***/ }),
  332. /* 3 */
  333. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  334. "use strict";
  335. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  336. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCRipple", function() { return MDCRipple; });
  337. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(2);
  338. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(13);
  339. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(26);
  340. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util__ = __webpack_require__(6);
  341. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCRippleFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  342. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "util", function() { return __WEBPACK_IMPORTED_MODULE_3__util__; });
  343. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  344. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  345. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  346. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  347. /**
  348. * @license
  349. * Copyright 2016 Google Inc. All Rights Reserved.
  350. *
  351. * Licensed under the Apache License, Version 2.0 (the "License");
  352. * you may not use this file except in compliance with the License.
  353. * You may obtain a copy of the License at
  354. *
  355. * http://www.apache.org/licenses/LICENSE-2.0
  356. *
  357. * Unless required by applicable law or agreed to in writing, software
  358. * distributed under the License is distributed on an "AS IS" BASIS,
  359. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  360. * See the License for the specific language governing permissions and
  361. * limitations under the License.
  362. */
  363. /**
  364. * @extends MDCComponent<!MDCRippleFoundation>
  365. */
  366. var MDCRipple = function (_MDCComponent) {
  367. _inherits(MDCRipple, _MDCComponent);
  368. /** @param {...?} args */
  369. function MDCRipple() {
  370. var _ref;
  371. _classCallCheck(this, MDCRipple);
  372. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  373. args[_key] = arguments[_key];
  374. }
  375. /** @type {boolean} */
  376. var _this = _possibleConstructorReturn(this, (_ref = MDCRipple.__proto__ || Object.getPrototypeOf(MDCRipple)).call.apply(_ref, [this].concat(args)));
  377. _this.disabled = false;
  378. /** @private {boolean} */
  379. _this.unbounded_;
  380. return _this;
  381. }
  382. /**
  383. * @param {!Element} root
  384. * @param {{isUnbounded: (boolean|undefined)}=} options
  385. * @return {!MDCRipple}
  386. */
  387. _createClass(MDCRipple, [{
  388. key: 'activate',
  389. value: function activate() {
  390. this.foundation_.activate();
  391. }
  392. }, {
  393. key: 'deactivate',
  394. value: function deactivate() {
  395. this.foundation_.deactivate();
  396. }
  397. }, {
  398. key: 'layout',
  399. value: function layout() {
  400. this.foundation_.layout();
  401. }
  402. /** @return {!MDCRippleFoundation} */
  403. }, {
  404. key: 'getDefaultFoundation',
  405. value: function getDefaultFoundation() {
  406. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */](MDCRipple.createAdapter(this));
  407. }
  408. }, {
  409. key: 'initialSyncWithDOM',
  410. value: function initialSyncWithDOM() {
  411. this.unbounded = 'mdcRippleIsUnbounded' in this.root_.dataset;
  412. }
  413. }, {
  414. key: 'unbounded',
  415. /** @return {boolean} */
  416. get: function get() {
  417. return this.unbounded_;
  418. }
  419. /** @param {boolean} unbounded */
  420. ,
  421. set: function set(unbounded) {
  422. var UNBOUNDED = __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].cssClasses.UNBOUNDED;
  423. this.unbounded_ = Boolean(unbounded);
  424. if (this.unbounded_) {
  425. this.root_.classList.add(UNBOUNDED);
  426. } else {
  427. this.root_.classList.remove(UNBOUNDED);
  428. }
  429. }
  430. }], [{
  431. key: 'attachTo',
  432. value: function attachTo(root) {
  433. var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  434. _ref2$isUnbounded = _ref2.isUnbounded,
  435. isUnbounded = _ref2$isUnbounded === undefined ? undefined : _ref2$isUnbounded;
  436. var ripple = new MDCRipple(root);
  437. // Only override unbounded behavior if option is explicitly specified
  438. if (isUnbounded !== undefined) {
  439. ripple.unbounded = /** @type {boolean} */isUnbounded;
  440. }
  441. return ripple;
  442. }
  443. /**
  444. * @param {!RippleCapableSurface} instance
  445. * @return {!MDCRippleAdapter}
  446. */
  447. }, {
  448. key: 'createAdapter',
  449. value: function createAdapter(instance) {
  450. var MATCHES = __WEBPACK_IMPORTED_MODULE_3__util__["getMatchesProperty"](HTMLElement.prototype);
  451. return {
  452. browserSupportsCssVars: function browserSupportsCssVars() {
  453. return __WEBPACK_IMPORTED_MODULE_3__util__["supportsCssVariables"](window);
  454. },
  455. isUnbounded: function isUnbounded() {
  456. return instance.unbounded;
  457. },
  458. isSurfaceActive: function isSurfaceActive() {
  459. return instance.root_[MATCHES](':active');
  460. },
  461. isSurfaceDisabled: function isSurfaceDisabled() {
  462. return instance.disabled;
  463. },
  464. addClass: function addClass(className) {
  465. return instance.root_.classList.add(className);
  466. },
  467. removeClass: function removeClass(className) {
  468. return instance.root_.classList.remove(className);
  469. },
  470. registerInteractionHandler: function registerInteractionHandler(evtType, handler) {
  471. return instance.root_.addEventListener(evtType, handler, __WEBPACK_IMPORTED_MODULE_3__util__["applyPassive"]());
  472. },
  473. deregisterInteractionHandler: function deregisterInteractionHandler(evtType, handler) {
  474. return instance.root_.removeEventListener(evtType, handler, __WEBPACK_IMPORTED_MODULE_3__util__["applyPassive"]());
  475. },
  476. registerResizeHandler: function registerResizeHandler(handler) {
  477. return window.addEventListener('resize', handler);
  478. },
  479. deregisterResizeHandler: function deregisterResizeHandler(handler) {
  480. return window.removeEventListener('resize', handler);
  481. },
  482. updateCssVariable: function updateCssVariable(varName, value) {
  483. return instance.root_.style.setProperty(varName, value);
  484. },
  485. computeBoundingRect: function computeBoundingRect() {
  486. return instance.root_.getBoundingClientRect();
  487. },
  488. getWindowPageOffset: function getWindowPageOffset() {
  489. return { x: window.pageXOffset, y: window.pageYOffset };
  490. }
  491. };
  492. }
  493. }]);
  494. return MDCRipple;
  495. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  496. /**
  497. * See Material Design spec for more details on when to use ripples.
  498. * https://material.io/guidelines/motion/choreography.html#choreography-creation
  499. * @record
  500. */
  501. var RippleCapableSurface = function RippleCapableSurface() {
  502. _classCallCheck(this, RippleCapableSurface);
  503. };
  504. /** @protected {!Element} */
  505. RippleCapableSurface.prototype.root_;
  506. /**
  507. * Whether or not the ripple bleeds out of the bounds of the element.
  508. * @type {boolean|undefined}
  509. */
  510. RippleCapableSurface.prototype.unbounded;
  511. /**
  512. * Whether or not the ripple is attached to a disabled component.
  513. * @type {boolean|undefined}
  514. */
  515. RippleCapableSurface.prototype.disabled;
  516. /***/ }),
  517. /* 4 */
  518. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  519. "use strict";
  520. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  521. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSelectionControlState", function() { return MDCSelectionControlState; });
  522. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSelectionControl", function() { return MDCSelectionControl; });
  523. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_ripple__ = __webpack_require__(3);
  524. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  525. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  526. /**
  527. * @license
  528. * Copyright 2017 Google Inc. All Rights Reserved.
  529. *
  530. * Licensed under the Apache License, Version 2.0 (the "License");
  531. * you may not use this file except in compliance with the License.
  532. * You may obtain a copy of the License at
  533. *
  534. * http://www.apache.org/licenses/LICENSE-2.0
  535. *
  536. * Unless required by applicable law or agreed to in writing, software
  537. * distributed under the License is distributed on an "AS IS" BASIS,
  538. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  539. * See the License for the specific language governing permissions and
  540. * limitations under the License.
  541. */
  542. /* eslint-disable no-unused-vars */
  543. /* eslint-enable no-unused-vars */
  544. /**
  545. * @typedef {!{
  546. * checked: boolean,
  547. * indeterminate: boolean,
  548. * disabled: boolean,
  549. * value: ?string
  550. * }}
  551. */
  552. var MDCSelectionControlState = void 0;
  553. /**
  554. * @record
  555. */
  556. var MDCSelectionControl = function () {
  557. function MDCSelectionControl() {
  558. _classCallCheck(this, MDCSelectionControl);
  559. }
  560. _createClass(MDCSelectionControl, [{
  561. key: 'ripple',
  562. /** @return {?MDCRipple} */
  563. get: function get() {}
  564. }]);
  565. return MDCSelectionControl;
  566. }();
  567. /***/ }),
  568. /* 5 */
  569. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  570. "use strict";
  571. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return transformStyleProperties; });
  572. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getCorrectEventName; });
  573. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getCorrectPropertyName; });
  574. /**
  575. * @license
  576. * Copyright 2016 Google Inc. All Rights Reserved.
  577. *
  578. * Licensed under the Apache License, Version 2.0 (the "License");
  579. * you may not use this file except in compliance with the License.
  580. * You may obtain a copy of the License at
  581. *
  582. * http://www.apache.org/licenses/LICENSE-2.0
  583. *
  584. * Unless required by applicable law or agreed to in writing, software
  585. * distributed under the License is distributed on an "AS IS" BASIS,
  586. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  587. * See the License for the specific language governing permissions and
  588. * limitations under the License.
  589. */
  590. /**
  591. * @typedef {{
  592. * noPrefix: string,
  593. * webkitPrefix: string,
  594. * styleProperty: string
  595. * }}
  596. */
  597. var VendorPropertyMapType = void 0;
  598. /** @const {Object<string, !VendorPropertyMapType>} */
  599. var eventTypeMap = {
  600. 'animationstart': {
  601. noPrefix: 'animationstart',
  602. webkitPrefix: 'webkitAnimationStart',
  603. styleProperty: 'animation'
  604. },
  605. 'animationend': {
  606. noPrefix: 'animationend',
  607. webkitPrefix: 'webkitAnimationEnd',
  608. styleProperty: 'animation'
  609. },
  610. 'animationiteration': {
  611. noPrefix: 'animationiteration',
  612. webkitPrefix: 'webkitAnimationIteration',
  613. styleProperty: 'animation'
  614. },
  615. 'transitionend': {
  616. noPrefix: 'transitionend',
  617. webkitPrefix: 'webkitTransitionEnd',
  618. styleProperty: 'transition'
  619. }
  620. };
  621. /** @const {Object<string, !VendorPropertyMapType>} */
  622. var cssPropertyMap = {
  623. 'animation': {
  624. noPrefix: 'animation',
  625. webkitPrefix: '-webkit-animation'
  626. },
  627. 'transform': {
  628. noPrefix: 'transform',
  629. webkitPrefix: '-webkit-transform'
  630. },
  631. 'transition': {
  632. noPrefix: 'transition',
  633. webkitPrefix: '-webkit-transition'
  634. }
  635. };
  636. /**
  637. * @param {!Object} windowObj
  638. * @return {boolean}
  639. */
  640. function hasProperShape(windowObj) {
  641. return windowObj['document'] !== undefined && typeof windowObj['document']['createElement'] === 'function';
  642. }
  643. /**
  644. * @param {string} eventType
  645. * @return {boolean}
  646. */
  647. function eventFoundInMaps(eventType) {
  648. return eventType in eventTypeMap || eventType in cssPropertyMap;
  649. }
  650. /**
  651. * @param {string} eventType
  652. * @param {!Object<string, !VendorPropertyMapType>} map
  653. * @param {!Element} el
  654. * @return {string}
  655. */
  656. function getJavaScriptEventName(eventType, map, el) {
  657. return map[eventType].styleProperty in el.style ? map[eventType].noPrefix : map[eventType].webkitPrefix;
  658. }
  659. /**
  660. * Helper function to determine browser prefix for CSS3 animation events
  661. * and property names.
  662. * @param {!Object} windowObj
  663. * @param {string} eventType
  664. * @return {string}
  665. */
  666. function getAnimationName(windowObj, eventType) {
  667. if (!hasProperShape(windowObj) || !eventFoundInMaps(eventType)) {
  668. return eventType;
  669. }
  670. var map = /** @type {!Object<string, !VendorPropertyMapType>} */eventType in eventTypeMap ? eventTypeMap : cssPropertyMap;
  671. var el = windowObj['document']['createElement']('div');
  672. var eventName = '';
  673. if (map === eventTypeMap) {
  674. eventName = getJavaScriptEventName(eventType, map, el);
  675. } else {
  676. eventName = map[eventType].noPrefix in el.style ? map[eventType].noPrefix : map[eventType].webkitPrefix;
  677. }
  678. return eventName;
  679. }
  680. // Public functions to access getAnimationName() for JavaScript events or CSS
  681. // property names.
  682. var transformStyleProperties = ['transform', 'WebkitTransform', 'MozTransform', 'OTransform', 'MSTransform'];
  683. /**
  684. * @param {!Object} windowObj
  685. * @param {string} eventType
  686. * @return {string}
  687. */
  688. function getCorrectEventName(windowObj, eventType) {
  689. return getAnimationName(windowObj, eventType);
  690. }
  691. /**
  692. * @param {!Object} windowObj
  693. * @param {string} eventType
  694. * @return {string}
  695. */
  696. function getCorrectPropertyName(windowObj, eventType) {
  697. return getAnimationName(windowObj, eventType);
  698. }
  699. /***/ }),
  700. /* 6 */
  701. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  702. "use strict";
  703. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  704. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "supportsCssVariables", function() { return supportsCssVariables; });
  705. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "applyPassive", function() { return applyPassive; });
  706. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getMatchesProperty", function() { return getMatchesProperty; });
  707. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getNormalizedEventCoords", function() { return getNormalizedEventCoords; });
  708. /**
  709. * @license
  710. * Copyright 2016 Google Inc. All Rights Reserved.
  711. *
  712. * Licensed under the Apache License, Version 2.0 (the "License");
  713. * you may not use this file except in compliance with the License.
  714. * You may obtain a copy of the License at
  715. *
  716. * http://www.apache.org/licenses/LICENSE-2.0
  717. *
  718. * Unless required by applicable law or agreed to in writing, software
  719. * distributed under the License is distributed on an "AS IS" BASIS,
  720. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  721. * See the License for the specific language governing permissions and
  722. * limitations under the License.
  723. */
  724. /**
  725. * Stores result from supportsCssVariables to avoid redundant processing to detect CSS custom variable support.
  726. * @private {boolean|undefined}
  727. */
  728. var supportsCssVariables_ = void 0;
  729. /**
  730. * Stores result from applyPassive to avoid redundant processing to detect passive event listener support.
  731. * @private {boolean|undefined}
  732. */
  733. var supportsPassive_ = void 0;
  734. /**
  735. * @param {!Window} windowObj
  736. * @return {boolean}
  737. */
  738. function detectEdgePseudoVarBug(windowObj) {
  739. // Detect versions of Edge with buggy var() support
  740. // See: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/11495448/
  741. var document = windowObj.document;
  742. var node = document.createElement('div');
  743. node.className = 'mdc-ripple-surface--test-edge-var-bug';
  744. document.body.appendChild(node);
  745. // The bug exists if ::before style ends up propagating to the parent element.
  746. // Additionally, getComputedStyle returns null in iframes with display: "none" in Firefox,
  747. // but Firefox is known to support CSS custom properties correctly.
  748. // See: https://bugzilla.mozilla.org/show_bug.cgi?id=548397
  749. var computedStyle = windowObj.getComputedStyle(node);
  750. var hasPseudoVarBug = computedStyle !== null && computedStyle.borderTopStyle === 'solid';
  751. node.remove();
  752. return hasPseudoVarBug;
  753. }
  754. /**
  755. * @param {!Window} windowObj
  756. * @param {boolean=} forceRefresh
  757. * @return {boolean|undefined}
  758. */
  759. function supportsCssVariables(windowObj) {
  760. var forceRefresh = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  761. if (typeof supportsCssVariables_ === 'boolean' && !forceRefresh) {
  762. return supportsCssVariables_;
  763. }
  764. var supportsFunctionPresent = windowObj.CSS && typeof windowObj.CSS.supports === 'function';
  765. if (!supportsFunctionPresent) {
  766. return;
  767. }
  768. var explicitlySupportsCssVars = windowObj.CSS.supports('--css-vars', 'yes');
  769. // See: https://bugs.webkit.org/show_bug.cgi?id=154669
  770. // See: README section on Safari
  771. var weAreFeatureDetectingSafari10plus = windowObj.CSS.supports('(--css-vars: yes)') && windowObj.CSS.supports('color', '#00000000');
  772. if (explicitlySupportsCssVars || weAreFeatureDetectingSafari10plus) {
  773. supportsCssVariables_ = !detectEdgePseudoVarBug(windowObj);
  774. } else {
  775. supportsCssVariables_ = false;
  776. }
  777. return supportsCssVariables_;
  778. }
  779. //
  780. /**
  781. * Determine whether the current browser supports passive event listeners, and if so, use them.
  782. * @param {!Window=} globalObj
  783. * @param {boolean=} forceRefresh
  784. * @return {boolean|{passive: boolean}}
  785. */
  786. function applyPassive() {
  787. var globalObj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
  788. var forceRefresh = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  789. if (supportsPassive_ === undefined || forceRefresh) {
  790. var isSupported = false;
  791. try {
  792. globalObj.document.addEventListener('test', null, { get passive() {
  793. isSupported = true;
  794. } });
  795. } catch (e) {}
  796. supportsPassive_ = isSupported;
  797. }
  798. return supportsPassive_ ? { passive: true } : false;
  799. }
  800. /**
  801. * @param {!Object} HTMLElementPrototype
  802. * @return {!Array<string>}
  803. */
  804. function getMatchesProperty(HTMLElementPrototype) {
  805. return ['webkitMatchesSelector', 'msMatchesSelector', 'matches'].filter(function (p) {
  806. return p in HTMLElementPrototype;
  807. }).pop();
  808. }
  809. /**
  810. * @param {!Event} ev
  811. * @param {!{x: number, y: number}} pageOffset
  812. * @param {!ClientRect} clientRect
  813. * @return {!{x: number, y: number}}
  814. */
  815. function getNormalizedEventCoords(ev, pageOffset, clientRect) {
  816. var x = pageOffset.x,
  817. y = pageOffset.y;
  818. var documentX = x + clientRect.left;
  819. var documentY = y + clientRect.top;
  820. var normalizedX = void 0;
  821. var normalizedY = void 0;
  822. // Determine touch point relative to the ripple container.
  823. if (ev.type === 'touchstart') {
  824. normalizedX = ev.changedTouches[0].pageX - documentX;
  825. normalizedY = ev.changedTouches[0].pageY - documentY;
  826. } else {
  827. normalizedX = ev.pageX - documentX;
  828. normalizedY = ev.pageY - documentY;
  829. }
  830. return { x: normalizedX, y: normalizedY };
  831. }
  832. /***/ }),
  833. /* 7 */
  834. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  835. "use strict";
  836. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__constants__ = __webpack_require__(40);
  837. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__constants__["a"]; });
  838. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(41);
  839. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  840. /**
  841. * Copyright 2016 Google Inc. All Rights Reserved.
  842. *
  843. * Licensed under the Apache License, Version 2.0 (the "License");
  844. * you may not use this file except in compliance with the License.
  845. * You may obtain a copy of the License at
  846. *
  847. * http://www.apache.org/licenses/LICENSE-2.0
  848. *
  849. * Unless required by applicable law or agreed to in writing, software
  850. * distributed under the License is distributed on an "AS IS" BASIS,
  851. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  852. * See the License for the specific language governing permissions and
  853. * limitations under the License.
  854. */
  855. /***/ }),
  856. /* 8 */
  857. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  858. "use strict";
  859. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  860. /* harmony export (immutable) */ __webpack_exports__["remapEvent"] = remapEvent;
  861. /* harmony export (immutable) */ __webpack_exports__["getTransformPropertyName"] = getTransformPropertyName;
  862. /* harmony export (immutable) */ __webpack_exports__["supportsCssCustomProperties"] = supportsCssCustomProperties;
  863. /* harmony export (immutable) */ __webpack_exports__["applyPassive"] = applyPassive;
  864. /* harmony export (immutable) */ __webpack_exports__["saveElementTabState"] = saveElementTabState;
  865. /* harmony export (immutable) */ __webpack_exports__["restoreElementTabState"] = restoreElementTabState;
  866. /**
  867. * Copyright 2016 Google Inc. All Rights Reserved.
  868. *
  869. * Licensed under the Apache License, Version 2.0 (the "License");
  870. * you may not use this file except in compliance with the License.
  871. * You may obtain a copy of the License at
  872. *
  873. * http://www.apache.org/licenses/LICENSE-2.0
  874. *
  875. * Unless required by applicable law or agreed to in writing, software
  876. * distributed under the License is distributed on an "AS IS" BASIS,
  877. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  878. * See the License for the specific language governing permissions and
  879. * limitations under the License.
  880. */
  881. var TAB_DATA = 'data-mdc-tabindex';
  882. var TAB_DATA_HANDLED = 'data-mdc-tabindex-handled';
  883. var storedTransformPropertyName_ = void 0;
  884. var supportsPassive_ = void 0;
  885. // Remap touch events to pointer events, if the browser doesn't support touch events.
  886. function remapEvent(eventName) {
  887. var globalObj = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window;
  888. if (!('ontouchstart' in globalObj.document)) {
  889. switch (eventName) {
  890. case 'touchstart':
  891. return 'pointerdown';
  892. case 'touchmove':
  893. return 'pointermove';
  894. case 'touchend':
  895. return 'pointerup';
  896. default:
  897. return eventName;
  898. }
  899. }
  900. return eventName;
  901. }
  902. // Choose the correct transform property to use on the current browser.
  903. function getTransformPropertyName() {
  904. var globalObj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
  905. var forceRefresh = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  906. if (storedTransformPropertyName_ === undefined || forceRefresh) {
  907. var el = globalObj.document.createElement('div');
  908. var transformPropertyName = 'transform' in el.style ? 'transform' : '-webkit-transform';
  909. storedTransformPropertyName_ = transformPropertyName;
  910. }
  911. return storedTransformPropertyName_;
  912. }
  913. // Determine whether the current browser supports CSS properties.
  914. function supportsCssCustomProperties() {
  915. var globalObj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
  916. if ('CSS' in globalObj) {
  917. return globalObj.CSS.supports('(--color: red)');
  918. }
  919. return false;
  920. }
  921. // Determine whether the current browser supports passive event listeners, and if so, use them.
  922. function applyPassive() {
  923. var globalObj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
  924. var forceRefresh = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  925. if (supportsPassive_ === undefined || forceRefresh) {
  926. var isSupported = false;
  927. try {
  928. globalObj.document.addEventListener('test', null, { get passive() {
  929. isSupported = true;
  930. } });
  931. } catch (e) {}
  932. supportsPassive_ = isSupported;
  933. }
  934. return supportsPassive_ ? { passive: true } : false;
  935. }
  936. // Save the tab state for an element.
  937. function saveElementTabState(el) {
  938. if (el.hasAttribute('tabindex')) {
  939. el.setAttribute(TAB_DATA, el.getAttribute('tabindex'));
  940. }
  941. el.setAttribute(TAB_DATA_HANDLED, true);
  942. }
  943. // Restore the tab state for an element, if it was saved.
  944. function restoreElementTabState(el) {
  945. // Only modify elements we've already handled, in case anything was dynamically added since we saved state.
  946. if (el.hasAttribute(TAB_DATA_HANDLED)) {
  947. if (el.hasAttribute(TAB_DATA)) {
  948. el.setAttribute('tabindex', el.getAttribute(TAB_DATA));
  949. el.removeAttribute(TAB_DATA);
  950. } else {
  951. el.removeAttribute('tabindex');
  952. }
  953. el.removeAttribute(TAB_DATA_HANDLED);
  954. }
  955. }
  956. /***/ }),
  957. /* 9 */
  958. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  959. "use strict";
  960. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  961. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util__ = __webpack_require__(10);
  962. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__simple__ = __webpack_require__(60);
  963. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSimpleMenu", function() { return __WEBPACK_IMPORTED_MODULE_1__simple__["a"]; });
  964. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSimpleMenuFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__simple__["b"]; });
  965. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "util", function() { return __WEBPACK_IMPORTED_MODULE_0__util__; });
  966. /**
  967. * @license
  968. * Copyright 2016 Google Inc. All Rights Reserved.
  969. *
  970. * Licensed under the Apache License, Version 2.0 (the "License");
  971. * you may not use this file except in compliance with the License.
  972. * You may obtain a copy of the License at
  973. *
  974. * http://www.apache.org/licenses/LICENSE-2.0
  975. *
  976. * Unless required by applicable law or agreed to in writing, software
  977. * distributed under the License is distributed on an "AS IS" BASIS,
  978. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  979. * See the License for the specific language governing permissions and
  980. * limitations under the License.
  981. */
  982. /***/ }),
  983. /* 10 */
  984. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  985. "use strict";
  986. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  987. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTransformPropertyName", function() { return getTransformPropertyName; });
  988. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clamp", function() { return clamp; });
  989. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bezierProgress", function() { return bezierProgress; });
  990. /**
  991. * Copyright 2016 Google Inc. All Rights Reserved.
  992. *
  993. * Licensed under the Apache License, Version 2.0 (the "License");
  994. * you may not use this file except in compliance with the License.
  995. * You may obtain a copy of the License at
  996. *
  997. * http://www.apache.org/licenses/LICENSE-2.0
  998. *
  999. * Unless required by applicable law or agreed to in writing, software
  1000. * distributed under the License is distributed on an "AS IS" BASIS,
  1001. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1002. * See the License for the specific language governing permissions and
  1003. * limitations under the License.
  1004. */
  1005. /** @type {string|undefined} */
  1006. var storedTransformPropertyName_ = void 0;
  1007. /**
  1008. * Returns the name of the correct transform property to use on the current browser.
  1009. * @param {!Window} globalObj
  1010. * @param {boolean=} forceRefresh
  1011. * @return {string}
  1012. */
  1013. function getTransformPropertyName(globalObj) {
  1014. var forceRefresh = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  1015. if (storedTransformPropertyName_ === undefined || forceRefresh) {
  1016. var el = globalObj.document.createElement('div');
  1017. var transformPropertyName = 'transform' in el.style ? 'transform' : 'webkitTransform';
  1018. storedTransformPropertyName_ = transformPropertyName;
  1019. }
  1020. return storedTransformPropertyName_;
  1021. }
  1022. /**
  1023. * Clamps a value between the minimum and the maximum, returning the clamped value.
  1024. * @param {number} value
  1025. * @param {number} min
  1026. * @param {number} max
  1027. * @return {number}
  1028. */
  1029. function clamp(value) {
  1030. var min = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  1031. var max = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
  1032. return Math.min(max, Math.max(min, value));
  1033. }
  1034. /**
  1035. * Returns the easing value to apply at time t, for a given cubic bezier curve.
  1036. * Control points P0 and P3 are assumed to be (0,0) and (1,1), respectively.
  1037. * Parameters are as follows:
  1038. * - time: The current time in the animation, scaled between 0 and 1.
  1039. * - x1: The x value of control point P1.
  1040. * - y1: The y value of control point P1.
  1041. * - x2: The x value of control point P2.
  1042. * - y2: The y value of control point P2.
  1043. * @param {number} time
  1044. * @param {number} x1
  1045. * @param {number} y1
  1046. * @param {number} x2
  1047. * @param {number} y2
  1048. * @return {number}
  1049. */
  1050. function bezierProgress(time, x1, y1, x2, y2) {
  1051. return getBezierCoordinate_(solvePositionFromXValue_(time, x1, x2), y1, y2);
  1052. }
  1053. /**
  1054. * Compute a single coordinate at a position point between 0 and 1.
  1055. * c1 and c2 are the matching coordinate on control points P1 and P2, respectively.
  1056. * Control points P0 and P3 are assumed to be (0,0) and (1,1), respectively.
  1057. * Adapted from https://github.com/google/closure-library/blob/master/closure/goog/math/bezier.js.
  1058. * @param {number} t
  1059. * @param {number} c1
  1060. * @param {number} c2
  1061. * @return {number}
  1062. */
  1063. function getBezierCoordinate_(t, c1, c2) {
  1064. // Special case start and end.
  1065. if (t === 0 || t === 1) {
  1066. return t;
  1067. }
  1068. // Step one - from 4 points to 3
  1069. var ic0 = t * c1;
  1070. var ic1 = c1 + t * (c2 - c1);
  1071. var ic2 = c2 + t * (1 - c2);
  1072. // Step two - from 3 points to 2
  1073. ic0 += t * (ic1 - ic0);
  1074. ic1 += t * (ic2 - ic1);
  1075. // Final step - last point
  1076. return ic0 + t * (ic1 - ic0);
  1077. }
  1078. /**
  1079. * Project a point onto the Bezier curve, from a given X. Calculates the position t along the curve.
  1080. * Adapted from https://github.com/google/closure-library/blob/master/closure/goog/math/bezier.js.
  1081. * @param {number} xVal
  1082. * @param {number} x1
  1083. * @param {number} x2
  1084. * @return {number}
  1085. */
  1086. function solvePositionFromXValue_(xVal, x1, x2) {
  1087. var EPSILON = 1e-6;
  1088. var MAX_ITERATIONS = 8;
  1089. if (xVal <= 0) {
  1090. return 0;
  1091. } else if (xVal >= 1) {
  1092. return 1;
  1093. }
  1094. // Initial estimate of t using linear interpolation.
  1095. var t = xVal;
  1096. // Try gradient descent to solve for t. If it works, it is very fast.
  1097. var tMin = 0;
  1098. var tMax = 1;
  1099. var value = 0;
  1100. for (var i = 0; i < MAX_ITERATIONS; i++) {
  1101. value = getBezierCoordinate_(t, x1, x2);
  1102. var derivative = (getBezierCoordinate_(t + EPSILON, x1, x2) - value) / EPSILON;
  1103. if (Math.abs(value - xVal) < EPSILON) {
  1104. return t;
  1105. } else if (Math.abs(derivative) < EPSILON) {
  1106. break;
  1107. } else {
  1108. if (value < xVal) {
  1109. tMin = t;
  1110. } else {
  1111. tMax = t;
  1112. }
  1113. t -= (value - xVal) / derivative;
  1114. }
  1115. }
  1116. // If the gradient descent got stuck in a local minimum, e.g. because
  1117. // the derivative was close to 0, use a Dichotomy refinement instead.
  1118. // We limit the number of interations to 8.
  1119. for (var _i = 0; Math.abs(value - xVal) > EPSILON && _i < MAX_ITERATIONS; _i++) {
  1120. if (value < xVal) {
  1121. tMin = t;
  1122. t = (t + tMax) / 2;
  1123. } else {
  1124. tMax = t;
  1125. t = (t + tMin) / 2;
  1126. }
  1127. value = getBezierCoordinate_(t, x1, x2);
  1128. }
  1129. return t;
  1130. }
  1131. /***/ }),
  1132. /* 11 */
  1133. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1134. "use strict";
  1135. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  1136. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(21);
  1137. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(83);
  1138. 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; };
  1139. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1140. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1141. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1142. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  1143. /**
  1144. * @license
  1145. * Copyright 2017 Google Inc. All Rights Reserved.
  1146. *
  1147. * Licensed under the Apache License, Version 2.0 (the "License");
  1148. * you may not use this file except in compliance with the License.
  1149. * You may obtain a copy of the License at
  1150. *
  1151. * http://www.apache.org/licenses/LICENSE-2.0
  1152. *
  1153. * Unless required by applicable law or agreed to in writing, software
  1154. * distributed under the License is distributed on an "AS IS" BASIS,
  1155. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1156. * See the License for the specific language governing permissions and
  1157. * limitations under the License.
  1158. */
  1159. /**
  1160. * @extends {MDCFoundation<!MDCTextFieldBottomLineAdapter>}
  1161. * @final
  1162. */
  1163. var MDCTextFieldBottomLineFoundation = function (_MDCFoundation) {
  1164. _inherits(MDCTextFieldBottomLineFoundation, _MDCFoundation);
  1165. _createClass(MDCTextFieldBottomLineFoundation, null, [{
  1166. key: 'cssClasses',
  1167. /** @return enum {string} */
  1168. get: function get() {
  1169. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  1170. }
  1171. /** @return enum {string} */
  1172. }, {
  1173. key: 'strings',
  1174. get: function get() {
  1175. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  1176. }
  1177. /**
  1178. * {@see MDCTextFieldBottomLineAdapter} for typing information on parameters and return
  1179. * types.
  1180. * @return {!MDCTextFieldBottomLineAdapter}
  1181. */
  1182. }, {
  1183. key: 'defaultAdapter',
  1184. get: function get() {
  1185. return (/** @type {!MDCTextFieldBottomLineAdapter} */{
  1186. addClass: function addClass() {},
  1187. removeClass: function removeClass() {},
  1188. setAttr: function setAttr() {},
  1189. registerEventHandler: function registerEventHandler() {},
  1190. deregisterEventHandler: function deregisterEventHandler() {},
  1191. notifyAnimationEnd: function notifyAnimationEnd() {}
  1192. }
  1193. );
  1194. }
  1195. /**
  1196. * @param {!MDCTextFieldBottomLineAdapter=} adapter
  1197. */
  1198. }]);
  1199. function MDCTextFieldBottomLineFoundation() {
  1200. var adapter = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : /** @type {!MDCTextFieldBottomLineAdapter} */{};
  1201. _classCallCheck(this, MDCTextFieldBottomLineFoundation);
  1202. /** @private {function(!Event): undefined} */
  1203. var _this = _possibleConstructorReturn(this, (MDCTextFieldBottomLineFoundation.__proto__ || Object.getPrototypeOf(MDCTextFieldBottomLineFoundation)).call(this, _extends(MDCTextFieldBottomLineFoundation.defaultAdapter, adapter)));
  1204. _this.transitionEndHandler_ = function (evt) {
  1205. return _this.handleTransitionEnd(evt);
  1206. };
  1207. return _this;
  1208. }
  1209. _createClass(MDCTextFieldBottomLineFoundation, [{
  1210. key: 'init',
  1211. value: function init() {
  1212. this.adapter_.registerEventHandler('transitionend', this.transitionEndHandler_);
  1213. }
  1214. }, {
  1215. key: 'destroy',
  1216. value: function destroy() {
  1217. this.adapter_.deregisterEventHandler('transitionend', this.transitionEndHandler_);
  1218. }
  1219. /**
  1220. * Activates the bottom line
  1221. */
  1222. }, {
  1223. key: 'activate',
  1224. value: function activate() {
  1225. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].BOTTOM_LINE_ACTIVE);
  1226. }
  1227. /**
  1228. * Sets the transform origin given a user's click location.
  1229. * @param {!Event} evt
  1230. */
  1231. }, {
  1232. key: 'setTransformOrigin',
  1233. value: function setTransformOrigin(evt) {
  1234. var targetClientRect = evt.target.getBoundingClientRect();
  1235. var evtCoords = { x: evt.clientX, y: evt.clientY };
  1236. var normalizedX = evtCoords.x - targetClientRect.left;
  1237. var attributeString = 'transform-origin: ' + normalizedX + 'px center';
  1238. this.adapter_.setAttr('style', attributeString);
  1239. }
  1240. /**
  1241. * Deactivates the bottom line
  1242. */
  1243. }, {
  1244. key: 'deactivate',
  1245. value: function deactivate() {
  1246. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].BOTTOM_LINE_ACTIVE);
  1247. }
  1248. /**
  1249. * Handles a transition end event
  1250. * @param {!Event} evt
  1251. */
  1252. }, {
  1253. key: 'handleTransitionEnd',
  1254. value: function handleTransitionEnd(evt) {
  1255. // Wait for the bottom line to be either transparent or opaque
  1256. // before emitting the animation end event
  1257. if (evt.propertyName === 'opacity') {
  1258. this.adapter_.notifyAnimationEnd();
  1259. }
  1260. }
  1261. }]);
  1262. return MDCTextFieldBottomLineFoundation;
  1263. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  1264. /* harmony default export */ __webpack_exports__["a"] = (MDCTextFieldBottomLineFoundation);
  1265. /***/ }),
  1266. /* 12 */
  1267. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1268. "use strict";
  1269. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  1270. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(22);
  1271. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(84);
  1272. 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; };
  1273. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1274. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1275. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1276. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  1277. /**
  1278. * @license
  1279. * Copyright 2017 Google Inc. All Rights Reserved.
  1280. *
  1281. * Licensed under the Apache License, Version 2.0 (the "License");
  1282. * you may not use this file except in compliance with the License.
  1283. * You may obtain a copy of the License at
  1284. *
  1285. * http://www.apache.org/licenses/LICENSE-2.0
  1286. *
  1287. * Unless required by applicable law or agreed to in writing, software
  1288. * distributed under the License is distributed on an "AS IS" BASIS,
  1289. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1290. * See the License for the specific language governing permissions and
  1291. * limitations under the License.
  1292. */
  1293. /**
  1294. * @extends {MDCFoundation<!MDCTextFieldHelperTextAdapter>}
  1295. * @final
  1296. */
  1297. var MDCTextFieldHelperTextFoundation = function (_MDCFoundation) {
  1298. _inherits(MDCTextFieldHelperTextFoundation, _MDCFoundation);
  1299. _createClass(MDCTextFieldHelperTextFoundation, null, [{
  1300. key: 'cssClasses',
  1301. /** @return enum {string} */
  1302. get: function get() {
  1303. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  1304. }
  1305. /** @return enum {string} */
  1306. }, {
  1307. key: 'strings',
  1308. get: function get() {
  1309. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  1310. }
  1311. /**
  1312. * {@see MDCTextFieldHelperTextAdapter} for typing information on parameters and return
  1313. * types.
  1314. * @return {!MDCTextFieldHelperTextAdapter}
  1315. */
  1316. }, {
  1317. key: 'defaultAdapter',
  1318. get: function get() {
  1319. return (/** @type {!MDCTextFieldHelperTextAdapter} */{
  1320. addClass: function addClass() {},
  1321. removeClass: function removeClass() {},
  1322. hasClass: function hasClass() {},
  1323. setAttr: function setAttr() {},
  1324. removeAttr: function removeAttr() {},
  1325. setContent: function setContent() {}
  1326. }
  1327. );
  1328. }
  1329. /**
  1330. * @param {!MDCTextFieldHelperTextAdapter=} adapter
  1331. */
  1332. }]);
  1333. function MDCTextFieldHelperTextFoundation() {
  1334. var adapter = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : /** @type {!MDCTextFieldHelperTextAdapter} */{};
  1335. _classCallCheck(this, MDCTextFieldHelperTextFoundation);
  1336. return _possibleConstructorReturn(this, (MDCTextFieldHelperTextFoundation.__proto__ || Object.getPrototypeOf(MDCTextFieldHelperTextFoundation)).call(this, _extends(MDCTextFieldHelperTextFoundation.defaultAdapter, adapter)));
  1337. }
  1338. /**
  1339. * Sets the content of the helper text field.
  1340. * @param {string} content
  1341. */
  1342. _createClass(MDCTextFieldHelperTextFoundation, [{
  1343. key: 'setContent',
  1344. value: function setContent(content) {
  1345. this.adapter_.setContent(content);
  1346. }
  1347. /** Makes the helper text visible to the screen reader. */
  1348. }, {
  1349. key: 'showToScreenReader',
  1350. value: function showToScreenReader() {
  1351. this.adapter_.removeAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_HIDDEN);
  1352. }
  1353. /**
  1354. * Sets the validity of the helper text based on the input validity.
  1355. * @param {boolean} inputIsValid
  1356. */
  1357. }, {
  1358. key: 'setValidity',
  1359. value: function setValidity(inputIsValid) {
  1360. var helperTextIsPersistent = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_PERSISTENT);
  1361. var helperTextIsValidationMsg = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].HELPER_TEXT_VALIDATION_MSG);
  1362. var validationMsgNeedsDisplay = helperTextIsValidationMsg && !inputIsValid;
  1363. if (validationMsgNeedsDisplay) {
  1364. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ROLE, 'alert');
  1365. } else {
  1366. this.adapter_.removeAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ROLE);
  1367. }
  1368. if (!helperTextIsPersistent && !validationMsgNeedsDisplay) {
  1369. this.hide_();
  1370. }
  1371. }
  1372. /**
  1373. * Hides the help text from screen readers.
  1374. * @private
  1375. */
  1376. }, {
  1377. key: 'hide_',
  1378. value: function hide_() {
  1379. this.adapter_.setAttr(__WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */].ARIA_HIDDEN, 'true');
  1380. }
  1381. }]);
  1382. return MDCTextFieldHelperTextFoundation;
  1383. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  1384. /* harmony default export */ __webpack_exports__["a"] = (MDCTextFieldHelperTextFoundation);
  1385. /***/ }),
  1386. /* 13 */
  1387. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1388. "use strict";
  1389. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1390. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1391. /**
  1392. * @license
  1393. * Copyright 2016 Google Inc. All Rights Reserved.
  1394. *
  1395. * Licensed under the Apache License, Version 2.0 (the "License");
  1396. * you may not use this file except in compliance with the License.
  1397. * You may obtain a copy of the License at
  1398. *
  1399. * http://www.apache.org/licenses/LICENSE-2.0
  1400. *
  1401. * Unless required by applicable law or agreed to in writing, software
  1402. * distributed under the License is distributed on an "AS IS" BASIS,
  1403. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1404. * See the License for the specific language governing permissions and
  1405. * limitations under the License.
  1406. */
  1407. /* eslint no-unused-vars: [2, {"args": "none"}] */
  1408. /**
  1409. * Adapter for MDC Ripple. Provides an interface for managing
  1410. * - classes
  1411. * - dom
  1412. * - CSS variables
  1413. * - position
  1414. * - dimensions
  1415. * - scroll position
  1416. * - event handlers
  1417. * - unbounded, active and disabled states
  1418. *
  1419. * Additionally, provides type information for the adapter to the Closure
  1420. * compiler.
  1421. *
  1422. * Implement this adapter for your framework of choice to delegate updates to
  1423. * the component in your framework of choice. See architecture documentation
  1424. * for more details.
  1425. * https://github.com/material-components/material-components-web/blob/master/docs/architecture.md
  1426. *
  1427. * @record
  1428. */
  1429. var MDCRippleAdapter = function () {
  1430. function MDCRippleAdapter() {
  1431. _classCallCheck(this, MDCRippleAdapter);
  1432. }
  1433. _createClass(MDCRippleAdapter, [{
  1434. key: "browserSupportsCssVars",
  1435. /** @return {boolean} */
  1436. value: function browserSupportsCssVars() {}
  1437. /** @return {boolean} */
  1438. }, {
  1439. key: "isUnbounded",
  1440. value: function isUnbounded() {}
  1441. /** @return {boolean} */
  1442. }, {
  1443. key: "isSurfaceActive",
  1444. value: function isSurfaceActive() {}
  1445. /** @return {boolean} */
  1446. }, {
  1447. key: "isSurfaceDisabled",
  1448. value: function isSurfaceDisabled() {}
  1449. /** @param {string} className */
  1450. }, {
  1451. key: "addClass",
  1452. value: function addClass(className) {}
  1453. /** @param {string} className */
  1454. }, {
  1455. key: "removeClass",
  1456. value: function removeClass(className) {}
  1457. /**
  1458. * @param {string} evtType
  1459. * @param {!Function} handler
  1460. */
  1461. }, {
  1462. key: "registerInteractionHandler",
  1463. value: function registerInteractionHandler(evtType, handler) {}
  1464. /**
  1465. * @param {string} evtType
  1466. * @param {!Function} handler
  1467. */
  1468. }, {
  1469. key: "deregisterInteractionHandler",
  1470. value: function deregisterInteractionHandler(evtType, handler) {}
  1471. /**
  1472. * @param {!Function} handler
  1473. */
  1474. }, {
  1475. key: "registerResizeHandler",
  1476. value: function registerResizeHandler(handler) {}
  1477. /**
  1478. * @param {!Function} handler
  1479. */
  1480. }, {
  1481. key: "deregisterResizeHandler",
  1482. value: function deregisterResizeHandler(handler) {}
  1483. /**
  1484. * @param {string} varName
  1485. * @param {?number|string} value
  1486. */
  1487. }, {
  1488. key: "updateCssVariable",
  1489. value: function updateCssVariable(varName, value) {}
  1490. /** @return {!ClientRect} */
  1491. }, {
  1492. key: "computeBoundingRect",
  1493. value: function computeBoundingRect() {}
  1494. /** @return {{x: number, y: number}} */
  1495. }, {
  1496. key: "getWindowPageOffset",
  1497. value: function getWindowPageOffset() {}
  1498. }]);
  1499. return MDCRippleAdapter;
  1500. }();
  1501. /* unused harmony default export */ var _unused_webpack_default_export = (MDCRippleAdapter);
  1502. /***/ }),
  1503. /* 14 */
  1504. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1505. "use strict";
  1506. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  1507. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  1508. /**
  1509. * Copyright 2016 Google Inc. All Rights Reserved.
  1510. *
  1511. * Licensed under the Apache License, Version 2.0 (the "License");
  1512. * you may not use this file except in compliance with the License.
  1513. * You may obtain a copy of the License at
  1514. *
  1515. * http://www.apache.org/licenses/LICENSE-2.0
  1516. *
  1517. * Unless required by applicable law or agreed to in writing, software
  1518. * distributed under the License is distributed on an "AS IS" BASIS,
  1519. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1520. * See the License for the specific language governing permissions and
  1521. * limitations under the License.
  1522. */
  1523. var cssClasses = {
  1524. BOTTOM_LINE: 'mdc-select__bottom-line',
  1525. BOTTOM_LINE_ACTIVE: 'mdc-select__bottom-line--active',
  1526. BOX: 'mdc-select--box',
  1527. DISABLED: 'mdc-select--disabled',
  1528. LABEL_FLOAT_ABOVE: 'mdc-select__label--float-above',
  1529. OPEN: 'mdc-select--open',
  1530. ROOT: 'mdc-select',
  1531. SCROLL_LOCK: 'mdc-select-scroll-lock'
  1532. };
  1533. var strings = {
  1534. CHANGE_EVENT: 'MDCSelect:change',
  1535. BOTTOM_LINE_SELECTOR: '.mdc-select__bottom-line',
  1536. LABEL_SELECTOR: '.mdc-select__label',
  1537. MENU_SELECTOR: '.mdc-select__menu',
  1538. SURFACE_SELECTOR: '.mdc-select__surface',
  1539. SELECTED_TEXT_SELECTOR: '.mdc-select__selected-text'
  1540. };
  1541. /***/ }),
  1542. /* 15 */
  1543. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1544. "use strict";
  1545. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  1546. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  1547. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  1548. /**
  1549. * Copyright 2017 Google Inc. All Rights Reserved.
  1550. *
  1551. * Licensed under the Apache License, Version 2.0 (the "License");
  1552. * you may not use this file except in compliance with the License.
  1553. * You may obtain a copy of the License at
  1554. *
  1555. * http://www.apache.org/licenses/LICENSE-2.0
  1556. *
  1557. * Unless required by applicable law or agreed to in writing, software
  1558. * distributed under the License is distributed on an "AS IS" BASIS,
  1559. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1560. * See the License for the specific language governing permissions and
  1561. * limitations under the License.
  1562. */
  1563. var cssClasses = {
  1564. ACTIVE: 'mdc-slider--active',
  1565. DISABLED: 'mdc-slider--disabled',
  1566. DISCRETE: 'mdc-slider--discrete',
  1567. FOCUS: 'mdc-slider--focus',
  1568. IN_TRANSIT: 'mdc-slider--in-transit',
  1569. IS_DISCRETE: 'mdc-slider--discrete',
  1570. HAS_TRACK_MARKER: 'mdc-slider--display-markers'
  1571. };
  1572. var strings = {
  1573. TRACK_SELECTOR: '.mdc-slider__track',
  1574. TRACK_MARKER_CONTAINER_SELECTOR: '.mdc-slider__track-marker-container',
  1575. LAST_TRACK_MARKER_SELECTOR: '.mdc-slider__track-marker:last-child',
  1576. THUMB_CONTAINER_SELECTOR: '.mdc-slider__thumb-container',
  1577. PIN_VALUE_MARKER_SELECTOR: '.mdc-slider__pin-value-marker',
  1578. ARIA_VALUEMIN: 'aria-valuemin',
  1579. ARIA_VALUEMAX: 'aria-valuemax',
  1580. ARIA_VALUENOW: 'aria-valuenow',
  1581. ARIA_DISABLED: 'aria-disabled',
  1582. STEP_DATA_ATTR: 'data-step',
  1583. CHANGE_EVENT: 'MDCSlider:change',
  1584. INPUT_EVENT: 'MDCSlider:input'
  1585. };
  1586. var numbers = {
  1587. PAGE_FACTOR: 4
  1588. };
  1589. /***/ }),
  1590. /* 16 */
  1591. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1592. "use strict";
  1593. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTab; });
  1594. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(2);
  1595. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_ripple__ = __webpack_require__(3);
  1596. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(17);
  1597. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation__ = __webpack_require__(76);
  1598. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_3__foundation__["a"]; });
  1599. 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); } };
  1600. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1601. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1602. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1603. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  1604. /**
  1605. * Copyright 2017 Google Inc. All Rights Reserved.
  1606. *
  1607. * Licensed under the Apache License, Version 2.0 (the "License");
  1608. * you may not use this file except in compliance with the License.
  1609. * You may obtain a copy of the License at
  1610. *
  1611. * http://www.apache.org/licenses/LICENSE-2.0
  1612. *
  1613. * Unless required by applicable law or agreed to in writing, software
  1614. * distributed under the License is distributed on an "AS IS" BASIS,
  1615. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1616. * See the License for the specific language governing permissions and
  1617. * limitations under the License.
  1618. */
  1619. var MDCTab = function (_MDCComponent) {
  1620. _inherits(MDCTab, _MDCComponent);
  1621. _createClass(MDCTab, [{
  1622. key: 'computedWidth',
  1623. get: function get() {
  1624. return this.foundation_.getComputedWidth();
  1625. }
  1626. }, {
  1627. key: 'computedLeft',
  1628. get: function get() {
  1629. return this.foundation_.getComputedLeft();
  1630. }
  1631. }, {
  1632. key: 'isActive',
  1633. get: function get() {
  1634. return this.foundation_.isActive();
  1635. },
  1636. set: function set(isActive) {
  1637. this.foundation_.setActive(isActive);
  1638. }
  1639. }, {
  1640. key: 'preventDefaultOnClick',
  1641. get: function get() {
  1642. return this.foundation_.preventsDefaultOnClick();
  1643. },
  1644. set: function set(preventDefaultOnClick) {
  1645. this.foundation_.setPreventDefaultOnClick(preventDefaultOnClick);
  1646. }
  1647. }], [{
  1648. key: 'attachTo',
  1649. value: function attachTo(root) {
  1650. return new MDCTab(root);
  1651. }
  1652. }]);
  1653. function MDCTab() {
  1654. var _ref;
  1655. _classCallCheck(this, MDCTab);
  1656. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  1657. args[_key] = arguments[_key];
  1658. }
  1659. var _this = _possibleConstructorReturn(this, (_ref = MDCTab.__proto__ || Object.getPrototypeOf(MDCTab)).call.apply(_ref, [this].concat(args)));
  1660. _this.ripple_ = __WEBPACK_IMPORTED_MODULE_1__material_ripple__["MDCRipple"].attachTo(_this.root_);
  1661. return _this;
  1662. }
  1663. _createClass(MDCTab, [{
  1664. key: 'destroy',
  1665. value: function destroy() {
  1666. this.ripple_.destroy();
  1667. _get(MDCTab.prototype.__proto__ || Object.getPrototypeOf(MDCTab.prototype), 'destroy', this).call(this);
  1668. }
  1669. }, {
  1670. key: 'getDefaultFoundation',
  1671. value: function getDefaultFoundation() {
  1672. var _this2 = this;
  1673. return new __WEBPACK_IMPORTED_MODULE_3__foundation__["a" /* default */]({
  1674. addClass: function addClass(className) {
  1675. return _this2.root_.classList.add(className);
  1676. },
  1677. removeClass: function removeClass(className) {
  1678. return _this2.root_.classList.remove(className);
  1679. },
  1680. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  1681. return _this2.root_.addEventListener(type, handler);
  1682. },
  1683. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  1684. return _this2.root_.removeEventListener(type, handler);
  1685. },
  1686. getOffsetWidth: function getOffsetWidth() {
  1687. return _this2.root_.offsetWidth;
  1688. },
  1689. getOffsetLeft: function getOffsetLeft() {
  1690. return _this2.root_.offsetLeft;
  1691. },
  1692. notifySelected: function notifySelected() {
  1693. return _this2.emit(__WEBPACK_IMPORTED_MODULE_3__foundation__["a" /* default */].strings.SELECTED_EVENT, { tab: _this2 }, true);
  1694. }
  1695. });
  1696. }
  1697. }, {
  1698. key: 'initialSyncWithDOM',
  1699. value: function initialSyncWithDOM() {
  1700. this.isActive = this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].ACTIVE);
  1701. }
  1702. }, {
  1703. key: 'measureSelf',
  1704. value: function measureSelf() {
  1705. this.foundation_.measureSelf();
  1706. }
  1707. }]);
  1708. return MDCTab;
  1709. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  1710. /***/ }),
  1711. /* 17 */
  1712. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1713. "use strict";
  1714. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  1715. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  1716. /**
  1717. * Copyright 2017 Google Inc. All Rights Reserved.
  1718. *
  1719. * Licensed under the Apache License, Version 2.0 (the "License");
  1720. * you may not use this file except in compliance with the License.
  1721. * You may obtain a copy of the License at
  1722. *
  1723. * http://www.apache.org/licenses/LICENSE-2.0
  1724. *
  1725. * Unless required by applicable law or agreed to in writing, software
  1726. * distributed under the License is distributed on an "AS IS" BASIS,
  1727. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1728. * See the License for the specific language governing permissions and
  1729. * limitations under the License.
  1730. */
  1731. var cssClasses = {
  1732. ACTIVE: 'mdc-tab--active'
  1733. };
  1734. var strings = {
  1735. SELECTED_EVENT: 'MDCTab:selected'
  1736. };
  1737. /***/ }),
  1738. /* 18 */
  1739. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1740. "use strict";
  1741. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTabBar; });
  1742. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(2);
  1743. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__tab__ = __webpack_require__(16);
  1744. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(77);
  1745. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  1746. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1747. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1748. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  1749. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  1750. /**
  1751. * Copyright 2017 Google Inc. All Rights Reserved.
  1752. *
  1753. * Licensed under the Apache License, Version 2.0 (the "License");
  1754. * you may not use this file except in compliance with the License.
  1755. * You may obtain a copy of the License at
  1756. *
  1757. * http://www.apache.org/licenses/LICENSE-2.0
  1758. *
  1759. * Unless required by applicable law or agreed to in writing, software
  1760. * distributed under the License is distributed on an "AS IS" BASIS,
  1761. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1762. * See the License for the specific language governing permissions and
  1763. * limitations under the License.
  1764. */
  1765. var MDCTabBar = function (_MDCComponent) {
  1766. _inherits(MDCTabBar, _MDCComponent);
  1767. function MDCTabBar() {
  1768. _classCallCheck(this, MDCTabBar);
  1769. return _possibleConstructorReturn(this, (MDCTabBar.__proto__ || Object.getPrototypeOf(MDCTabBar)).apply(this, arguments));
  1770. }
  1771. _createClass(MDCTabBar, [{
  1772. key: 'initialize',
  1773. value: function initialize() {
  1774. var _this2 = this;
  1775. var tabFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el) {
  1776. return new __WEBPACK_IMPORTED_MODULE_1__tab__["a" /* MDCTab */](el);
  1777. };
  1778. this.indicator_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.INDICATOR_SELECTOR);
  1779. this.tabs_ = this.gatherTabs_(tabFactory);
  1780. this.tabSelectedHandler_ = function (_ref) {
  1781. var detail = _ref.detail;
  1782. var tab = detail.tab;
  1783. _this2.setActiveTab_(tab, true);
  1784. };
  1785. }
  1786. }, {
  1787. key: 'getDefaultFoundation',
  1788. value: function getDefaultFoundation() {
  1789. var _this3 = this;
  1790. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]({
  1791. addClass: function addClass(className) {
  1792. return _this3.root_.classList.add(className);
  1793. },
  1794. removeClass: function removeClass(className) {
  1795. return _this3.root_.classList.remove(className);
  1796. },
  1797. bindOnMDCTabSelectedEvent: function bindOnMDCTabSelectedEvent() {
  1798. return _this3.listen(__WEBPACK_IMPORTED_MODULE_1__tab__["b" /* MDCTabFoundation */].strings.SELECTED_EVENT, _this3.tabSelectedHandler_);
  1799. },
  1800. unbindOnMDCTabSelectedEvent: function unbindOnMDCTabSelectedEvent() {
  1801. return _this3.unlisten(__WEBPACK_IMPORTED_MODULE_1__tab__["b" /* MDCTabFoundation */].strings.SELECTED_EVENT, _this3.tabSelectedHandler_);
  1802. },
  1803. registerResizeHandler: function registerResizeHandler(handler) {
  1804. return window.addEventListener('resize', handler);
  1805. },
  1806. deregisterResizeHandler: function deregisterResizeHandler(handler) {
  1807. return window.removeEventListener('resize', handler);
  1808. },
  1809. getOffsetWidth: function getOffsetWidth() {
  1810. return _this3.root_.offsetWidth;
  1811. },
  1812. setStyleForIndicator: function setStyleForIndicator(propertyName, value) {
  1813. return _this3.indicator_.style.setProperty(propertyName, value);
  1814. },
  1815. getOffsetWidthForIndicator: function getOffsetWidthForIndicator() {
  1816. return _this3.indicator_.offsetWidth;
  1817. },
  1818. notifyChange: function notifyChange(evtData) {
  1819. return _this3.emit(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.CHANGE_EVENT, evtData);
  1820. },
  1821. getNumberOfTabs: function getNumberOfTabs() {
  1822. return _this3.tabs.length;
  1823. },
  1824. isTabActiveAtIndex: function isTabActiveAtIndex(index) {
  1825. return _this3.tabs[index].isActive;
  1826. },
  1827. setTabActiveAtIndex: function setTabActiveAtIndex(index, isActive) {
  1828. _this3.tabs[index].isActive = isActive;
  1829. },
  1830. isDefaultPreventedOnClickForTabAtIndex: function isDefaultPreventedOnClickForTabAtIndex(index) {
  1831. return _this3.tabs[index].preventDefaultOnClick;
  1832. },
  1833. setPreventDefaultOnClickForTabAtIndex: function setPreventDefaultOnClickForTabAtIndex(index, preventDefaultOnClick) {
  1834. _this3.tabs[index].preventDefaultOnClick = preventDefaultOnClick;
  1835. },
  1836. measureTabAtIndex: function measureTabAtIndex(index) {
  1837. return _this3.tabs[index].measureSelf();
  1838. },
  1839. getComputedWidthForTabAtIndex: function getComputedWidthForTabAtIndex(index) {
  1840. return _this3.tabs[index].computedWidth;
  1841. },
  1842. getComputedLeftForTabAtIndex: function getComputedLeftForTabAtIndex(index) {
  1843. return _this3.tabs[index].computedLeft;
  1844. }
  1845. });
  1846. }
  1847. }, {
  1848. key: 'gatherTabs_',
  1849. value: function gatherTabs_(tabFactory) {
  1850. var tabElements = [].slice.call(this.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.TAB_SELECTOR));
  1851. return tabElements.map(function (el) {
  1852. return tabFactory(el);
  1853. });
  1854. }
  1855. }, {
  1856. key: 'setActiveTabIndex_',
  1857. value: function setActiveTabIndex_(activeTabIndex, notifyChange) {
  1858. this.foundation_.switchToTabAtIndex(activeTabIndex, notifyChange);
  1859. }
  1860. }, {
  1861. key: 'layout',
  1862. value: function layout() {
  1863. this.foundation_.layout();
  1864. }
  1865. }, {
  1866. key: 'setActiveTab_',
  1867. value: function setActiveTab_(activeTab, notifyChange) {
  1868. var indexOfTab = this.tabs.indexOf(activeTab);
  1869. if (indexOfTab < 0) {
  1870. throw new Error('Invalid tab component given as activeTab: Tab not found within this component\'s tab list');
  1871. }
  1872. this.setActiveTabIndex_(indexOfTab, notifyChange);
  1873. }
  1874. }, {
  1875. key: 'tabs',
  1876. get: function get() {
  1877. return this.tabs_;
  1878. }
  1879. }, {
  1880. key: 'activeTab',
  1881. get: function get() {
  1882. var activeIndex = this.foundation_.getActiveTabIndex();
  1883. return this.tabs[activeIndex];
  1884. },
  1885. set: function set(tab) {
  1886. this.setActiveTab_(tab, false);
  1887. }
  1888. }, {
  1889. key: 'activeTabIndex',
  1890. get: function get() {
  1891. return this.foundation_.getActiveTabIndex();
  1892. },
  1893. set: function set(index) {
  1894. this.setActiveTabIndex_(index, false);
  1895. }
  1896. }], [{
  1897. key: 'attachTo',
  1898. value: function attachTo(root) {
  1899. return new MDCTabBar(root);
  1900. }
  1901. }]);
  1902. return MDCTabBar;
  1903. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  1904. /***/ }),
  1905. /* 19 */
  1906. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1907. "use strict";
  1908. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  1909. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  1910. /**
  1911. * @license
  1912. * Copyright 2016 Google Inc. All Rights Reserved.
  1913. *
  1914. * Licensed under the Apache License, Version 2.0 (the "License");
  1915. * you may not use this file except in compliance with the License.
  1916. * You may obtain a copy of the License at
  1917. *
  1918. * http://www.apache.org/licenses/LICENSE-2.0
  1919. *
  1920. * Unless required by applicable law or agreed to in writing, software
  1921. * distributed under the License is distributed on an "AS IS" BASIS,
  1922. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1923. * See the License for the specific language governing permissions and
  1924. * limitations under the License.
  1925. */
  1926. /** @enum {string} */
  1927. var strings = {
  1928. ARIA_CONTROLS: 'aria-controls',
  1929. INPUT_SELECTOR: '.mdc-text-field__input',
  1930. LABEL_SELECTOR: '.mdc-text-field__label',
  1931. ICON_SELECTOR: '.mdc-text-field__icon',
  1932. ICON_EVENT: 'MDCTextField:icon',
  1933. BOTTOM_LINE_SELECTOR: '.mdc-text-field__bottom-line'
  1934. };
  1935. /** @enum {string} */
  1936. var cssClasses = {
  1937. ROOT: 'mdc-text-field',
  1938. UPGRADED: 'mdc-text-field--upgraded',
  1939. DISABLED: 'mdc-text-field--disabled',
  1940. FOCUSED: 'mdc-text-field--focused',
  1941. INVALID: 'mdc-text-field--invalid',
  1942. LABEL_FLOAT_ABOVE: 'mdc-text-field__label--float-above',
  1943. LABEL_SHAKE: 'mdc-text-field__label--shake',
  1944. BOX: 'mdc-text-field--box',
  1945. TEXT_FIELD_ICON: 'mdc-text-field__icon',
  1946. TEXTAREA: 'mdc-text-field--textarea'
  1947. };
  1948. /***/ }),
  1949. /* 20 */
  1950. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1951. "use strict";
  1952. /* unused harmony export MDCTextFieldAdapter */
  1953. /* unused harmony export NativeInputType */
  1954. /* unused harmony export FoundationMapType */
  1955. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__bottom_line_foundation__ = __webpack_require__(11);
  1956. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__helper_text_foundation__ = __webpack_require__(12);
  1957. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  1958. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1959. /**
  1960. * @license
  1961. * Copyright 2017 Google Inc. All Rights Reserved.
  1962. *
  1963. * Licensed under the Apache License, Version 2.0 (the "License");
  1964. * you may not use this file except in compliance with the License.
  1965. * You may obtain a copy of the License at
  1966. *
  1967. * http://www.apache.org/licenses/LICENSE-2.0
  1968. *
  1969. * Unless required by applicable law or agreed to in writing, software
  1970. * distributed under the License is distributed on an "AS IS" BASIS,
  1971. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1972. * See the License for the specific language governing permissions and
  1973. * limitations under the License.
  1974. */
  1975. /* eslint-disable no-unused-vars */
  1976. /* eslint no-unused-vars: [2, {"args": "none"}] */
  1977. /**
  1978. * @typedef {{
  1979. * value: string,
  1980. * disabled: boolean,
  1981. * badInput: boolean,
  1982. * checkValidity: (function(): boolean)
  1983. * }}
  1984. */
  1985. var NativeInputType = void 0;
  1986. /**
  1987. * @typedef {{
  1988. * bottomLine: (!MDCTextFieldBottomLineFoundation|undefined),
  1989. * helperText: (!MDCTextFieldHelperTextFoundation|undefined)
  1990. * }}
  1991. */
  1992. var FoundationMapType = void 0;
  1993. /**
  1994. * Adapter for MDC Text Field.
  1995. *
  1996. * Defines the shape of the adapter expected by the foundation. Implement this
  1997. * adapter to integrate the Text Field into your framework. See
  1998. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  1999. * for more information.
  2000. *
  2001. * @record
  2002. */
  2003. var MDCTextFieldAdapter = function () {
  2004. function MDCTextFieldAdapter() {
  2005. _classCallCheck(this, MDCTextFieldAdapter);
  2006. }
  2007. _createClass(MDCTextFieldAdapter, [{
  2008. key: 'addClass',
  2009. /**
  2010. * Adds a class to the root Element.
  2011. * @param {string} className
  2012. */
  2013. value: function addClass(className) {}
  2014. /**
  2015. * Removes a class from the root Element.
  2016. * @param {string} className
  2017. */
  2018. }, {
  2019. key: 'removeClass',
  2020. value: function removeClass(className) {}
  2021. /**
  2022. * Adds a class to the label Element. We recommend you add a conditional
  2023. * check here, and in removeClassFromLabel for whether or not the label is
  2024. * present so that the JS component could be used with text fields that don't
  2025. * require a label, such as the full-width text field.
  2026. * @param {string} className
  2027. */
  2028. }, {
  2029. key: 'addClassToLabel',
  2030. value: function addClassToLabel(className) {}
  2031. /**
  2032. * Removes a class from the label Element.
  2033. * @param {string} className
  2034. */
  2035. }, {
  2036. key: 'removeClassFromLabel',
  2037. value: function removeClassFromLabel(className) {}
  2038. /**
  2039. * Sets an attribute on the icon Element.
  2040. * @param {string} name
  2041. * @param {string} value
  2042. */
  2043. }, {
  2044. key: 'setIconAttr',
  2045. value: function setIconAttr(name, value) {}
  2046. /**
  2047. * Returns true if classname exists for a given target element.
  2048. * @param {?EventTarget} target
  2049. * @param {string} className
  2050. * @return {boolean}
  2051. */
  2052. }, {
  2053. key: 'eventTargetHasClass',
  2054. value: function eventTargetHasClass(target, className) {}
  2055. /**
  2056. * Registers an event handler on the root element for a given event.
  2057. * @param {string} type
  2058. * @param {function(!Event): undefined} handler
  2059. */
  2060. }, {
  2061. key: 'registerTextFieldInteractionHandler',
  2062. value: function registerTextFieldInteractionHandler(type, handler) {}
  2063. /**
  2064. * Deregisters an event handler on the root element for a given event.
  2065. * @param {string} type
  2066. * @param {function(!Event): undefined} handler
  2067. */
  2068. }, {
  2069. key: 'deregisterTextFieldInteractionHandler',
  2070. value: function deregisterTextFieldInteractionHandler(type, handler) {}
  2071. /**
  2072. * Emits a custom event "MDCTextField:icon" denoting a user has clicked the icon.
  2073. */
  2074. }, {
  2075. key: 'notifyIconAction',
  2076. value: function notifyIconAction() {}
  2077. /**
  2078. * Registers an event listener on the native input element for a given event.
  2079. * @param {string} evtType
  2080. * @param {function(!Event): undefined} handler
  2081. */
  2082. }, {
  2083. key: 'registerInputInteractionHandler',
  2084. value: function registerInputInteractionHandler(evtType, handler) {}
  2085. /**
  2086. * Deregisters an event listener on the native input element for a given event.
  2087. * @param {string} evtType
  2088. * @param {function(!Event): undefined} handler
  2089. */
  2090. }, {
  2091. key: 'deregisterInputInteractionHandler',
  2092. value: function deregisterInputInteractionHandler(evtType, handler) {}
  2093. /**
  2094. * Registers an event listener on the bottom line element for a given event.
  2095. * @param {string} evtType
  2096. * @param {function(!Event): undefined} handler
  2097. */
  2098. }, {
  2099. key: 'registerBottomLineEventHandler',
  2100. value: function registerBottomLineEventHandler(evtType, handler) {}
  2101. /**
  2102. * Deregisters an event listener on the bottom line element for a given event.
  2103. * @param {string} evtType
  2104. * @param {function(!Event): undefined} handler
  2105. */
  2106. }, {
  2107. key: 'deregisterBottomLineEventHandler',
  2108. value: function deregisterBottomLineEventHandler(evtType, handler) {}
  2109. /**
  2110. * Returns an object representing the native text input element, with a
  2111. * similar API shape. The object returned should include the value, disabled
  2112. * and badInput properties, as well as the checkValidity() function. We never
  2113. * alter the value within our code, however we do update the disabled
  2114. * property, so if you choose to duck-type the return value for this method
  2115. * in your implementation it's important to keep this in mind. Also note that
  2116. * this method can return null, which the foundation will handle gracefully.
  2117. * @return {?Element|?NativeInputType}
  2118. */
  2119. }, {
  2120. key: 'getNativeInput',
  2121. value: function getNativeInput() {}
  2122. }]);
  2123. return MDCTextFieldAdapter;
  2124. }();
  2125. /***/ }),
  2126. /* 21 */
  2127. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2128. "use strict";
  2129. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  2130. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2131. /**
  2132. * @license
  2133. * Copyright 2017 Google Inc. All Rights Reserved.
  2134. *
  2135. * Licensed under the Apache License, Version 2.0 (the "License");
  2136. * you may not use this file except in compliance with the License.
  2137. * You may obtain a copy of the License at
  2138. *
  2139. * http://www.apache.org/licenses/LICENSE-2.0
  2140. *
  2141. * Unless required by applicable law or agreed to in writing, software
  2142. * distributed under the License is distributed on an "AS IS" BASIS,
  2143. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2144. * See the License for the specific language governing permissions and
  2145. * limitations under the License.
  2146. */
  2147. /* eslint no-unused-vars: [2, {"args": "none"}] */
  2148. /**
  2149. * Adapter for MDC TextField Bottom Line.
  2150. *
  2151. * Defines the shape of the adapter expected by the foundation. Implement this
  2152. * adapter to integrate the TextField bottom line into your framework. See
  2153. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  2154. * for more information.
  2155. *
  2156. * @record
  2157. */
  2158. var MDCTextFieldBottomLineAdapter = function () {
  2159. function MDCTextFieldBottomLineAdapter() {
  2160. _classCallCheck(this, MDCTextFieldBottomLineAdapter);
  2161. }
  2162. _createClass(MDCTextFieldBottomLineAdapter, [{
  2163. key: "addClass",
  2164. /**
  2165. * Adds a class to the bottom line element.
  2166. * @param {string} className
  2167. */
  2168. value: function addClass(className) {}
  2169. /**
  2170. * Removes a class from the bottom line element.
  2171. * @param {string} className
  2172. */
  2173. }, {
  2174. key: "removeClass",
  2175. value: function removeClass(className) {}
  2176. /**
  2177. * Sets an attribute with a given value on the bottom line element.
  2178. * @param {string} attr
  2179. * @param {string} value
  2180. */
  2181. }, {
  2182. key: "setAttr",
  2183. value: function setAttr(attr, value) {}
  2184. /**
  2185. * Registers an event listener on the bottom line element for a given event.
  2186. * @param {string} evtType
  2187. * @param {function(!Event): undefined} handler
  2188. */
  2189. }, {
  2190. key: "registerEventHandler",
  2191. value: function registerEventHandler(evtType, handler) {}
  2192. /**
  2193. * Deregisters an event listener on the bottom line element for a given event.
  2194. * @param {string} evtType
  2195. * @param {function(!Event): undefined} handler
  2196. */
  2197. }, {
  2198. key: "deregisterEventHandler",
  2199. value: function deregisterEventHandler(evtType, handler) {}
  2200. /**
  2201. * Emits a custom event "MDCTextFieldBottomLine:animation-end" denoting the
  2202. * bottom line has finished its animation; either the activate or
  2203. * deactivate animation
  2204. */
  2205. }, {
  2206. key: "notifyAnimationEnd",
  2207. value: function notifyAnimationEnd() {}
  2208. }]);
  2209. return MDCTextFieldBottomLineAdapter;
  2210. }();
  2211. /* unused harmony default export */ var _unused_webpack_default_export = (MDCTextFieldBottomLineAdapter);
  2212. /***/ }),
  2213. /* 22 */
  2214. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2215. "use strict";
  2216. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  2217. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2218. /**
  2219. * @license
  2220. * Copyright 2017 Google Inc. All Rights Reserved.
  2221. *
  2222. * Licensed under the Apache License, Version 2.0 (the "License");
  2223. * you may not use this file except in compliance with the License.
  2224. * You may obtain a copy of the License at
  2225. *
  2226. * http://www.apache.org/licenses/LICENSE-2.0
  2227. *
  2228. * Unless required by applicable law or agreed to in writing, software
  2229. * distributed under the License is distributed on an "AS IS" BASIS,
  2230. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2231. * See the License for the specific language governing permissions and
  2232. * limitations under the License.
  2233. */
  2234. /* eslint no-unused-vars: [2, {"args": "none"}] */
  2235. /**
  2236. * Adapter for MDC Text Field Helper Text.
  2237. *
  2238. * Defines the shape of the adapter expected by the foundation. Implement this
  2239. * adapter to integrate the TextField helper text into your framework. See
  2240. * https://github.com/material-components/material-components-web/blob/master/docs/authoring-components.md
  2241. * for more information.
  2242. *
  2243. * @record
  2244. */
  2245. var MDCTextFieldHelperTextAdapter = function () {
  2246. function MDCTextFieldHelperTextAdapter() {
  2247. _classCallCheck(this, MDCTextFieldHelperTextAdapter);
  2248. }
  2249. _createClass(MDCTextFieldHelperTextAdapter, [{
  2250. key: "addClass",
  2251. /**
  2252. * Adds a class to the helper text element.
  2253. * @param {string} className
  2254. */
  2255. value: function addClass(className) {}
  2256. /**
  2257. * Removes a class from the helper text element.
  2258. * @param {string} className
  2259. */
  2260. }, {
  2261. key: "removeClass",
  2262. value: function removeClass(className) {}
  2263. /**
  2264. * Returns whether or not the helper text element contains the given class.
  2265. * @param {string} className
  2266. * @return {boolean}
  2267. */
  2268. }, {
  2269. key: "hasClass",
  2270. value: function hasClass(className) {}
  2271. /**
  2272. * Sets an attribute with a given value on the helper text element.
  2273. * @param {string} attr
  2274. * @param {string} value
  2275. */
  2276. }, {
  2277. key: "setAttr",
  2278. value: function setAttr(attr, value) {}
  2279. /**
  2280. * Removes an attribute from the helper text element.
  2281. * @param {string} attr
  2282. */
  2283. }, {
  2284. key: "removeAttr",
  2285. value: function removeAttr(attr) {}
  2286. /**
  2287. * Sets the text content for the helper text element.
  2288. * @param {string} content
  2289. */
  2290. }, {
  2291. key: "setContent",
  2292. value: function setContent(content) {}
  2293. }]);
  2294. return MDCTextFieldHelperTextAdapter;
  2295. }();
  2296. /* unused harmony default export */ var _unused_webpack_default_export = (MDCTextFieldHelperTextAdapter);
  2297. /***/ }),
  2298. /* 23 */
  2299. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2300. "use strict";
  2301. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  2302. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_auto_init__ = __webpack_require__(24);
  2303. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base__ = __webpack_require__(1);
  2304. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_checkbox__ = __webpack_require__(25);
  2305. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_dialog__ = __webpack_require__(31);
  2306. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_drawer__ = __webpack_require__(37);
  2307. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__material_form_field__ = __webpack_require__(46);
  2308. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__material_grid_list__ = __webpack_require__(50);
  2309. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__material_icon_toggle__ = __webpack_require__(53);
  2310. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__material_linear_progress__ = __webpack_require__(57);
  2311. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__material_menu__ = __webpack_require__(9);
  2312. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__material_radio__ = __webpack_require__(64);
  2313. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__material_ripple__ = __webpack_require__(3);
  2314. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__material_select__ = __webpack_require__(68);
  2315. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__material_selection_control__ = __webpack_require__(4);
  2316. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__material_slider__ = __webpack_require__(70);
  2317. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__material_snackbar__ = __webpack_require__(72);
  2318. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__material_tabs__ = __webpack_require__(75);
  2319. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__material_textfield__ = __webpack_require__(82);
  2320. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__material_toolbar__ = __webpack_require__(88);
  2321. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "autoInit", function() { return __WEBPACK_IMPORTED_MODULE_0__material_auto_init__["a"]; });
  2322. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "base", function() { return __WEBPACK_IMPORTED_MODULE_1__material_base__; });
  2323. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "checkbox", function() { return __WEBPACK_IMPORTED_MODULE_2__material_checkbox__; });
  2324. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "dialog", function() { return __WEBPACK_IMPORTED_MODULE_3__material_dialog__; });
  2325. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "drawer", function() { return __WEBPACK_IMPORTED_MODULE_4__material_drawer__; });
  2326. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "formField", function() { return __WEBPACK_IMPORTED_MODULE_5__material_form_field__; });
  2327. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "gridList", function() { return __WEBPACK_IMPORTED_MODULE_6__material_grid_list__; });
  2328. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "iconToggle", function() { return __WEBPACK_IMPORTED_MODULE_7__material_icon_toggle__; });
  2329. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "linearProgress", function() { return __WEBPACK_IMPORTED_MODULE_8__material_linear_progress__; });
  2330. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "menu", function() { return __WEBPACK_IMPORTED_MODULE_9__material_menu__; });
  2331. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "radio", function() { return __WEBPACK_IMPORTED_MODULE_10__material_radio__; });
  2332. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "ripple", function() { return __WEBPACK_IMPORTED_MODULE_11__material_ripple__; });
  2333. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "select", function() { return __WEBPACK_IMPORTED_MODULE_12__material_select__; });
  2334. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "selectionControl", function() { return __WEBPACK_IMPORTED_MODULE_13__material_selection_control__; });
  2335. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "slider", function() { return __WEBPACK_IMPORTED_MODULE_14__material_slider__; });
  2336. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "snackbar", function() { return __WEBPACK_IMPORTED_MODULE_15__material_snackbar__; });
  2337. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "tabs", function() { return __WEBPACK_IMPORTED_MODULE_16__material_tabs__; });
  2338. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "textField", function() { return __WEBPACK_IMPORTED_MODULE_17__material_textfield__; });
  2339. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "toolbar", function() { return __WEBPACK_IMPORTED_MODULE_18__material_toolbar__; });
  2340. /**
  2341. * Copyright 2016 Google Inc. All Rights Reserved.
  2342. *
  2343. * Licensed under the Apache License, Version 2.0 (the "License");
  2344. * you may not use this file except in compliance with the License.
  2345. * You may obtain a copy of the License at
  2346. *
  2347. * http://www.apache.org/licenses/LICENSE-2.0
  2348. *
  2349. * Unless required by applicable law or agreed to in writing, software
  2350. * distributed under the License is distributed on an "AS IS" BASIS,
  2351. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2352. * See the License for the specific language governing permissions and
  2353. * limitations under the License.
  2354. */
  2355. // Register all components
  2356. __WEBPACK_IMPORTED_MODULE_0__material_auto_init__["a" /* default */].register('MDCCheckbox', __WEBPACK_IMPORTED_MODULE_2__material_checkbox__["MDCCheckbox"]);
  2357. __WEBPACK_IMPORTED_MODULE_0__material_auto_init__["a" /* default */].register('MDCDialog', __WEBPACK_IMPORTED_MODULE_3__material_dialog__["MDCDialog"]);
  2358. __WEBPACK_IMPORTED_MODULE_0__material_auto_init__["a" /* default */].register('MDCPersistentDrawer', __WEBPACK_IMPORTED_MODULE_4__material_drawer__["MDCPersistentDrawer"]);
  2359. __WEBPACK_IMPORTED_MODULE_0__material_auto_init__["a" /* default */].register('MDCTemporaryDrawer', __WEBPACK_IMPORTED_MODULE_4__material_drawer__["MDCTemporaryDrawer"]);
  2360. __WEBPACK_IMPORTED_MODULE_0__material_auto_init__["a" /* default */].register('MDCFormField', __WEBPACK_IMPORTED_MODULE_5__material_form_field__["MDCFormField"]);
  2361. __WEBPACK_IMPORTED_MODULE_0__material_auto_init__["a" /* default */].register('MDCRipple', __WEBPACK_IMPORTED_MODULE_11__material_ripple__["MDCRipple"]);
  2362. __WEBPACK_IMPORTED_MODULE_0__material_auto_init__["a" /* default */].register('MDCGridList', __WEBPACK_IMPORTED_MODULE_6__material_grid_list__["MDCGridList"]);
  2363. __WEBPACK_IMPORTED_MODULE_0__material_auto_init__["a" /* default */].register('MDCIconToggle', __WEBPACK_IMPORTED_MODULE_7__material_icon_toggle__["MDCIconToggle"]);
  2364. __WEBPACK_IMPORTED_MODULE_0__material_auto_init__["a" /* default */].register('MDCLinearProgress', __WEBPACK_IMPORTED_MODULE_8__material_linear_progress__["MDCLinearProgress"]);
  2365. __WEBPACK_IMPORTED_MODULE_0__material_auto_init__["a" /* default */].register('MDCRadio', __WEBPACK_IMPORTED_MODULE_10__material_radio__["MDCRadio"]);
  2366. __WEBPACK_IMPORTED_MODULE_0__material_auto_init__["a" /* default */].register('MDCSnackbar', __WEBPACK_IMPORTED_MODULE_15__material_snackbar__["MDCSnackbar"]);
  2367. __WEBPACK_IMPORTED_MODULE_0__material_auto_init__["a" /* default */].register('MDCTab', __WEBPACK_IMPORTED_MODULE_16__material_tabs__["MDCTab"]);
  2368. __WEBPACK_IMPORTED_MODULE_0__material_auto_init__["a" /* default */].register('MDCTabBar', __WEBPACK_IMPORTED_MODULE_16__material_tabs__["MDCTabBar"]);
  2369. __WEBPACK_IMPORTED_MODULE_0__material_auto_init__["a" /* default */].register('MDCTextField', __WEBPACK_IMPORTED_MODULE_17__material_textfield__["MDCTextField"]);
  2370. __WEBPACK_IMPORTED_MODULE_0__material_auto_init__["a" /* default */].register('MDCSimpleMenu', __WEBPACK_IMPORTED_MODULE_9__material_menu__["MDCSimpleMenu"]);
  2371. __WEBPACK_IMPORTED_MODULE_0__material_auto_init__["a" /* default */].register('MDCSelect', __WEBPACK_IMPORTED_MODULE_12__material_select__["MDCSelect"]);
  2372. __WEBPACK_IMPORTED_MODULE_0__material_auto_init__["a" /* default */].register('MDCSlider', __WEBPACK_IMPORTED_MODULE_14__material_slider__["MDCSlider"]);
  2373. __WEBPACK_IMPORTED_MODULE_0__material_auto_init__["a" /* default */].register('MDCToolbar', __WEBPACK_IMPORTED_MODULE_18__material_toolbar__["MDCToolbar"]);
  2374. // Export all components.
  2375. /***/ }),
  2376. /* 24 */
  2377. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2378. "use strict";
  2379. /* harmony export (immutable) */ __webpack_exports__["a"] = mdcAutoInit;
  2380. /**
  2381. * Copyright 2016 Google Inc. All Rights Reserved.
  2382. *
  2383. * Licensed under the Apache License, Version 2.0 (the "License");
  2384. * you may not use this file except in compliance with the License.
  2385. * You may obtain a copy of the License at
  2386. *
  2387. * http://www.apache.org/licenses/LICENSE-2.0
  2388. *
  2389. * Unless required by applicable law or agreed to in writing, software
  2390. * distributed under the License is distributed on an "AS IS" BASIS,
  2391. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2392. * See the License for the specific language governing permissions and
  2393. * limitations under the License.
  2394. */
  2395. var registry = Object.create(null);
  2396. var CONSOLE_WARN = console.warn.bind(console);
  2397. function _emit(evtType, evtData) {
  2398. var shouldBubble = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  2399. var evt = void 0;
  2400. if (typeof CustomEvent === 'function') {
  2401. evt = new CustomEvent(evtType, {
  2402. detail: evtData,
  2403. bubbles: shouldBubble
  2404. });
  2405. } else {
  2406. evt = document.createEvent('CustomEvent');
  2407. evt.initCustomEvent(evtType, shouldBubble, false, evtData);
  2408. }
  2409. document.dispatchEvent(evt);
  2410. }
  2411. /**
  2412. * Auto-initializes all mdc components on a page.
  2413. */
  2414. function mdcAutoInit() {
  2415. var root = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
  2416. var warn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : CONSOLE_WARN;
  2417. var nodes = root.querySelectorAll('[data-mdc-auto-init]');
  2418. for (var i = 0, node; node = nodes[i]; i++) {
  2419. var ctorName = node.dataset.mdcAutoInit;
  2420. if (!ctorName) {
  2421. throw new Error('(mdc-auto-init) Constructor name must be given.');
  2422. }
  2423. var Ctor = registry[ctorName];
  2424. if (typeof Ctor !== 'function') {
  2425. throw new Error('(mdc-auto-init) Could not find constructor in registry for ' + ctorName);
  2426. }
  2427. if (node[ctorName]) {
  2428. warn('(mdc-auto-init) Component already initialized for ' + node + '. Skipping...');
  2429. continue;
  2430. }
  2431. // TODO: Should we make an eslint rule for an attachTo() static method?
  2432. var component = Ctor.attachTo(node);
  2433. Object.defineProperty(node, ctorName, {
  2434. value: component,
  2435. writable: false,
  2436. enumerable: false,
  2437. configurable: true
  2438. });
  2439. }
  2440. _emit('MDCAutoInit:End', {});
  2441. }
  2442. mdcAutoInit.register = function (componentName, Ctor) {
  2443. var warn = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : CONSOLE_WARN;
  2444. if (typeof Ctor !== 'function') {
  2445. throw new Error('(mdc-auto-init) Invalid Ctor value ' + Ctor + '. Expected function');
  2446. }
  2447. if (registry[componentName]) {
  2448. warn('(mdc-auto-init) Overriding registration for ' + componentName + ' with ' + Ctor + '. ' + ('Was: ' + registry[componentName]));
  2449. }
  2450. registry[componentName] = Ctor;
  2451. };
  2452. mdcAutoInit.deregister = function (componentName) {
  2453. delete registry[componentName];
  2454. };
  2455. mdcAutoInit.deregisterAll = function () {
  2456. Object.keys(registry).forEach(this.deregister, this);
  2457. };
  2458. /***/ }),
  2459. /* 25 */
  2460. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2461. "use strict";
  2462. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  2463. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCCheckbox", function() { return MDCCheckbox; });
  2464. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_animation__ = __webpack_require__(5);
  2465. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(2);
  2466. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_selection_control__ = __webpack_require__(4);
  2467. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation__ = __webpack_require__(28);
  2468. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__material_ripple__ = __webpack_require__(3);
  2469. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__material_ripple_util__ = __webpack_require__(6);
  2470. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCCheckboxFoundation", function() { return __WEBPACK_IMPORTED_MODULE_3__foundation__["a"]; });
  2471. 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; };
  2472. 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); } };
  2473. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  2474. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2475. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  2476. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  2477. /**
  2478. * @license
  2479. * Copyright 2016 Google Inc. All Rights Reserved.
  2480. *
  2481. * Licensed under the Apache License, Version 2.0 (the "License");
  2482. * you may not use this file except in compliance with the License.
  2483. * You may obtain a copy of the License at
  2484. *
  2485. * http://www.apache.org/licenses/LICENSE-2.0
  2486. *
  2487. * Unless required by applicable law or agreed to in writing, software
  2488. * distributed under the License is distributed on an "AS IS" BASIS,
  2489. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2490. * See the License for the specific language governing permissions and
  2491. * limitations under the License.
  2492. */
  2493. /* eslint-disable no-unused-vars */
  2494. /* eslint-enable no-unused-vars */
  2495. /**
  2496. * @extends MDCComponent<!MDCCheckboxFoundation>
  2497. * @implements {MDCSelectionControl}
  2498. */
  2499. var MDCCheckbox = function (_MDCComponent) {
  2500. _inherits(MDCCheckbox, _MDCComponent);
  2501. _createClass(MDCCheckbox, [{
  2502. key: 'nativeCb_',
  2503. /**
  2504. * Returns the state of the native control element, or null if the native control element is not present.
  2505. * @return {?MDCSelectionControlState}
  2506. * @private
  2507. */
  2508. get: function get() {
  2509. var NATIVE_CONTROL_SELECTOR = __WEBPACK_IMPORTED_MODULE_3__foundation__["a" /* default */].strings.NATIVE_CONTROL_SELECTOR;
  2510. var cbEl = /** @type {?MDCSelectionControlState} */this.root_.querySelector(NATIVE_CONTROL_SELECTOR);
  2511. return cbEl;
  2512. }
  2513. }], [{
  2514. key: 'attachTo',
  2515. value: function attachTo(root) {
  2516. return new MDCCheckbox(root);
  2517. }
  2518. }]);
  2519. function MDCCheckbox() {
  2520. var _ref;
  2521. _classCallCheck(this, MDCCheckbox);
  2522. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  2523. args[_key] = arguments[_key];
  2524. }
  2525. /** @private {!MDCRipple} */
  2526. var _this = _possibleConstructorReturn(this, (_ref = MDCCheckbox.__proto__ || Object.getPrototypeOf(MDCCheckbox)).call.apply(_ref, [this].concat(args)));
  2527. _this.ripple_ = _this.initRipple_();
  2528. return _this;
  2529. }
  2530. /**
  2531. * @return {!MDCRipple}
  2532. * @private
  2533. */
  2534. _createClass(MDCCheckbox, [{
  2535. key: 'initRipple_',
  2536. value: function initRipple_() {
  2537. var _this2 = this;
  2538. var MATCHES = Object(__WEBPACK_IMPORTED_MODULE_5__material_ripple_util__["getMatchesProperty"])(HTMLElement.prototype);
  2539. var adapter = _extends(__WEBPACK_IMPORTED_MODULE_4__material_ripple__["MDCRipple"].createAdapter(this), {
  2540. isUnbounded: function isUnbounded() {
  2541. return true;
  2542. },
  2543. isSurfaceActive: function isSurfaceActive() {
  2544. return _this2.nativeCb_[MATCHES](':active');
  2545. },
  2546. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  2547. return _this2.nativeCb_.addEventListener(type, handler);
  2548. },
  2549. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  2550. return _this2.nativeCb_.removeEventListener(type, handler);
  2551. },
  2552. computeBoundingRect: function computeBoundingRect() {
  2553. var _root_$getBoundingCli = _this2.root_.getBoundingClientRect(),
  2554. left = _root_$getBoundingCli.left,
  2555. top = _root_$getBoundingCli.top;
  2556. var DIM = 40;
  2557. return {
  2558. top: top,
  2559. left: left,
  2560. right: left + DIM,
  2561. bottom: top + DIM,
  2562. width: DIM,
  2563. height: DIM
  2564. };
  2565. }
  2566. });
  2567. var foundation = new __WEBPACK_IMPORTED_MODULE_4__material_ripple__["MDCRippleFoundation"](adapter);
  2568. return new __WEBPACK_IMPORTED_MODULE_4__material_ripple__["MDCRipple"](this.root_, foundation);
  2569. }
  2570. /** @return {!MDCCheckboxFoundation} */
  2571. }, {
  2572. key: 'getDefaultFoundation',
  2573. value: function getDefaultFoundation() {
  2574. var _this3 = this;
  2575. return new __WEBPACK_IMPORTED_MODULE_3__foundation__["a" /* default */]({
  2576. addClass: function addClass(className) {
  2577. return _this3.root_.classList.add(className);
  2578. },
  2579. removeClass: function removeClass(className) {
  2580. return _this3.root_.classList.remove(className);
  2581. },
  2582. registerAnimationEndHandler: function registerAnimationEndHandler(handler) {
  2583. return _this3.root_.addEventListener(Object(__WEBPACK_IMPORTED_MODULE_0__material_animation__["a" /* getCorrectEventName */])(window, 'animationend'), handler);
  2584. },
  2585. deregisterAnimationEndHandler: function deregisterAnimationEndHandler(handler) {
  2586. return _this3.root_.removeEventListener(Object(__WEBPACK_IMPORTED_MODULE_0__material_animation__["a" /* getCorrectEventName */])(window, 'animationend'), handler);
  2587. },
  2588. registerChangeHandler: function registerChangeHandler(handler) {
  2589. return _this3.nativeCb_.addEventListener('change', handler);
  2590. },
  2591. deregisterChangeHandler: function deregisterChangeHandler(handler) {
  2592. return _this3.nativeCb_.removeEventListener('change', handler);
  2593. },
  2594. getNativeControl: function getNativeControl() {
  2595. return _this3.nativeCb_;
  2596. },
  2597. forceLayout: function forceLayout() {
  2598. return _this3.root_.offsetWidth;
  2599. },
  2600. isAttachedToDOM: function isAttachedToDOM() {
  2601. return Boolean(_this3.root_.parentNode);
  2602. }
  2603. });
  2604. }
  2605. /** @return {!MDCRipple} */
  2606. }, {
  2607. key: 'destroy',
  2608. value: function destroy() {
  2609. this.ripple_.destroy();
  2610. _get(MDCCheckbox.prototype.__proto__ || Object.getPrototypeOf(MDCCheckbox.prototype), 'destroy', this).call(this);
  2611. }
  2612. }, {
  2613. key: 'ripple',
  2614. get: function get() {
  2615. return this.ripple_;
  2616. }
  2617. /** @return {boolean} */
  2618. }, {
  2619. key: 'checked',
  2620. get: function get() {
  2621. return this.foundation_.isChecked();
  2622. }
  2623. /** @param {boolean} checked */
  2624. ,
  2625. set: function set(checked) {
  2626. this.foundation_.setChecked(checked);
  2627. }
  2628. /** @return {boolean} */
  2629. }, {
  2630. key: 'indeterminate',
  2631. get: function get() {
  2632. return this.foundation_.isIndeterminate();
  2633. }
  2634. /** @param {boolean} indeterminate */
  2635. ,
  2636. set: function set(indeterminate) {
  2637. this.foundation_.setIndeterminate(indeterminate);
  2638. }
  2639. /** @return {boolean} */
  2640. }, {
  2641. key: 'disabled',
  2642. get: function get() {
  2643. return this.foundation_.isDisabled();
  2644. }
  2645. /** @param {boolean} disabled */
  2646. ,
  2647. set: function set(disabled) {
  2648. this.foundation_.setDisabled(disabled);
  2649. }
  2650. /** @return {?string} */
  2651. }, {
  2652. key: 'value',
  2653. get: function get() {
  2654. return this.foundation_.getValue();
  2655. }
  2656. /** @param {?string} value */
  2657. ,
  2658. set: function set(value) {
  2659. this.foundation_.setValue(value);
  2660. }
  2661. }]);
  2662. return MDCCheckbox;
  2663. }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* default */]);
  2664. /***/ }),
  2665. /* 26 */
  2666. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2667. "use strict";
  2668. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  2669. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(13);
  2670. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(27);
  2671. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util__ = __webpack_require__(6);
  2672. 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; };
  2673. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  2674. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2675. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  2676. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  2677. /**
  2678. * @license
  2679. * Copyright 2016 Google Inc. All Rights Reserved.
  2680. *
  2681. * Licensed under the Apache License, Version 2.0 (the "License");
  2682. * you may not use this file except in compliance with the License.
  2683. * You may obtain a copy of the License at
  2684. *
  2685. * http://www.apache.org/licenses/LICENSE-2.0
  2686. *
  2687. * Unless required by applicable law or agreed to in writing, software
  2688. * distributed under the License is distributed on an "AS IS" BASIS,
  2689. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  2690. * See the License for the specific language governing permissions and
  2691. * limitations under the License.
  2692. */
  2693. /**
  2694. * @typedef {!{
  2695. * isActivated: (boolean|undefined),
  2696. * hasDeactivationUXRun: (boolean|undefined),
  2697. * wasActivatedByPointer: (boolean|undefined),
  2698. * wasElementMadeActive: (boolean|undefined),
  2699. * activationStartTime: (number|undefined),
  2700. * activationEvent: Event,
  2701. * isProgrammatic: (boolean|undefined)
  2702. * }}
  2703. */
  2704. var ActivationStateType = void 0;
  2705. /**
  2706. * @typedef {!{
  2707. * activate: (string|undefined),
  2708. * deactivate: (string|undefined),
  2709. * focus: (string|undefined),
  2710. * blur: (string|undefined)
  2711. * }}
  2712. */
  2713. var ListenerInfoType = void 0;
  2714. /**
  2715. * @typedef {!{
  2716. * activate: function(!Event),
  2717. * deactivate: function(!Event),
  2718. * focus: function(),
  2719. * blur: function()
  2720. * }}
  2721. */
  2722. var ListenersType = void 0;
  2723. /**
  2724. * @typedef {!{
  2725. * x: number,
  2726. * y: number
  2727. * }}
  2728. */
  2729. var PointType = void 0;
  2730. /**
  2731. * @enum {string}
  2732. */
  2733. var DEACTIVATION_ACTIVATION_PAIRS = {
  2734. mouseup: 'mousedown',
  2735. pointerup: 'pointerdown',
  2736. touchend: 'touchstart',
  2737. keyup: 'keydown',
  2738. blur: 'focus'
  2739. };
  2740. /**
  2741. * @extends {MDCFoundation<!MDCRippleAdapter>}
  2742. */
  2743. var MDCRippleFoundation = function (_MDCFoundation) {
  2744. _inherits(MDCRippleFoundation, _MDCFoundation);
  2745. _createClass(MDCRippleFoundation, null, [{
  2746. key: 'cssClasses',
  2747. get: function get() {
  2748. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  2749. }
  2750. }, {
  2751. key: 'strings',
  2752. get: function get() {
  2753. return __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */];
  2754. }
  2755. }, {
  2756. key: 'numbers',
  2757. get: function get() {
  2758. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */];
  2759. }
  2760. }, {
  2761. key: 'defaultAdapter',
  2762. get: function get() {
  2763. return {
  2764. browserSupportsCssVars: function browserSupportsCssVars() /* boolean - cached */{},
  2765. isUnbounded: function isUnbounded() /* boolean */{},
  2766. isSurfaceActive: function isSurfaceActive() /* boolean */{},
  2767. isSurfaceDisabled: function isSurfaceDisabled() /* boolean */{},
  2768. addClass: function addClass() /* className: string */{},
  2769. removeClass: function removeClass() /* className: string */{},
  2770. registerInteractionHandler: function registerInteractionHandler() /* evtType: string, handler: EventListener */{},
  2771. deregisterInteractionHandler: function deregisterInteractionHandler() /* evtType: string, handler: EventListener */{},
  2772. registerResizeHandler: function registerResizeHandler() /* handler: EventListener */{},
  2773. deregisterResizeHandler: function deregisterResizeHandler() /* handler: EventListener */{},
  2774. updateCssVariable: function updateCssVariable() /* varName: string, value: string */{},
  2775. computeBoundingRect: function computeBoundingRect() /* ClientRect */{},
  2776. getWindowPageOffset: function getWindowPageOffset() /* {x: number, y: number} */{}
  2777. };
  2778. }
  2779. }]);
  2780. function MDCRippleFoundation(adapter) {
  2781. _classCallCheck(this, MDCRippleFoundation);
  2782. /** @private {number} */
  2783. var _this = _possibleConstructorReturn(this, (MDCRippleFoundation.__proto__ || Object.getPrototypeOf(MDCRippleFoundation)).call(this, _extends(MDCRippleFoundation.defaultAdapter, adapter)));
  2784. _this.layoutFrame_ = 0;
  2785. /** @private {!ClientRect} */
  2786. _this.frame_ = /** @type {!ClientRect} */{ width: 0, height: 0 };
  2787. /** @private {!ActivationStateType} */
  2788. _this.activationState_ = _this.defaultActivationState_();
  2789. /** @private {number} */
  2790. _this.xfDuration_ = 0;
  2791. /** @private {number} */
  2792. _this.initialSize_ = 0;
  2793. /** @private {number} */
  2794. _this.maxRadius_ = 0;
  2795. /** @private {!Array<{ListenerInfoType}>} */
  2796. _this.listenerInfos_ = [{ activate: 'touchstart', deactivate: 'touchend' }, { activate: 'pointerdown', deactivate: 'pointerup' }, { activate: 'mousedown', deactivate: 'mouseup' }, { activate: 'keydown', deactivate: 'keyup' }, { focus: 'focus', blur: 'blur' }];
  2797. /** @private {!ListenersType} */
  2798. _this.listeners_ = {
  2799. activate: function activate(e) {
  2800. return _this.activate_(e);
  2801. },
  2802. deactivate: function deactivate(e) {
  2803. return _this.deactivate_(e);
  2804. },
  2805. focus: function focus() {
  2806. return requestAnimationFrame(function () {
  2807. return _this.adapter_.addClass(MDCRippleFoundation.cssClasses.BG_FOCUSED);
  2808. });
  2809. },
  2810. blur: function blur() {
  2811. return requestAnimationFrame(function () {
  2812. return _this.adapter_.removeClass(MDCRippleFoundation.cssClasses.BG_FOCUSED);
  2813. });
  2814. }
  2815. };
  2816. /** @private {!Function} */
  2817. _this.resizeHandler_ = function () {
  2818. return _this.layout();
  2819. };
  2820. /** @private {!{left: number, top:number}} */
  2821. _this.unboundedCoords_ = {
  2822. left: 0,
  2823. top: 0
  2824. };
  2825. /** @private {number} */
  2826. _this.fgScale_ = 0;
  2827. /** @private {number} */
  2828. _this.activationTimer_ = 0;
  2829. /** @private {number} */
  2830. _this.fgDeactivationRemovalTimer_ = 0;
  2831. /** @private {boolean} */
  2832. _this.activationAnimationHasEnded_ = false;
  2833. /** @private {!Function} */
  2834. _this.activationTimerCallback_ = function () {
  2835. _this.activationAnimationHasEnded_ = true;
  2836. _this.runDeactivationUXLogicIfReady_();
  2837. };
  2838. return _this;
  2839. }
  2840. /**
  2841. * We compute this property so that we are not querying information about the client
  2842. * until the point in time where the foundation requests it. This prevents scenarios where
  2843. * client-side feature-detection may happen too early, such as when components are rendered on the server
  2844. * and then initialized at mount time on the client.
  2845. * @return {boolean}
  2846. * @private
  2847. */
  2848. _createClass(MDCRippleFoundation, [{
  2849. key: 'isSupported_',
  2850. value: function isSupported_() {
  2851. return this.adapter_.browserSupportsCssVars();
  2852. }
  2853. /**
  2854. * @return {!ActivationStateType}
  2855. */
  2856. }, {
  2857. key: 'defaultActivationState_',
  2858. value: function defaultActivationState_() {
  2859. return {
  2860. isActivated: false,
  2861. hasDeactivationUXRun: false,
  2862. wasActivatedByPointer: false,
  2863. wasElementMadeActive: false,
  2864. activationStartTime: 0,
  2865. activationEvent: null,
  2866. isProgrammatic: false
  2867. };
  2868. }
  2869. }, {
  2870. key: 'init',
  2871. value: function init() {
  2872. var _this2 = this;
  2873. if (!this.isSupported_()) {
  2874. return;
  2875. }
  2876. this.addEventListeners_();
  2877. var _MDCRippleFoundation$ = MDCRippleFoundation.cssClasses,
  2878. ROOT = _MDCRippleFoundation$.ROOT,
  2879. UNBOUNDED = _MDCRippleFoundation$.UNBOUNDED;
  2880. requestAnimationFrame(function () {
  2881. _this2.adapter_.addClass(ROOT);
  2882. if (_this2.adapter_.isUnbounded()) {
  2883. _this2.adapter_.addClass(UNBOUNDED);
  2884. }
  2885. _this2.layoutInternal_();
  2886. });
  2887. }
  2888. /** @private */
  2889. }, {
  2890. key: 'addEventListeners_',
  2891. value: function addEventListeners_() {
  2892. var _this3 = this;
  2893. this.listenerInfos_.forEach(function (info) {
  2894. Object.keys(info).forEach(function (k) {
  2895. _this3.adapter_.registerInteractionHandler(info[k], _this3.listeners_[k]);
  2896. });
  2897. });
  2898. this.adapter_.registerResizeHandler(this.resizeHandler_);
  2899. }
  2900. /**
  2901. * @param {Event} e
  2902. * @private
  2903. */
  2904. }, {
  2905. key: 'activate_',
  2906. value: function activate_(e) {
  2907. var _this4 = this;
  2908. if (this.adapter_.isSurfaceDisabled()) {
  2909. return;
  2910. }
  2911. var activationState = this.activationState_;
  2912. if (activationState.isActivated) {
  2913. return;
  2914. }
  2915. activationState.isActivated = true;
  2916. activationState.isProgrammatic = e === null;
  2917. activationState.activationEvent = e;
  2918. activationState.wasActivatedByPointer = activationState.isProgrammatic ? false : e.type === 'mousedown' || e.type === 'touchstart' || e.type === 'pointerdown';
  2919. activationState.activationStartTime = Date.now();
  2920. requestAnimationFrame(function () {
  2921. // This needs to be wrapped in an rAF call b/c web browsers
  2922. // report active states inconsistently when they're called within
  2923. // event handling code:
  2924. // - https://bugs.chromium.org/p/chromium/issues/detail?id=635971
  2925. // - https://bugzilla.mozilla.org/show_bug.cgi?id=1293741
  2926. activationState.wasElementMadeActive = e && e.type === 'keydown' ? _this4.adapter_.isSurfaceActive() : true;
  2927. if (activationState.wasElementMadeActive) {
  2928. _this4.animateActivation_();
  2929. } else {
  2930. // Reset activation state immediately if element was not made active.
  2931. _this4.activationState_ = _this4.defaultActivationState_();
  2932. }
  2933. });
  2934. }
  2935. /**
  2936. * @param {?Event=} event Optional event containing position information.
  2937. */
  2938. }, {
  2939. key: 'activate',
  2940. value: function activate() {
  2941. var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  2942. this.activate_(event);
  2943. }
  2944. /** @private */
  2945. }, {
  2946. key: 'animateActivation_',
  2947. value: function animateActivation_() {
  2948. var _this5 = this;
  2949. var _MDCRippleFoundation$2 = MDCRippleFoundation.strings,
  2950. VAR_FG_TRANSLATE_START = _MDCRippleFoundation$2.VAR_FG_TRANSLATE_START,
  2951. VAR_FG_TRANSLATE_END = _MDCRippleFoundation$2.VAR_FG_TRANSLATE_END;
  2952. var _MDCRippleFoundation$3 = MDCRippleFoundation.cssClasses,
  2953. BG_ACTIVE_FILL = _MDCRippleFoundation$3.BG_ACTIVE_FILL,
  2954. FG_DEACTIVATION = _MDCRippleFoundation$3.FG_DEACTIVATION,
  2955. FG_ACTIVATION = _MDCRippleFoundation$3.FG_ACTIVATION;
  2956. var DEACTIVATION_TIMEOUT_MS = MDCRippleFoundation.numbers.DEACTIVATION_TIMEOUT_MS;
  2957. var translateStart = '';
  2958. var translateEnd = '';
  2959. if (!this.adapter_.isUnbounded()) {
  2960. var _getFgTranslationCoor = this.getFgTranslationCoordinates_(),
  2961. startPoint = _getFgTranslationCoor.startPoint,
  2962. endPoint = _getFgTranslationCoor.endPoint;
  2963. translateStart = startPoint.x + 'px, ' + startPoint.y + 'px';
  2964. translateEnd = endPoint.x + 'px, ' + endPoint.y + 'px';
  2965. }
  2966. this.adapter_.updateCssVariable(VAR_FG_TRANSLATE_START, translateStart);
  2967. this.adapter_.updateCssVariable(VAR_FG_TRANSLATE_END, translateEnd);
  2968. // Cancel any ongoing activation/deactivation animations
  2969. clearTimeout(this.activationTimer_);
  2970. clearTimeout(this.fgDeactivationRemovalTimer_);
  2971. this.rmBoundedActivationClasses_();
  2972. this.adapter_.removeClass(FG_DEACTIVATION);
  2973. // Force layout in order to re-trigger the animation.
  2974. this.adapter_.computeBoundingRect();
  2975. this.adapter_.addClass(BG_ACTIVE_FILL);
  2976. this.adapter_.addClass(FG_ACTIVATION);
  2977. this.activationTimer_ = setTimeout(function () {
  2978. return _this5.activationTimerCallback_();
  2979. }, DEACTIVATION_TIMEOUT_MS);
  2980. }
  2981. /**
  2982. * @private
  2983. * @return {{startPoint: PointType, endPoint: PointType}}
  2984. */
  2985. }, {
  2986. key: 'getFgTranslationCoordinates_',
  2987. value: function getFgTranslationCoordinates_() {
  2988. var activationState = this.activationState_;
  2989. var activationEvent = activationState.activationEvent,
  2990. wasActivatedByPointer = activationState.wasActivatedByPointer;
  2991. var startPoint = void 0;
  2992. if (wasActivatedByPointer) {
  2993. startPoint = Object(__WEBPACK_IMPORTED_MODULE_3__util__["getNormalizedEventCoords"])(
  2994. /** @type {!Event} */activationEvent, this.adapter_.getWindowPageOffset(), this.adapter_.computeBoundingRect());
  2995. } else {
  2996. startPoint = {
  2997. x: this.frame_.width / 2,
  2998. y: this.frame_.height / 2
  2999. };
  3000. }
  3001. // Center the element around the start point.
  3002. startPoint = {
  3003. x: startPoint.x - this.initialSize_ / 2,
  3004. y: startPoint.y - this.initialSize_ / 2
  3005. };
  3006. var endPoint = {
  3007. x: this.frame_.width / 2 - this.initialSize_ / 2,
  3008. y: this.frame_.height / 2 - this.initialSize_ / 2
  3009. };
  3010. return { startPoint: startPoint, endPoint: endPoint };
  3011. }
  3012. /** @private */
  3013. }, {
  3014. key: 'runDeactivationUXLogicIfReady_',
  3015. value: function runDeactivationUXLogicIfReady_() {
  3016. var _this6 = this;
  3017. var FG_DEACTIVATION = MDCRippleFoundation.cssClasses.FG_DEACTIVATION;
  3018. var _activationState_ = this.activationState_,
  3019. hasDeactivationUXRun = _activationState_.hasDeactivationUXRun,
  3020. isActivated = _activationState_.isActivated;
  3021. var activationHasEnded = hasDeactivationUXRun || !isActivated;
  3022. if (activationHasEnded && this.activationAnimationHasEnded_) {
  3023. this.rmBoundedActivationClasses_();
  3024. this.adapter_.addClass(FG_DEACTIVATION);
  3025. this.fgDeactivationRemovalTimer_ = setTimeout(function () {
  3026. _this6.adapter_.removeClass(FG_DEACTIVATION);
  3027. }, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].FG_DEACTIVATION_MS);
  3028. }
  3029. }
  3030. /** @private */
  3031. }, {
  3032. key: 'rmBoundedActivationClasses_',
  3033. value: function rmBoundedActivationClasses_() {
  3034. var _MDCRippleFoundation$4 = MDCRippleFoundation.cssClasses,
  3035. BG_ACTIVE_FILL = _MDCRippleFoundation$4.BG_ACTIVE_FILL,
  3036. FG_ACTIVATION = _MDCRippleFoundation$4.FG_ACTIVATION;
  3037. this.adapter_.removeClass(BG_ACTIVE_FILL);
  3038. this.adapter_.removeClass(FG_ACTIVATION);
  3039. this.activationAnimationHasEnded_ = false;
  3040. this.adapter_.computeBoundingRect();
  3041. }
  3042. /**
  3043. * @param {Event} e
  3044. * @private
  3045. */
  3046. }, {
  3047. key: 'deactivate_',
  3048. value: function deactivate_(e) {
  3049. var _this7 = this;
  3050. var activationState = this.activationState_;
  3051. // This can happen in scenarios such as when you have a keyup event that blurs the element.
  3052. if (!activationState.isActivated) {
  3053. return;
  3054. }
  3055. // Programmatic deactivation.
  3056. if (activationState.isProgrammatic) {
  3057. var evtObject = null;
  3058. var _state = /** @type {!ActivationStateType} */_extends({}, activationState);
  3059. requestAnimationFrame(function () {
  3060. return _this7.animateDeactivation_(evtObject, _state);
  3061. });
  3062. this.activationState_ = this.defaultActivationState_();
  3063. return;
  3064. }
  3065. var actualActivationType = DEACTIVATION_ACTIVATION_PAIRS[e.type];
  3066. var expectedActivationType = activationState.activationEvent.type;
  3067. // NOTE: Pointer events are tricky - https://patrickhlauke.github.io/touch/tests/results/
  3068. // Essentially, what we need to do here is decouple the deactivation UX from the actual
  3069. // deactivation state itself. This way, touch/pointer events in sequence do not trample one
  3070. // another.
  3071. var needsDeactivationUX = actualActivationType === expectedActivationType;
  3072. var needsActualDeactivation = needsDeactivationUX;
  3073. if (activationState.wasActivatedByPointer) {
  3074. needsActualDeactivation = e.type === 'mouseup';
  3075. }
  3076. var state = /** @type {!ActivationStateType} */_extends({}, activationState);
  3077. requestAnimationFrame(function () {
  3078. if (needsDeactivationUX) {
  3079. _this7.activationState_.hasDeactivationUXRun = true;
  3080. _this7.animateDeactivation_(e, state);
  3081. }
  3082. if (needsActualDeactivation) {
  3083. _this7.activationState_ = _this7.defaultActivationState_();
  3084. }
  3085. });
  3086. }
  3087. /**
  3088. * @param {?Event=} event Optional event containing position information.
  3089. */
  3090. }, {
  3091. key: 'deactivate',
  3092. value: function deactivate() {
  3093. var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  3094. this.deactivate_(event);
  3095. }
  3096. /**
  3097. * @param {Event} e
  3098. * @param {!ActivationStateType} options
  3099. * @private
  3100. */
  3101. }, {
  3102. key: 'animateDeactivation_',
  3103. value: function animateDeactivation_(e, _ref) {
  3104. var wasActivatedByPointer = _ref.wasActivatedByPointer,
  3105. wasElementMadeActive = _ref.wasElementMadeActive;
  3106. var BG_FOCUSED = MDCRippleFoundation.cssClasses.BG_FOCUSED;
  3107. if (wasActivatedByPointer || wasElementMadeActive) {
  3108. // Remove class left over by element being focused
  3109. this.adapter_.removeClass(BG_FOCUSED);
  3110. this.runDeactivationUXLogicIfReady_();
  3111. }
  3112. }
  3113. }, {
  3114. key: 'destroy',
  3115. value: function destroy() {
  3116. var _this8 = this;
  3117. if (!this.isSupported_()) {
  3118. return;
  3119. }
  3120. this.removeEventListeners_();
  3121. var _MDCRippleFoundation$5 = MDCRippleFoundation.cssClasses,
  3122. ROOT = _MDCRippleFoundation$5.ROOT,
  3123. UNBOUNDED = _MDCRippleFoundation$5.UNBOUNDED;
  3124. requestAnimationFrame(function () {
  3125. _this8.adapter_.removeClass(ROOT);
  3126. _this8.adapter_.removeClass(UNBOUNDED);
  3127. _this8.removeCssVars_();
  3128. });
  3129. }
  3130. /** @private */
  3131. }, {
  3132. key: 'removeEventListeners_',
  3133. value: function removeEventListeners_() {
  3134. var _this9 = this;
  3135. this.listenerInfos_.forEach(function (info) {
  3136. Object.keys(info).forEach(function (k) {
  3137. _this9.adapter_.deregisterInteractionHandler(info[k], _this9.listeners_[k]);
  3138. });
  3139. });
  3140. this.adapter_.deregisterResizeHandler(this.resizeHandler_);
  3141. }
  3142. /** @private */
  3143. }, {
  3144. key: 'removeCssVars_',
  3145. value: function removeCssVars_() {
  3146. var _this10 = this;
  3147. var strings = MDCRippleFoundation.strings;
  3148. Object.keys(strings).forEach(function (k) {
  3149. if (k.indexOf('VAR_') === 0) {
  3150. _this10.adapter_.updateCssVariable(strings[k], null);
  3151. }
  3152. });
  3153. }
  3154. }, {
  3155. key: 'layout',
  3156. value: function layout() {
  3157. var _this11 = this;
  3158. if (this.layoutFrame_) {
  3159. cancelAnimationFrame(this.layoutFrame_);
  3160. }
  3161. this.layoutFrame_ = requestAnimationFrame(function () {
  3162. _this11.layoutInternal_();
  3163. _this11.layoutFrame_ = 0;
  3164. });
  3165. }
  3166. /** @private */
  3167. }, {
  3168. key: 'layoutInternal_',
  3169. value: function layoutInternal_() {
  3170. this.frame_ = this.adapter_.computeBoundingRect();
  3171. var maxDim = Math.max(this.frame_.height, this.frame_.width);
  3172. var surfaceDiameter = Math.sqrt(Math.pow(this.frame_.width, 2) + Math.pow(this.frame_.height, 2));
  3173. // 60% of the largest dimension of the surface
  3174. this.initialSize_ = maxDim * MDCRippleFoundation.numbers.INITIAL_ORIGIN_SCALE;
  3175. // Diameter of the surface + 10px
  3176. this.maxRadius_ = surfaceDiameter + MDCRippleFoundation.numbers.PADDING;
  3177. this.fgScale_ = this.maxRadius_ / this.initialSize_;
  3178. this.xfDuration_ = 1000 * Math.sqrt(this.maxRadius_ / 1024);
  3179. this.updateLayoutCssVars_();
  3180. }
  3181. /** @private */
  3182. }, {
  3183. key: 'updateLayoutCssVars_',
  3184. value: function updateLayoutCssVars_() {
  3185. var _MDCRippleFoundation$6 = MDCRippleFoundation.strings,
  3186. VAR_FG_SIZE = _MDCRippleFoundation$6.VAR_FG_SIZE,
  3187. VAR_LEFT = _MDCRippleFoundation$6.VAR_LEFT,
  3188. VAR_TOP = _MDCRippleFoundation$6.VAR_TOP,
  3189. VAR_FG_SCALE = _MDCRippleFoundation$6.VAR_FG_SCALE;
  3190. this.adapter_.updateCssVariable(VAR_FG_SIZE, this.initialSize_ + 'px');
  3191. this.adapter_.updateCssVariable(VAR_FG_SCALE, this.fgScale_);
  3192. if (this.adapter_.isUnbounded()) {
  3193. this.unboundedCoords_ = {
  3194. left: Math.round(this.frame_.width / 2 - this.initialSize_ / 2),
  3195. top: Math.round(this.frame_.height / 2 - this.initialSize_ / 2)
  3196. };
  3197. this.adapter_.updateCssVariable(VAR_LEFT, this.unboundedCoords_.left + 'px');
  3198. this.adapter_.updateCssVariable(VAR_TOP, this.unboundedCoords_.top + 'px');
  3199. }
  3200. }
  3201. }]);
  3202. return MDCRippleFoundation;
  3203. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  3204. /* harmony default export */ __webpack_exports__["a"] = (MDCRippleFoundation);
  3205. /***/ }),
  3206. /* 27 */
  3207. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3208. "use strict";
  3209. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  3210. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  3211. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  3212. /**
  3213. * @license
  3214. * Copyright 2016 Google Inc. All Rights Reserved.
  3215. *
  3216. * Licensed under the Apache License, Version 2.0 (the "License");
  3217. * you may not use this file except in compliance with the License.
  3218. * You may obtain a copy of the License at
  3219. *
  3220. * http://www.apache.org/licenses/LICENSE-2.0
  3221. *
  3222. * Unless required by applicable law or agreed to in writing, software
  3223. * distributed under the License is distributed on an "AS IS" BASIS,
  3224. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3225. * See the License for the specific language governing permissions and
  3226. * limitations under the License.
  3227. */
  3228. var cssClasses = {
  3229. // Ripple is a special case where the "root" component is really a "mixin" of sorts,
  3230. // given that it's an 'upgrade' to an existing component. That being said it is the root
  3231. // CSS class that all other CSS classes derive from.
  3232. ROOT: 'mdc-ripple-upgraded',
  3233. UNBOUNDED: 'mdc-ripple-upgraded--unbounded',
  3234. BG_FOCUSED: 'mdc-ripple-upgraded--background-focused',
  3235. BG_ACTIVE_FILL: 'mdc-ripple-upgraded--background-active-fill',
  3236. FG_ACTIVATION: 'mdc-ripple-upgraded--foreground-activation',
  3237. FG_DEACTIVATION: 'mdc-ripple-upgraded--foreground-deactivation'
  3238. };
  3239. var strings = {
  3240. VAR_FG_SIZE: '--mdc-ripple-fg-size',
  3241. VAR_LEFT: '--mdc-ripple-left',
  3242. VAR_TOP: '--mdc-ripple-top',
  3243. VAR_FG_SCALE: '--mdc-ripple-fg-scale',
  3244. VAR_FG_TRANSLATE_START: '--mdc-ripple-fg-translate-start',
  3245. VAR_FG_TRANSLATE_END: '--mdc-ripple-fg-translate-end'
  3246. };
  3247. var numbers = {
  3248. PADDING: 10,
  3249. INITIAL_ORIGIN_SCALE: 0.6,
  3250. DEACTIVATION_TIMEOUT_MS: 225, // Corresponds to $mdc-ripple-translate-duration (i.e. activation animation duration)
  3251. FG_DEACTIVATION_MS: 150 };
  3252. /***/ }),
  3253. /* 28 */
  3254. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3255. "use strict";
  3256. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  3257. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_selection_control__ = __webpack_require__(4);
  3258. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__adapter__ = __webpack_require__(29);
  3259. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(30);
  3260. 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; };
  3261. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  3262. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3263. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  3264. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  3265. /**
  3266. * @license
  3267. * Copyright 2016 Google Inc. All Rights Reserved.
  3268. *
  3269. * Licensed under the Apache License, Version 2.0 (the "License");
  3270. * you may not use this file except in compliance with the License.
  3271. * You may obtain a copy of the License at
  3272. *
  3273. * http://www.apache.org/licenses/LICENSE-2.0
  3274. *
  3275. * Unless required by applicable law or agreed to in writing, software
  3276. * distributed under the License is distributed on an "AS IS" BASIS,
  3277. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3278. * See the License for the specific language governing permissions and
  3279. * limitations under the License.
  3280. */
  3281. /* eslint-disable no-unused-vars */
  3282. /* eslint-enable no-unused-vars */
  3283. /** @const {!Array<string>} */
  3284. var CB_PROTO_PROPS = ['checked', 'indeterminate'];
  3285. /**
  3286. * @extends {MDCFoundation<!MDCCheckboxAdapter>}
  3287. */
  3288. var MDCCheckboxFoundation = function (_MDCFoundation) {
  3289. _inherits(MDCCheckboxFoundation, _MDCFoundation);
  3290. _createClass(MDCCheckboxFoundation, null, [{
  3291. key: 'cssClasses',
  3292. /** @return enum {cssClasses} */
  3293. get: function get() {
  3294. return __WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */];
  3295. }
  3296. /** @return enum {strings} */
  3297. }, {
  3298. key: 'strings',
  3299. get: function get() {
  3300. return __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */];
  3301. }
  3302. /** @return enum {numbers} */
  3303. }, {
  3304. key: 'numbers',
  3305. get: function get() {
  3306. return __WEBPACK_IMPORTED_MODULE_3__constants__["b" /* numbers */];
  3307. }
  3308. /** @return {!MDCCheckboxAdapter} */
  3309. }, {
  3310. key: 'defaultAdapter',
  3311. get: function get() {
  3312. return (/** @type {!MDCCheckboxAdapter} */{
  3313. addClass: function addClass() /* className: string */{},
  3314. removeClass: function removeClass() /* className: string */{},
  3315. registerAnimationEndHandler: function registerAnimationEndHandler() /* handler: EventListener */{},
  3316. deregisterAnimationEndHandler: function deregisterAnimationEndHandler() /* handler: EventListener */{},
  3317. registerChangeHandler: function registerChangeHandler() /* handler: EventListener */{},
  3318. deregisterChangeHandler: function deregisterChangeHandler() /* handler: EventListener */{},
  3319. getNativeControl: function getNativeControl() /* !MDCSelectionControlState */{},
  3320. forceLayout: function forceLayout() {},
  3321. isAttachedToDOM: function isAttachedToDOM() /* boolean */{}
  3322. }
  3323. );
  3324. }
  3325. }]);
  3326. function MDCCheckboxFoundation(adapter) {
  3327. _classCallCheck(this, MDCCheckboxFoundation);
  3328. /** @private {string} */
  3329. var _this = _possibleConstructorReturn(this, (MDCCheckboxFoundation.__proto__ || Object.getPrototypeOf(MDCCheckboxFoundation)).call(this, _extends(MDCCheckboxFoundation.defaultAdapter, adapter)));
  3330. _this.currentCheckState_ = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRANSITION_STATE_INIT;
  3331. /** @private {string} */
  3332. _this.currentAnimationClass_ = '';
  3333. /** @private {number} */
  3334. _this.animEndLatchTimer_ = 0;
  3335. _this.animEndHandler_ = /** @private {!EventListener} */function () {
  3336. clearTimeout(_this.animEndLatchTimer_);
  3337. _this.animEndLatchTimer_ = setTimeout(function () {
  3338. _this.adapter_.removeClass(_this.currentAnimationClass_);
  3339. _this.adapter_.deregisterAnimationEndHandler(_this.animEndHandler_);
  3340. }, __WEBPACK_IMPORTED_MODULE_3__constants__["b" /* numbers */].ANIM_END_LATCH_MS);
  3341. };
  3342. _this.changeHandler_ = /** @private {!EventListener} */function () {
  3343. return _this.transitionCheckState_();
  3344. };
  3345. return _this;
  3346. }
  3347. _createClass(MDCCheckboxFoundation, [{
  3348. key: 'init',
  3349. value: function init() {
  3350. this.currentCheckState_ = this.determineCheckState_(this.getNativeControl_());
  3351. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].UPGRADED);
  3352. this.adapter_.registerChangeHandler(this.changeHandler_);
  3353. this.installPropertyChangeHooks_();
  3354. }
  3355. }, {
  3356. key: 'destroy',
  3357. value: function destroy() {
  3358. this.adapter_.deregisterChangeHandler(this.changeHandler_);
  3359. this.uninstallPropertyChangeHooks_();
  3360. }
  3361. /** @return {boolean} */
  3362. }, {
  3363. key: 'isChecked',
  3364. value: function isChecked() {
  3365. return this.getNativeControl_().checked;
  3366. }
  3367. /** @param {boolean} checked */
  3368. }, {
  3369. key: 'setChecked',
  3370. value: function setChecked(checked) {
  3371. this.getNativeControl_().checked = checked;
  3372. }
  3373. /** @return {boolean} */
  3374. }, {
  3375. key: 'isIndeterminate',
  3376. value: function isIndeterminate() {
  3377. return this.getNativeControl_().indeterminate;
  3378. }
  3379. /** @param {boolean} indeterminate */
  3380. }, {
  3381. key: 'setIndeterminate',
  3382. value: function setIndeterminate(indeterminate) {
  3383. this.getNativeControl_().indeterminate = indeterminate;
  3384. }
  3385. /** @return {boolean} */
  3386. }, {
  3387. key: 'isDisabled',
  3388. value: function isDisabled() {
  3389. return this.getNativeControl_().disabled;
  3390. }
  3391. /** @param {boolean} disabled */
  3392. }, {
  3393. key: 'setDisabled',
  3394. value: function setDisabled(disabled) {
  3395. this.getNativeControl_().disabled = disabled;
  3396. if (disabled) {
  3397. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].DISABLED);
  3398. } else {
  3399. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].DISABLED);
  3400. }
  3401. }
  3402. /** @return {?string} */
  3403. }, {
  3404. key: 'getValue',
  3405. value: function getValue() {
  3406. return this.getNativeControl_().value;
  3407. }
  3408. /** @param {?string} value */
  3409. }, {
  3410. key: 'setValue',
  3411. value: function setValue(value) {
  3412. this.getNativeControl_().value = value;
  3413. }
  3414. /** @private */
  3415. }, {
  3416. key: 'installPropertyChangeHooks_',
  3417. value: function installPropertyChangeHooks_() {
  3418. var _this2 = this;
  3419. var nativeCb = this.getNativeControl_();
  3420. var cbProto = Object.getPrototypeOf(nativeCb);
  3421. CB_PROTO_PROPS.forEach(function (controlState) {
  3422. var desc = Object.getOwnPropertyDescriptor(cbProto, controlState);
  3423. // We have to check for this descriptor, since some browsers (Safari) don't support its return.
  3424. // See: https://bugs.webkit.org/show_bug.cgi?id=49739
  3425. if (validDescriptor(desc)) {
  3426. var nativeCbDesc = /** @type {!ObjectPropertyDescriptor} */{
  3427. get: desc.get,
  3428. set: function set(state) {
  3429. desc.set.call(nativeCb, state);
  3430. _this2.transitionCheckState_();
  3431. },
  3432. configurable: desc.configurable,
  3433. enumerable: desc.enumerable
  3434. };
  3435. Object.defineProperty(nativeCb, controlState, nativeCbDesc);
  3436. }
  3437. });
  3438. }
  3439. /** @private */
  3440. }, {
  3441. key: 'uninstallPropertyChangeHooks_',
  3442. value: function uninstallPropertyChangeHooks_() {
  3443. var nativeCb = this.getNativeControl_();
  3444. var cbProto = Object.getPrototypeOf(nativeCb);
  3445. CB_PROTO_PROPS.forEach(function (controlState) {
  3446. var desc = /** @type {!ObjectPropertyDescriptor} */Object.getOwnPropertyDescriptor(cbProto, controlState);
  3447. if (validDescriptor(desc)) {
  3448. Object.defineProperty(nativeCb, controlState, desc);
  3449. }
  3450. });
  3451. }
  3452. /** @private */
  3453. }, {
  3454. key: 'transitionCheckState_',
  3455. value: function transitionCheckState_() {
  3456. var nativeCb = this.adapter_.getNativeControl();
  3457. if (!nativeCb) {
  3458. return;
  3459. }
  3460. var oldState = this.currentCheckState_;
  3461. var newState = this.determineCheckState_(nativeCb);
  3462. if (oldState === newState) {
  3463. return;
  3464. }
  3465. // Check to ensure that there isn't a previously existing animation class, in case for example
  3466. // the user interacted with the checkbox before the animation was finished.
  3467. if (this.currentAnimationClass_.length > 0) {
  3468. clearTimeout(this.animEndLatchTimer_);
  3469. this.adapter_.forceLayout();
  3470. this.adapter_.removeClass(this.currentAnimationClass_);
  3471. }
  3472. this.currentAnimationClass_ = this.getTransitionAnimationClass_(oldState, newState);
  3473. this.currentCheckState_ = newState;
  3474. // Check for parentNode so that animations are only run when the element is attached
  3475. // to the DOM.
  3476. if (this.adapter_.isAttachedToDOM() && this.currentAnimationClass_.length > 0) {
  3477. this.adapter_.addClass(this.currentAnimationClass_);
  3478. this.adapter_.registerAnimationEndHandler(this.animEndHandler_);
  3479. }
  3480. }
  3481. /**
  3482. * @param {!MDCSelectionControlState} nativeCb
  3483. * @return {string}
  3484. * @private
  3485. */
  3486. }, {
  3487. key: 'determineCheckState_',
  3488. value: function determineCheckState_(nativeCb) {
  3489. var TRANSITION_STATE_INDETERMINATE = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRANSITION_STATE_INDETERMINATE,
  3490. TRANSITION_STATE_CHECKED = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRANSITION_STATE_CHECKED,
  3491. TRANSITION_STATE_UNCHECKED = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRANSITION_STATE_UNCHECKED;
  3492. if (nativeCb.indeterminate) {
  3493. return TRANSITION_STATE_INDETERMINATE;
  3494. }
  3495. return nativeCb.checked ? TRANSITION_STATE_CHECKED : TRANSITION_STATE_UNCHECKED;
  3496. }
  3497. /**
  3498. * @param {string} oldState
  3499. * @param {string} newState
  3500. * @return {string}
  3501. */
  3502. }, {
  3503. key: 'getTransitionAnimationClass_',
  3504. value: function getTransitionAnimationClass_(oldState, newState) {
  3505. var TRANSITION_STATE_INIT = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRANSITION_STATE_INIT,
  3506. TRANSITION_STATE_CHECKED = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRANSITION_STATE_CHECKED,
  3507. TRANSITION_STATE_UNCHECKED = __WEBPACK_IMPORTED_MODULE_3__constants__["c" /* strings */].TRANSITION_STATE_UNCHECKED;
  3508. var _MDCCheckboxFoundatio = MDCCheckboxFoundation.cssClasses,
  3509. ANIM_UNCHECKED_CHECKED = _MDCCheckboxFoundatio.ANIM_UNCHECKED_CHECKED,
  3510. ANIM_UNCHECKED_INDETERMINATE = _MDCCheckboxFoundatio.ANIM_UNCHECKED_INDETERMINATE,
  3511. ANIM_CHECKED_UNCHECKED = _MDCCheckboxFoundatio.ANIM_CHECKED_UNCHECKED,
  3512. ANIM_CHECKED_INDETERMINATE = _MDCCheckboxFoundatio.ANIM_CHECKED_INDETERMINATE,
  3513. ANIM_INDETERMINATE_CHECKED = _MDCCheckboxFoundatio.ANIM_INDETERMINATE_CHECKED,
  3514. ANIM_INDETERMINATE_UNCHECKED = _MDCCheckboxFoundatio.ANIM_INDETERMINATE_UNCHECKED;
  3515. switch (oldState) {
  3516. case TRANSITION_STATE_INIT:
  3517. if (newState === TRANSITION_STATE_UNCHECKED) {
  3518. return '';
  3519. }
  3520. // fallthrough
  3521. case TRANSITION_STATE_UNCHECKED:
  3522. return newState === TRANSITION_STATE_CHECKED ? ANIM_UNCHECKED_CHECKED : ANIM_UNCHECKED_INDETERMINATE;
  3523. case TRANSITION_STATE_CHECKED:
  3524. return newState === TRANSITION_STATE_UNCHECKED ? ANIM_CHECKED_UNCHECKED : ANIM_CHECKED_INDETERMINATE;
  3525. // TRANSITION_STATE_INDETERMINATE
  3526. default:
  3527. return newState === TRANSITION_STATE_CHECKED ? ANIM_INDETERMINATE_CHECKED : ANIM_INDETERMINATE_UNCHECKED;
  3528. }
  3529. }
  3530. /**
  3531. * @return {!MDCSelectionControlState}
  3532. * @private
  3533. */
  3534. }, {
  3535. key: 'getNativeControl_',
  3536. value: function getNativeControl_() {
  3537. return this.adapter_.getNativeControl() || {
  3538. checked: false,
  3539. indeterminate: false,
  3540. disabled: false,
  3541. value: null
  3542. };
  3543. }
  3544. }]);
  3545. return MDCCheckboxFoundation;
  3546. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  3547. /**
  3548. * @param {ObjectPropertyDescriptor|undefined} inputPropDesc
  3549. * @return {boolean}
  3550. */
  3551. function validDescriptor(inputPropDesc) {
  3552. return !!inputPropDesc && typeof inputPropDesc.set === 'function';
  3553. }
  3554. /* harmony default export */ __webpack_exports__["a"] = (MDCCheckboxFoundation);
  3555. /***/ }),
  3556. /* 29 */
  3557. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3558. "use strict";
  3559. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_selection_control__ = __webpack_require__(4);
  3560. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  3561. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3562. /**
  3563. * @license
  3564. * Copyright 2016 Google Inc. All Rights Reserved.
  3565. *
  3566. * Licensed under the Apache License, Version 2.0 (the "License");
  3567. * you may not use this file except in compliance with the License.
  3568. * You may obtain a copy of the License at
  3569. *
  3570. * http://www.apache.org/licenses/LICENSE-2.0
  3571. *
  3572. * Unless required by applicable law or agreed to in writing, software
  3573. * distributed under the License is distributed on an "AS IS" BASIS,
  3574. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3575. * See the License for the specific language governing permissions and
  3576. * limitations under the License.
  3577. */
  3578. /* eslint-disable no-unused-vars */
  3579. /* eslint no-unused-vars: [2, {"args": "none"}] */
  3580. /**
  3581. * Adapter for MDC Checkbox. Provides an interface for managing
  3582. * - classes
  3583. * - dom
  3584. * - event handlers
  3585. *
  3586. * Additionally, provides type information for the adapter to the Closure
  3587. * compiler.
  3588. *
  3589. * Implement this adapter for your framework of choice to delegate updates to
  3590. * the component in your framework of choice. See architecture documentation
  3591. * for more details.
  3592. * https://github.com/material-components/material-components-web/blob/master/docs/architecture.md
  3593. *
  3594. * @record
  3595. */
  3596. var MDCCheckboxAdapter = function () {
  3597. function MDCCheckboxAdapter() {
  3598. _classCallCheck(this, MDCCheckboxAdapter);
  3599. }
  3600. _createClass(MDCCheckboxAdapter, [{
  3601. key: 'addClass',
  3602. /** @param {string} className */
  3603. value: function addClass(className) {}
  3604. /** @param {string} className */
  3605. }, {
  3606. key: 'removeClass',
  3607. value: function removeClass(className) {}
  3608. /** @param {!EventListener} handler */
  3609. }, {
  3610. key: 'registerAnimationEndHandler',
  3611. value: function registerAnimationEndHandler(handler) {}
  3612. /** @param {!EventListener} handler */
  3613. }, {
  3614. key: 'deregisterAnimationEndHandler',
  3615. value: function deregisterAnimationEndHandler(handler) {}
  3616. /** @param {!EventListener} handler */
  3617. }, {
  3618. key: 'registerChangeHandler',
  3619. value: function registerChangeHandler(handler) {}
  3620. /** @param {!EventListener} handler */
  3621. }, {
  3622. key: 'deregisterChangeHandler',
  3623. value: function deregisterChangeHandler(handler) {}
  3624. /** @return {!MDCSelectionControlState} */
  3625. }, {
  3626. key: 'getNativeControl',
  3627. value: function getNativeControl() {}
  3628. }, {
  3629. key: 'forceLayout',
  3630. value: function forceLayout() {}
  3631. /** @return {boolean} */
  3632. }, {
  3633. key: 'isAttachedToDOM',
  3634. value: function isAttachedToDOM() {}
  3635. }]);
  3636. return MDCCheckboxAdapter;
  3637. }();
  3638. /* unused harmony default export */ var _unused_webpack_default_export = (MDCCheckboxAdapter);
  3639. /***/ }),
  3640. /* 30 */
  3641. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3642. "use strict";
  3643. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  3644. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  3645. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  3646. /**
  3647. * @license
  3648. * Copyright 2016 Google Inc. All Rights Reserved.
  3649. *
  3650. * Licensed under the Apache License, Version 2.0 (the "License");
  3651. * you may not use this file except in compliance with the License.
  3652. * You may obtain a copy of the License at
  3653. *
  3654. * http://www.apache.org/licenses/LICENSE-2.0
  3655. *
  3656. * Unless required by applicable law or agreed to in writing, software
  3657. * distributed under the License is distributed on an "AS IS" BASIS,
  3658. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3659. * See the License for the specific language governing permissions and
  3660. * limitations under the License.
  3661. */
  3662. /** @const {string} */
  3663. var ROOT = 'mdc-checkbox';
  3664. /** @enum {string} */
  3665. var cssClasses = {
  3666. UPGRADED: 'mdc-checkbox--upgraded',
  3667. CHECKED: 'mdc-checkbox--checked',
  3668. INDETERMINATE: 'mdc-checkbox--indeterminate',
  3669. DISABLED: 'mdc-checkbox--disabled',
  3670. ANIM_UNCHECKED_CHECKED: 'mdc-checkbox--anim-unchecked-checked',
  3671. ANIM_UNCHECKED_INDETERMINATE: 'mdc-checkbox--anim-unchecked-indeterminate',
  3672. ANIM_CHECKED_UNCHECKED: 'mdc-checkbox--anim-checked-unchecked',
  3673. ANIM_CHECKED_INDETERMINATE: 'mdc-checkbox--anim-checked-indeterminate',
  3674. ANIM_INDETERMINATE_CHECKED: 'mdc-checkbox--anim-indeterminate-checked',
  3675. ANIM_INDETERMINATE_UNCHECKED: 'mdc-checkbox--anim-indeterminate-unchecked'
  3676. };
  3677. /** @enum {string} */
  3678. var strings = {
  3679. NATIVE_CONTROL_SELECTOR: '.' + ROOT + '__native-control',
  3680. TRANSITION_STATE_INIT: 'init',
  3681. TRANSITION_STATE_CHECKED: 'checked',
  3682. TRANSITION_STATE_UNCHECKED: 'unchecked',
  3683. TRANSITION_STATE_INDETERMINATE: 'indeterminate'
  3684. };
  3685. /** @enum {number} */
  3686. var numbers = {
  3687. ANIM_END_LATCH_MS: 100
  3688. };
  3689. /***/ }),
  3690. /* 31 */
  3691. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3692. "use strict";
  3693. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  3694. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCDialog", function() { return MDCDialog; });
  3695. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base__ = __webpack_require__(1);
  3696. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_ripple__ = __webpack_require__(3);
  3697. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(32);
  3698. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util__ = __webpack_require__(34);
  3699. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCDialogFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  3700. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "util", function() { return __WEBPACK_IMPORTED_MODULE_3__util__; });
  3701. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  3702. 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); } };
  3703. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3704. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  3705. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  3706. /**
  3707. * Copyright 2017 Google Inc. All Rights Reserved.
  3708. *
  3709. * Licensed under the Apache License, Version 2.0 (the "License");
  3710. * you may not use this file except in compliance with the License.
  3711. * You may obtain a copy of the License at
  3712. *
  3713. * http://www.apache.org/licenses/LICENSE-2.0
  3714. *
  3715. * Unless required by applicable law or agreed to in writing, software
  3716. * distributed under the License is distributed on an "AS IS" BASIS,
  3717. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3718. * See the License for the specific language governing permissions and
  3719. * limitations under the License.
  3720. */
  3721. var MDCDialog = function (_MDCComponent) {
  3722. _inherits(MDCDialog, _MDCComponent);
  3723. function MDCDialog() {
  3724. _classCallCheck(this, MDCDialog);
  3725. return _possibleConstructorReturn(this, (MDCDialog.__proto__ || Object.getPrototypeOf(MDCDialog)).apply(this, arguments));
  3726. }
  3727. _createClass(MDCDialog, [{
  3728. key: 'initialize',
  3729. value: function initialize() {
  3730. this.focusTrap_ = __WEBPACK_IMPORTED_MODULE_3__util__["createFocusTrapInstance"](this.dialogSurface_, this.acceptButton_);
  3731. this.footerBtnRipples_ = [];
  3732. var footerBtns = this.root_.querySelectorAll('.mdc-dialog__footer__button');
  3733. for (var i = 0, footerBtn; footerBtn = footerBtns[i]; i++) {
  3734. this.footerBtnRipples_.push(new __WEBPACK_IMPORTED_MODULE_1__material_ripple__["MDCRipple"](footerBtn));
  3735. }
  3736. }
  3737. }, {
  3738. key: 'destroy',
  3739. value: function destroy() {
  3740. this.footerBtnRipples_.forEach(function (ripple) {
  3741. return ripple.destroy();
  3742. });
  3743. _get(MDCDialog.prototype.__proto__ || Object.getPrototypeOf(MDCDialog.prototype), 'destroy', this).call(this);
  3744. }
  3745. }, {
  3746. key: 'show',
  3747. value: function show() {
  3748. this.foundation_.open();
  3749. }
  3750. }, {
  3751. key: 'close',
  3752. value: function close() {
  3753. this.foundation_.close();
  3754. }
  3755. }, {
  3756. key: 'getDefaultFoundation',
  3757. value: function getDefaultFoundation() {
  3758. var _this2 = this;
  3759. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]({
  3760. addClass: function addClass(className) {
  3761. return _this2.root_.classList.add(className);
  3762. },
  3763. removeClass: function removeClass(className) {
  3764. return _this2.root_.classList.remove(className);
  3765. },
  3766. addBodyClass: function addBodyClass(className) {
  3767. return document.body.classList.add(className);
  3768. },
  3769. removeBodyClass: function removeBodyClass(className) {
  3770. return document.body.classList.remove(className);
  3771. },
  3772. eventTargetHasClass: function eventTargetHasClass(target, className) {
  3773. return target.classList.contains(className);
  3774. },
  3775. registerInteractionHandler: function registerInteractionHandler(evt, handler) {
  3776. return _this2.root_.addEventListener(evt, handler);
  3777. },
  3778. deregisterInteractionHandler: function deregisterInteractionHandler(evt, handler) {
  3779. return _this2.root_.removeEventListener(evt, handler);
  3780. },
  3781. registerSurfaceInteractionHandler: function registerSurfaceInteractionHandler(evt, handler) {
  3782. return _this2.dialogSurface_.addEventListener(evt, handler);
  3783. },
  3784. deregisterSurfaceInteractionHandler: function deregisterSurfaceInteractionHandler(evt, handler) {
  3785. return _this2.dialogSurface_.removeEventListener(evt, handler);
  3786. },
  3787. registerDocumentKeydownHandler: function registerDocumentKeydownHandler(handler) {
  3788. return document.addEventListener('keydown', handler);
  3789. },
  3790. deregisterDocumentKeydownHandler: function deregisterDocumentKeydownHandler(handler) {
  3791. return document.removeEventListener('keydown', handler);
  3792. },
  3793. registerTransitionEndHandler: function registerTransitionEndHandler(handler) {
  3794. return _this2.dialogSurface_.addEventListener('transitionend', handler);
  3795. },
  3796. deregisterTransitionEndHandler: function deregisterTransitionEndHandler(handler) {
  3797. return _this2.dialogSurface_.removeEventListener('transitionend', handler);
  3798. },
  3799. notifyAccept: function notifyAccept() {
  3800. return _this2.emit(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.ACCEPT_EVENT);
  3801. },
  3802. notifyCancel: function notifyCancel() {
  3803. return _this2.emit(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.CANCEL_EVENT);
  3804. },
  3805. trapFocusOnSurface: function trapFocusOnSurface() {
  3806. return _this2.focusTrap_.activate();
  3807. },
  3808. untrapFocusOnSurface: function untrapFocusOnSurface() {
  3809. return _this2.focusTrap_.deactivate();
  3810. },
  3811. isDialog: function isDialog(el) {
  3812. return el === _this2.dialogSurface_;
  3813. },
  3814. layoutFooterRipples: function layoutFooterRipples() {
  3815. return _this2.footerBtnRipples_.forEach(function (ripple) {
  3816. return ripple.layout();
  3817. });
  3818. }
  3819. });
  3820. }
  3821. }, {
  3822. key: 'open',
  3823. get: function get() {
  3824. return this.foundation_.isOpen();
  3825. }
  3826. }, {
  3827. key: 'acceptButton_',
  3828. get: function get() {
  3829. return this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.ACCEPT_SELECTOR);
  3830. }
  3831. }, {
  3832. key: 'dialogSurface_',
  3833. get: function get() {
  3834. return this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.DIALOG_SURFACE_SELECTOR);
  3835. }
  3836. }], [{
  3837. key: 'attachTo',
  3838. value: function attachTo(root) {
  3839. return new MDCDialog(root);
  3840. }
  3841. }]);
  3842. return MDCDialog;
  3843. }(__WEBPACK_IMPORTED_MODULE_0__material_base__["MDCComponent"]);
  3844. /***/ }),
  3845. /* 32 */
  3846. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3847. "use strict";
  3848. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base__ = __webpack_require__(1);
  3849. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(33);
  3850. 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; };
  3851. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  3852. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3853. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  3854. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  3855. /**
  3856. * Copyright 2017 Google Inc. All Rights Reserved.
  3857. *
  3858. * Licensed under the Apache License, Version 2.0 (the "License");
  3859. * you may not use this file except in compliance with the License.
  3860. * You may obtain a copy of the License at
  3861. *
  3862. * http://www.apache.org/licenses/LICENSE-2.0
  3863. *
  3864. * Unless required by applicable law or agreed to in writing, software
  3865. * distributed under the License is distributed on an "AS IS" BASIS,
  3866. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  3867. * See the License for the specific language governing permissions and
  3868. * limitations under the License.
  3869. */
  3870. var MDCDialogFoundation = function (_MDCFoundation) {
  3871. _inherits(MDCDialogFoundation, _MDCFoundation);
  3872. _createClass(MDCDialogFoundation, null, [{
  3873. key: 'cssClasses',
  3874. get: function get() {
  3875. return __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */];
  3876. }
  3877. }, {
  3878. key: 'strings',
  3879. get: function get() {
  3880. return __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */];
  3881. }
  3882. }, {
  3883. key: 'defaultAdapter',
  3884. get: function get() {
  3885. return {
  3886. addClass: function addClass() /* className: string */{},
  3887. removeClass: function removeClass() /* className: string */{},
  3888. addBodyClass: function addBodyClass() /* className: string */{},
  3889. removeBodyClass: function removeBodyClass() /* className: string */{},
  3890. eventTargetHasClass: function eventTargetHasClass() {
  3891. return (/* target: EventTarget, className: string */ /* boolean */false
  3892. );
  3893. },
  3894. registerInteractionHandler: function registerInteractionHandler() /* evt: string, handler: EventListener */{},
  3895. deregisterInteractionHandler: function deregisterInteractionHandler() /* evt: string, handler: EventListener */{},
  3896. registerSurfaceInteractionHandler: function registerSurfaceInteractionHandler() /* evt: string, handler: EventListener */{},
  3897. deregisterSurfaceInteractionHandler: function deregisterSurfaceInteractionHandler() /* evt: string, handler: EventListener */{},
  3898. registerDocumentKeydownHandler: function registerDocumentKeydownHandler() /* handler: EventListener */{},
  3899. deregisterDocumentKeydownHandler: function deregisterDocumentKeydownHandler() /* handler: EventListener */{},
  3900. registerTransitionEndHandler: function registerTransitionEndHandler() /* handler: EventListener */{},
  3901. deregisterTransitionEndHandler: function deregisterTransitionEndHandler() /* handler: EventListener */{},
  3902. notifyAccept: function notifyAccept() {},
  3903. notifyCancel: function notifyCancel() {},
  3904. trapFocusOnSurface: function trapFocusOnSurface() {},
  3905. untrapFocusOnSurface: function untrapFocusOnSurface() {},
  3906. isDialog: function isDialog() {
  3907. return (/* el: Element */ /* boolean */false
  3908. );
  3909. },
  3910. layoutFooterRipples: function layoutFooterRipples() {}
  3911. };
  3912. }
  3913. }]);
  3914. function MDCDialogFoundation(adapter) {
  3915. _classCallCheck(this, MDCDialogFoundation);
  3916. var _this = _possibleConstructorReturn(this, (MDCDialogFoundation.__proto__ || Object.getPrototypeOf(MDCDialogFoundation)).call(this, _extends(MDCDialogFoundation.defaultAdapter, adapter)));
  3917. _this.isOpen_ = false;
  3918. _this.componentClickHandler_ = function (evt) {
  3919. if (_this.adapter_.eventTargetHasClass(evt.target, __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].BACKDROP)) {
  3920. _this.cancel(true);
  3921. }
  3922. };
  3923. _this.dialogClickHandler_ = function (evt) {
  3924. return _this.handleDialogClick_(evt);
  3925. };
  3926. _this.documentKeydownHandler_ = function (evt) {
  3927. if (evt.key && evt.key === 'Escape' || evt.keyCode === 27) {
  3928. _this.cancel(true);
  3929. }
  3930. };
  3931. _this.transitionEndHandler_ = function (evt) {
  3932. return _this.handleTransitionEnd_(evt);
  3933. };
  3934. return _this;
  3935. }
  3936. _createClass(MDCDialogFoundation, [{
  3937. key: 'destroy',
  3938. value: function destroy() {
  3939. // Ensure that dialog is cleaned up when destroyed
  3940. if (this.isOpen_) {
  3941. this.adapter_.deregisterSurfaceInteractionHandler('click', this.dialogClickHandler_);
  3942. this.adapter_.deregisterDocumentKeydownHandler(this.documentKeydownHandler_);
  3943. this.adapter_.deregisterInteractionHandler('click', this.componentClickHandler_);
  3944. this.adapter_.untrapFocusOnSurface();
  3945. this.adapter_.deregisterTransitionEndHandler(this.transitionEndHandler_);
  3946. this.adapter_.removeClass(MDCDialogFoundation.cssClasses.ANIMATING);
  3947. this.adapter_.removeClass(MDCDialogFoundation.cssClasses.OPEN);
  3948. this.enableScroll_();
  3949. }
  3950. }
  3951. }, {
  3952. key: 'open',
  3953. value: function open() {
  3954. this.isOpen_ = true;
  3955. this.disableScroll_();
  3956. this.adapter_.registerDocumentKeydownHandler(this.documentKeydownHandler_);
  3957. this.adapter_.registerSurfaceInteractionHandler('click', this.dialogClickHandler_);
  3958. this.adapter_.registerInteractionHandler('click', this.componentClickHandler_);
  3959. this.adapter_.registerTransitionEndHandler(this.transitionEndHandler_);
  3960. this.adapter_.addClass(MDCDialogFoundation.cssClasses.ANIMATING);
  3961. this.adapter_.addClass(MDCDialogFoundation.cssClasses.OPEN);
  3962. }
  3963. }, {
  3964. key: 'close',
  3965. value: function close() {
  3966. this.isOpen_ = false;
  3967. this.adapter_.deregisterSurfaceInteractionHandler('click', this.dialogClickHandler_);
  3968. this.adapter_.deregisterDocumentKeydownHandler(this.documentKeydownHandler_);
  3969. this.adapter_.deregisterInteractionHandler('click', this.componentClickHandler_);
  3970. this.adapter_.untrapFocusOnSurface();
  3971. this.adapter_.registerTransitionEndHandler(this.transitionEndHandler_);
  3972. this.adapter_.addClass(MDCDialogFoundation.cssClasses.ANIMATING);
  3973. this.adapter_.removeClass(MDCDialogFoundation.cssClasses.OPEN);
  3974. }
  3975. }, {
  3976. key: 'isOpen',
  3977. value: function isOpen() {
  3978. return this.isOpen_;
  3979. }
  3980. }, {
  3981. key: 'accept',
  3982. value: function accept(shouldNotify) {
  3983. if (shouldNotify) {
  3984. this.adapter_.notifyAccept();
  3985. }
  3986. this.close();
  3987. }
  3988. }, {
  3989. key: 'cancel',
  3990. value: function cancel(shouldNotify) {
  3991. if (shouldNotify) {
  3992. this.adapter_.notifyCancel();
  3993. }
  3994. this.close();
  3995. }
  3996. }, {
  3997. key: 'handleDialogClick_',
  3998. value: function handleDialogClick_(evt) {
  3999. var target = evt.target;
  4000. if (this.adapter_.eventTargetHasClass(target, __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].ACCEPT_BTN)) {
  4001. this.accept(true);
  4002. } else if (this.adapter_.eventTargetHasClass(target, __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].CANCEL_BTN)) {
  4003. this.cancel(true);
  4004. }
  4005. }
  4006. }, {
  4007. key: 'handleTransitionEnd_',
  4008. value: function handleTransitionEnd_(evt) {
  4009. if (this.adapter_.isDialog(evt.target)) {
  4010. this.adapter_.deregisterTransitionEndHandler(this.transitionEndHandler_);
  4011. this.adapter_.removeClass(MDCDialogFoundation.cssClasses.ANIMATING);
  4012. if (this.isOpen_) {
  4013. this.adapter_.trapFocusOnSurface();
  4014. this.adapter_.layoutFooterRipples();
  4015. } else {
  4016. this.enableScroll_();
  4017. };
  4018. };
  4019. }
  4020. }, {
  4021. key: 'disableScroll_',
  4022. value: function disableScroll_() {
  4023. this.adapter_.addBodyClass(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].SCROLL_LOCK);
  4024. }
  4025. }, {
  4026. key: 'enableScroll_',
  4027. value: function enableScroll_() {
  4028. this.adapter_.removeBodyClass(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].SCROLL_LOCK);
  4029. }
  4030. }]);
  4031. return MDCDialogFoundation;
  4032. }(__WEBPACK_IMPORTED_MODULE_0__material_base__["MDCFoundation"]);
  4033. /* harmony default export */ __webpack_exports__["a"] = (MDCDialogFoundation);
  4034. /***/ }),
  4035. /* 33 */
  4036. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4037. "use strict";
  4038. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  4039. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  4040. /**
  4041. * Copyright 2016 Google Inc. All Rights Reserved.
  4042. *
  4043. * Licensed under the Apache License, Version 2.0 (the "License");
  4044. * you may not use this file except in compliance with the License.
  4045. * You may obtain a copy of the License at
  4046. *
  4047. * http://www.apache.org/licenses/LICENSE-2.0
  4048. *
  4049. * Unless required by applicable law or agreed to in writing, software
  4050. * distributed under the License is distributed on an "AS IS" BASIS,
  4051. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4052. * See the License for the specific language governing permissions and
  4053. * limitations under the License.
  4054. */
  4055. var cssClasses = {
  4056. ROOT: 'mdc-dialog',
  4057. OPEN: 'mdc-dialog--open',
  4058. ANIMATING: 'mdc-dialog--animating',
  4059. BACKDROP: 'mdc-dialog__backdrop',
  4060. SCROLL_LOCK: 'mdc-dialog-scroll-lock',
  4061. ACCEPT_BTN: 'mdc-dialog__footer__button--accept',
  4062. CANCEL_BTN: 'mdc-dialog__footer__button--cancel'
  4063. };
  4064. var strings = {
  4065. OPEN_DIALOG_SELECTOR: '.mdc-dialog--open',
  4066. DIALOG_SURFACE_SELECTOR: '.mdc-dialog__surface',
  4067. ACCEPT_SELECTOR: '.mdc-dialog__footer__button--accept',
  4068. ACCEPT_EVENT: 'MDCDialog:accept',
  4069. CANCEL_EVENT: 'MDCDialog:cancel'
  4070. };
  4071. /***/ }),
  4072. /* 34 */
  4073. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4074. "use strict";
  4075. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  4076. /* harmony export (immutable) */ __webpack_exports__["createFocusTrapInstance"] = createFocusTrapInstance;
  4077. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_focus_trap__ = __webpack_require__(35);
  4078. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_focus_trap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_focus_trap__);
  4079. /**
  4080. * Copyright 2016 Google Inc. All Rights Reserved.
  4081. *
  4082. * Licensed under the Apache License, Version 2.0 (the "License");
  4083. * you may not use this file except in compliance with the License.
  4084. * You may obtain a copy of the License at
  4085. *
  4086. * http://www.apache.org/licenses/LICENSE-2.0
  4087. *
  4088. * Unless required by applicable law or agreed to in writing, software
  4089. * distributed under the License is distributed on an "AS IS" BASIS,
  4090. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4091. * See the License for the specific language governing permissions and
  4092. * limitations under the License.
  4093. */
  4094. function createFocusTrapInstance(surfaceEl, acceptButtonEl) {
  4095. var focusTrapFactory = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : __WEBPACK_IMPORTED_MODULE_0_focus_trap___default.a;
  4096. return focusTrapFactory(surfaceEl, {
  4097. initialFocus: acceptButtonEl,
  4098. clickOutsideDeactivates: true
  4099. });
  4100. }
  4101. /***/ }),
  4102. /* 35 */
  4103. /***/ (function(module, exports, __webpack_require__) {
  4104. var tabbable = __webpack_require__(36);
  4105. var listeningFocusTrap = null;
  4106. function focusTrap(element, userOptions) {
  4107. var tabbableNodes = [];
  4108. var nodeFocusedBeforeActivation = null;
  4109. var active = false;
  4110. var paused = false;
  4111. var container = (typeof element === 'string')
  4112. ? document.querySelector(element)
  4113. : element;
  4114. var config = userOptions || {};
  4115. config.returnFocusOnDeactivate = (userOptions && userOptions.returnFocusOnDeactivate !== undefined)
  4116. ? userOptions.returnFocusOnDeactivate
  4117. : true;
  4118. config.escapeDeactivates = (userOptions && userOptions.escapeDeactivates !== undefined)
  4119. ? userOptions.escapeDeactivates
  4120. : true;
  4121. var trap = {
  4122. activate: activate,
  4123. deactivate: deactivate,
  4124. pause: pause,
  4125. unpause: unpause,
  4126. };
  4127. return trap;
  4128. function activate(activateOptions) {
  4129. if (active) return;
  4130. var defaultedActivateOptions = {
  4131. onActivate: (activateOptions && activateOptions.onActivate !== undefined)
  4132. ? activateOptions.onActivate
  4133. : config.onActivate,
  4134. };
  4135. active = true;
  4136. paused = false;
  4137. nodeFocusedBeforeActivation = document.activeElement;
  4138. if (defaultedActivateOptions.onActivate) {
  4139. defaultedActivateOptions.onActivate();
  4140. }
  4141. addListeners();
  4142. return trap;
  4143. }
  4144. function deactivate(deactivateOptions) {
  4145. if (!active) return;
  4146. var defaultedDeactivateOptions = {
  4147. returnFocus: (deactivateOptions && deactivateOptions.returnFocus !== undefined)
  4148. ? deactivateOptions.returnFocus
  4149. : config.returnFocusOnDeactivate,
  4150. onDeactivate: (deactivateOptions && deactivateOptions.onDeactivate !== undefined)
  4151. ? deactivateOptions.onDeactivate
  4152. : config.onDeactivate,
  4153. };
  4154. removeListeners();
  4155. if (defaultedDeactivateOptions.onDeactivate) {
  4156. defaultedDeactivateOptions.onDeactivate();
  4157. }
  4158. if (defaultedDeactivateOptions.returnFocus) {
  4159. setTimeout(function () {
  4160. tryFocus(nodeFocusedBeforeActivation);
  4161. }, 0);
  4162. }
  4163. active = false;
  4164. paused = false;
  4165. return this;
  4166. }
  4167. function pause() {
  4168. if (paused || !active) return;
  4169. paused = true;
  4170. removeListeners();
  4171. }
  4172. function unpause() {
  4173. if (!paused || !active) return;
  4174. paused = false;
  4175. addListeners();
  4176. }
  4177. function addListeners() {
  4178. if (!active) return;
  4179. // There can be only one listening focus trap at a time
  4180. if (listeningFocusTrap) {
  4181. listeningFocusTrap.pause();
  4182. }
  4183. listeningFocusTrap = trap;
  4184. updateTabbableNodes();
  4185. tryFocus(firstFocusNode());
  4186. document.addEventListener('focus', checkFocus, true);
  4187. document.addEventListener('click', checkClick, true);
  4188. document.addEventListener('mousedown', checkPointerDown, true);
  4189. document.addEventListener('touchstart', checkPointerDown, true);
  4190. document.addEventListener('keydown', checkKey, true);
  4191. return trap;
  4192. }
  4193. function removeListeners() {
  4194. if (!active || listeningFocusTrap !== trap) return;
  4195. document.removeEventListener('focus', checkFocus, true);
  4196. document.removeEventListener('click', checkClick, true);
  4197. document.removeEventListener('mousedown', checkPointerDown, true);
  4198. document.removeEventListener('touchstart', checkPointerDown, true);
  4199. document.removeEventListener('keydown', checkKey, true);
  4200. listeningFocusTrap = null;
  4201. return trap;
  4202. }
  4203. function getNodeForOption(optionName) {
  4204. var optionValue = config[optionName];
  4205. var node = optionValue;
  4206. if (!optionValue) {
  4207. return null;
  4208. }
  4209. if (typeof optionValue === 'string') {
  4210. node = document.querySelector(optionValue);
  4211. if (!node) {
  4212. throw new Error('`' + optionName + '` refers to no known node');
  4213. }
  4214. }
  4215. if (typeof optionValue === 'function') {
  4216. node = optionValue();
  4217. if (!node) {
  4218. throw new Error('`' + optionName + '` did not return a node');
  4219. }
  4220. }
  4221. return node;
  4222. }
  4223. function firstFocusNode() {
  4224. var node;
  4225. if (getNodeForOption('initialFocus') !== null) {
  4226. node = getNodeForOption('initialFocus');
  4227. } else if (container.contains(document.activeElement)) {
  4228. node = document.activeElement;
  4229. } else {
  4230. node = tabbableNodes[0] || getNodeForOption('fallbackFocus');
  4231. }
  4232. if (!node) {
  4233. throw new Error('You can\'t have a focus-trap without at least one focusable element');
  4234. }
  4235. return node;
  4236. }
  4237. // This needs to be done on mousedown and touchstart instead of click
  4238. // so that it precedes the focus event
  4239. function checkPointerDown(e) {
  4240. if (config.clickOutsideDeactivates && !container.contains(e.target)) {
  4241. deactivate({ returnFocus: false });
  4242. }
  4243. }
  4244. function checkClick(e) {
  4245. if (config.clickOutsideDeactivates) return;
  4246. if (container.contains(e.target)) return;
  4247. e.preventDefault();
  4248. e.stopImmediatePropagation();
  4249. }
  4250. function checkFocus(e) {
  4251. if (container.contains(e.target)) return;
  4252. e.preventDefault();
  4253. e.stopImmediatePropagation();
  4254. // Checking for a blur method here resolves a Firefox issue (#15)
  4255. if (typeof e.target.blur === 'function') e.target.blur();
  4256. }
  4257. function checkKey(e) {
  4258. if (e.key === 'Tab' || e.keyCode === 9) {
  4259. handleTab(e);
  4260. }
  4261. if (config.escapeDeactivates !== false && isEscapeEvent(e)) {
  4262. deactivate();
  4263. }
  4264. }
  4265. function handleTab(e) {
  4266. e.preventDefault();
  4267. updateTabbableNodes();
  4268. var currentFocusIndex = tabbableNodes.indexOf(e.target);
  4269. var lastTabbableNode = tabbableNodes[tabbableNodes.length - 1];
  4270. var firstTabbableNode = tabbableNodes[0];
  4271. if (e.shiftKey) {
  4272. if (e.target === firstTabbableNode || tabbableNodes.indexOf(e.target) === -1) {
  4273. return tryFocus(lastTabbableNode);
  4274. }
  4275. return tryFocus(tabbableNodes[currentFocusIndex - 1]);
  4276. }
  4277. if (e.target === lastTabbableNode) return tryFocus(firstTabbableNode);
  4278. tryFocus(tabbableNodes[currentFocusIndex + 1]);
  4279. }
  4280. function updateTabbableNodes() {
  4281. tabbableNodes = tabbable(container);
  4282. }
  4283. }
  4284. function isEscapeEvent(e) {
  4285. return e.key === 'Escape' || e.key === 'Esc' || e.keyCode === 27;
  4286. }
  4287. function tryFocus(node) {
  4288. if (!node || !node.focus) return;
  4289. node.focus();
  4290. if (node.tagName.toLowerCase() === 'input') {
  4291. node.select();
  4292. }
  4293. }
  4294. module.exports = focusTrap;
  4295. /***/ }),
  4296. /* 36 */
  4297. /***/ (function(module, exports) {
  4298. module.exports = function(el) {
  4299. var basicTabbables = [];
  4300. var orderedTabbables = [];
  4301. // A node is "available" if
  4302. // - it's computed style
  4303. var isUnavailable = createIsUnavailable();
  4304. var candidateSelectors = [
  4305. 'input',
  4306. 'select',
  4307. 'a[href]',
  4308. 'textarea',
  4309. 'button',
  4310. '[tabindex]',
  4311. ];
  4312. var candidates = el.querySelectorAll(candidateSelectors);
  4313. var candidate, candidateIndex;
  4314. for (var i = 0, l = candidates.length; i < l; i++) {
  4315. candidate = candidates[i];
  4316. candidateIndex = parseInt(candidate.getAttribute('tabindex'), 10) || candidate.tabIndex;
  4317. if (
  4318. candidateIndex < 0
  4319. || (candidate.tagName === 'INPUT' && candidate.type === 'hidden')
  4320. || candidate.disabled
  4321. || isUnavailable(candidate)
  4322. ) {
  4323. continue;
  4324. }
  4325. if (candidateIndex === 0) {
  4326. basicTabbables.push(candidate);
  4327. } else {
  4328. orderedTabbables.push({
  4329. tabIndex: candidateIndex,
  4330. node: candidate,
  4331. });
  4332. }
  4333. }
  4334. var tabbableNodes = orderedTabbables
  4335. .sort(function(a, b) {
  4336. return a.tabIndex - b.tabIndex;
  4337. })
  4338. .map(function(a) {
  4339. return a.node
  4340. });
  4341. Array.prototype.push.apply(tabbableNodes, basicTabbables);
  4342. return tabbableNodes;
  4343. }
  4344. function createIsUnavailable() {
  4345. // Node cache must be refreshed on every check, in case
  4346. // the content of the element has changed
  4347. var isOffCache = [];
  4348. // "off" means `display: none;`, as opposed to "hidden",
  4349. // which means `visibility: hidden;`. getComputedStyle
  4350. // accurately reflects visiblity in context but not
  4351. // "off" state, so we need to recursively check parents.
  4352. function isOff(node, nodeComputedStyle) {
  4353. if (node === document.documentElement) return false;
  4354. // Find the cached node (Array.prototype.find not available in IE9)
  4355. for (var i = 0, length = isOffCache.length; i < length; i++) {
  4356. if (isOffCache[i][0] === node) return isOffCache[i][1];
  4357. }
  4358. nodeComputedStyle = nodeComputedStyle || window.getComputedStyle(node);
  4359. var result = false;
  4360. if (nodeComputedStyle.display === 'none') {
  4361. result = true;
  4362. } else if (node.parentNode) {
  4363. result = isOff(node.parentNode);
  4364. }
  4365. isOffCache.push([node, result]);
  4366. return result;
  4367. }
  4368. return function isUnavailable(node) {
  4369. if (node === document.documentElement) return false;
  4370. var computedStyle = window.getComputedStyle(node);
  4371. if (isOff(node, computedStyle)) return true;
  4372. return computedStyle.visibility === 'hidden';
  4373. }
  4374. }
  4375. /***/ }),
  4376. /* 37 */
  4377. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4378. "use strict";
  4379. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  4380. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util__ = __webpack_require__(8);
  4381. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__temporary__ = __webpack_require__(38);
  4382. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTemporaryDrawer", function() { return __WEBPACK_IMPORTED_MODULE_1__temporary__["a"]; });
  4383. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTemporaryDrawerFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__temporary__["b"]; });
  4384. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__persistent__ = __webpack_require__(43);
  4385. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCPersistentDrawer", function() { return __WEBPACK_IMPORTED_MODULE_2__persistent__["a"]; });
  4386. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCPersistentDrawerFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__persistent__["b"]; });
  4387. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "util", function() { return __WEBPACK_IMPORTED_MODULE_0__util__; });
  4388. /**
  4389. * Copyright 2016 Google Inc. All Rights Reserved.
  4390. *
  4391. * Licensed under the Apache License, Version 2.0 (the "License");
  4392. * you may not use this file except in compliance with the License.
  4393. * You may obtain a copy of the License at
  4394. *
  4395. * http://www.apache.org/licenses/LICENSE-2.0
  4396. *
  4397. * Unless required by applicable law or agreed to in writing, software
  4398. * distributed under the License is distributed on an "AS IS" BASIS,
  4399. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4400. * See the License for the specific language governing permissions and
  4401. * limitations under the License.
  4402. */
  4403. /***/ }),
  4404. /* 38 */
  4405. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4406. "use strict";
  4407. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTemporaryDrawer; });
  4408. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base__ = __webpack_require__(1);
  4409. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(39);
  4410. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util__ = __webpack_require__(8);
  4411. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  4412. /* unused harmony reexport util */
  4413. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  4414. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4415. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  4416. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  4417. /**
  4418. * Copyright 2016 Google Inc. All Rights Reserved.
  4419. *
  4420. * Licensed under the Apache License, Version 2.0 (the "License");
  4421. * you may not use this file except in compliance with the License.
  4422. * You may obtain a copy of the License at
  4423. *
  4424. * http://www.apache.org/licenses/LICENSE-2.0
  4425. *
  4426. * Unless required by applicable law or agreed to in writing, software
  4427. * distributed under the License is distributed on an "AS IS" BASIS,
  4428. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4429. * See the License for the specific language governing permissions and
  4430. * limitations under the License.
  4431. */
  4432. var MDCTemporaryDrawer = function (_MDCComponent) {
  4433. _inherits(MDCTemporaryDrawer, _MDCComponent);
  4434. function MDCTemporaryDrawer() {
  4435. _classCallCheck(this, MDCTemporaryDrawer);
  4436. return _possibleConstructorReturn(this, (MDCTemporaryDrawer.__proto__ || Object.getPrototypeOf(MDCTemporaryDrawer)).apply(this, arguments));
  4437. }
  4438. _createClass(MDCTemporaryDrawer, [{
  4439. key: 'getDefaultFoundation',
  4440. value: function getDefaultFoundation() {
  4441. var _this2 = this;
  4442. var _MDCTemporaryDrawerFo = __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings,
  4443. FOCUSABLE_ELEMENTS = _MDCTemporaryDrawerFo.FOCUSABLE_ELEMENTS,
  4444. OPACITY_VAR_NAME = _MDCTemporaryDrawerFo.OPACITY_VAR_NAME;
  4445. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]({
  4446. addClass: function addClass(className) {
  4447. return _this2.root_.classList.add(className);
  4448. },
  4449. removeClass: function removeClass(className) {
  4450. return _this2.root_.classList.remove(className);
  4451. },
  4452. hasClass: function hasClass(className) {
  4453. return _this2.root_.classList.contains(className);
  4454. },
  4455. addBodyClass: function addBodyClass(className) {
  4456. return document.body.classList.add(className);
  4457. },
  4458. removeBodyClass: function removeBodyClass(className) {
  4459. return document.body.classList.remove(className);
  4460. },
  4461. eventTargetHasClass: function eventTargetHasClass(target, className) {
  4462. return target.classList.contains(className);
  4463. },
  4464. hasNecessaryDom: function hasNecessaryDom() {
  4465. return Boolean(_this2.drawer);
  4466. },
  4467. registerInteractionHandler: function registerInteractionHandler(evt, handler) {
  4468. return _this2.root_.addEventListener(__WEBPACK_IMPORTED_MODULE_2__util__["remapEvent"](evt), handler, __WEBPACK_IMPORTED_MODULE_2__util__["applyPassive"]());
  4469. },
  4470. deregisterInteractionHandler: function deregisterInteractionHandler(evt, handler) {
  4471. return _this2.root_.removeEventListener(__WEBPACK_IMPORTED_MODULE_2__util__["remapEvent"](evt), handler, __WEBPACK_IMPORTED_MODULE_2__util__["applyPassive"]());
  4472. },
  4473. registerDrawerInteractionHandler: function registerDrawerInteractionHandler(evt, handler) {
  4474. return _this2.drawer.addEventListener(__WEBPACK_IMPORTED_MODULE_2__util__["remapEvent"](evt), handler);
  4475. },
  4476. deregisterDrawerInteractionHandler: function deregisterDrawerInteractionHandler(evt, handler) {
  4477. return _this2.drawer.removeEventListener(__WEBPACK_IMPORTED_MODULE_2__util__["remapEvent"](evt), handler);
  4478. },
  4479. registerTransitionEndHandler: function registerTransitionEndHandler(handler) {
  4480. return _this2.drawer.addEventListener('transitionend', handler);
  4481. },
  4482. deregisterTransitionEndHandler: function deregisterTransitionEndHandler(handler) {
  4483. return _this2.drawer.removeEventListener('transitionend', handler);
  4484. },
  4485. registerDocumentKeydownHandler: function registerDocumentKeydownHandler(handler) {
  4486. return document.addEventListener('keydown', handler);
  4487. },
  4488. deregisterDocumentKeydownHandler: function deregisterDocumentKeydownHandler(handler) {
  4489. return document.removeEventListener('keydown', handler);
  4490. },
  4491. getDrawerWidth: function getDrawerWidth() {
  4492. return _this2.drawer.offsetWidth;
  4493. },
  4494. setTranslateX: function setTranslateX(value) {
  4495. return _this2.drawer.style.setProperty(__WEBPACK_IMPORTED_MODULE_2__util__["getTransformPropertyName"](), value === null ? null : 'translateX(' + value + 'px)');
  4496. },
  4497. updateCssVariable: function updateCssVariable(value) {
  4498. if (__WEBPACK_IMPORTED_MODULE_2__util__["supportsCssCustomProperties"]()) {
  4499. _this2.root_.style.setProperty(OPACITY_VAR_NAME, value);
  4500. }
  4501. },
  4502. getFocusableElements: function getFocusableElements() {
  4503. return _this2.drawer.querySelectorAll(FOCUSABLE_ELEMENTS);
  4504. },
  4505. saveElementTabState: function saveElementTabState(el) {
  4506. return __WEBPACK_IMPORTED_MODULE_2__util__["saveElementTabState"](el);
  4507. },
  4508. restoreElementTabState: function restoreElementTabState(el) {
  4509. return __WEBPACK_IMPORTED_MODULE_2__util__["restoreElementTabState"](el);
  4510. },
  4511. makeElementUntabbable: function makeElementUntabbable(el) {
  4512. return el.setAttribute('tabindex', -1);
  4513. },
  4514. notifyOpen: function notifyOpen() {
  4515. return _this2.emit(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.OPEN_EVENT);
  4516. },
  4517. notifyClose: function notifyClose() {
  4518. return _this2.emit(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.CLOSE_EVENT);
  4519. },
  4520. isRtl: function isRtl() {
  4521. return getComputedStyle(_this2.root_).getPropertyValue('direction') === 'rtl';
  4522. },
  4523. isDrawer: function isDrawer(el) {
  4524. return el === _this2.drawer;
  4525. }
  4526. });
  4527. }
  4528. }, {
  4529. key: 'open',
  4530. get: function get() {
  4531. return this.foundation_.isOpen();
  4532. },
  4533. set: function set(value) {
  4534. if (value) {
  4535. this.foundation_.open();
  4536. } else {
  4537. this.foundation_.close();
  4538. }
  4539. }
  4540. /* Return the drawer element inside the component. */
  4541. }, {
  4542. key: 'drawer',
  4543. get: function get() {
  4544. return this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.DRAWER_SELECTOR);
  4545. }
  4546. }], [{
  4547. key: 'attachTo',
  4548. value: function attachTo(root) {
  4549. return new MDCTemporaryDrawer(root);
  4550. }
  4551. }]);
  4552. return MDCTemporaryDrawer;
  4553. }(__WEBPACK_IMPORTED_MODULE_0__material_base__["MDCComponent"]);
  4554. /***/ }),
  4555. /* 39 */
  4556. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4557. "use strict";
  4558. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__slidable__ = __webpack_require__(7);
  4559. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(42);
  4560. 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; };
  4561. 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); } };
  4562. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  4563. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4564. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  4565. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  4566. /**
  4567. * Copyright 2016 Google Inc. All Rights Reserved.
  4568. *
  4569. * Licensed under the Apache License, Version 2.0 (the "License");
  4570. * you may not use this file except in compliance with the License.
  4571. * You may obtain a copy of the License at
  4572. *
  4573. * http://www.apache.org/licenses/LICENSE-2.0
  4574. *
  4575. * Unless required by applicable law or agreed to in writing, software
  4576. * distributed under the License is distributed on an "AS IS" BASIS,
  4577. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4578. * See the License for the specific language governing permissions and
  4579. * limitations under the License.
  4580. */
  4581. var MDCTemporaryDrawerFoundation = function (_MDCSlidableDrawerFou) {
  4582. _inherits(MDCTemporaryDrawerFoundation, _MDCSlidableDrawerFou);
  4583. _createClass(MDCTemporaryDrawerFoundation, null, [{
  4584. key: 'cssClasses',
  4585. get: function get() {
  4586. return __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */];
  4587. }
  4588. }, {
  4589. key: 'strings',
  4590. get: function get() {
  4591. return __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */];
  4592. }
  4593. }, {
  4594. key: 'defaultAdapter',
  4595. get: function get() {
  4596. return _extends(__WEBPACK_IMPORTED_MODULE_0__slidable__["b" /* MDCSlidableDrawerFoundation */].defaultAdapter, {
  4597. addBodyClass: function addBodyClass() /* className: string */{},
  4598. removeBodyClass: function removeBodyClass() /* className: string */{},
  4599. isDrawer: function isDrawer() {
  4600. return false;
  4601. },
  4602. updateCssVariable: function updateCssVariable() /* value: string */{},
  4603. eventTargetHasClass: function eventTargetHasClass() {
  4604. return (/* target: EventTarget, className: string */ /* boolean */false
  4605. );
  4606. }
  4607. });
  4608. }
  4609. }]);
  4610. function MDCTemporaryDrawerFoundation(adapter) {
  4611. _classCallCheck(this, MDCTemporaryDrawerFoundation);
  4612. var _this = _possibleConstructorReturn(this, (MDCTemporaryDrawerFoundation.__proto__ || Object.getPrototypeOf(MDCTemporaryDrawerFoundation)).call(this, _extends(MDCTemporaryDrawerFoundation.defaultAdapter, adapter), MDCTemporaryDrawerFoundation.cssClasses.ROOT, MDCTemporaryDrawerFoundation.cssClasses.ANIMATING, MDCTemporaryDrawerFoundation.cssClasses.OPEN));
  4613. _this.componentClickHandler_ = function (evt) {
  4614. if (_this.adapter_.eventTargetHasClass(evt.target, __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].ROOT)) {
  4615. _this.close(true);
  4616. }
  4617. };
  4618. return _this;
  4619. }
  4620. _createClass(MDCTemporaryDrawerFoundation, [{
  4621. key: 'init',
  4622. value: function init() {
  4623. _get(MDCTemporaryDrawerFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCTemporaryDrawerFoundation.prototype), 'init', this).call(this);
  4624. // Make browser aware of custom property being used in this element.
  4625. // Workaround for certain types of hard-to-reproduce heisenbugs.
  4626. this.adapter_.updateCssVariable(0);
  4627. this.adapter_.registerInteractionHandler('click', this.componentClickHandler_);
  4628. }
  4629. }, {
  4630. key: 'destroy',
  4631. value: function destroy() {
  4632. _get(MDCTemporaryDrawerFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCTemporaryDrawerFoundation.prototype), 'destroy', this).call(this);
  4633. this.adapter_.deregisterInteractionHandler('click', this.componentClickHandler_);
  4634. this.enableScroll_();
  4635. }
  4636. }, {
  4637. key: 'open',
  4638. value: function open() {
  4639. this.disableScroll_();
  4640. // Make sure custom property values are cleared before starting.
  4641. this.adapter_.updateCssVariable('');
  4642. _get(MDCTemporaryDrawerFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCTemporaryDrawerFoundation.prototype), 'open', this).call(this);
  4643. }
  4644. }, {
  4645. key: 'close',
  4646. value: function close() {
  4647. // Make sure custom property values are cleared before making any changes.
  4648. this.adapter_.updateCssVariable('');
  4649. _get(MDCTemporaryDrawerFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCTemporaryDrawerFoundation.prototype), 'close', this).call(this);
  4650. }
  4651. }, {
  4652. key: 'prepareForTouchEnd_',
  4653. value: function prepareForTouchEnd_() {
  4654. _get(MDCTemporaryDrawerFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCTemporaryDrawerFoundation.prototype), 'prepareForTouchEnd_', this).call(this);
  4655. this.adapter_.updateCssVariable('');
  4656. }
  4657. }, {
  4658. key: 'updateDrawer_',
  4659. value: function updateDrawer_() {
  4660. _get(MDCTemporaryDrawerFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCTemporaryDrawerFoundation.prototype), 'updateDrawer_', this).call(this);
  4661. var newOpacity = Math.max(0, 1 + this.direction_ * (this.newPosition_ / this.drawerWidth_));
  4662. this.adapter_.updateCssVariable(newOpacity);
  4663. }
  4664. }, {
  4665. key: 'isRootTransitioningEventTarget_',
  4666. value: function isRootTransitioningEventTarget_(el) {
  4667. return this.adapter_.isDrawer(el);
  4668. }
  4669. }, {
  4670. key: 'handleTransitionEnd_',
  4671. value: function handleTransitionEnd_(evt) {
  4672. _get(MDCTemporaryDrawerFoundation.prototype.__proto__ || Object.getPrototypeOf(MDCTemporaryDrawerFoundation.prototype), 'handleTransitionEnd_', this).call(this, evt);
  4673. if (!this.isOpen_) {
  4674. this.enableScroll_();
  4675. }
  4676. }
  4677. }, {
  4678. key: 'disableScroll_',
  4679. value: function disableScroll_() {
  4680. this.adapter_.addBodyClass(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].SCROLL_LOCK);
  4681. }
  4682. }, {
  4683. key: 'enableScroll_',
  4684. value: function enableScroll_() {
  4685. this.adapter_.removeBodyClass(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].SCROLL_LOCK);
  4686. }
  4687. }]);
  4688. return MDCTemporaryDrawerFoundation;
  4689. }(__WEBPACK_IMPORTED_MODULE_0__slidable__["b" /* MDCSlidableDrawerFoundation */]);
  4690. /* harmony default export */ __webpack_exports__["a"] = (MDCTemporaryDrawerFoundation);
  4691. /***/ }),
  4692. /* 40 */
  4693. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4694. "use strict";
  4695. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FOCUSABLE_ELEMENTS; });
  4696. /**
  4697. * Copyright 2016 Google Inc. All Rights Reserved.
  4698. *
  4699. * Licensed under the Apache License, Version 2.0 (the "License");
  4700. * you may not use this file except in compliance with the License.
  4701. * You may obtain a copy of the License at
  4702. *
  4703. * http://www.apache.org/licenses/LICENSE-2.0
  4704. *
  4705. * Unless required by applicable law or agreed to in writing, software
  4706. * distributed under the License is distributed on an "AS IS" BASIS,
  4707. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4708. * See the License for the specific language governing permissions and
  4709. * limitations under the License.
  4710. */
  4711. var FOCUSABLE_ELEMENTS = 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), ' + 'button:not([disabled]), iframe, object, embed, [tabindex], [contenteditable]';
  4712. /***/ }),
  4713. /* 41 */
  4714. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4715. "use strict";
  4716. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCSlidableDrawerFoundation; });
  4717. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base__ = __webpack_require__(1);
  4718. 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; };
  4719. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  4720. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4721. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  4722. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  4723. /**
  4724. * Copyright 2016 Google Inc. All Rights Reserved.
  4725. *
  4726. * Licensed under the Apache License, Version 2.0 (the "License");
  4727. * you may not use this file except in compliance with the License.
  4728. * You may obtain a copy of the License at
  4729. *
  4730. * http://www.apache.org/licenses/LICENSE-2.0
  4731. *
  4732. * Unless required by applicable law or agreed to in writing, software
  4733. * distributed under the License is distributed on an "AS IS" BASIS,
  4734. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4735. * See the License for the specific language governing permissions and
  4736. * limitations under the License.
  4737. */
  4738. var MDCSlidableDrawerFoundation = function (_MDCFoundation) {
  4739. _inherits(MDCSlidableDrawerFoundation, _MDCFoundation);
  4740. _createClass(MDCSlidableDrawerFoundation, null, [{
  4741. key: 'defaultAdapter',
  4742. get: function get() {
  4743. return {
  4744. addClass: function addClass() /* className: string */{},
  4745. removeClass: function removeClass() /* className: string */{},
  4746. hasClass: function hasClass() /* className: string */{},
  4747. hasNecessaryDom: function hasNecessaryDom() {
  4748. return (/* boolean */false
  4749. );
  4750. },
  4751. registerInteractionHandler: function registerInteractionHandler() /* evt: string, handler: EventListener */{},
  4752. deregisterInteractionHandler: function deregisterInteractionHandler() /* evt: string, handler: EventListener */{},
  4753. registerDrawerInteractionHandler: function registerDrawerInteractionHandler() /* evt: string, handler: EventListener */{},
  4754. deregisterDrawerInteractionHandler: function deregisterDrawerInteractionHandler() /* evt: string, handler: EventListener */{},
  4755. registerTransitionEndHandler: function registerTransitionEndHandler() /* handler: EventListener */{},
  4756. deregisterTransitionEndHandler: function deregisterTransitionEndHandler() /* handler: EventListener */{},
  4757. registerDocumentKeydownHandler: function registerDocumentKeydownHandler() /* handler: EventListener */{},
  4758. deregisterDocumentKeydownHandler: function deregisterDocumentKeydownHandler() /* handler: EventListener */{},
  4759. setTranslateX: function setTranslateX() /* value: number | null */{},
  4760. getFocusableElements: function getFocusableElements() /* NodeList */{},
  4761. saveElementTabState: function saveElementTabState() /* el: Element */{},
  4762. restoreElementTabState: function restoreElementTabState() /* el: Element */{},
  4763. makeElementUntabbable: function makeElementUntabbable() /* el: Element */{},
  4764. notifyOpen: function notifyOpen() {},
  4765. notifyClose: function notifyClose() {},
  4766. isRtl: function isRtl() {
  4767. return (/* boolean */false
  4768. );
  4769. },
  4770. getDrawerWidth: function getDrawerWidth() {
  4771. return (/* number */0
  4772. );
  4773. }
  4774. };
  4775. }
  4776. }]);
  4777. function MDCSlidableDrawerFoundation(adapter, rootCssClass, animatingCssClass, openCssClass) {
  4778. _classCallCheck(this, MDCSlidableDrawerFoundation);
  4779. var _this = _possibleConstructorReturn(this, (MDCSlidableDrawerFoundation.__proto__ || Object.getPrototypeOf(MDCSlidableDrawerFoundation)).call(this, _extends(MDCSlidableDrawerFoundation.defaultAdapter, adapter)));
  4780. _this.rootCssClass_ = rootCssClass;
  4781. _this.animatingCssClass_ = animatingCssClass;
  4782. _this.openCssClass_ = openCssClass;
  4783. _this.transitionEndHandler_ = function (evt) {
  4784. return _this.handleTransitionEnd_(evt);
  4785. };
  4786. _this.inert_ = false;
  4787. _this.componentTouchStartHandler_ = function (evt) {
  4788. return _this.handleTouchStart_(evt);
  4789. };
  4790. _this.componentTouchMoveHandler_ = function (evt) {
  4791. return _this.handleTouchMove_(evt);
  4792. };
  4793. _this.componentTouchEndHandler_ = function (evt) {
  4794. return _this.handleTouchEnd_(evt);
  4795. };
  4796. _this.documentKeydownHandler_ = function (evt) {
  4797. if (evt.key && evt.key === 'Escape' || evt.keyCode === 27) {
  4798. _this.close();
  4799. }
  4800. };
  4801. return _this;
  4802. }
  4803. _createClass(MDCSlidableDrawerFoundation, [{
  4804. key: 'init',
  4805. value: function init() {
  4806. var ROOT = this.rootCssClass_;
  4807. var OPEN = this.openCssClass_;
  4808. if (!this.adapter_.hasClass(ROOT)) {
  4809. throw new Error(ROOT + ' class required in root element.');
  4810. }
  4811. if (!this.adapter_.hasNecessaryDom()) {
  4812. throw new Error('Required DOM nodes missing in ' + ROOT + ' component.');
  4813. }
  4814. if (this.adapter_.hasClass(OPEN)) {
  4815. this.isOpen_ = true;
  4816. } else {
  4817. this.detabinate_();
  4818. this.isOpen_ = false;
  4819. }
  4820. this.adapter_.registerDrawerInteractionHandler('touchstart', this.componentTouchStartHandler_);
  4821. this.adapter_.registerInteractionHandler('touchmove', this.componentTouchMoveHandler_);
  4822. this.adapter_.registerInteractionHandler('touchend', this.componentTouchEndHandler_);
  4823. }
  4824. }, {
  4825. key: 'destroy',
  4826. value: function destroy() {
  4827. this.adapter_.deregisterDrawerInteractionHandler('touchstart', this.componentTouchStartHandler_);
  4828. this.adapter_.deregisterInteractionHandler('touchmove', this.componentTouchMoveHandler_);
  4829. this.adapter_.deregisterInteractionHandler('touchend', this.componentTouchEndHandler_);
  4830. // Deregister the document keydown handler just in case the component is destroyed while the menu is open.
  4831. this.adapter_.deregisterDocumentKeydownHandler(this.documentKeydownHandler_);
  4832. }
  4833. }, {
  4834. key: 'open',
  4835. value: function open() {
  4836. this.adapter_.registerTransitionEndHandler(this.transitionEndHandler_);
  4837. this.adapter_.registerDocumentKeydownHandler(this.documentKeydownHandler_);
  4838. this.adapter_.addClass(this.animatingCssClass_);
  4839. this.adapter_.addClass(this.openCssClass_);
  4840. this.retabinate_();
  4841. // Debounce multiple calls
  4842. if (!this.isOpen_) {
  4843. this.adapter_.notifyOpen();
  4844. }
  4845. this.isOpen_ = true;
  4846. }
  4847. }, {
  4848. key: 'close',
  4849. value: function close() {
  4850. this.adapter_.deregisterDocumentKeydownHandler(this.documentKeydownHandler_);
  4851. this.adapter_.registerTransitionEndHandler(this.transitionEndHandler_);
  4852. this.adapter_.addClass(this.animatingCssClass_);
  4853. this.adapter_.removeClass(this.openCssClass_);
  4854. this.detabinate_();
  4855. // Debounce multiple calls
  4856. if (this.isOpen_) {
  4857. this.adapter_.notifyClose();
  4858. }
  4859. this.isOpen_ = false;
  4860. }
  4861. }, {
  4862. key: 'isOpen',
  4863. value: function isOpen() {
  4864. return this.isOpen_;
  4865. }
  4866. /**
  4867. * Render all children of the drawer inert when it's closed.
  4868. */
  4869. }, {
  4870. key: 'detabinate_',
  4871. value: function detabinate_() {
  4872. if (this.inert_) {
  4873. return;
  4874. }
  4875. var elements = this.adapter_.getFocusableElements();
  4876. if (elements) {
  4877. for (var i = 0; i < elements.length; i++) {
  4878. this.adapter_.saveElementTabState(elements[i]);
  4879. this.adapter_.makeElementUntabbable(elements[i]);
  4880. }
  4881. }
  4882. this.inert_ = true;
  4883. }
  4884. /**
  4885. * Make all children of the drawer tabbable again when it's open.
  4886. */
  4887. }, {
  4888. key: 'retabinate_',
  4889. value: function retabinate_() {
  4890. if (!this.inert_) {
  4891. return;
  4892. }
  4893. var elements = this.adapter_.getFocusableElements();
  4894. if (elements) {
  4895. for (var i = 0; i < elements.length; i++) {
  4896. this.adapter_.restoreElementTabState(elements[i]);
  4897. }
  4898. }
  4899. this.inert_ = false;
  4900. }
  4901. }, {
  4902. key: 'handleTouchStart_',
  4903. value: function handleTouchStart_(evt) {
  4904. if (!this.adapter_.hasClass(this.openCssClass_)) {
  4905. return;
  4906. }
  4907. if (evt.pointerType && evt.pointerType !== 'touch') {
  4908. return;
  4909. }
  4910. this.direction_ = this.adapter_.isRtl() ? -1 : 1;
  4911. this.drawerWidth_ = this.adapter_.getDrawerWidth();
  4912. this.startX_ = evt.touches ? evt.touches[0].pageX : evt.pageX;
  4913. this.currentX_ = this.startX_;
  4914. this.updateRaf_ = requestAnimationFrame(this.updateDrawer_.bind(this));
  4915. }
  4916. }, {
  4917. key: 'handleTouchMove_',
  4918. value: function handleTouchMove_(evt) {
  4919. if (evt.pointerType && evt.pointerType !== 'touch') {
  4920. return;
  4921. }
  4922. this.currentX_ = evt.touches ? evt.touches[0].pageX : evt.pageX;
  4923. }
  4924. }, {
  4925. key: 'handleTouchEnd_',
  4926. value: function handleTouchEnd_(evt) {
  4927. if (evt.pointerType && evt.pointerType !== 'touch') {
  4928. return;
  4929. }
  4930. this.prepareForTouchEnd_();
  4931. // Did the user close the drawer by more than 50%?
  4932. if (Math.abs(this.newPosition_ / this.drawerWidth_) >= 0.5) {
  4933. this.close();
  4934. } else {
  4935. // Triggering an open here means we'll get a nice animation back to the fully open state.
  4936. this.open();
  4937. }
  4938. }
  4939. }, {
  4940. key: 'prepareForTouchEnd_',
  4941. value: function prepareForTouchEnd_() {
  4942. cancelAnimationFrame(this.updateRaf_);
  4943. this.adapter_.setTranslateX(null);
  4944. }
  4945. }, {
  4946. key: 'updateDrawer_',
  4947. value: function updateDrawer_() {
  4948. this.updateRaf_ = requestAnimationFrame(this.updateDrawer_.bind(this));
  4949. this.adapter_.setTranslateX(this.newPosition_);
  4950. }
  4951. }, {
  4952. key: 'isRootTransitioningEventTarget_',
  4953. value: function isRootTransitioningEventTarget_() {
  4954. // Classes extending MDCSlidableDrawerFoundation should implement this method to return true or false
  4955. // if the event target is the root event target currently transitioning.
  4956. return false;
  4957. }
  4958. }, {
  4959. key: 'handleTransitionEnd_',
  4960. value: function handleTransitionEnd_(evt) {
  4961. if (this.isRootTransitioningEventTarget_(evt.target)) {
  4962. this.adapter_.removeClass(this.animatingCssClass_);
  4963. this.adapter_.deregisterTransitionEndHandler(this.transitionEndHandler_);
  4964. }
  4965. }
  4966. }, {
  4967. key: 'newPosition_',
  4968. get: function get() {
  4969. var newPos = null;
  4970. if (this.direction_ === 1) {
  4971. newPos = Math.min(0, this.currentX_ - this.startX_);
  4972. } else {
  4973. newPos = Math.max(0, this.currentX_ - this.startX_);
  4974. }
  4975. return newPos;
  4976. }
  4977. }]);
  4978. return MDCSlidableDrawerFoundation;
  4979. }(__WEBPACK_IMPORTED_MODULE_0__material_base__["MDCFoundation"]);
  4980. /***/ }),
  4981. /* 42 */
  4982. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  4983. "use strict";
  4984. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  4985. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  4986. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__slidable__ = __webpack_require__(7);
  4987. /**
  4988. * Copyright 2016 Google Inc. All Rights Reserved.
  4989. *
  4990. * Licensed under the Apache License, Version 2.0 (the "License");
  4991. * you may not use this file except in compliance with the License.
  4992. * You may obtain a copy of the License at
  4993. *
  4994. * http://www.apache.org/licenses/LICENSE-2.0
  4995. *
  4996. * Unless required by applicable law or agreed to in writing, software
  4997. * distributed under the License is distributed on an "AS IS" BASIS,
  4998. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  4999. * See the License for the specific language governing permissions and
  5000. * limitations under the License.
  5001. */
  5002. var cssClasses = {
  5003. ROOT: 'mdc-temporary-drawer',
  5004. OPEN: 'mdc-temporary-drawer--open',
  5005. ANIMATING: 'mdc-temporary-drawer--animating',
  5006. SCROLL_LOCK: 'mdc-drawer-scroll-lock'
  5007. };
  5008. var strings = {
  5009. DRAWER_SELECTOR: '.mdc-temporary-drawer__drawer',
  5010. OPACITY_VAR_NAME: '--mdc-temporary-drawer-opacity',
  5011. FOCUSABLE_ELEMENTS: __WEBPACK_IMPORTED_MODULE_0__slidable__["a" /* FOCUSABLE_ELEMENTS */],
  5012. OPEN_EVENT: 'MDCTemporaryDrawer:open',
  5013. CLOSE_EVENT: 'MDCTemporaryDrawer:close'
  5014. };
  5015. /***/ }),
  5016. /* 43 */
  5017. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5018. "use strict";
  5019. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCPersistentDrawer; });
  5020. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base__ = __webpack_require__(1);
  5021. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(44);
  5022. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util__ = __webpack_require__(8);
  5023. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  5024. /* unused harmony reexport util */
  5025. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  5026. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5027. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  5028. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  5029. /**
  5030. * Copyright 2016 Google Inc. All Rights Reserved.
  5031. *
  5032. * Licensed under the Apache License, Version 2.0 (the "License");
  5033. * you may not use this file except in compliance with the License.
  5034. * You may obtain a copy of the License at
  5035. *
  5036. * http://www.apache.org/licenses/LICENSE-2.0
  5037. *
  5038. * Unless required by applicable law or agreed to in writing, software
  5039. * distributed under the License is distributed on an "AS IS" BASIS,
  5040. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5041. * See the License for the specific language governing permissions and
  5042. * limitations under the License.
  5043. */
  5044. var MDCPersistentDrawer = function (_MDCComponent) {
  5045. _inherits(MDCPersistentDrawer, _MDCComponent);
  5046. function MDCPersistentDrawer() {
  5047. _classCallCheck(this, MDCPersistentDrawer);
  5048. return _possibleConstructorReturn(this, (MDCPersistentDrawer.__proto__ || Object.getPrototypeOf(MDCPersistentDrawer)).apply(this, arguments));
  5049. }
  5050. _createClass(MDCPersistentDrawer, [{
  5051. key: 'getDefaultFoundation',
  5052. value: function getDefaultFoundation() {
  5053. var _this2 = this;
  5054. var FOCUSABLE_ELEMENTS = __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.FOCUSABLE_ELEMENTS;
  5055. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]({
  5056. addClass: function addClass(className) {
  5057. return _this2.root_.classList.add(className);
  5058. },
  5059. removeClass: function removeClass(className) {
  5060. return _this2.root_.classList.remove(className);
  5061. },
  5062. hasClass: function hasClass(className) {
  5063. return _this2.root_.classList.contains(className);
  5064. },
  5065. hasNecessaryDom: function hasNecessaryDom() {
  5066. return Boolean(_this2.drawer);
  5067. },
  5068. registerInteractionHandler: function registerInteractionHandler(evt, handler) {
  5069. return _this2.root_.addEventListener(__WEBPACK_IMPORTED_MODULE_2__util__["remapEvent"](evt), handler, __WEBPACK_IMPORTED_MODULE_2__util__["applyPassive"]());
  5070. },
  5071. deregisterInteractionHandler: function deregisterInteractionHandler(evt, handler) {
  5072. return _this2.root_.removeEventListener(__WEBPACK_IMPORTED_MODULE_2__util__["remapEvent"](evt), handler, __WEBPACK_IMPORTED_MODULE_2__util__["applyPassive"]());
  5073. },
  5074. registerDrawerInteractionHandler: function registerDrawerInteractionHandler(evt, handler) {
  5075. return _this2.drawer.addEventListener(__WEBPACK_IMPORTED_MODULE_2__util__["remapEvent"](evt), handler);
  5076. },
  5077. deregisterDrawerInteractionHandler: function deregisterDrawerInteractionHandler(evt, handler) {
  5078. return _this2.drawer.removeEventListener(__WEBPACK_IMPORTED_MODULE_2__util__["remapEvent"](evt), handler);
  5079. },
  5080. registerTransitionEndHandler: function registerTransitionEndHandler(handler) {
  5081. return _this2.root_.addEventListener('transitionend', handler);
  5082. },
  5083. deregisterTransitionEndHandler: function deregisterTransitionEndHandler(handler) {
  5084. return _this2.root_.removeEventListener('transitionend', handler);
  5085. },
  5086. registerDocumentKeydownHandler: function registerDocumentKeydownHandler(handler) {
  5087. return document.addEventListener('keydown', handler);
  5088. },
  5089. deregisterDocumentKeydownHandler: function deregisterDocumentKeydownHandler(handler) {
  5090. return document.removeEventListener('keydown', handler);
  5091. },
  5092. getDrawerWidth: function getDrawerWidth() {
  5093. return _this2.drawer.offsetWidth;
  5094. },
  5095. setTranslateX: function setTranslateX(value) {
  5096. return _this2.drawer.style.setProperty(__WEBPACK_IMPORTED_MODULE_2__util__["getTransformPropertyName"](), value === null ? null : 'translateX(' + value + 'px)');
  5097. },
  5098. getFocusableElements: function getFocusableElements() {
  5099. return _this2.drawer.querySelectorAll(FOCUSABLE_ELEMENTS);
  5100. },
  5101. saveElementTabState: function saveElementTabState(el) {
  5102. return __WEBPACK_IMPORTED_MODULE_2__util__["saveElementTabState"](el);
  5103. },
  5104. restoreElementTabState: function restoreElementTabState(el) {
  5105. return __WEBPACK_IMPORTED_MODULE_2__util__["restoreElementTabState"](el);
  5106. },
  5107. makeElementUntabbable: function makeElementUntabbable(el) {
  5108. return el.setAttribute('tabindex', -1);
  5109. },
  5110. notifyOpen: function notifyOpen() {
  5111. return _this2.emit(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.OPEN_EVENT);
  5112. },
  5113. notifyClose: function notifyClose() {
  5114. return _this2.emit(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.CLOSE_EVENT);
  5115. },
  5116. isRtl: function isRtl() {
  5117. return getComputedStyle(_this2.root_).getPropertyValue('direction') === 'rtl';
  5118. },
  5119. isDrawer: function isDrawer(el) {
  5120. return el === _this2.drawer;
  5121. }
  5122. });
  5123. }
  5124. }, {
  5125. key: 'open',
  5126. get: function get() {
  5127. return this.foundation_.isOpen();
  5128. },
  5129. set: function set(value) {
  5130. if (value) {
  5131. this.foundation_.open();
  5132. } else {
  5133. this.foundation_.close();
  5134. }
  5135. }
  5136. // Return the drawer element inside the component.
  5137. }, {
  5138. key: 'drawer',
  5139. get: function get() {
  5140. return this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.DRAWER_SELECTOR);
  5141. }
  5142. }], [{
  5143. key: 'attachTo',
  5144. value: function attachTo(root) {
  5145. return new MDCPersistentDrawer(root);
  5146. }
  5147. }]);
  5148. return MDCPersistentDrawer;
  5149. }(__WEBPACK_IMPORTED_MODULE_0__material_base__["MDCComponent"]);
  5150. /***/ }),
  5151. /* 44 */
  5152. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5153. "use strict";
  5154. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__slidable__ = __webpack_require__(7);
  5155. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(45);
  5156. 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; };
  5157. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  5158. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5159. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  5160. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  5161. /**
  5162. * Copyright 2016 Google Inc. All Rights Reserved.
  5163. *
  5164. * Licensed under the Apache License, Version 2.0 (the "License");
  5165. * you may not use this file except in compliance with the License.
  5166. * You may obtain a copy of the License at
  5167. *
  5168. * http://www.apache.org/licenses/LICENSE-2.0
  5169. *
  5170. * Unless required by applicable law or agreed to in writing, software
  5171. * distributed under the License is distributed on an "AS IS" BASIS,
  5172. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5173. * See the License for the specific language governing permissions and
  5174. * limitations under the License.
  5175. */
  5176. var MDCPersistentDrawerFoundation = function (_MDCSlidableDrawerFou) {
  5177. _inherits(MDCPersistentDrawerFoundation, _MDCSlidableDrawerFou);
  5178. _createClass(MDCPersistentDrawerFoundation, null, [{
  5179. key: 'cssClasses',
  5180. get: function get() {
  5181. return __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */];
  5182. }
  5183. }, {
  5184. key: 'strings',
  5185. get: function get() {
  5186. return __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */];
  5187. }
  5188. }, {
  5189. key: 'defaultAdapter',
  5190. get: function get() {
  5191. return _extends(__WEBPACK_IMPORTED_MODULE_0__slidable__["b" /* MDCSlidableDrawerFoundation */].defaultAdapter, {
  5192. isDrawer: function isDrawer() {
  5193. return false;
  5194. }
  5195. });
  5196. }
  5197. }]);
  5198. function MDCPersistentDrawerFoundation(adapter) {
  5199. _classCallCheck(this, MDCPersistentDrawerFoundation);
  5200. return _possibleConstructorReturn(this, (MDCPersistentDrawerFoundation.__proto__ || Object.getPrototypeOf(MDCPersistentDrawerFoundation)).call(this, _extends(MDCPersistentDrawerFoundation.defaultAdapter, adapter), MDCPersistentDrawerFoundation.cssClasses.ROOT, MDCPersistentDrawerFoundation.cssClasses.ANIMATING, MDCPersistentDrawerFoundation.cssClasses.OPEN));
  5201. }
  5202. _createClass(MDCPersistentDrawerFoundation, [{
  5203. key: 'isRootTransitioningEventTarget_',
  5204. value: function isRootTransitioningEventTarget_(el) {
  5205. return this.adapter_.isDrawer(el);
  5206. }
  5207. }]);
  5208. return MDCPersistentDrawerFoundation;
  5209. }(__WEBPACK_IMPORTED_MODULE_0__slidable__["b" /* MDCSlidableDrawerFoundation */]);
  5210. /* harmony default export */ __webpack_exports__["a"] = (MDCPersistentDrawerFoundation);
  5211. /***/ }),
  5212. /* 45 */
  5213. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5214. "use strict";
  5215. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  5216. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  5217. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__slidable__ = __webpack_require__(7);
  5218. /**
  5219. * Copyright 2016 Google Inc. All Rights Reserved.
  5220. *
  5221. * Licensed under the Apache License, Version 2.0 (the "License");
  5222. * you may not use this file except in compliance with the License.
  5223. * You may obtain a copy of the License at
  5224. *
  5225. * http://www.apache.org/licenses/LICENSE-2.0
  5226. *
  5227. * Unless required by applicable law or agreed to in writing, software
  5228. * distributed under the License is distributed on an "AS IS" BASIS,
  5229. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5230. * See the License for the specific language governing permissions and
  5231. * limitations under the License.
  5232. */
  5233. var cssClasses = {
  5234. ROOT: 'mdc-persistent-drawer',
  5235. OPEN: 'mdc-persistent-drawer--open',
  5236. ANIMATING: 'mdc-persistent-drawer--animating'
  5237. };
  5238. var strings = {
  5239. DRAWER_SELECTOR: '.mdc-persistent-drawer__drawer',
  5240. FOCUSABLE_ELEMENTS: __WEBPACK_IMPORTED_MODULE_0__slidable__["a" /* FOCUSABLE_ELEMENTS */],
  5241. OPEN_EVENT: 'MDCPersistentDrawer:open',
  5242. CLOSE_EVENT: 'MDCPersistentDrawer:close'
  5243. };
  5244. /***/ }),
  5245. /* 46 */
  5246. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5247. "use strict";
  5248. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  5249. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFormField", function() { return MDCFormField; });
  5250. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(2);
  5251. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(47);
  5252. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_selection_control__ = __webpack_require__(4);
  5253. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCFormFieldFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  5254. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  5255. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5256. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  5257. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  5258. /**
  5259. * @license
  5260. * Copyright 2017 Google Inc. All Rights Reserved.
  5261. *
  5262. * Licensed under the Apache License, Version 2.0 (the "License");
  5263. * you may not use this file except in compliance with the License.
  5264. * You may obtain a copy of the License at
  5265. *
  5266. * http://www.apache.org/licenses/LICENSE-2.0
  5267. *
  5268. * Unless required by applicable law or agreed to in writing, software
  5269. * distributed under the License is distributed on an "AS IS" BASIS,
  5270. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5271. * See the License for the specific language governing permissions and
  5272. * limitations under the License.
  5273. */
  5274. /* eslint-disable no-unused-vars */
  5275. /* eslint-enable no-unused-vars */
  5276. /**
  5277. * @extends MDCComponent<!MDCFormFieldFoundation>
  5278. */
  5279. var MDCFormField = function (_MDCComponent) {
  5280. _inherits(MDCFormField, _MDCComponent);
  5281. _createClass(MDCFormField, [{
  5282. key: 'input',
  5283. /** @param {?MDCSelectionControl} input */
  5284. set: function set(input) {
  5285. this.input_ = input;
  5286. }
  5287. /** @return {?MDCSelectionControl} */
  5288. ,
  5289. get: function get() {
  5290. return this.input_;
  5291. }
  5292. }], [{
  5293. key: 'attachTo',
  5294. value: function attachTo(root) {
  5295. return new MDCFormField(root);
  5296. }
  5297. }]);
  5298. function MDCFormField() {
  5299. var _ref;
  5300. _classCallCheck(this, MDCFormField);
  5301. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  5302. args[_key] = arguments[_key];
  5303. }
  5304. /** @private {?MDCSelectionControl} */
  5305. var _this = _possibleConstructorReturn(this, (_ref = MDCFormField.__proto__ || Object.getPrototypeOf(MDCFormField)).call.apply(_ref, [this].concat(args)));
  5306. _this.input_;
  5307. return _this;
  5308. }
  5309. /**
  5310. * @return {!Element}
  5311. * @private
  5312. */
  5313. _createClass(MDCFormField, [{
  5314. key: 'getDefaultFoundation',
  5315. /** @return {!MDCFormFieldFoundation} */
  5316. value: function getDefaultFoundation() {
  5317. var _this2 = this;
  5318. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]({
  5319. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  5320. return _this2.label_.addEventListener(type, handler);
  5321. },
  5322. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  5323. return _this2.label_.removeEventListener(type, handler);
  5324. },
  5325. activateInputRipple: function activateInputRipple() {
  5326. if (_this2.input_ && _this2.input_.ripple) {
  5327. _this2.input_.ripple.activate();
  5328. }
  5329. },
  5330. deactivateInputRipple: function deactivateInputRipple() {
  5331. if (_this2.input_ && _this2.input_.ripple) {
  5332. _this2.input_.ripple.deactivate();
  5333. }
  5334. }
  5335. });
  5336. }
  5337. }, {
  5338. key: 'label_',
  5339. get: function get() {
  5340. var LABEL_SELECTOR = __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.LABEL_SELECTOR;
  5341. return (/** @type {!Element} */this.root_.querySelector(LABEL_SELECTOR)
  5342. );
  5343. }
  5344. }]);
  5345. return MDCFormField;
  5346. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  5347. /***/ }),
  5348. /* 47 */
  5349. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5350. "use strict";
  5351. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  5352. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(48);
  5353. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(49);
  5354. 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; };
  5355. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  5356. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5357. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  5358. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  5359. /**
  5360. * @license
  5361. * Copyright 2017 Google Inc. All Rights Reserved.
  5362. *
  5363. * Licensed under the Apache License, Version 2.0 (the "License");
  5364. * you may not use this file except in compliance with the License.
  5365. * You may obtain a copy of the License at
  5366. *
  5367. * http://www.apache.org/licenses/LICENSE-2.0
  5368. *
  5369. * Unless required by applicable law or agreed to in writing, software
  5370. * distributed under the License is distributed on an "AS IS" BASIS,
  5371. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5372. * See the License for the specific language governing permissions and
  5373. * limitations under the License.
  5374. */
  5375. /**
  5376. * @extends {MDCFoundation<!MDCFormFieldAdapter>}
  5377. */
  5378. var MDCFormFieldFoundation = function (_MDCFoundation) {
  5379. _inherits(MDCFormFieldFoundation, _MDCFoundation);
  5380. _createClass(MDCFormFieldFoundation, null, [{
  5381. key: 'cssClasses',
  5382. /** @return enum {cssClasses} */
  5383. get: function get() {
  5384. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  5385. }
  5386. /** @return enum {strings} */
  5387. }, {
  5388. key: 'strings',
  5389. get: function get() {
  5390. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  5391. }
  5392. /** @return {!MDCFormFieldAdapter} */
  5393. }, {
  5394. key: 'defaultAdapter',
  5395. get: function get() {
  5396. return {
  5397. registerInteractionHandler: function registerInteractionHandler() /* type: string, handler: EventListener */{},
  5398. deregisterInteractionHandler: function deregisterInteractionHandler() /* type: string, handler: EventListener */{},
  5399. activateInputRipple: function activateInputRipple() {},
  5400. deactivateInputRipple: function deactivateInputRipple() {}
  5401. };
  5402. }
  5403. }]);
  5404. function MDCFormFieldFoundation(adapter) {
  5405. _classCallCheck(this, MDCFormFieldFoundation);
  5406. /** @private {!EventListener} */
  5407. var _this = _possibleConstructorReturn(this, (MDCFormFieldFoundation.__proto__ || Object.getPrototypeOf(MDCFormFieldFoundation)).call(this, _extends(MDCFormFieldFoundation.defaultAdapter, adapter)));
  5408. _this.clickHandler_ = /** @type {!EventListener} */function () {
  5409. return _this.handleClick_();
  5410. };
  5411. return _this;
  5412. }
  5413. _createClass(MDCFormFieldFoundation, [{
  5414. key: 'init',
  5415. value: function init() {
  5416. this.adapter_.registerInteractionHandler('click', this.clickHandler_);
  5417. }
  5418. }, {
  5419. key: 'destroy',
  5420. value: function destroy() {
  5421. this.adapter_.deregisterInteractionHandler('click', this.clickHandler_);
  5422. }
  5423. /** @private */
  5424. }, {
  5425. key: 'handleClick_',
  5426. value: function handleClick_() {
  5427. var _this2 = this;
  5428. this.adapter_.activateInputRipple();
  5429. requestAnimationFrame(function () {
  5430. return _this2.adapter_.deactivateInputRipple();
  5431. });
  5432. }
  5433. }]);
  5434. return MDCFormFieldFoundation;
  5435. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  5436. /* harmony default export */ __webpack_exports__["a"] = (MDCFormFieldFoundation);
  5437. /***/ }),
  5438. /* 48 */
  5439. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5440. "use strict";
  5441. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  5442. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5443. /**
  5444. * @license
  5445. * Copyright 2016 Google Inc. All Rights Reserved.
  5446. *
  5447. * Licensed under the Apache License, Version 2.0 (the "License");
  5448. * you may not use this file except in compliance with the License.
  5449. * You may obtain a copy of the License at
  5450. *
  5451. * http://www.apache.org/licenses/LICENSE-2.0
  5452. *
  5453. * Unless required by applicable law or agreed to in writing, software
  5454. * distributed under the License is distributed on an "AS IS" BASIS,
  5455. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5456. * See the License for the specific language governing permissions and
  5457. * limitations under the License.
  5458. */
  5459. /* eslint no-unused-vars: [2, {"args": "none"}] */
  5460. /**
  5461. * Adapter for MDC Form Field. Provides an interface for managing
  5462. * - event handlers
  5463. * - ripple activation
  5464. *
  5465. * Additionally, provides type information for the adapter to the Closure
  5466. * compiler.
  5467. *
  5468. * Implement this adapter for your framework of choice to delegate updates to
  5469. * the component in your framework of choice. See architecture documentation
  5470. * for more details.
  5471. * https://github.com/material-components/material-components-web/blob/master/docs/architecture.md
  5472. *
  5473. * @record
  5474. */
  5475. var MDCFormFieldAdapter = function () {
  5476. function MDCFormFieldAdapter() {
  5477. _classCallCheck(this, MDCFormFieldAdapter);
  5478. }
  5479. _createClass(MDCFormFieldAdapter, [{
  5480. key: "registerInteractionHandler",
  5481. /**
  5482. * @param {string} type
  5483. * @param {!EventListener} handler
  5484. */
  5485. value: function registerInteractionHandler(type, handler) {}
  5486. /**
  5487. * @param {string} type
  5488. * @param {!EventListener} handler
  5489. */
  5490. }, {
  5491. key: "deregisterInteractionHandler",
  5492. value: function deregisterInteractionHandler(type, handler) {}
  5493. }, {
  5494. key: "activateInputRipple",
  5495. value: function activateInputRipple() {}
  5496. }, {
  5497. key: "deactivateInputRipple",
  5498. value: function deactivateInputRipple() {}
  5499. }]);
  5500. return MDCFormFieldAdapter;
  5501. }();
  5502. /* unused harmony default export */ var _unused_webpack_default_export = (MDCFormFieldAdapter);
  5503. /***/ }),
  5504. /* 49 */
  5505. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5506. "use strict";
  5507. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  5508. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  5509. /**
  5510. * @license
  5511. * Copyright 2017 Google Inc. All Rights Reserved.
  5512. *
  5513. * Licensed under the Apache License, Version 2.0 (the "License");
  5514. * you may not use this file except in compliance with the License.
  5515. * You may obtain a copy of the License at
  5516. *
  5517. * http://www.apache.org/licenses/LICENSE-2.0
  5518. *
  5519. * Unless required by applicable law or agreed to in writing, software
  5520. * distributed under the License is distributed on an "AS IS" BASIS,
  5521. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5522. * See the License for the specific language governing permissions and
  5523. * limitations under the License.
  5524. */
  5525. /** @enum {string} */
  5526. var cssClasses = {
  5527. ROOT: 'mdc-form-field'
  5528. };
  5529. /** @enum {string} */
  5530. var strings = {
  5531. LABEL_SELECTOR: '.mdc-form-field > label'
  5532. };
  5533. /***/ }),
  5534. /* 50 */
  5535. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5536. "use strict";
  5537. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  5538. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCGridList", function() { return MDCGridList; });
  5539. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base__ = __webpack_require__(1);
  5540. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(51);
  5541. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCGridListFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  5542. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  5543. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5544. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  5545. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  5546. /**
  5547. * Copyright 2016 Google Inc. All Rights Reserved.
  5548. *
  5549. * Licensed under the Apache License, Version 2.0 (the "License");
  5550. * you may not use this file except in compliance with the License.
  5551. * You may obtain a copy of the License at
  5552. *
  5553. * http://www.apache.org/licenses/LICENSE-2.0
  5554. *
  5555. * Unless required by applicable law or agreed to in writing, software
  5556. * distributed under the License is distributed on an "AS IS" BASIS,
  5557. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5558. * See the License for the specific language governing permissions and
  5559. * limitations under the License.
  5560. */
  5561. var MDCGridList = function (_MDCComponent) {
  5562. _inherits(MDCGridList, _MDCComponent);
  5563. function MDCGridList() {
  5564. _classCallCheck(this, MDCGridList);
  5565. return _possibleConstructorReturn(this, (MDCGridList.__proto__ || Object.getPrototypeOf(MDCGridList)).apply(this, arguments));
  5566. }
  5567. _createClass(MDCGridList, [{
  5568. key: 'getDefaultFoundation',
  5569. value: function getDefaultFoundation() {
  5570. var _this2 = this;
  5571. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]({
  5572. getOffsetWidth: function getOffsetWidth() {
  5573. return _this2.root_.offsetWidth;
  5574. },
  5575. getNumberOfTiles: function getNumberOfTiles() {
  5576. return _this2.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.TILE_SELECTOR).length;
  5577. },
  5578. getOffsetWidthForTileAtIndex: function getOffsetWidthForTileAtIndex(index) {
  5579. return _this2.root_.querySelectorAll(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.TILE_SELECTOR)[index].offsetWidth;
  5580. },
  5581. setStyleForTilesElement: function setStyleForTilesElement(property, value) {
  5582. _this2.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.TILES_SELECTOR).style[property] = value;
  5583. },
  5584. registerResizeHandler: function registerResizeHandler(handler) {
  5585. return window.addEventListener('resize', handler);
  5586. },
  5587. deregisterResizeHandler: function deregisterResizeHandler(handler) {
  5588. return window.removeEventListener('resize', handler);
  5589. }
  5590. });
  5591. }
  5592. }], [{
  5593. key: 'attachTo',
  5594. value: function attachTo(root) {
  5595. return new MDCGridList(root);
  5596. }
  5597. }]);
  5598. return MDCGridList;
  5599. }(__WEBPACK_IMPORTED_MODULE_0__material_base__["MDCComponent"]);
  5600. /***/ }),
  5601. /* 51 */
  5602. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5603. "use strict";
  5604. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base__ = __webpack_require__(1);
  5605. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(52);
  5606. 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; };
  5607. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  5608. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5609. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  5610. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  5611. /**
  5612. * Copyright 2016 Google Inc. All Rights Reserved.
  5613. *
  5614. * Licensed under the Apache License, Version 2.0 (the "License");
  5615. * you may not use this file except in compliance with the License.
  5616. * You may obtain a copy of the License at
  5617. *
  5618. * http://www.apache.org/licenses/LICENSE-2.0
  5619. *
  5620. * Unless required by applicable law or agreed to in writing, software
  5621. * distributed under the License is distributed on an "AS IS" BASIS,
  5622. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5623. * See the License for the specific language governing permissions and
  5624. * limitations under the License.
  5625. */
  5626. var MDCGridListFoundation = function (_MDCFoundation) {
  5627. _inherits(MDCGridListFoundation, _MDCFoundation);
  5628. _createClass(MDCGridListFoundation, null, [{
  5629. key: 'strings',
  5630. get: function get() {
  5631. return __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* strings */];
  5632. }
  5633. }, {
  5634. key: 'defaultAdapter',
  5635. get: function get() {
  5636. return {
  5637. getOffsetWidth: function getOffsetWidth() {
  5638. return (/* number */0
  5639. );
  5640. },
  5641. getNumberOfTiles: function getNumberOfTiles() {
  5642. return (/* number */0
  5643. );
  5644. },
  5645. getOffsetWidthForTileAtIndex: function getOffsetWidthForTileAtIndex() {
  5646. return (/* index: number */ /* number */0
  5647. );
  5648. },
  5649. setStyleForTilesElement: function setStyleForTilesElement() /* property: string, value: string */{},
  5650. registerResizeHandler: function registerResizeHandler() /* handler: EventListener */{},
  5651. deregisterResizeHandler: function deregisterResizeHandler() /* handler: EventListener */{}
  5652. };
  5653. }
  5654. }]);
  5655. function MDCGridListFoundation(adapter) {
  5656. _classCallCheck(this, MDCGridListFoundation);
  5657. var _this = _possibleConstructorReturn(this, (MDCGridListFoundation.__proto__ || Object.getPrototypeOf(MDCGridListFoundation)).call(this, _extends(MDCGridListFoundation.defaultAdapter, adapter)));
  5658. _this.resizeHandler_ = function () {
  5659. return _this.alignCenter();
  5660. };
  5661. _this.resizeFrame_ = 0;
  5662. return _this;
  5663. }
  5664. _createClass(MDCGridListFoundation, [{
  5665. key: 'init',
  5666. value: function init() {
  5667. this.alignCenter();
  5668. this.adapter_.registerResizeHandler(this.resizeHandler_);
  5669. }
  5670. }, {
  5671. key: 'destroy',
  5672. value: function destroy() {
  5673. this.adapter_.deregisterResizeHandler(this.resizeHandler_);
  5674. }
  5675. }, {
  5676. key: 'alignCenter',
  5677. value: function alignCenter() {
  5678. var _this2 = this;
  5679. if (this.resizeFrame_ !== 0) {
  5680. cancelAnimationFrame(this.resizeFrame_);
  5681. }
  5682. this.resizeFrame_ = requestAnimationFrame(function () {
  5683. _this2.alignCenter_();
  5684. _this2.resizeFrame_ = 0;
  5685. });
  5686. }
  5687. }, {
  5688. key: 'alignCenter_',
  5689. value: function alignCenter_() {
  5690. if (this.adapter_.getNumberOfTiles() == 0) {
  5691. return;
  5692. }
  5693. var gridWidth = this.adapter_.getOffsetWidth();
  5694. var itemWidth = this.adapter_.getOffsetWidthForTileAtIndex(0);
  5695. var tilesWidth = itemWidth * Math.floor(gridWidth / itemWidth);
  5696. this.adapter_.setStyleForTilesElement('width', tilesWidth + 'px');
  5697. }
  5698. }]);
  5699. return MDCGridListFoundation;
  5700. }(__WEBPACK_IMPORTED_MODULE_0__material_base__["MDCFoundation"]);
  5701. /* harmony default export */ __webpack_exports__["a"] = (MDCGridListFoundation);
  5702. /***/ }),
  5703. /* 52 */
  5704. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5705. "use strict";
  5706. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return strings; });
  5707. /**
  5708. * Copyright 2016 Google Inc. All Rights Reserved.
  5709. *
  5710. * Licensed under the Apache License, Version 2.0 (the "License");
  5711. * you may not use this file except in compliance with the License.
  5712. * You may obtain a copy of the License at
  5713. *
  5714. * http://www.apache.org/licenses/LICENSE-2.0
  5715. *
  5716. * Unless required by applicable law or agreed to in writing, software
  5717. * distributed under the License is distributed on an "AS IS" BASIS,
  5718. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5719. * See the License for the specific language governing permissions and
  5720. * limitations under the License.
  5721. */
  5722. var strings = {
  5723. TILES_SELECTOR: '.mdc-grid-list__tiles',
  5724. TILE_SELECTOR: '.mdc-grid-tile'
  5725. };
  5726. /***/ }),
  5727. /* 53 */
  5728. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5729. "use strict";
  5730. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  5731. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCIconToggle", function() { return MDCIconToggle; });
  5732. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(2);
  5733. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(54);
  5734. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_ripple__ = __webpack_require__(3);
  5735. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCIconToggleFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  5736. 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; };
  5737. 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); } };
  5738. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  5739. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5740. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  5741. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  5742. /**
  5743. * @license
  5744. * Copyright 2016 Google Inc. All Rights Reserved.
  5745. *
  5746. * Licensed under the Apache License, Version 2.0 (the "License");
  5747. * you may not use this file except in compliance with the License.
  5748. * You may obtain a copy of the License at
  5749. *
  5750. * http://www.apache.org/licenses/LICENSE-2.0
  5751. *
  5752. * Unless required by applicable law or agreed to in writing, software
  5753. * distributed under the License is distributed on an "AS IS" BASIS,
  5754. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5755. * See the License for the specific language governing permissions and
  5756. * limitations under the License.
  5757. */
  5758. /**
  5759. * @extends {MDCComponent<!MDCIconToggleFoundation>}
  5760. */
  5761. var MDCIconToggle = function (_MDCComponent) {
  5762. _inherits(MDCIconToggle, _MDCComponent);
  5763. _createClass(MDCIconToggle, null, [{
  5764. key: 'attachTo',
  5765. value: function attachTo(root) {
  5766. return new MDCIconToggle(root);
  5767. }
  5768. }]);
  5769. function MDCIconToggle() {
  5770. var _ref;
  5771. _classCallCheck(this, MDCIconToggle);
  5772. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  5773. args[_key] = arguments[_key];
  5774. }
  5775. /** @private {!MDCRipple} */
  5776. var _this = _possibleConstructorReturn(this, (_ref = MDCIconToggle.__proto__ || Object.getPrototypeOf(MDCIconToggle)).call.apply(_ref, [this].concat(args)));
  5777. _this.ripple_ = _this.initRipple_();
  5778. return _this;
  5779. }
  5780. /** @return {!Element} */
  5781. _createClass(MDCIconToggle, [{
  5782. key: 'initRipple_',
  5783. /**
  5784. * @return {!MDCRipple}
  5785. * @private
  5786. */
  5787. value: function initRipple_() {
  5788. var _this2 = this;
  5789. var adapter = _extends(__WEBPACK_IMPORTED_MODULE_2__material_ripple__["MDCRipple"].createAdapter(this), {
  5790. isUnbounded: function isUnbounded() {
  5791. return true;
  5792. },
  5793. isSurfaceActive: function isSurfaceActive() {
  5794. return _this2.foundation_.isKeyboardActivated();
  5795. },
  5796. computeBoundingRect: function computeBoundingRect() {
  5797. var dim = 48;
  5798. var _root_$getBoundingCli = _this2.root_.getBoundingClientRect(),
  5799. left = _root_$getBoundingCli.left,
  5800. top = _root_$getBoundingCli.top;
  5801. return {
  5802. left: left,
  5803. top: top,
  5804. width: dim,
  5805. height: dim,
  5806. right: left + dim,
  5807. bottom: left + dim
  5808. };
  5809. }
  5810. });
  5811. var foundation = new __WEBPACK_IMPORTED_MODULE_2__material_ripple__["MDCRippleFoundation"](adapter);
  5812. return new __WEBPACK_IMPORTED_MODULE_2__material_ripple__["MDCRipple"](this.root_, foundation);
  5813. }
  5814. }, {
  5815. key: 'destroy',
  5816. value: function destroy() {
  5817. this.ripple_.destroy();
  5818. _get(MDCIconToggle.prototype.__proto__ || Object.getPrototypeOf(MDCIconToggle.prototype), 'destroy', this).call(this);
  5819. }
  5820. /** @return {!MDCIconToggleFoundation} */
  5821. }, {
  5822. key: 'getDefaultFoundation',
  5823. value: function getDefaultFoundation() {
  5824. var _this3 = this;
  5825. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]({
  5826. addClass: function addClass(className) {
  5827. return _this3.iconEl_.classList.add(className);
  5828. },
  5829. removeClass: function removeClass(className) {
  5830. return _this3.iconEl_.classList.remove(className);
  5831. },
  5832. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  5833. return _this3.root_.addEventListener(type, handler);
  5834. },
  5835. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  5836. return _this3.root_.removeEventListener(type, handler);
  5837. },
  5838. setText: function setText(text) {
  5839. return _this3.iconEl_.textContent = text;
  5840. },
  5841. getTabIndex: function getTabIndex() {
  5842. return (/* number */_this3.root_.tabIndex
  5843. );
  5844. },
  5845. setTabIndex: function setTabIndex(tabIndex) {
  5846. return _this3.root_.tabIndex = tabIndex;
  5847. },
  5848. getAttr: function getAttr(name, value) {
  5849. return _this3.root_.getAttribute(name, value);
  5850. },
  5851. setAttr: function setAttr(name, value) {
  5852. return _this3.root_.setAttribute(name, value);
  5853. },
  5854. rmAttr: function rmAttr(name) {
  5855. return _this3.root_.removeAttribute(name);
  5856. },
  5857. notifyChange: function notifyChange(evtData) {
  5858. return _this3.emit(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.CHANGE_EVENT, evtData);
  5859. }
  5860. });
  5861. }
  5862. }, {
  5863. key: 'initialSyncWithDOM',
  5864. value: function initialSyncWithDOM() {
  5865. this.on = this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.ARIA_PRESSED) === 'true';
  5866. this.disabled = this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.ARIA_DISABLED) === 'true';
  5867. }
  5868. /** @return {!MDCRipple} */
  5869. }, {
  5870. key: 'refreshToggleData',
  5871. value: function refreshToggleData() {
  5872. this.foundation_.refreshToggleData();
  5873. }
  5874. }, {
  5875. key: 'iconEl_',
  5876. get: function get() {
  5877. var sel = this.root_.dataset['iconInnerSelector'];
  5878. return sel ?
  5879. /** @type {!Element} */this.root_.querySelector(sel) : this.root_;
  5880. }
  5881. }, {
  5882. key: 'ripple',
  5883. get: function get() {
  5884. return this.ripple_;
  5885. }
  5886. /** @return {boolean} */
  5887. }, {
  5888. key: 'on',
  5889. get: function get() {
  5890. return this.foundation_.isOn();
  5891. }
  5892. /** @param {boolean} isOn */
  5893. ,
  5894. set: function set(isOn) {
  5895. this.foundation_.toggle(isOn);
  5896. }
  5897. /** @return {boolean} */
  5898. }, {
  5899. key: 'disabled',
  5900. get: function get() {
  5901. return this.foundation_.isDisabled();
  5902. }
  5903. /** @param {boolean} isDisabled */
  5904. ,
  5905. set: function set(isDisabled) {
  5906. this.foundation_.setDisabled(isDisabled);
  5907. }
  5908. }]);
  5909. return MDCIconToggle;
  5910. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  5911. /***/ }),
  5912. /* 54 */
  5913. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  5914. "use strict";
  5915. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  5916. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(55);
  5917. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(56);
  5918. 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; };
  5919. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  5920. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5921. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  5922. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  5923. /**
  5924. * @license
  5925. * Copyright 2016 Google Inc. All Rights Reserved.
  5926. *
  5927. * Licensed under the Apache License, Version 2.0 (the "License");
  5928. * you may not use this file except in compliance with the License.
  5929. * You may obtain a copy of the License at
  5930. *
  5931. * http://www.apache.org/licenses/LICENSE-2.0
  5932. *
  5933. * Unless required by applicable law or agreed to in writing, software
  5934. * distributed under the License is distributed on an "AS IS" BASIS,
  5935. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  5936. * See the License for the specific language governing permissions and
  5937. * limitations under the License.
  5938. */
  5939. /* eslint-disable no-unused-vars */
  5940. /**
  5941. * @extends {MDCFoundation<!MDCIconToggleAdapter>}
  5942. */
  5943. var MDCIconToggleFoundation = function (_MDCFoundation) {
  5944. _inherits(MDCIconToggleFoundation, _MDCFoundation);
  5945. _createClass(MDCIconToggleFoundation, null, [{
  5946. key: 'cssClasses',
  5947. get: function get() {
  5948. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  5949. }
  5950. }, {
  5951. key: 'strings',
  5952. get: function get() {
  5953. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  5954. }
  5955. }, {
  5956. key: 'defaultAdapter',
  5957. get: function get() {
  5958. return {
  5959. addClass: function addClass() /* className: string */{},
  5960. removeClass: function removeClass() /* className: string */{},
  5961. registerInteractionHandler: function registerInteractionHandler() /* type: string, handler: EventListener */{},
  5962. deregisterInteractionHandler: function deregisterInteractionHandler() /* type: string, handler: EventListener */{},
  5963. setText: function setText() /* text: string */{},
  5964. getTabIndex: function getTabIndex() {
  5965. return (/* number */0
  5966. );
  5967. },
  5968. setTabIndex: function setTabIndex() /* tabIndex: number */{},
  5969. getAttr: function getAttr() {
  5970. return (/* name: string */ /* string */''
  5971. );
  5972. },
  5973. setAttr: function setAttr() /* name: string, value: string */{},
  5974. rmAttr: function rmAttr() /* name: string */{},
  5975. notifyChange: function notifyChange() /* evtData: IconToggleEvent */{}
  5976. };
  5977. }
  5978. }]);
  5979. function MDCIconToggleFoundation(adapter) {
  5980. _classCallCheck(this, MDCIconToggleFoundation);
  5981. /** @private {boolean} */
  5982. var _this = _possibleConstructorReturn(this, (MDCIconToggleFoundation.__proto__ || Object.getPrototypeOf(MDCIconToggleFoundation)).call(this, _extends(MDCIconToggleFoundation.defaultAdapter, adapter)));
  5983. _this.on_ = false;
  5984. /** @private {boolean} */
  5985. _this.disabled_ = false;
  5986. /** @private {number} */
  5987. _this.savedTabIndex_ = -1;
  5988. /** @private {?IconToggleState} */
  5989. _this.toggleOnData_ = null;
  5990. /** @private {?IconToggleState} */
  5991. _this.toggleOffData_ = null;
  5992. _this.clickHandler_ = /** @private {!EventListener} */function () {
  5993. return _this.toggleFromEvt_();
  5994. };
  5995. /** @private {boolean} */
  5996. _this.isHandlingKeydown_ = false;
  5997. _this.keydownHandler_ = /** @private {!EventListener} */function ( /** @type {!KeyboardKey} */evt) {
  5998. if (isSpace(evt)) {
  5999. _this.isHandlingKeydown_ = true;
  6000. return evt.preventDefault();
  6001. }
  6002. };
  6003. _this.keyupHandler_ = /** @private {!EventListener} */function ( /** @type {!KeyboardKey} */evt) {
  6004. if (isSpace(evt)) {
  6005. _this.isHandlingKeydown_ = false;
  6006. _this.toggleFromEvt_();
  6007. }
  6008. };
  6009. return _this;
  6010. }
  6011. _createClass(MDCIconToggleFoundation, [{
  6012. key: 'init',
  6013. value: function init() {
  6014. this.refreshToggleData();
  6015. this.savedTabIndex_ = this.adapter_.getTabIndex();
  6016. this.adapter_.registerInteractionHandler('click', this.clickHandler_);
  6017. this.adapter_.registerInteractionHandler('keydown', this.keydownHandler_);
  6018. this.adapter_.registerInteractionHandler('keyup', this.keyupHandler_);
  6019. }
  6020. }, {
  6021. key: 'refreshToggleData',
  6022. value: function refreshToggleData() {
  6023. var _MDCIconToggleFoundat = MDCIconToggleFoundation.strings,
  6024. DATA_TOGGLE_ON = _MDCIconToggleFoundat.DATA_TOGGLE_ON,
  6025. DATA_TOGGLE_OFF = _MDCIconToggleFoundat.DATA_TOGGLE_OFF;
  6026. this.toggleOnData_ = this.parseJsonDataAttr_(DATA_TOGGLE_ON);
  6027. this.toggleOffData_ = this.parseJsonDataAttr_(DATA_TOGGLE_OFF);
  6028. }
  6029. }, {
  6030. key: 'destroy',
  6031. value: function destroy() {
  6032. this.adapter_.deregisterInteractionHandler('click', this.clickHandler_);
  6033. this.adapter_.deregisterInteractionHandler('keydown', this.keydownHandler_);
  6034. this.adapter_.deregisterInteractionHandler('keyup', this.keyupHandler_);
  6035. }
  6036. /** @private */
  6037. }, {
  6038. key: 'toggleFromEvt_',
  6039. value: function toggleFromEvt_() {
  6040. this.toggle();
  6041. var isOn = this.on_;
  6042. this.adapter_.notifyChange( /** @type {!IconToggleEvent} */{ isOn: isOn });
  6043. }
  6044. /** @return {boolean} */
  6045. }, {
  6046. key: 'isOn',
  6047. value: function isOn() {
  6048. return this.on_;
  6049. }
  6050. /** @param {boolean=} isOn */
  6051. }, {
  6052. key: 'toggle',
  6053. value: function toggle() {
  6054. var isOn = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !this.on_;
  6055. this.on_ = isOn;
  6056. var _MDCIconToggleFoundat2 = MDCIconToggleFoundation.strings,
  6057. ARIA_LABEL = _MDCIconToggleFoundat2.ARIA_LABEL,
  6058. ARIA_PRESSED = _MDCIconToggleFoundat2.ARIA_PRESSED;
  6059. if (this.on_) {
  6060. this.adapter_.setAttr(ARIA_PRESSED, 'true');
  6061. } else {
  6062. this.adapter_.setAttr(ARIA_PRESSED, 'false');
  6063. }
  6064. var _ref = this.on_ ? this.toggleOffData_ : this.toggleOnData_,
  6065. classToRemove = _ref.cssClass;
  6066. if (classToRemove) {
  6067. this.adapter_.removeClass(classToRemove);
  6068. }
  6069. var _ref2 = this.on_ ? this.toggleOnData_ : this.toggleOffData_,
  6070. content = _ref2.content,
  6071. label = _ref2.label,
  6072. cssClass = _ref2.cssClass;
  6073. if (cssClass) {
  6074. this.adapter_.addClass(cssClass);
  6075. }
  6076. if (content) {
  6077. this.adapter_.setText(content);
  6078. }
  6079. if (label) {
  6080. this.adapter_.setAttr(ARIA_LABEL, label);
  6081. }
  6082. }
  6083. /**
  6084. * @param {string} dataAttr
  6085. * @return {!IconToggleState}
  6086. */
  6087. }, {
  6088. key: 'parseJsonDataAttr_',
  6089. value: function parseJsonDataAttr_(dataAttr) {
  6090. var val = this.adapter_.getAttr(dataAttr);
  6091. if (!val) {
  6092. return {};
  6093. }
  6094. return (/** @type {!IconToggleState} */JSON.parse(val)
  6095. );
  6096. }
  6097. /** @return {boolean} */
  6098. }, {
  6099. key: 'isDisabled',
  6100. value: function isDisabled() {
  6101. return this.disabled_;
  6102. }
  6103. /** @param {boolean} isDisabled */
  6104. }, {
  6105. key: 'setDisabled',
  6106. value: function setDisabled(isDisabled) {
  6107. this.disabled_ = isDisabled;
  6108. var DISABLED = MDCIconToggleFoundation.cssClasses.DISABLED;
  6109. var ARIA_DISABLED = MDCIconToggleFoundation.strings.ARIA_DISABLED;
  6110. if (this.disabled_) {
  6111. this.savedTabIndex_ = this.adapter_.getTabIndex();
  6112. this.adapter_.setTabIndex(-1);
  6113. this.adapter_.setAttr(ARIA_DISABLED, 'true');
  6114. this.adapter_.addClass(DISABLED);
  6115. } else {
  6116. this.adapter_.setTabIndex(this.savedTabIndex_);
  6117. this.adapter_.rmAttr(ARIA_DISABLED);
  6118. this.adapter_.removeClass(DISABLED);
  6119. }
  6120. }
  6121. /** @return {boolean} */
  6122. }, {
  6123. key: 'isKeyboardActivated',
  6124. value: function isKeyboardActivated() {
  6125. return this.isHandlingKeydown_;
  6126. }
  6127. }]);
  6128. return MDCIconToggleFoundation;
  6129. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  6130. /**
  6131. * @typedef {!{
  6132. * key: string,
  6133. * keyCode: number
  6134. * }}
  6135. */
  6136. var KeyboardKey = void 0;
  6137. /**
  6138. * @param {!KeyboardKey} keyboardKey
  6139. * @return {boolean}
  6140. */
  6141. function isSpace(keyboardKey) {
  6142. return keyboardKey.key === 'Space' || keyboardKey.keyCode === 32;
  6143. }
  6144. /** @record */
  6145. var IconToggleState = function IconToggleState() {
  6146. _classCallCheck(this, IconToggleState);
  6147. };
  6148. /**
  6149. * The aria-label value of the icon toggle, or undefined if there is no aria-label.
  6150. * @export {string|undefined}
  6151. */
  6152. IconToggleState.prototype.label;
  6153. /**
  6154. * The text for the icon toggle, or undefined if there is no text.
  6155. * @export {string|undefined}
  6156. */
  6157. IconToggleState.prototype.content;
  6158. /**
  6159. * The CSS class to add to the icon toggle, or undefined if there is no CSS class.
  6160. * @export {string|undefined}
  6161. */
  6162. IconToggleState.prototype.cssClass;
  6163. /* harmony default export */ __webpack_exports__["a"] = (MDCIconToggleFoundation);
  6164. /***/ }),
  6165. /* 55 */
  6166. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6167. "use strict";
  6168. /* unused harmony export MDCIconToggleAdapter */
  6169. /* unused harmony export IconToggleEvent */
  6170. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  6171. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6172. /**
  6173. * @license
  6174. * Copyright 2017 Google Inc. All Rights Reserved.
  6175. *
  6176. * Licensed under the Apache License, Version 2.0 (the "License");
  6177. * you may not use this file except in compliance with the License.
  6178. * You may obtain a copy of the License at
  6179. *
  6180. * http://www.apache.org/licenses/LICENSE-2.0
  6181. *
  6182. * Unless required by applicable law or agreed to in writing, software
  6183. * distributed under the License is distributed on an "AS IS" BASIS,
  6184. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6185. * See the License for the specific language governing permissions and
  6186. * limitations under the License.
  6187. */
  6188. /* eslint no-unused-vars: [2, {"args": "none"}] */
  6189. /**
  6190. * Adapter for MDC Icon Toggle. Provides an interface for managing
  6191. * - classes
  6192. * - dom
  6193. * - inner text
  6194. * - event handlers
  6195. * - event dispatch
  6196. *
  6197. * Additionally, provides type information for the adapter to the Closure
  6198. * compiler.
  6199. *
  6200. * Implement this adapter for your framework of choice to delegate updates to
  6201. * the component in your framework of choice. See architecture documentation
  6202. * for more details.
  6203. * https://github.com/material-components/material-components-web/blob/master/docs/architecture.md
  6204. *
  6205. * @record
  6206. */
  6207. var MDCIconToggleAdapter = function () {
  6208. function MDCIconToggleAdapter() {
  6209. _classCallCheck(this, MDCIconToggleAdapter);
  6210. }
  6211. _createClass(MDCIconToggleAdapter, [{
  6212. key: "addClass",
  6213. /** @param {string} className */
  6214. value: function addClass(className) {}
  6215. /** @param {string} className */
  6216. }, {
  6217. key: "removeClass",
  6218. value: function removeClass(className) {}
  6219. /**
  6220. * @param {string} type
  6221. * @param {!EventListener} handler
  6222. */
  6223. }, {
  6224. key: "registerInteractionHandler",
  6225. value: function registerInteractionHandler(type, handler) {}
  6226. /**
  6227. * @param {string} type
  6228. * @param {!EventListener} handler
  6229. */
  6230. }, {
  6231. key: "deregisterInteractionHandler",
  6232. value: function deregisterInteractionHandler(type, handler) {}
  6233. /** @param {string} text */
  6234. }, {
  6235. key: "setText",
  6236. value: function setText(text) {}
  6237. /** @return {number} */
  6238. }, {
  6239. key: "getTabIndex",
  6240. value: function getTabIndex() {}
  6241. /** @param {number} tabIndex */
  6242. }, {
  6243. key: "setTabIndex",
  6244. value: function setTabIndex(tabIndex) {}
  6245. /**
  6246. * @param {string} name
  6247. * @return {string}
  6248. */
  6249. }, {
  6250. key: "getAttr",
  6251. value: function getAttr(name) {}
  6252. /**
  6253. * @param {string} name
  6254. * @param {string} value
  6255. */
  6256. }, {
  6257. key: "setAttr",
  6258. value: function setAttr(name, value) {}
  6259. /** @param {string} name */
  6260. }, {
  6261. key: "rmAttr",
  6262. value: function rmAttr(name) {}
  6263. /** @param {!IconToggleEvent} evtData */
  6264. }, {
  6265. key: "notifyChange",
  6266. value: function notifyChange(evtData) {}
  6267. }]);
  6268. return MDCIconToggleAdapter;
  6269. }();
  6270. /**
  6271. * @typedef {!{
  6272. * isOn: boolean,
  6273. * }}
  6274. */
  6275. var IconToggleEvent = void 0;
  6276. /***/ }),
  6277. /* 56 */
  6278. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6279. "use strict";
  6280. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  6281. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  6282. /**
  6283. * @license
  6284. * Copyright 2016 Google Inc. All Rights Reserved.
  6285. *
  6286. * Licensed under the Apache License, Version 2.0 (the "License");
  6287. * you may not use this file except in compliance with the License.
  6288. * You may obtain a copy of the License at
  6289. *
  6290. * http://www.apache.org/licenses/LICENSE-2.0
  6291. *
  6292. * Unless required by applicable law or agreed to in writing, software
  6293. * distributed under the License is distributed on an "AS IS" BASIS,
  6294. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6295. * See the License for the specific language governing permissions and
  6296. * limitations under the License.
  6297. */
  6298. /** @enum {string} */
  6299. var cssClasses = {
  6300. ROOT: 'mdc-icon-toggle',
  6301. DISABLED: 'mdc-icon-toggle--disabled'
  6302. };
  6303. /** @enum {string} */
  6304. var strings = {
  6305. DATA_TOGGLE_ON: 'data-toggle-on',
  6306. DATA_TOGGLE_OFF: 'data-toggle-off',
  6307. ARIA_PRESSED: 'aria-pressed',
  6308. ARIA_DISABLED: 'aria-disabled',
  6309. ARIA_LABEL: 'aria-label',
  6310. CHANGE_EVENT: 'MDCIconToggle:change'
  6311. };
  6312. /***/ }),
  6313. /* 57 */
  6314. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6315. "use strict";
  6316. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  6317. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCLinearProgress", function() { return MDCLinearProgress; });
  6318. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base__ = __webpack_require__(1);
  6319. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(58);
  6320. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCLinearProgressFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  6321. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  6322. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6323. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  6324. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  6325. /**
  6326. * Copyright 2017 Google Inc. All Rights Reserved.
  6327. *
  6328. * Licensed under the Apache License, Version 2.0 (the "License");
  6329. * you may not use this file except in compliance with the License.
  6330. * You may obtain a copy of the License at
  6331. *
  6332. * http://www.apache.org/licenses/LICENSE-2.0
  6333. *
  6334. * Unless required by applicable law or agreed to in writing, software
  6335. * distributed under the License is distributed on an "AS IS" BASIS,
  6336. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6337. * See the License for the specific language governing permissions and
  6338. * limitations under the License.
  6339. */
  6340. var MDCLinearProgress = function (_MDCComponent) {
  6341. _inherits(MDCLinearProgress, _MDCComponent);
  6342. function MDCLinearProgress() {
  6343. _classCallCheck(this, MDCLinearProgress);
  6344. return _possibleConstructorReturn(this, (MDCLinearProgress.__proto__ || Object.getPrototypeOf(MDCLinearProgress)).apply(this, arguments));
  6345. }
  6346. _createClass(MDCLinearProgress, [{
  6347. key: 'open',
  6348. value: function open() {
  6349. this.foundation_.open();
  6350. }
  6351. }, {
  6352. key: 'close',
  6353. value: function close() {
  6354. this.foundation_.close();
  6355. }
  6356. }, {
  6357. key: 'getDefaultFoundation',
  6358. value: function getDefaultFoundation() {
  6359. var _this2 = this;
  6360. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]({
  6361. addClass: function addClass(className) {
  6362. return _this2.root_.classList.add(className);
  6363. },
  6364. getPrimaryBar: function getPrimaryBar() {
  6365. return _this2.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.PRIMARY_BAR_SELECTOR);
  6366. },
  6367. getBuffer: function getBuffer() {
  6368. return _this2.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.BUFFER_SELECTOR);
  6369. },
  6370. hasClass: function hasClass(className) {
  6371. return _this2.root_.classList.contains(className);
  6372. },
  6373. removeClass: function removeClass(className) {
  6374. return _this2.root_.classList.remove(className);
  6375. },
  6376. setStyle: function setStyle(el, styleProperty, value) {
  6377. return el.style[styleProperty] = value;
  6378. }
  6379. });
  6380. }
  6381. }, {
  6382. key: 'determinate',
  6383. set: function set(value) {
  6384. this.foundation_.setDeterminate(value);
  6385. }
  6386. }, {
  6387. key: 'progress',
  6388. set: function set(value) {
  6389. this.foundation_.setProgress(value);
  6390. }
  6391. }, {
  6392. key: 'buffer',
  6393. set: function set(value) {
  6394. this.foundation_.setBuffer(value);
  6395. }
  6396. }, {
  6397. key: 'reverse',
  6398. set: function set(value) {
  6399. this.foundation_.setReverse(value);
  6400. }
  6401. }], [{
  6402. key: 'attachTo',
  6403. value: function attachTo(root) {
  6404. return new MDCLinearProgress(root);
  6405. }
  6406. }]);
  6407. return MDCLinearProgress;
  6408. }(__WEBPACK_IMPORTED_MODULE_0__material_base__["MDCComponent"]);
  6409. /***/ }),
  6410. /* 58 */
  6411. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6412. "use strict";
  6413. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base__ = __webpack_require__(1);
  6414. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_animation__ = __webpack_require__(5);
  6415. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(59);
  6416. 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; };
  6417. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  6418. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6419. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  6420. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  6421. /**
  6422. * Copyright 2017 Google Inc. All Rights Reserved.
  6423. *
  6424. * Licensed under the Apache License, Version 2.0 (the "License");
  6425. * you may not use this file except in compliance with the License.
  6426. * You may obtain a copy of the License at
  6427. *
  6428. * http://www.apache.org/licenses/LICENSE-2.0
  6429. *
  6430. * Unless required by applicable law or agreed to in writing, software
  6431. * distributed under the License is distributed on an "AS IS" BASIS,
  6432. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6433. * See the License for the specific language governing permissions and
  6434. * limitations under the License.
  6435. */
  6436. var MDCLinearProgressFoundation = function (_MDCFoundation) {
  6437. _inherits(MDCLinearProgressFoundation, _MDCFoundation);
  6438. _createClass(MDCLinearProgressFoundation, null, [{
  6439. key: 'cssClasses',
  6440. get: function get() {
  6441. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  6442. }
  6443. }, {
  6444. key: 'strings',
  6445. get: function get() {
  6446. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  6447. }
  6448. }, {
  6449. key: 'defaultAdapter',
  6450. get: function get() {
  6451. return {
  6452. addClass: function addClass() /* className: string */{},
  6453. getPrimaryBar: function getPrimaryBar() /* el: Element */{},
  6454. getBuffer: function getBuffer() /* el: Element */{},
  6455. hasClass: function hasClass() {
  6456. return (/* className: string */false
  6457. );
  6458. },
  6459. removeClass: function removeClass() /* className: string */{},
  6460. setStyle: function setStyle() /* el: Element, styleProperty: string, value: number */{}
  6461. };
  6462. }
  6463. }]);
  6464. function MDCLinearProgressFoundation(adapter) {
  6465. _classCallCheck(this, MDCLinearProgressFoundation);
  6466. return _possibleConstructorReturn(this, (MDCLinearProgressFoundation.__proto__ || Object.getPrototypeOf(MDCLinearProgressFoundation)).call(this, _extends(MDCLinearProgressFoundation.defaultAdapter, adapter)));
  6467. }
  6468. _createClass(MDCLinearProgressFoundation, [{
  6469. key: 'init',
  6470. value: function init() {
  6471. this.determinate_ = !this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].INDETERMINATE_CLASS);
  6472. this.reverse_ = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].REVERSED_CLASS);
  6473. }
  6474. }, {
  6475. key: 'setDeterminate',
  6476. value: function setDeterminate(isDeterminate) {
  6477. this.determinate_ = isDeterminate;
  6478. if (this.determinate_) {
  6479. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].INDETERMINATE_CLASS);
  6480. } else {
  6481. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].INDETERMINATE_CLASS);
  6482. this.setScale_(this.adapter_.getPrimaryBar(), 1);
  6483. this.setScale_(this.adapter_.getBuffer(), 1);
  6484. }
  6485. }
  6486. }, {
  6487. key: 'setProgress',
  6488. value: function setProgress(value) {
  6489. if (this.determinate_) {
  6490. this.setScale_(this.adapter_.getPrimaryBar(), value);
  6491. }
  6492. }
  6493. }, {
  6494. key: 'setBuffer',
  6495. value: function setBuffer(value) {
  6496. if (this.determinate_) {
  6497. this.setScale_(this.adapter_.getBuffer(), value);
  6498. }
  6499. }
  6500. }, {
  6501. key: 'setReverse',
  6502. value: function setReverse(isReversed) {
  6503. this.reverse_ = isReversed;
  6504. if (this.reverse_) {
  6505. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].REVERSED_CLASS);
  6506. } else {
  6507. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].REVERSED_CLASS);
  6508. }
  6509. }
  6510. }, {
  6511. key: 'open',
  6512. value: function open() {
  6513. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CLOSED_CLASS);
  6514. }
  6515. }, {
  6516. key: 'close',
  6517. value: function close() {
  6518. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].CLOSED_CLASS);
  6519. }
  6520. }, {
  6521. key: 'setScale_',
  6522. value: function setScale_(el, scaleValue) {
  6523. var _this2 = this;
  6524. var value = 'scaleX(' + scaleValue + ')';
  6525. __WEBPACK_IMPORTED_MODULE_1__material_animation__["c" /* transformStyleProperties */].forEach(function (transformStyleProperty) {
  6526. _this2.adapter_.setStyle(el, transformStyleProperty, value);
  6527. });
  6528. }
  6529. }]);
  6530. return MDCLinearProgressFoundation;
  6531. }(__WEBPACK_IMPORTED_MODULE_0__material_base__["MDCFoundation"]);
  6532. /* harmony default export */ __webpack_exports__["a"] = (MDCLinearProgressFoundation);
  6533. /***/ }),
  6534. /* 59 */
  6535. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6536. "use strict";
  6537. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  6538. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  6539. /**
  6540. * Copyright 2017 Google Inc. All Rights Reserved.
  6541. *
  6542. * Licensed under the Apache License, Version 2.0 (the "License");
  6543. * you may not use this file except in compliance with the License.
  6544. * You may obtain a copy of the License at
  6545. *
  6546. * http://www.apache.org/licenses/LICENSE-2.0
  6547. *
  6548. * Unless required by applicable law or agreed to in writing, software
  6549. * distributed under the License is distributed on an "AS IS" BASIS,
  6550. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6551. * See the License for the specific language governing permissions and
  6552. * limitations under the License.
  6553. */
  6554. var cssClasses = {
  6555. CLOSED_CLASS: 'mdc-linear-progress--closed',
  6556. INDETERMINATE_CLASS: 'mdc-linear-progress--indeterminate',
  6557. REVERSED_CLASS: 'mdc-linear-progress--reversed'
  6558. };
  6559. var strings = {
  6560. PRIMARY_BAR_SELECTOR: '.mdc-linear-progress__primary-bar',
  6561. BUFFER_SELECTOR: '.mdc-linear-progress__buffer'
  6562. };
  6563. /***/ }),
  6564. /* 60 */
  6565. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6566. "use strict";
  6567. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCSimpleMenu; });
  6568. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(2);
  6569. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(61);
  6570. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util__ = __webpack_require__(10);
  6571. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  6572. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  6573. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6574. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  6575. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  6576. /**
  6577. * @license
  6578. * Copyright 2016 Google Inc. All Rights Reserved.
  6579. *
  6580. * Licensed under the Apache License, Version 2.0 (the "License");
  6581. * you may not use this file except in compliance with the License.
  6582. * You may obtain a copy of the License at
  6583. *
  6584. * http://www.apache.org/licenses/LICENSE-2.0
  6585. *
  6586. * Unless required by applicable law or agreed to in writing, software
  6587. * distributed under the License is distributed on an "AS IS" BASIS,
  6588. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6589. * See the License for the specific language governing permissions and
  6590. * limitations under the License.
  6591. */
  6592. /**
  6593. * @extends MDCComponent<!MDCSimpleMenuFoundation>
  6594. */
  6595. var MDCSimpleMenu = function (_MDCComponent) {
  6596. _inherits(MDCSimpleMenu, _MDCComponent);
  6597. /** @param {...?} args */
  6598. function MDCSimpleMenu() {
  6599. var _ref;
  6600. _classCallCheck(this, MDCSimpleMenu);
  6601. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  6602. args[_key] = arguments[_key];
  6603. }
  6604. /** @private {!Element} */
  6605. var _this = _possibleConstructorReturn(this, (_ref = MDCSimpleMenu.__proto__ || Object.getPrototypeOf(MDCSimpleMenu)).call.apply(_ref, [this].concat(args)));
  6606. _this.previousFocus_;
  6607. return _this;
  6608. }
  6609. /**
  6610. * @param {!Element} root
  6611. * @return {!MDCSimpleMenu}
  6612. */
  6613. _createClass(MDCSimpleMenu, [{
  6614. key: 'show',
  6615. /** @param {{focusIndex: ?number}=} options */
  6616. value: function show() {
  6617. var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  6618. _ref2$focusIndex = _ref2.focusIndex,
  6619. focusIndex = _ref2$focusIndex === undefined ? null : _ref2$focusIndex;
  6620. this.foundation_.open({ focusIndex: focusIndex });
  6621. }
  6622. }, {
  6623. key: 'hide',
  6624. value: function hide() {
  6625. this.foundation_.close();
  6626. }
  6627. /**
  6628. * Return the item container element inside the component.
  6629. * @return {?Element}
  6630. */
  6631. }, {
  6632. key: 'getDefaultFoundation',
  6633. /** @return {!MDCSimpleMenuFoundation} */
  6634. value: function getDefaultFoundation() {
  6635. var _this2 = this;
  6636. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]({
  6637. addClass: function addClass(className) {
  6638. return _this2.root_.classList.add(className);
  6639. },
  6640. removeClass: function removeClass(className) {
  6641. return _this2.root_.classList.remove(className);
  6642. },
  6643. hasClass: function hasClass(className) {
  6644. return _this2.root_.classList.contains(className);
  6645. },
  6646. hasNecessaryDom: function hasNecessaryDom() {
  6647. return Boolean(_this2.itemsContainer_);
  6648. },
  6649. getAttributeForEventTarget: function getAttributeForEventTarget(target, attributeName) {
  6650. return target.getAttribute(attributeName);
  6651. },
  6652. eventTargetHasClass: function eventTargetHasClass(target, className) {
  6653. return target.classList.contains(className);
  6654. },
  6655. getInnerDimensions: function getInnerDimensions() {
  6656. var itemsContainer = _this2.itemsContainer_;
  6657. return { width: itemsContainer.offsetWidth, height: itemsContainer.offsetHeight };
  6658. },
  6659. hasAnchor: function hasAnchor() {
  6660. return _this2.root_.parentElement && _this2.root_.parentElement.classList.contains('mdc-menu-anchor');
  6661. },
  6662. getAnchorDimensions: function getAnchorDimensions() {
  6663. return _this2.root_.parentElement.getBoundingClientRect();
  6664. },
  6665. getWindowDimensions: function getWindowDimensions() {
  6666. return { width: window.innerWidth, height: window.innerHeight };
  6667. },
  6668. setScale: function setScale(x, y) {
  6669. _this2.root_.style[Object(__WEBPACK_IMPORTED_MODULE_2__util__["getTransformPropertyName"])(window)] = 'scale(' + x + ', ' + y + ')';
  6670. },
  6671. setInnerScale: function setInnerScale(x, y) {
  6672. _this2.itemsContainer_.style[Object(__WEBPACK_IMPORTED_MODULE_2__util__["getTransformPropertyName"])(window)] = 'scale(' + x + ', ' + y + ')';
  6673. },
  6674. getNumberOfItems: function getNumberOfItems() {
  6675. return _this2.items.length;
  6676. },
  6677. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  6678. return _this2.root_.addEventListener(type, handler);
  6679. },
  6680. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  6681. return _this2.root_.removeEventListener(type, handler);
  6682. },
  6683. registerBodyClickHandler: function registerBodyClickHandler(handler) {
  6684. return document.body.addEventListener('click', handler);
  6685. },
  6686. deregisterBodyClickHandler: function deregisterBodyClickHandler(handler) {
  6687. return document.body.removeEventListener('click', handler);
  6688. },
  6689. getYParamsForItemAtIndex: function getYParamsForItemAtIndex(index) {
  6690. var _items$index = _this2.items[index],
  6691. top = _items$index.offsetTop,
  6692. height = _items$index.offsetHeight;
  6693. return { top: top, height: height };
  6694. },
  6695. setTransitionDelayForItemAtIndex: function setTransitionDelayForItemAtIndex(index, value) {
  6696. return _this2.items[index].style.setProperty('transition-delay', value);
  6697. },
  6698. getIndexForEventTarget: function getIndexForEventTarget(target) {
  6699. return _this2.items.indexOf(target);
  6700. },
  6701. notifySelected: function notifySelected(evtData) {
  6702. return _this2.emit(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.SELECTED_EVENT, {
  6703. index: evtData.index,
  6704. item: _this2.items[evtData.index]
  6705. });
  6706. },
  6707. notifyCancel: function notifyCancel() {
  6708. return _this2.emit(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.CANCEL_EVENT, {});
  6709. },
  6710. saveFocus: function saveFocus() {
  6711. _this2.previousFocus_ = document.activeElement;
  6712. },
  6713. restoreFocus: function restoreFocus() {
  6714. if (_this2.previousFocus_) {
  6715. _this2.previousFocus_.focus();
  6716. }
  6717. },
  6718. isFocused: function isFocused() {
  6719. return document.activeElement === _this2.root_;
  6720. },
  6721. focus: function focus() {
  6722. return _this2.root_.focus();
  6723. },
  6724. getFocusedItemIndex: function getFocusedItemIndex() {
  6725. return _this2.items.indexOf(document.activeElement);
  6726. },
  6727. focusItemAtIndex: function focusItemAtIndex(index) {
  6728. return _this2.items[index].focus();
  6729. },
  6730. isRtl: function isRtl() {
  6731. return getComputedStyle(_this2.root_).getPropertyValue('direction') === 'rtl';
  6732. },
  6733. setTransformOrigin: function setTransformOrigin(origin) {
  6734. _this2.root_.style[Object(__WEBPACK_IMPORTED_MODULE_2__util__["getTransformPropertyName"])(window) + '-origin'] = origin;
  6735. },
  6736. setPosition: function setPosition(position) {
  6737. _this2.root_.style.left = 'left' in position ? position.left : null;
  6738. _this2.root_.style.right = 'right' in position ? position.right : null;
  6739. _this2.root_.style.top = 'top' in position ? position.top : null;
  6740. _this2.root_.style.bottom = 'bottom' in position ? position.bottom : null;
  6741. },
  6742. getAccurateTime: function getAccurateTime() {
  6743. return window.performance.now();
  6744. }
  6745. });
  6746. }
  6747. }, {
  6748. key: 'open',
  6749. /** @return {boolean} */
  6750. get: function get() {
  6751. return this.foundation_.isOpen();
  6752. }
  6753. /** @param {boolean} value */
  6754. ,
  6755. set: function set(value) {
  6756. if (value) {
  6757. this.foundation_.open();
  6758. } else {
  6759. this.foundation_.close();
  6760. }
  6761. }
  6762. }, {
  6763. key: 'itemsContainer_',
  6764. get: function get() {
  6765. return this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.ITEMS_SELECTOR);
  6766. }
  6767. /**
  6768. * Return the items within the menu. Note that this only contains the set of elements within
  6769. * the items container that are proper list items, and not supplemental / presentational DOM
  6770. * elements.
  6771. * @return {!Array<!Element>}
  6772. */
  6773. }, {
  6774. key: 'items',
  6775. get: function get() {
  6776. var itemsContainer = this.itemsContainer_;
  6777. return [].slice.call(itemsContainer.querySelectorAll('.mdc-list-item[role]'));
  6778. }
  6779. }], [{
  6780. key: 'attachTo',
  6781. value: function attachTo(root) {
  6782. return new MDCSimpleMenu(root);
  6783. }
  6784. }]);
  6785. return MDCSimpleMenu;
  6786. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  6787. /***/ }),
  6788. /* 61 */
  6789. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6790. "use strict";
  6791. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  6792. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(62);
  6793. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(63);
  6794. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util__ = __webpack_require__(10);
  6795. 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; };
  6796. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  6797. 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; }
  6798. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6799. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  6800. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  6801. /**
  6802. * @license
  6803. * Copyright 2016 Google Inc. All Rights Reserved.
  6804. *
  6805. * Licensed under the Apache License, Version 2.0 (the "License");
  6806. * you may not use this file except in compliance with the License.
  6807. * You may obtain a copy of the License at
  6808. *
  6809. * http://www.apache.org/licenses/LICENSE-2.0
  6810. *
  6811. * Unless required by applicable law or agreed to in writing, software
  6812. * distributed under the License is distributed on an "AS IS" BASIS,
  6813. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  6814. * See the License for the specific language governing permissions and
  6815. * limitations under the License.
  6816. */
  6817. /**
  6818. * @extends {MDCFoundation<!MDCSimpleMenuAdapter>}
  6819. */
  6820. var MDCSimpleMenuFoundation = function (_MDCFoundation) {
  6821. _inherits(MDCSimpleMenuFoundation, _MDCFoundation);
  6822. _createClass(MDCSimpleMenuFoundation, null, [{
  6823. key: 'cssClasses',
  6824. /** @return enum{cssClasses} */
  6825. get: function get() {
  6826. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  6827. }
  6828. /** @return enum{strings} */
  6829. }, {
  6830. key: 'strings',
  6831. get: function get() {
  6832. return __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */];
  6833. }
  6834. /** @return enum{numbers} */
  6835. }, {
  6836. key: 'numbers',
  6837. get: function get() {
  6838. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */];
  6839. }
  6840. /**
  6841. * {@see MDCSimpleMenuAdapter} for typing information on parameters and return
  6842. * types.
  6843. * @return {!MDCSimpleMenuAdapter}
  6844. */
  6845. }, {
  6846. key: 'defaultAdapter',
  6847. get: function get() {
  6848. return (/** @type {!MDCSimpleMenuAdapter} */{
  6849. addClass: function addClass() {},
  6850. removeClass: function removeClass() {},
  6851. hasClass: function hasClass() {
  6852. return false;
  6853. },
  6854. hasNecessaryDom: function hasNecessaryDom() {
  6855. return false;
  6856. },
  6857. getAttributeForEventTarget: function getAttributeForEventTarget() {},
  6858. eventTargetHasClass: function eventTargetHasClass() {},
  6859. getInnerDimensions: function getInnerDimensions() {
  6860. return {};
  6861. },
  6862. hasAnchor: function hasAnchor() {
  6863. return false;
  6864. },
  6865. getAnchorDimensions: function getAnchorDimensions() {
  6866. return {};
  6867. },
  6868. getWindowDimensions: function getWindowDimensions() {
  6869. return {};
  6870. },
  6871. setScale: function setScale() {},
  6872. setInnerScale: function setInnerScale() {},
  6873. getNumberOfItems: function getNumberOfItems() {
  6874. return 0;
  6875. },
  6876. registerInteractionHandler: function registerInteractionHandler() {},
  6877. deregisterInteractionHandler: function deregisterInteractionHandler() {},
  6878. registerBodyClickHandler: function registerBodyClickHandler() {},
  6879. deregisterBodyClickHandler: function deregisterBodyClickHandler() {},
  6880. getYParamsForItemAtIndex: function getYParamsForItemAtIndex() {
  6881. return {};
  6882. },
  6883. setTransitionDelayForItemAtIndex: function setTransitionDelayForItemAtIndex() {},
  6884. getIndexForEventTarget: function getIndexForEventTarget() {
  6885. return 0;
  6886. },
  6887. notifySelected: function notifySelected() {},
  6888. notifyCancel: function notifyCancel() {},
  6889. saveFocus: function saveFocus() {},
  6890. restoreFocus: function restoreFocus() {},
  6891. isFocused: function isFocused() {
  6892. return false;
  6893. },
  6894. focus: function focus() {},
  6895. getFocusedItemIndex: function getFocusedItemIndex() {
  6896. return -1;
  6897. },
  6898. focusItemAtIndex: function focusItemAtIndex() {},
  6899. isRtl: function isRtl() {
  6900. return false;
  6901. },
  6902. setTransformOrigin: function setTransformOrigin() {},
  6903. setPosition: function setPosition() {},
  6904. getAccurateTime: function getAccurateTime() {
  6905. return 0;
  6906. }
  6907. }
  6908. );
  6909. }
  6910. /** @param {!MDCSimpleMenuAdapter} adapter */
  6911. }]);
  6912. function MDCSimpleMenuFoundation(adapter) {
  6913. _classCallCheck(this, MDCSimpleMenuFoundation);
  6914. /** @private {function(!Event)} */
  6915. var _this = _possibleConstructorReturn(this, (MDCSimpleMenuFoundation.__proto__ || Object.getPrototypeOf(MDCSimpleMenuFoundation)).call(this, _extends(MDCSimpleMenuFoundation.defaultAdapter, adapter)));
  6916. _this.clickHandler_ = function (evt) {
  6917. return _this.handlePossibleSelected_(evt);
  6918. };
  6919. /** @private {function(!Event)} */
  6920. _this.keydownHandler_ = function (evt) {
  6921. return _this.handleKeyboardDown_(evt);
  6922. };
  6923. /** @private {function(!Event)} */
  6924. _this.keyupHandler_ = function (evt) {
  6925. return _this.handleKeyboardUp_(evt);
  6926. };
  6927. /** @private {function(!Event)} */
  6928. _this.documentClickHandler_ = function (evt) {
  6929. return _this.handleDocumentClick_(evt);
  6930. };
  6931. /** @private {boolean} */
  6932. _this.isOpen_ = false;
  6933. /** @private {number} */
  6934. _this.startScaleX_ = 0;
  6935. /** @private {number} */
  6936. _this.startScaleY_ = 0;
  6937. /** @private {number} */
  6938. _this.targetScale_ = 1;
  6939. /** @private {number} */
  6940. _this.scaleX_ = 0;
  6941. /** @private {number} */
  6942. _this.scaleY_ = 0;
  6943. /** @private {boolean} */
  6944. _this.running_ = false;
  6945. /** @private {number} */
  6946. _this.selectedTriggerTimerId_ = 0;
  6947. /** @private {number} */
  6948. _this.animationRequestId_ = 0;
  6949. /** @private {!{ width: number, height: number }} */
  6950. _this.dimensions_;
  6951. /** @private {number} */
  6952. _this.startTime_;
  6953. /** @private {number} */
  6954. _this.itemHeight_;
  6955. return _this;
  6956. }
  6957. _createClass(MDCSimpleMenuFoundation, [{
  6958. key: 'init',
  6959. value: function init() {
  6960. var _MDCSimpleMenuFoundat = MDCSimpleMenuFoundation.cssClasses,
  6961. ROOT = _MDCSimpleMenuFoundat.ROOT,
  6962. OPEN = _MDCSimpleMenuFoundat.OPEN;
  6963. if (!this.adapter_.hasClass(ROOT)) {
  6964. throw new Error(ROOT + ' class required in root element.');
  6965. }
  6966. if (!this.adapter_.hasNecessaryDom()) {
  6967. throw new Error('Required DOM nodes missing in ' + ROOT + ' component.');
  6968. }
  6969. if (this.adapter_.hasClass(OPEN)) {
  6970. this.isOpen_ = true;
  6971. }
  6972. this.adapter_.registerInteractionHandler('click', this.clickHandler_);
  6973. this.adapter_.registerInteractionHandler('keyup', this.keyupHandler_);
  6974. this.adapter_.registerInteractionHandler('keydown', this.keydownHandler_);
  6975. }
  6976. }, {
  6977. key: 'destroy',
  6978. value: function destroy() {
  6979. clearTimeout(this.selectedTriggerTimerId_);
  6980. // Cancel any currently running animations.
  6981. cancelAnimationFrame(this.animationRequestId_);
  6982. this.adapter_.deregisterInteractionHandler('click', this.clickHandler_);
  6983. this.adapter_.deregisterInteractionHandler('keyup', this.keyupHandler_);
  6984. this.adapter_.deregisterInteractionHandler('keydown', this.keydownHandler_);
  6985. this.adapter_.deregisterBodyClickHandler(this.documentClickHandler_);
  6986. }
  6987. /**
  6988. * Calculates transition delays for individual menu items, so that they fade in one at a time.
  6989. * @private
  6990. */
  6991. }, {
  6992. key: 'applyTransitionDelays_',
  6993. value: function applyTransitionDelays_() {
  6994. var _MDCSimpleMenuFoundat2 = MDCSimpleMenuFoundation.cssClasses,
  6995. BOTTOM_LEFT = _MDCSimpleMenuFoundat2.BOTTOM_LEFT,
  6996. BOTTOM_RIGHT = _MDCSimpleMenuFoundat2.BOTTOM_RIGHT;
  6997. var numItems = this.adapter_.getNumberOfItems();
  6998. var height = this.dimensions_.height;
  6999. var transitionDuration = MDCSimpleMenuFoundation.numbers.TRANSITION_DURATION_MS / 1000;
  7000. var start = MDCSimpleMenuFoundation.numbers.TRANSITION_SCALE_ADJUSTMENT_Y;
  7001. for (var index = 0; index < numItems; index++) {
  7002. var _adapter_$getYParamsF = this.adapter_.getYParamsForItemAtIndex(index),
  7003. itemTop = _adapter_$getYParamsF.top,
  7004. itemHeight = _adapter_$getYParamsF.height;
  7005. this.itemHeight_ = itemHeight;
  7006. var itemDelayFraction = itemTop / height;
  7007. if (this.adapter_.hasClass(BOTTOM_LEFT) || this.adapter_.hasClass(BOTTOM_RIGHT)) {
  7008. itemDelayFraction = (height - itemTop - itemHeight) / height;
  7009. }
  7010. var itemDelay = (start + itemDelayFraction * (1 - start)) * transitionDuration;
  7011. // Use toFixed() here to normalize CSS unit precision across browsers
  7012. this.adapter_.setTransitionDelayForItemAtIndex(index, itemDelay.toFixed(3) + 's');
  7013. }
  7014. }
  7015. /**
  7016. * Removes transition delays from menu items.
  7017. * @private
  7018. */
  7019. }, {
  7020. key: 'removeTransitionDelays_',
  7021. value: function removeTransitionDelays_() {
  7022. var numItems = this.adapter_.getNumberOfItems();
  7023. for (var i = 0; i < numItems; i++) {
  7024. this.adapter_.setTransitionDelayForItemAtIndex(i, null);
  7025. }
  7026. }
  7027. /**
  7028. * Animates menu opening or closing.
  7029. * @private
  7030. */
  7031. }, {
  7032. key: 'animationLoop_',
  7033. value: function animationLoop_() {
  7034. var _this2 = this;
  7035. var time = this.adapter_.getAccurateTime();
  7036. var _MDCSimpleMenuFoundat3 = MDCSimpleMenuFoundation.numbers,
  7037. TRANSITION_DURATION_MS = _MDCSimpleMenuFoundat3.TRANSITION_DURATION_MS,
  7038. TRANSITION_X1 = _MDCSimpleMenuFoundat3.TRANSITION_X1,
  7039. TRANSITION_Y1 = _MDCSimpleMenuFoundat3.TRANSITION_Y1,
  7040. TRANSITION_X2 = _MDCSimpleMenuFoundat3.TRANSITION_X2,
  7041. TRANSITION_Y2 = _MDCSimpleMenuFoundat3.TRANSITION_Y2,
  7042. TRANSITION_SCALE_ADJUSTMENT_X = _MDCSimpleMenuFoundat3.TRANSITION_SCALE_ADJUSTMENT_X,
  7043. TRANSITION_SCALE_ADJUSTMENT_Y = _MDCSimpleMenuFoundat3.TRANSITION_SCALE_ADJUSTMENT_Y;
  7044. var currentTime = Object(__WEBPACK_IMPORTED_MODULE_3__util__["clamp"])((time - this.startTime_) / TRANSITION_DURATION_MS);
  7045. // Animate X axis very slowly, so that only the Y axis animation is visible during fade-out.
  7046. var currentTimeX = Object(__WEBPACK_IMPORTED_MODULE_3__util__["clamp"])((currentTime - TRANSITION_SCALE_ADJUSTMENT_X) / (1 - TRANSITION_SCALE_ADJUSTMENT_X));
  7047. // No time-shifting on the Y axis when closing.
  7048. var currentTimeY = currentTime;
  7049. var startScaleY = this.startScaleY_;
  7050. if (this.targetScale_ === 1) {
  7051. // Start with the menu at the height of a single item.
  7052. if (this.itemHeight_) {
  7053. startScaleY = Math.max(this.itemHeight_ / this.dimensions_.height, startScaleY);
  7054. }
  7055. // X axis moves faster, so time-shift forward.
  7056. currentTimeX = Object(__WEBPACK_IMPORTED_MODULE_3__util__["clamp"])(currentTime + TRANSITION_SCALE_ADJUSTMENT_X);
  7057. // Y axis moves slower, so time-shift backwards and adjust speed by the difference.
  7058. currentTimeY = Object(__WEBPACK_IMPORTED_MODULE_3__util__["clamp"])((currentTime - TRANSITION_SCALE_ADJUSTMENT_Y) / (1 - TRANSITION_SCALE_ADJUSTMENT_Y));
  7059. }
  7060. // Apply cubic bezier easing independently to each axis.
  7061. var easeX = Object(__WEBPACK_IMPORTED_MODULE_3__util__["bezierProgress"])(currentTimeX, TRANSITION_X1, TRANSITION_Y1, TRANSITION_X2, TRANSITION_Y2);
  7062. var easeY = Object(__WEBPACK_IMPORTED_MODULE_3__util__["bezierProgress"])(currentTimeY, TRANSITION_X1, TRANSITION_Y1, TRANSITION_X2, TRANSITION_Y2);
  7063. // Calculate the scales to apply to the outer container and inner container.
  7064. this.scaleX_ = this.startScaleX_ + (this.targetScale_ - this.startScaleX_) * easeX;
  7065. var invScaleX = 1 / (this.scaleX_ === 0 ? 1 : this.scaleX_);
  7066. this.scaleY_ = startScaleY + (this.targetScale_ - startScaleY) * easeY;
  7067. var invScaleY = 1 / (this.scaleY_ === 0 ? 1 : this.scaleY_);
  7068. // Apply scales.
  7069. this.adapter_.setScale(this.scaleX_, this.scaleY_);
  7070. this.adapter_.setInnerScale(invScaleX, invScaleY);
  7071. // Stop animation when we've covered the entire 0 - 1 range of time.
  7072. if (currentTime < 1) {
  7073. this.animationRequestId_ = requestAnimationFrame(function () {
  7074. return _this2.animationLoop_();
  7075. });
  7076. } else {
  7077. this.animationRequestId_ = 0;
  7078. this.running_ = false;
  7079. this.adapter_.removeClass(MDCSimpleMenuFoundation.cssClasses.ANIMATING);
  7080. }
  7081. }
  7082. /**
  7083. * Starts the open or close animation.
  7084. * @private
  7085. */
  7086. }, {
  7087. key: 'animateMenu_',
  7088. value: function animateMenu_() {
  7089. var _this3 = this;
  7090. this.startTime_ = this.adapter_.getAccurateTime();
  7091. this.startScaleX_ = this.scaleX_;
  7092. this.startScaleY_ = this.scaleY_;
  7093. this.targetScale_ = this.isOpen_ ? 1 : 0;
  7094. if (!this.running_) {
  7095. this.running_ = true;
  7096. this.animationRequestId_ = requestAnimationFrame(function () {
  7097. return _this3.animationLoop_();
  7098. });
  7099. }
  7100. }
  7101. /**
  7102. * @param {?number} focusIndex
  7103. * @private
  7104. */
  7105. }, {
  7106. key: 'focusOnOpen_',
  7107. value: function focusOnOpen_(focusIndex) {
  7108. if (focusIndex === null) {
  7109. // First, try focusing the menu.
  7110. this.adapter_.focus();
  7111. // If that doesn't work, focus first item instead.
  7112. if (!this.adapter_.isFocused()) {
  7113. this.adapter_.focusItemAtIndex(0);
  7114. }
  7115. } else {
  7116. this.adapter_.focusItemAtIndex(focusIndex);
  7117. }
  7118. }
  7119. /**
  7120. * Handle clicks and cancel the menu if not a list item
  7121. * @param {!Event} evt
  7122. * @private
  7123. */
  7124. }, {
  7125. key: 'handleDocumentClick_',
  7126. value: function handleDocumentClick_(evt) {
  7127. var el = evt.target;
  7128. while (el && el !== document.documentElement) {
  7129. if (this.adapter_.eventTargetHasClass(el, __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].LIST_ITEM)) {
  7130. return;
  7131. }
  7132. el = el.parentNode;
  7133. }
  7134. this.adapter_.notifyCancel();
  7135. this.close(evt);
  7136. }
  7137. }, {
  7138. key: 'handleKeyboardDown_',
  7139. /**
  7140. * Handle keys that we want to repeat on hold (tab and arrows).
  7141. * @param {!Event} evt
  7142. * @return {boolean}
  7143. * @private
  7144. */
  7145. value: function handleKeyboardDown_(evt) {
  7146. // Do nothing if Alt, Ctrl or Meta are pressed.
  7147. if (evt.altKey || evt.ctrlKey || evt.metaKey) {
  7148. return true;
  7149. }
  7150. var keyCode = evt.keyCode,
  7151. key = evt.key,
  7152. shiftKey = evt.shiftKey;
  7153. var isTab = key === 'Tab' || keyCode === 9;
  7154. var isArrowUp = key === 'ArrowUp' || keyCode === 38;
  7155. var isArrowDown = key === 'ArrowDown' || keyCode === 40;
  7156. var isSpace = key === 'Space' || keyCode === 32;
  7157. var focusedItemIndex = this.adapter_.getFocusedItemIndex();
  7158. var lastItemIndex = this.adapter_.getNumberOfItems() - 1;
  7159. if (shiftKey && isTab && focusedItemIndex === 0) {
  7160. this.adapter_.focusItemAtIndex(lastItemIndex);
  7161. evt.preventDefault();
  7162. return false;
  7163. }
  7164. if (!shiftKey && isTab && focusedItemIndex === lastItemIndex) {
  7165. this.adapter_.focusItemAtIndex(0);
  7166. evt.preventDefault();
  7167. return false;
  7168. }
  7169. // Ensure Arrow{Up,Down} and space do not cause inadvertent scrolling
  7170. if (isArrowUp || isArrowDown || isSpace) {
  7171. evt.preventDefault();
  7172. }
  7173. if (isArrowUp) {
  7174. if (focusedItemIndex === 0 || this.adapter_.isFocused()) {
  7175. this.adapter_.focusItemAtIndex(lastItemIndex);
  7176. } else {
  7177. this.adapter_.focusItemAtIndex(focusedItemIndex - 1);
  7178. }
  7179. } else if (isArrowDown) {
  7180. if (focusedItemIndex === lastItemIndex || this.adapter_.isFocused()) {
  7181. this.adapter_.focusItemAtIndex(0);
  7182. } else {
  7183. this.adapter_.focusItemAtIndex(focusedItemIndex + 1);
  7184. }
  7185. }
  7186. return true;
  7187. }
  7188. /**
  7189. * Handle keys that we don't want to repeat on hold (Enter, Space, Escape).
  7190. * @param {!Event} evt
  7191. * @return {boolean}
  7192. * @private
  7193. */
  7194. }, {
  7195. key: 'handleKeyboardUp_',
  7196. value: function handleKeyboardUp_(evt) {
  7197. // Do nothing if Alt, Ctrl or Meta are pressed.
  7198. if (evt.altKey || evt.ctrlKey || evt.metaKey) {
  7199. return true;
  7200. }
  7201. var keyCode = evt.keyCode,
  7202. key = evt.key;
  7203. var isEnter = key === 'Enter' || keyCode === 13;
  7204. var isSpace = key === 'Space' || keyCode === 32;
  7205. var isEscape = key === 'Escape' || keyCode === 27;
  7206. if (isEnter || isSpace) {
  7207. this.handlePossibleSelected_(evt);
  7208. }
  7209. if (isEscape) {
  7210. this.adapter_.notifyCancel();
  7211. this.close();
  7212. }
  7213. return true;
  7214. }
  7215. /**
  7216. * @param {!Event} evt
  7217. * @private
  7218. */
  7219. }, {
  7220. key: 'handlePossibleSelected_',
  7221. value: function handlePossibleSelected_(evt) {
  7222. var _this4 = this;
  7223. if (this.adapter_.getAttributeForEventTarget(evt.target, __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].ARIA_DISABLED_ATTR) === 'true') {
  7224. return;
  7225. }
  7226. var targetIndex = this.adapter_.getIndexForEventTarget(evt.target);
  7227. if (targetIndex < 0) {
  7228. return;
  7229. }
  7230. // Debounce multiple selections
  7231. if (this.selectedTriggerTimerId_) {
  7232. return;
  7233. }
  7234. this.selectedTriggerTimerId_ = setTimeout(function () {
  7235. _this4.selectedTriggerTimerId_ = 0;
  7236. _this4.close();
  7237. _this4.adapter_.notifySelected({ index: targetIndex });
  7238. }, __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* numbers */].SELECTED_TRIGGER_DELAY);
  7239. }
  7240. /** @private */
  7241. }, {
  7242. key: 'autoPosition_',
  7243. value: function autoPosition_() {
  7244. var _position;
  7245. if (!this.adapter_.hasAnchor()) {
  7246. return;
  7247. }
  7248. // Defaults: open from the top left.
  7249. var vertical = 'top';
  7250. var horizontal = 'left';
  7251. var anchor = this.adapter_.getAnchorDimensions();
  7252. var windowDimensions = this.adapter_.getWindowDimensions();
  7253. var topOverflow = anchor.top + this.dimensions_.height - windowDimensions.height;
  7254. var bottomOverflow = this.dimensions_.height - anchor.bottom;
  7255. var extendsBeyondTopBounds = topOverflow > 0;
  7256. if (extendsBeyondTopBounds) {
  7257. if (bottomOverflow < topOverflow) {
  7258. vertical = 'bottom';
  7259. }
  7260. }
  7261. var leftOverflow = anchor.left + this.dimensions_.width - windowDimensions.width;
  7262. var rightOverflow = this.dimensions_.width - anchor.right;
  7263. var extendsBeyondLeftBounds = leftOverflow > 0;
  7264. var extendsBeyondRightBounds = rightOverflow > 0;
  7265. if (this.adapter_.isRtl()) {
  7266. // In RTL, we prefer to open from the right.
  7267. horizontal = 'right';
  7268. if (extendsBeyondRightBounds && leftOverflow < rightOverflow) {
  7269. horizontal = 'left';
  7270. }
  7271. } else if (extendsBeyondLeftBounds && rightOverflow < leftOverflow) {
  7272. horizontal = 'right';
  7273. }
  7274. var position = (_position = {}, _defineProperty(_position, horizontal, '0'), _defineProperty(_position, vertical, '0'), _position);
  7275. this.adapter_.setTransformOrigin(vertical + ' ' + horizontal);
  7276. this.adapter_.setPosition(position);
  7277. }
  7278. /**
  7279. * Open the menu.
  7280. * @param {{focusIndex: ?number}=} options
  7281. */
  7282. }, {
  7283. key: 'open',
  7284. value: function open() {
  7285. var _this5 = this;
  7286. var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
  7287. _ref$focusIndex = _ref.focusIndex,
  7288. focusIndex = _ref$focusIndex === undefined ? null : _ref$focusIndex;
  7289. this.adapter_.saveFocus();
  7290. this.adapter_.addClass(MDCSimpleMenuFoundation.cssClasses.ANIMATING);
  7291. this.animationRequestId_ = requestAnimationFrame(function () {
  7292. _this5.dimensions_ = _this5.adapter_.getInnerDimensions();
  7293. _this5.applyTransitionDelays_();
  7294. _this5.autoPosition_();
  7295. _this5.animateMenu_();
  7296. _this5.adapter_.addClass(MDCSimpleMenuFoundation.cssClasses.OPEN);
  7297. _this5.focusOnOpen_(focusIndex);
  7298. _this5.adapter_.registerBodyClickHandler(_this5.documentClickHandler_);
  7299. });
  7300. this.isOpen_ = true;
  7301. }
  7302. /**
  7303. * Closes the menu.
  7304. * @param {Event=} evt
  7305. */
  7306. }, {
  7307. key: 'close',
  7308. value: function close() {
  7309. var _this6 = this;
  7310. var evt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  7311. var targetIsDisabled = evt ? this.adapter_.getAttributeForEventTarget(evt.target, __WEBPACK_IMPORTED_MODULE_2__constants__["c" /* strings */].ARIA_DISABLED_ATTR) === 'true' : false;
  7312. if (targetIsDisabled) {
  7313. return;
  7314. }
  7315. this.adapter_.deregisterBodyClickHandler(this.documentClickHandler_);
  7316. this.adapter_.addClass(MDCSimpleMenuFoundation.cssClasses.ANIMATING);
  7317. requestAnimationFrame(function () {
  7318. _this6.removeTransitionDelays_();
  7319. _this6.animateMenu_();
  7320. _this6.adapter_.removeClass(MDCSimpleMenuFoundation.cssClasses.OPEN);
  7321. });
  7322. this.isOpen_ = false;
  7323. this.adapter_.restoreFocus();
  7324. }
  7325. /** @return {boolean} */
  7326. }, {
  7327. key: 'isOpen',
  7328. value: function isOpen() {
  7329. return this.isOpen_;
  7330. }
  7331. }]);
  7332. return MDCSimpleMenuFoundation;
  7333. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  7334. /* harmony default export */ __webpack_exports__["a"] = (MDCSimpleMenuFoundation);
  7335. /***/ }),
  7336. /* 62 */
  7337. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7338. "use strict";
  7339. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  7340. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7341. /**
  7342. * @license
  7343. * Copyright 2016 Google Inc. All Rights Reserved.
  7344. *
  7345. * Licensed under the Apache License, Version 2.0 (the "License");
  7346. * you may not use this file except in compliance with the License.
  7347. * You may obtain a copy of the License at
  7348. *
  7349. * http://www.apache.org/licenses/LICENSE-2.0
  7350. *
  7351. * Unless required by applicable law or agreed to in writing, software
  7352. * distributed under the License is distributed on an "AS IS" BASIS,
  7353. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7354. * See the License for the specific language governing permissions and
  7355. * limitations under the License.
  7356. */
  7357. /* eslint no-unused-vars: [2, {"args": "none"}] */
  7358. /**
  7359. * Adapter for MDC Simple Menu. Provides an interface for managing
  7360. * - classes
  7361. * - dom
  7362. * - focus
  7363. * - position
  7364. * - dimensions
  7365. * - event handlers
  7366. *
  7367. * Additionally, provides type information for the adapter to the Closure
  7368. * compiler.
  7369. *
  7370. * Implement this adapter for your framework of choice to delegate updates to
  7371. * the component in your framework of choice. See architecture documentation
  7372. * for more details.
  7373. * https://github.com/material-components/material-components-web/blob/master/docs/architecture.md
  7374. *
  7375. * @record
  7376. */
  7377. var MDCSimpleMenuAdapter = function () {
  7378. function MDCSimpleMenuAdapter() {
  7379. _classCallCheck(this, MDCSimpleMenuAdapter);
  7380. }
  7381. _createClass(MDCSimpleMenuAdapter, [{
  7382. key: "addClass",
  7383. /** @param {string} className */
  7384. value: function addClass(className) {}
  7385. /** @param {string} className */
  7386. }, {
  7387. key: "removeClass",
  7388. value: function removeClass(className) {}
  7389. /**
  7390. * @param {string} className
  7391. * @return {boolean}
  7392. */
  7393. }, {
  7394. key: "hasClass",
  7395. value: function hasClass(className) {}
  7396. /** @return {boolean} */
  7397. }, {
  7398. key: "hasNecessaryDom",
  7399. value: function hasNecessaryDom() {}
  7400. /**
  7401. * @param {EventTarget} target
  7402. * @param {string} attributeName
  7403. * @return {string}
  7404. */
  7405. }, {
  7406. key: "getAttributeForEventTarget",
  7407. value: function getAttributeForEventTarget(target, attributeName) {}
  7408. /**
  7409. * @param {EventTarget} target
  7410. * @param {string} className
  7411. * @return {boolean}
  7412. */
  7413. }, {
  7414. key: "eventTargetHasClass",
  7415. value: function eventTargetHasClass(target, className) {}
  7416. /** @return {{ width: number, height: number }} */
  7417. }, {
  7418. key: "getInnerDimensions",
  7419. value: function getInnerDimensions() {}
  7420. /** @return {boolean} */
  7421. }, {
  7422. key: "hasAnchor",
  7423. value: function hasAnchor() {}
  7424. /** @return {{width: number, height: number, top: number, right: number, bottom: number, left: number}} */
  7425. }, {
  7426. key: "getAnchorDimensions",
  7427. value: function getAnchorDimensions() {}
  7428. /** @return {{ width: number, height: number }} */
  7429. }, {
  7430. key: "getWindowDimensions",
  7431. value: function getWindowDimensions() {}
  7432. /**
  7433. * @param {number} x
  7434. * @param {number} y
  7435. */
  7436. }, {
  7437. key: "setScale",
  7438. value: function setScale(x, y) {}
  7439. /**
  7440. * @param {number} x
  7441. * @param {number} y
  7442. */
  7443. }, {
  7444. key: "setInnerScale",
  7445. value: function setInnerScale(x, y) {}
  7446. /** @return {number} */
  7447. }, {
  7448. key: "getNumberOfItems",
  7449. value: function getNumberOfItems() {}
  7450. /**
  7451. * @param {string} type
  7452. * @param {function(!Event)} handler
  7453. */
  7454. }, {
  7455. key: "registerInteractionHandler",
  7456. value: function registerInteractionHandler(type, handler) {}
  7457. /**
  7458. * @param {string} type
  7459. * @param {function(!Event)} handler
  7460. */
  7461. }, {
  7462. key: "deregisterInteractionHandler",
  7463. value: function deregisterInteractionHandler(type, handler) {}
  7464. /** @param {function(!Event)} handler */
  7465. }, {
  7466. key: "registerBodyClickHandler",
  7467. value: function registerBodyClickHandler(handler) {}
  7468. /** @param {function(!Event)} handler */
  7469. }, {
  7470. key: "deregisterBodyClickHandler",
  7471. value: function deregisterBodyClickHandler(handler) {}
  7472. /**
  7473. * @param {number} index
  7474. * @return {{top: number, height: number}}
  7475. */
  7476. }, {
  7477. key: "getYParamsForItemAtIndex",
  7478. value: function getYParamsForItemAtIndex(index) {}
  7479. /**
  7480. * @param {number} index
  7481. * @param {string|null} value
  7482. */
  7483. }, {
  7484. key: "setTransitionDelayForItemAtIndex",
  7485. value: function setTransitionDelayForItemAtIndex(index, value) {}
  7486. /**
  7487. * @param {EventTarget} target
  7488. * @return {number}
  7489. */
  7490. }, {
  7491. key: "getIndexForEventTarget",
  7492. value: function getIndexForEventTarget(target) {}
  7493. /** @param {{index: number}} evtData */
  7494. }, {
  7495. key: "notifySelected",
  7496. value: function notifySelected(evtData) {}
  7497. }, {
  7498. key: "notifyCancel",
  7499. value: function notifyCancel() {}
  7500. }, {
  7501. key: "saveFocus",
  7502. value: function saveFocus() {}
  7503. }, {
  7504. key: "restoreFocus",
  7505. value: function restoreFocus() {}
  7506. /** @return {boolean} */
  7507. }, {
  7508. key: "isFocused",
  7509. value: function isFocused() {}
  7510. }, {
  7511. key: "focus",
  7512. value: function focus() {}
  7513. /** @return {number} */
  7514. }, {
  7515. key: "getFocusedItemIndex",
  7516. value: function getFocusedItemIndex() /* number */{}
  7517. /** @param {number} index */
  7518. }, {
  7519. key: "focusItemAtIndex",
  7520. value: function focusItemAtIndex(index) {}
  7521. /** @return {boolean} */
  7522. }, {
  7523. key: "isRtl",
  7524. value: function isRtl() {}
  7525. /** @param {string} origin */
  7526. }, {
  7527. key: "setTransformOrigin",
  7528. value: function setTransformOrigin(origin) {}
  7529. /** @param {{
  7530. * top: (string|undefined),
  7531. * right: (string|undefined),
  7532. * bottom: (string|undefined),
  7533. * left: (string|undefined)
  7534. * }} position */
  7535. }, {
  7536. key: "setPosition",
  7537. value: function setPosition(position) {}
  7538. /** @return {number} */
  7539. }, {
  7540. key: "getAccurateTime",
  7541. value: function getAccurateTime() {}
  7542. }]);
  7543. return MDCSimpleMenuAdapter;
  7544. }();
  7545. /* unused harmony default export */ var _unused_webpack_default_export = (MDCSimpleMenuAdapter);
  7546. /***/ }),
  7547. /* 63 */
  7548. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7549. "use strict";
  7550. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  7551. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  7552. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  7553. /**
  7554. * @license
  7555. * Copyright 2016 Google Inc. All Rights Reserved.
  7556. *
  7557. * Licensed under the Apache License, Version 2.0 (the "License");
  7558. * you may not use this file except in compliance with the License.
  7559. * You may obtain a copy of the License at
  7560. *
  7561. * http://www.apache.org/licenses/LICENSE-2.0
  7562. *
  7563. * Unless required by applicable law or agreed to in writing, software
  7564. * distributed under the License is distributed on an "AS IS" BASIS,
  7565. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7566. * See the License for the specific language governing permissions and
  7567. * limitations under the License.
  7568. */
  7569. /** @enum {string} */
  7570. var cssClasses = {
  7571. ROOT: 'mdc-simple-menu',
  7572. OPEN: 'mdc-simple-menu--open',
  7573. ANIMATING: 'mdc-simple-menu--animating',
  7574. TOP_RIGHT: 'mdc-simple-menu--open-from-top-right',
  7575. BOTTOM_LEFT: 'mdc-simple-menu--open-from-bottom-left',
  7576. BOTTOM_RIGHT: 'mdc-simple-menu--open-from-bottom-right',
  7577. LIST_ITEM: 'mdc-list-item'
  7578. };
  7579. /** @enum {string} */
  7580. var strings = {
  7581. ITEMS_SELECTOR: '.mdc-simple-menu__items',
  7582. SELECTED_EVENT: 'MDCSimpleMenu:selected',
  7583. CANCEL_EVENT: 'MDCSimpleMenu:cancel',
  7584. ARIA_DISABLED_ATTR: 'aria-disabled'
  7585. };
  7586. /** @enum {number} */
  7587. var numbers = {
  7588. // Amount of time to wait before triggering a selected event on the menu. Note that this time
  7589. // will most likely be bumped up once interactive lists are supported to allow for the ripple to
  7590. // animate before closing the menu
  7591. SELECTED_TRIGGER_DELAY: 50,
  7592. // Total duration of the menu animation.
  7593. TRANSITION_DURATION_MS: 300,
  7594. // The menu starts its open animation with the X axis at this time value (0 - 1).
  7595. TRANSITION_SCALE_ADJUSTMENT_X: 0.5,
  7596. // The time value the menu waits until the animation starts on the Y axis (0 - 1).
  7597. TRANSITION_SCALE_ADJUSTMENT_Y: 0.2,
  7598. // The cubic bezier control points for the animation (cubic-bezier(0, 0, 0.2, 1)).
  7599. TRANSITION_X1: 0,
  7600. TRANSITION_Y1: 0,
  7601. TRANSITION_X2: 0.2,
  7602. TRANSITION_Y2: 1
  7603. };
  7604. /***/ }),
  7605. /* 64 */
  7606. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7607. "use strict";
  7608. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  7609. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCRadio", function() { return MDCRadio; });
  7610. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(2);
  7611. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_selection_control__ = __webpack_require__(4);
  7612. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(65);
  7613. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__material_ripple__ = __webpack_require__(3);
  7614. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCRadioFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  7615. 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; };
  7616. 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); } };
  7617. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  7618. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7619. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  7620. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  7621. /**
  7622. * @license
  7623. * Copyright 2016 Google Inc. All Rights Reserved.
  7624. *
  7625. * Licensed under the Apache License, Version 2.0 (the "License");
  7626. * you may not use this file except in compliance with the License.
  7627. * You may obtain a copy of the License at
  7628. *
  7629. * http://www.apache.org/licenses/LICENSE-2.0
  7630. *
  7631. * Unless required by applicable law or agreed to in writing, software
  7632. * distributed under the License is distributed on an "AS IS" BASIS,
  7633. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7634. * See the License for the specific language governing permissions and
  7635. * limitations under the License.
  7636. */
  7637. /* eslint-disable no-unused-vars */
  7638. /* eslint-enable no-unused-vars */
  7639. /**
  7640. * @extends MDCComponent<!MDCRadioFoundation>
  7641. * @implements {MDCSelectionControl}
  7642. */
  7643. var MDCRadio = function (_MDCComponent) {
  7644. _inherits(MDCRadio, _MDCComponent);
  7645. _createClass(MDCRadio, [{
  7646. key: 'checked',
  7647. /** @return {boolean} */
  7648. get: function get() {
  7649. return this.foundation_.isChecked();
  7650. }
  7651. /** @param {boolean} checked */
  7652. ,
  7653. set: function set(checked) {
  7654. this.foundation_.setChecked(checked);
  7655. }
  7656. /** @return {boolean} */
  7657. }, {
  7658. key: 'disabled',
  7659. get: function get() {
  7660. return this.foundation_.isDisabled();
  7661. }
  7662. /** @param {boolean} disabled */
  7663. ,
  7664. set: function set(disabled) {
  7665. this.foundation_.setDisabled(disabled);
  7666. }
  7667. /** @return {?string} */
  7668. }, {
  7669. key: 'value',
  7670. get: function get() {
  7671. return this.foundation_.getValue();
  7672. }
  7673. /** @param {?string} value */
  7674. ,
  7675. set: function set(value) {
  7676. this.foundation_.setValue(value);
  7677. }
  7678. /** @return {!MDCRipple} */
  7679. }, {
  7680. key: 'ripple',
  7681. get: function get() {
  7682. return this.ripple_;
  7683. }
  7684. }], [{
  7685. key: 'attachTo',
  7686. value: function attachTo(root) {
  7687. return new MDCRadio(root);
  7688. }
  7689. }]);
  7690. function MDCRadio() {
  7691. var _ref;
  7692. _classCallCheck(this, MDCRadio);
  7693. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  7694. args[_key] = arguments[_key];
  7695. }
  7696. /** @private {!MDCRipple} */
  7697. var _this = _possibleConstructorReturn(this, (_ref = MDCRadio.__proto__ || Object.getPrototypeOf(MDCRadio)).call.apply(_ref, [this].concat(args)));
  7698. _this.ripple_ = _this.initRipple_();
  7699. return _this;
  7700. }
  7701. /**
  7702. * @return {!MDCRipple}
  7703. * @private
  7704. */
  7705. _createClass(MDCRadio, [{
  7706. key: 'initRipple_',
  7707. value: function initRipple_() {
  7708. var _this2 = this;
  7709. var adapter = _extends(__WEBPACK_IMPORTED_MODULE_3__material_ripple__["MDCRipple"].createAdapter(this), {
  7710. isUnbounded: function isUnbounded() {
  7711. return true;
  7712. },
  7713. // Radio buttons technically go "active" whenever there is *any* keyboard interaction. This is not the
  7714. // UI we desire.
  7715. isSurfaceActive: function isSurfaceActive() {
  7716. return false;
  7717. },
  7718. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  7719. return _this2.nativeControl_.addEventListener(type, handler);
  7720. },
  7721. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  7722. return _this2.nativeControl_.removeEventListener(type, handler);
  7723. },
  7724. computeBoundingRect: function computeBoundingRect() {
  7725. var _root_$getBoundingCli = _this2.root_.getBoundingClientRect(),
  7726. left = _root_$getBoundingCli.left,
  7727. top = _root_$getBoundingCli.top;
  7728. var DIM = 40;
  7729. return {
  7730. top: top,
  7731. left: left,
  7732. right: left + DIM,
  7733. bottom: top + DIM,
  7734. width: DIM,
  7735. height: DIM
  7736. };
  7737. }
  7738. });
  7739. var foundation = new __WEBPACK_IMPORTED_MODULE_3__material_ripple__["MDCRippleFoundation"](adapter);
  7740. return new __WEBPACK_IMPORTED_MODULE_3__material_ripple__["MDCRipple"](this.root_, foundation);
  7741. }
  7742. /**
  7743. * Returns the state of the native control element, or null if the native control element is not present.
  7744. * @return {?MDCSelectionControlState}
  7745. * @private
  7746. */
  7747. }, {
  7748. key: 'destroy',
  7749. value: function destroy() {
  7750. this.ripple_.destroy();
  7751. _get(MDCRadio.prototype.__proto__ || Object.getPrototypeOf(MDCRadio.prototype), 'destroy', this).call(this);
  7752. }
  7753. /** @return {!MDCRadioFoundation} */
  7754. }, {
  7755. key: 'getDefaultFoundation',
  7756. value: function getDefaultFoundation() {
  7757. var _this3 = this;
  7758. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]({
  7759. addClass: function addClass(className) {
  7760. return _this3.root_.classList.add(className);
  7761. },
  7762. removeClass: function removeClass(className) {
  7763. return _this3.root_.classList.remove(className);
  7764. },
  7765. getNativeControl: function getNativeControl() {
  7766. return _this3.root_.querySelector(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.NATIVE_CONTROL_SELECTOR);
  7767. }
  7768. });
  7769. }
  7770. }, {
  7771. key: 'nativeControl_',
  7772. get: function get() {
  7773. var NATIVE_CONTROL_SELECTOR = __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.NATIVE_CONTROL_SELECTOR;
  7774. var el = /** @type {?MDCSelectionControlState} */this.root_.querySelector(NATIVE_CONTROL_SELECTOR);
  7775. return el;
  7776. }
  7777. }]);
  7778. return MDCRadio;
  7779. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  7780. /***/ }),
  7781. /* 65 */
  7782. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7783. "use strict";
  7784. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  7785. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_selection_control__ = __webpack_require__(4);
  7786. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__adapter__ = __webpack_require__(66);
  7787. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(67);
  7788. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  7789. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7790. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  7791. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  7792. /**
  7793. * @license
  7794. * Copyright 2016 Google Inc. All Rights Reserved.
  7795. *
  7796. * Licensed under the Apache License, Version 2.0 (the "License");
  7797. * you may not use this file except in compliance with the License.
  7798. * You may obtain a copy of the License at
  7799. *
  7800. * http://www.apache.org/licenses/LICENSE-2.0
  7801. *
  7802. * Unless required by applicable law or agreed to in writing, software
  7803. * distributed under the License is distributed on an "AS IS" BASIS,
  7804. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7805. * See the License for the specific language governing permissions and
  7806. * limitations under the License.
  7807. */
  7808. /* eslint-disable no-unused-vars */
  7809. /* eslint-enable no-unused-vars */
  7810. /**
  7811. * @extends {MDCFoundation<!MDCRadioAdapter>}
  7812. */
  7813. var MDCRadioFoundation = function (_MDCFoundation) {
  7814. _inherits(MDCRadioFoundation, _MDCFoundation);
  7815. function MDCRadioFoundation() {
  7816. _classCallCheck(this, MDCRadioFoundation);
  7817. return _possibleConstructorReturn(this, (MDCRadioFoundation.__proto__ || Object.getPrototypeOf(MDCRadioFoundation)).apply(this, arguments));
  7818. }
  7819. _createClass(MDCRadioFoundation, [{
  7820. key: 'isChecked',
  7821. /** @return {boolean} */
  7822. value: function isChecked() {
  7823. return this.getNativeControl_().checked;
  7824. }
  7825. /** @param {boolean} checked */
  7826. }, {
  7827. key: 'setChecked',
  7828. value: function setChecked(checked) {
  7829. this.getNativeControl_().checked = checked;
  7830. }
  7831. /** @return {boolean} */
  7832. }, {
  7833. key: 'isDisabled',
  7834. value: function isDisabled() {
  7835. return this.getNativeControl_().disabled;
  7836. }
  7837. /** @param {boolean} disabled */
  7838. }, {
  7839. key: 'setDisabled',
  7840. value: function setDisabled(disabled) {
  7841. var DISABLED = MDCRadioFoundation.cssClasses.DISABLED;
  7842. this.getNativeControl_().disabled = disabled;
  7843. if (disabled) {
  7844. this.adapter_.addClass(DISABLED);
  7845. } else {
  7846. this.adapter_.removeClass(DISABLED);
  7847. }
  7848. }
  7849. /** @return {?string} */
  7850. }, {
  7851. key: 'getValue',
  7852. value: function getValue() {
  7853. return this.getNativeControl_().value;
  7854. }
  7855. /** @param {?string} value */
  7856. }, {
  7857. key: 'setValue',
  7858. value: function setValue(value) {
  7859. this.getNativeControl_().value = value;
  7860. }
  7861. /**
  7862. * @return {!MDCSelectionControlState}
  7863. * @private
  7864. */
  7865. }, {
  7866. key: 'getNativeControl_',
  7867. value: function getNativeControl_() {
  7868. return this.adapter_.getNativeControl() || {
  7869. checked: false,
  7870. disabled: false,
  7871. value: null
  7872. };
  7873. }
  7874. }], [{
  7875. key: 'cssClasses',
  7876. /** @return enum {cssClasses} */
  7877. get: function get() {
  7878. return __WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */];
  7879. }
  7880. /** @return enum {strings} */
  7881. }, {
  7882. key: 'strings',
  7883. get: function get() {
  7884. return __WEBPACK_IMPORTED_MODULE_3__constants__["b" /* strings */];
  7885. }
  7886. /** @return {!MDCRadioAdapter} */
  7887. }, {
  7888. key: 'defaultAdapter',
  7889. get: function get() {
  7890. return (/** @type {!MDCRadioAdapter} */{
  7891. addClass: function addClass() /* className: string */{},
  7892. removeClass: function removeClass() /* className: string */{},
  7893. getNativeControl: function getNativeControl() /* !MDCSelectionControlState */{}
  7894. }
  7895. );
  7896. }
  7897. }]);
  7898. return MDCRadioFoundation;
  7899. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  7900. /* harmony default export */ __webpack_exports__["a"] = (MDCRadioFoundation);
  7901. /***/ }),
  7902. /* 66 */
  7903. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7904. "use strict";
  7905. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_selection_control__ = __webpack_require__(4);
  7906. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  7907. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7908. /**
  7909. * @license
  7910. * Copyright 2016 Google Inc. All Rights Reserved.
  7911. *
  7912. * Licensed under the Apache License, Version 2.0 (the "License");
  7913. * you may not use this file except in compliance with the License.
  7914. * You may obtain a copy of the License at
  7915. *
  7916. * http://www.apache.org/licenses/LICENSE-2.0
  7917. *
  7918. * Unless required by applicable law or agreed to in writing, software
  7919. * distributed under the License is distributed on an "AS IS" BASIS,
  7920. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7921. * See the License for the specific language governing permissions and
  7922. * limitations under the License.
  7923. */
  7924. /* eslint-disable no-unused-vars */
  7925. /* eslint no-unused-vars: [2, {"args": "none"}] */
  7926. /**
  7927. * Adapter for MDC Radio. Provides an interface for managing
  7928. * - classes
  7929. * - dom
  7930. *
  7931. * Additionally, provides type information for the adapter to the Closure
  7932. * compiler.
  7933. *
  7934. * Implement this adapter for your framework of choice to delegate updates to
  7935. * the component in your framework of choice. See architecture documentation
  7936. * for more details.
  7937. * https://github.com/material-components/material-components-web/blob/master/docs/architecture.md
  7938. *
  7939. * @record
  7940. */
  7941. var MDCRadioAdapter = function () {
  7942. function MDCRadioAdapter() {
  7943. _classCallCheck(this, MDCRadioAdapter);
  7944. }
  7945. _createClass(MDCRadioAdapter, [{
  7946. key: 'addClass',
  7947. /** @param {string} className */
  7948. value: function addClass(className) {}
  7949. /** @param {string} className */
  7950. }, {
  7951. key: 'removeClass',
  7952. value: function removeClass(className) {}
  7953. /** @return {!MDCSelectionControlState} */
  7954. }, {
  7955. key: 'getNativeControl',
  7956. value: function getNativeControl() {}
  7957. }]);
  7958. return MDCRadioAdapter;
  7959. }();
  7960. /* unused harmony default export */ var _unused_webpack_default_export = (MDCRadioAdapter);
  7961. /***/ }),
  7962. /* 67 */
  7963. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7964. "use strict";
  7965. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  7966. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  7967. /**
  7968. * @license
  7969. * Copyright 2016 Google Inc. All Rights Reserved.
  7970. *
  7971. * Licensed under the Apache License, Version 2.0 (the "License");
  7972. * you may not use this file except in compliance with the License.
  7973. * You may obtain a copy of the License at
  7974. *
  7975. * http://www.apache.org/licenses/LICENSE-2.0
  7976. *
  7977. * Unless required by applicable law or agreed to in writing, software
  7978. * distributed under the License is distributed on an "AS IS" BASIS,
  7979. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  7980. * See the License for the specific language governing permissions and
  7981. * limitations under the License.
  7982. */
  7983. /** @enum {string} */
  7984. var strings = {
  7985. NATIVE_CONTROL_SELECTOR: '.mdc-radio__native-control'
  7986. };
  7987. /** @enum {string} */
  7988. var cssClasses = {
  7989. ROOT: 'mdc-radio',
  7990. DISABLED: 'mdc-radio--disabled'
  7991. };
  7992. /***/ }),
  7993. /* 68 */
  7994. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7995. "use strict";
  7996. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  7997. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSelect", function() { return MDCSelect; });
  7998. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base__ = __webpack_require__(1);
  7999. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_ripple__ = __webpack_require__(3);
  8000. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_menu__ = __webpack_require__(9);
  8001. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation__ = __webpack_require__(69);
  8002. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__constants__ = __webpack_require__(14);
  8003. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSelectFoundation", function() { return __WEBPACK_IMPORTED_MODULE_3__foundation__["a"]; });
  8004. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  8005. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8006. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  8007. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  8008. /**
  8009. * Copyright 2016 Google Inc. All Rights Reserved.
  8010. *
  8011. * Licensed under the Apache License, Version 2.0 (the "License");
  8012. * you may not use this file except in compliance with the License.
  8013. * You may obtain a copy of the License at
  8014. *
  8015. * http://www.apache.org/licenses/LICENSE-2.0
  8016. *
  8017. * Unless required by applicable law or agreed to in writing, software
  8018. * distributed under the License is distributed on an "AS IS" BASIS,
  8019. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8020. * See the License for the specific language governing permissions and
  8021. * limitations under the License.
  8022. */
  8023. var MDCSelect = function (_MDCComponent) {
  8024. _inherits(MDCSelect, _MDCComponent);
  8025. function MDCSelect() {
  8026. _classCallCheck(this, MDCSelect);
  8027. return _possibleConstructorReturn(this, (MDCSelect.__proto__ || Object.getPrototypeOf(MDCSelect)).apply(this, arguments));
  8028. }
  8029. _createClass(MDCSelect, [{
  8030. key: 'item',
  8031. value: function item(index) {
  8032. return this.options[index] || null;
  8033. }
  8034. }, {
  8035. key: 'nameditem',
  8036. value: function nameditem(key) {
  8037. // NOTE: IE11 precludes us from using Array.prototype.find
  8038. for (var i = 0, options = this.options, option; option = options[i]; i++) {
  8039. if (option.id === key || option.getAttribute('name') === key) {
  8040. return option;
  8041. }
  8042. }
  8043. return null;
  8044. }
  8045. }, {
  8046. key: 'initialize',
  8047. value: function initialize() {
  8048. var menuFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el) {
  8049. return new __WEBPACK_IMPORTED_MODULE_2__material_menu__["MDCSimpleMenu"](el);
  8050. };
  8051. this.surface_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].SURFACE_SELECTOR);
  8052. this.label_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].LABEL_SELECTOR);
  8053. this.bottomLine_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].BOTTOM_LINE_SELECTOR);
  8054. this.selectedText_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].SELECTED_TEXT_SELECTOR);
  8055. this.menuEl_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */].MENU_SELECTOR);
  8056. this.menu_ = menuFactory(this.menuEl_);
  8057. this.ripple = new __WEBPACK_IMPORTED_MODULE_1__material_ripple__["MDCRipple"](this.surface_);
  8058. }
  8059. }, {
  8060. key: 'getDefaultFoundation',
  8061. value: function getDefaultFoundation() {
  8062. var _this2 = this;
  8063. return new __WEBPACK_IMPORTED_MODULE_3__foundation__["a" /* default */]({
  8064. addClass: function addClass(className) {
  8065. return _this2.root_.classList.add(className);
  8066. },
  8067. removeClass: function removeClass(className) {
  8068. return _this2.root_.classList.remove(className);
  8069. },
  8070. addClassToLabel: function addClassToLabel(className) {
  8071. return _this2.label_.classList.add(className);
  8072. },
  8073. removeClassFromLabel: function removeClassFromLabel(className) {
  8074. return _this2.label_.classList.remove(className);
  8075. },
  8076. addClassToBottomLine: function addClassToBottomLine(className) {
  8077. return _this2.bottomLine_.classList.add(className);
  8078. },
  8079. removeClassFromBottomLine: function removeClassFromBottomLine(className) {
  8080. return _this2.bottomLine_.classList.remove(className);
  8081. },
  8082. setBottomLineAttr: function setBottomLineAttr(attr, value) {
  8083. return _this2.bottomLine_.setAttribute(attr, value);
  8084. },
  8085. setAttr: function setAttr(attr, value) {
  8086. return _this2.root_.setAttribute(attr, value);
  8087. },
  8088. rmAttr: function rmAttr(attr, value) {
  8089. return _this2.root_.removeAttribute(attr, value);
  8090. },
  8091. computeBoundingRect: function computeBoundingRect() {
  8092. return _this2.surface_.getBoundingClientRect();
  8093. },
  8094. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  8095. return _this2.root_.addEventListener(type, handler);
  8096. },
  8097. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  8098. return _this2.root_.removeEventListener(type, handler);
  8099. },
  8100. focus: function focus() {
  8101. return _this2.root_.focus();
  8102. },
  8103. makeTabbable: function makeTabbable() {
  8104. _this2.root_.tabIndex = 0;
  8105. },
  8106. makeUntabbable: function makeUntabbable() {
  8107. _this2.root_.tabIndex = -1;
  8108. },
  8109. getComputedStyleValue: function getComputedStyleValue(prop) {
  8110. return window.getComputedStyle(_this2.surface_).getPropertyValue(prop);
  8111. },
  8112. setStyle: function setStyle(propertyName, value) {
  8113. return _this2.surface_.style.setProperty(propertyName, value);
  8114. },
  8115. create2dRenderingContext: function create2dRenderingContext() {
  8116. return document.createElement('canvas').getContext('2d');
  8117. },
  8118. setMenuElStyle: function setMenuElStyle(propertyName, value) {
  8119. return _this2.menuEl_.style.setProperty(propertyName, value);
  8120. },
  8121. setMenuElAttr: function setMenuElAttr(attr, value) {
  8122. return _this2.menuEl_.setAttribute(attr, value);
  8123. },
  8124. rmMenuElAttr: function rmMenuElAttr(attr) {
  8125. return _this2.menuEl_.removeAttribute(attr);
  8126. },
  8127. getMenuElOffsetHeight: function getMenuElOffsetHeight() {
  8128. return _this2.menuEl_.offsetHeight;
  8129. },
  8130. openMenu: function openMenu(focusIndex) {
  8131. return _this2.menu_.show({ focusIndex: focusIndex });
  8132. },
  8133. isMenuOpen: function isMenuOpen() {
  8134. return _this2.menu_.open;
  8135. },
  8136. setSelectedTextContent: function setSelectedTextContent(selectedTextContent) {
  8137. _this2.selectedText_.textContent = selectedTextContent;
  8138. },
  8139. getNumberOfOptions: function getNumberOfOptions() {
  8140. return _this2.options.length;
  8141. },
  8142. getTextForOptionAtIndex: function getTextForOptionAtIndex(index) {
  8143. return _this2.options[index].textContent;
  8144. },
  8145. getValueForOptionAtIndex: function getValueForOptionAtIndex(index) {
  8146. return _this2.options[index].id || _this2.options[index].textContent;
  8147. },
  8148. setAttrForOptionAtIndex: function setAttrForOptionAtIndex(index, attr, value) {
  8149. return _this2.options[index].setAttribute(attr, value);
  8150. },
  8151. rmAttrForOptionAtIndex: function rmAttrForOptionAtIndex(index, attr) {
  8152. return _this2.options[index].removeAttribute(attr);
  8153. },
  8154. getOffsetTopForOptionAtIndex: function getOffsetTopForOptionAtIndex(index) {
  8155. return _this2.options[index].offsetTop;
  8156. },
  8157. registerMenuInteractionHandler: function registerMenuInteractionHandler(type, handler) {
  8158. return _this2.menu_.listen(type, handler);
  8159. },
  8160. deregisterMenuInteractionHandler: function deregisterMenuInteractionHandler(type, handler) {
  8161. return _this2.menu_.unlisten(type, handler);
  8162. },
  8163. notifyChange: function notifyChange() {
  8164. return _this2.emit(__WEBPACK_IMPORTED_MODULE_3__foundation__["a" /* default */].strings.CHANGE_EVENT, _this2);
  8165. },
  8166. getWindowInnerHeight: function getWindowInnerHeight() {
  8167. return window.innerHeight;
  8168. },
  8169. addBodyClass: function addBodyClass(className) {
  8170. return document.body.classList.add(className);
  8171. },
  8172. removeBodyClass: function removeBodyClass(className) {
  8173. return document.body.classList.remove(className);
  8174. }
  8175. });
  8176. }
  8177. }, {
  8178. key: 'initialSyncWithDOM',
  8179. value: function initialSyncWithDOM() {
  8180. var selectedOption = this.selectedOptions[0];
  8181. var idx = selectedOption ? this.options.indexOf(selectedOption) : -1;
  8182. if (idx >= 0) {
  8183. this.selectedIndex = idx;
  8184. }
  8185. if (this.root_.getAttribute('aria-disabled') === 'true') {
  8186. this.disabled = true;
  8187. }
  8188. }
  8189. }, {
  8190. key: 'value',
  8191. get: function get() {
  8192. return this.foundation_.getValue();
  8193. }
  8194. }, {
  8195. key: 'options',
  8196. get: function get() {
  8197. return this.menu_.items;
  8198. }
  8199. }, {
  8200. key: 'selectedOptions',
  8201. get: function get() {
  8202. return this.root_.querySelectorAll('[aria-selected]');
  8203. }
  8204. }, {
  8205. key: 'selectedIndex',
  8206. get: function get() {
  8207. return this.foundation_.getSelectedIndex();
  8208. },
  8209. set: function set(selectedIndex) {
  8210. this.foundation_.setSelectedIndex(selectedIndex);
  8211. }
  8212. }, {
  8213. key: 'disabled',
  8214. get: function get() {
  8215. return this.foundation_.isDisabled();
  8216. },
  8217. set: function set(disabled) {
  8218. this.foundation_.setDisabled(disabled);
  8219. }
  8220. }], [{
  8221. key: 'attachTo',
  8222. value: function attachTo(root) {
  8223. return new MDCSelect(root);
  8224. }
  8225. }]);
  8226. return MDCSelect;
  8227. }(__WEBPACK_IMPORTED_MODULE_0__material_base__["MDCComponent"]);
  8228. /***/ }),
  8229. /* 69 */
  8230. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8231. "use strict";
  8232. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base__ = __webpack_require__(1);
  8233. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(14);
  8234. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_menu__ = __webpack_require__(9);
  8235. 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; };
  8236. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  8237. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8238. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  8239. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  8240. /**
  8241. * Copyright 2016 Google Inc. All Rights Reserved.
  8242. *
  8243. * Licensed under the Apache License, Version 2.0 (the "License");
  8244. * you may not use this file except in compliance with the License.
  8245. * You may obtain a copy of the License at
  8246. *
  8247. * http://www.apache.org/licenses/LICENSE-2.0
  8248. *
  8249. * Unless required by applicable law or agreed to in writing, software
  8250. * distributed under the License is distributed on an "AS IS" BASIS,
  8251. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8252. * See the License for the specific language governing permissions and
  8253. * limitations under the License.
  8254. */
  8255. var OPENER_KEYS = [{ key: 'ArrowUp', keyCode: 38, forType: 'keydown' }, { key: 'ArrowDown', keyCode: 40, forType: 'keydown' }, { key: 'Space', keyCode: 32, forType: 'keyup' }];
  8256. var MDCSelectFoundation = function (_MDCFoundation) {
  8257. _inherits(MDCSelectFoundation, _MDCFoundation);
  8258. _createClass(MDCSelectFoundation, null, [{
  8259. key: 'cssClasses',
  8260. get: function get() {
  8261. return __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */];
  8262. }
  8263. }, {
  8264. key: 'strings',
  8265. get: function get() {
  8266. return __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */];
  8267. }
  8268. }, {
  8269. key: 'defaultAdapter',
  8270. get: function get() {
  8271. return {
  8272. addClass: function addClass() /* className: string */{},
  8273. removeClass: function removeClass() /* className: string */{},
  8274. addClassToLabel: function addClassToLabel() /* className: string */{},
  8275. removeClassFromLabel: function removeClassFromLabel() /* className: string */{},
  8276. addClassToBottomLine: function addClassToBottomLine() /* className: string */{},
  8277. removeClassFromBottomLine: function removeClassFromBottomLine() /* className: string */{},
  8278. setBottomLineAttr: function setBottomLineAttr() /* attr: string, value: string */{},
  8279. addBodyClass: function addBodyClass() /* className: string */{},
  8280. removeBodyClass: function removeBodyClass() /* className: string */{},
  8281. setAttr: function setAttr() /* attr: string, value: string */{},
  8282. rmAttr: function rmAttr() /* attr: string */{},
  8283. computeBoundingRect: function computeBoundingRect() {
  8284. return (/* {left: number, top: number} */{ left: 0, top: 0 }
  8285. );
  8286. },
  8287. registerInteractionHandler: function registerInteractionHandler() /* type: string, handler: EventListener */{},
  8288. deregisterInteractionHandler: function deregisterInteractionHandler() /* type: string, handler: EventListener */{},
  8289. focus: function focus() {},
  8290. makeTabbable: function makeTabbable() {},
  8291. makeUntabbable: function makeUntabbable() {},
  8292. getComputedStyleValue: function getComputedStyleValue() {
  8293. return (/* propertyName: string */ /* string */''
  8294. );
  8295. },
  8296. setStyle: function setStyle() /* propertyName: string, value: string */{},
  8297. create2dRenderingContext: function create2dRenderingContext() {
  8298. return (/* {font: string, measureText: (string) => {width: number}} */{
  8299. font: '',
  8300. measureText: function measureText() {
  8301. return { width: 0 };
  8302. }
  8303. }
  8304. );
  8305. },
  8306. setMenuElStyle: function setMenuElStyle() /* propertyName: string, value: string */{},
  8307. setMenuElAttr: function setMenuElAttr() /* attr: string, value: string */{},
  8308. rmMenuElAttr: function rmMenuElAttr() /* attr: string */{},
  8309. getMenuElOffsetHeight: function getMenuElOffsetHeight() {
  8310. return (/* number */0
  8311. );
  8312. },
  8313. openMenu: function openMenu() /* focusIndex: number */{},
  8314. isMenuOpen: function isMenuOpen() {
  8315. return (/* boolean */false
  8316. );
  8317. },
  8318. setSelectedTextContent: function setSelectedTextContent() /* textContent: string */{},
  8319. getNumberOfOptions: function getNumberOfOptions() {
  8320. return (/* number */0
  8321. );
  8322. },
  8323. getTextForOptionAtIndex: function getTextForOptionAtIndex() {
  8324. return (/* index: number */ /* string */''
  8325. );
  8326. },
  8327. getValueForOptionAtIndex: function getValueForOptionAtIndex() {
  8328. return (/* index: number */ /* string */''
  8329. );
  8330. },
  8331. setAttrForOptionAtIndex: function setAttrForOptionAtIndex() /* index: number, attr: string, value: string */{},
  8332. rmAttrForOptionAtIndex: function rmAttrForOptionAtIndex() /* index: number, attr: string */{},
  8333. getOffsetTopForOptionAtIndex: function getOffsetTopForOptionAtIndex() {
  8334. return (/* index: number */ /* number */0
  8335. );
  8336. },
  8337. registerMenuInteractionHandler: function registerMenuInteractionHandler() /* type: string, handler: EventListener */{},
  8338. deregisterMenuInteractionHandler: function deregisterMenuInteractionHandler() /* type: string, handler: EventListener */{},
  8339. notifyChange: function notifyChange() {},
  8340. getWindowInnerHeight: function getWindowInnerHeight() {
  8341. return (/* number */0
  8342. );
  8343. }
  8344. };
  8345. }
  8346. }]);
  8347. function MDCSelectFoundation(adapter) {
  8348. _classCallCheck(this, MDCSelectFoundation);
  8349. var _this = _possibleConstructorReturn(this, (MDCSelectFoundation.__proto__ || Object.getPrototypeOf(MDCSelectFoundation)).call(this, _extends(MDCSelectFoundation.defaultAdapter, adapter)));
  8350. _this.ctx_ = null;
  8351. _this.selectedIndex_ = -1;
  8352. _this.disabled_ = false;
  8353. _this.isFocused_ = false;
  8354. _this.setPointerXOffset_ = function (evt) {
  8355. return _this.setBottomLineOrigin_(evt);
  8356. };
  8357. _this.displayHandler_ = function (evt) {
  8358. evt.preventDefault();
  8359. if (!_this.adapter_.isMenuOpen()) {
  8360. _this.open_();
  8361. }
  8362. };
  8363. _this.displayViaKeyboardHandler_ = function (evt) {
  8364. return _this.handleDisplayViaKeyboard_(evt);
  8365. };
  8366. _this.selectionHandler_ = function (_ref) {
  8367. var detail = _ref.detail;
  8368. var index = detail.index;
  8369. if (index !== _this.selectedIndex_) {
  8370. _this.setSelectedIndex(index);
  8371. _this.adapter_.notifyChange();
  8372. }
  8373. _this.close_();
  8374. };
  8375. _this.cancelHandler_ = function () {
  8376. _this.close_();
  8377. if (_this.selectedIndex_ === -1) {
  8378. _this.adapter_.removeClassFromLabel(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].LABEL_FLOAT_ABOVE);
  8379. }
  8380. };
  8381. return _this;
  8382. }
  8383. _createClass(MDCSelectFoundation, [{
  8384. key: 'init',
  8385. value: function init() {
  8386. var _this2 = this;
  8387. this.ctx_ = this.adapter_.create2dRenderingContext();
  8388. this.adapter_.registerInteractionHandler('click', this.displayHandler_);
  8389. this.adapter_.registerInteractionHandler('keydown', this.displayViaKeyboardHandler_);
  8390. this.adapter_.registerInteractionHandler('keyup', this.displayViaKeyboardHandler_);
  8391. this.adapter_.registerMenuInteractionHandler(__WEBPACK_IMPORTED_MODULE_2__material_menu__["MDCSimpleMenuFoundation"].strings.SELECTED_EVENT, this.selectionHandler_);
  8392. this.adapter_.registerMenuInteractionHandler(__WEBPACK_IMPORTED_MODULE_2__material_menu__["MDCSimpleMenuFoundation"].strings.CANCEL_EVENT, this.cancelHandler_);
  8393. ['mousedown', 'touchstart'].forEach(function (evtType) {
  8394. _this2.adapter_.registerInteractionHandler(evtType, _this2.setPointerXOffset_);
  8395. });
  8396. this.resize();
  8397. }
  8398. }, {
  8399. key: 'destroy',
  8400. value: function destroy() {
  8401. var _this3 = this;
  8402. // Drop reference to context object to prevent potential leaks
  8403. this.ctx_ = null;
  8404. this.adapter_.deregisterInteractionHandler('click', this.displayHandler_);
  8405. this.adapter_.deregisterInteractionHandler('keydown', this.displayViaKeyboardHandler_);
  8406. this.adapter_.deregisterInteractionHandler('keyup', this.displayViaKeyboardHandler_);
  8407. this.adapter_.deregisterMenuInteractionHandler(__WEBPACK_IMPORTED_MODULE_2__material_menu__["MDCSimpleMenuFoundation"].strings.SELECTED_EVENT, this.selectionHandler_);
  8408. this.adapter_.deregisterMenuInteractionHandler(__WEBPACK_IMPORTED_MODULE_2__material_menu__["MDCSimpleMenuFoundation"].strings.CANCEL_EVENT, this.cancelHandler_);
  8409. ['mousedown', 'touchstart'].forEach(function (evtType) {
  8410. _this3.adapter_.deregisterInteractionHandler(evtType, _this3.setPointerXOffset_);
  8411. });
  8412. }
  8413. }, {
  8414. key: 'getValue',
  8415. value: function getValue() {
  8416. return this.selectedIndex_ >= 0 ? this.adapter_.getValueForOptionAtIndex(this.selectedIndex_) : '';
  8417. }
  8418. }, {
  8419. key: 'getSelectedIndex',
  8420. value: function getSelectedIndex() {
  8421. return this.selectedIndex_;
  8422. }
  8423. }, {
  8424. key: 'setSelectedIndex',
  8425. value: function setSelectedIndex(index) {
  8426. var prevSelectedIndex = this.selectedIndex_;
  8427. if (prevSelectedIndex >= 0) {
  8428. this.adapter_.rmAttrForOptionAtIndex(this.selectedIndex_, 'aria-selected');
  8429. }
  8430. this.selectedIndex_ = index >= 0 && index < this.adapter_.getNumberOfOptions() ? index : -1;
  8431. var selectedTextContent = '';
  8432. if (this.selectedIndex_ >= 0) {
  8433. selectedTextContent = this.adapter_.getTextForOptionAtIndex(this.selectedIndex_).trim();
  8434. this.adapter_.setAttrForOptionAtIndex(this.selectedIndex_, 'aria-selected', 'true');
  8435. }
  8436. this.adapter_.setSelectedTextContent(selectedTextContent);
  8437. }
  8438. }, {
  8439. key: 'isDisabled',
  8440. value: function isDisabled() {
  8441. return this.disabled_;
  8442. }
  8443. }, {
  8444. key: 'setDisabled',
  8445. value: function setDisabled(disabled) {
  8446. var DISABLED = MDCSelectFoundation.cssClasses.DISABLED;
  8447. this.disabled_ = disabled;
  8448. if (this.disabled_) {
  8449. this.adapter_.addClass(DISABLED);
  8450. this.adapter_.setAttr('aria-disabled', 'true');
  8451. this.adapter_.makeUntabbable();
  8452. } else {
  8453. this.adapter_.removeClass(DISABLED);
  8454. this.adapter_.rmAttr('aria-disabled');
  8455. this.adapter_.makeTabbable();
  8456. }
  8457. }
  8458. }, {
  8459. key: 'resize',
  8460. value: function resize() {
  8461. var font = this.adapter_.getComputedStyleValue('font');
  8462. var letterSpacing = parseFloat(this.adapter_.getComputedStyleValue('letter-spacing'));
  8463. if (font) {
  8464. this.ctx_.font = font;
  8465. } else {
  8466. var primaryFontFamily = this.adapter_.getComputedStyleValue('font-family').split(',')[0];
  8467. var fontSize = this.adapter_.getComputedStyleValue('font-size');
  8468. this.ctx_.font = fontSize + ' ' + primaryFontFamily;
  8469. }
  8470. var maxTextLength = 0;
  8471. for (var i = 0, l = this.adapter_.getNumberOfOptions(); i < l; i++) {
  8472. var surfacePaddingRight = parseInt(this.adapter_.getComputedStyleValue('padding-right'), 10);
  8473. var surfacePaddingLeft = parseInt(this.adapter_.getComputedStyleValue('padding-left'), 10);
  8474. var selectBoxAddedPadding = surfacePaddingRight + surfacePaddingLeft;
  8475. var txt = this.adapter_.getTextForOptionAtIndex(i).trim();
  8476. var _ctx_$measureText = this.ctx_.measureText(txt),
  8477. width = _ctx_$measureText.width;
  8478. var addedSpace = letterSpacing * txt.length;
  8479. maxTextLength = Math.max(maxTextLength, Math.ceil(width + addedSpace + selectBoxAddedPadding));
  8480. }
  8481. this.adapter_.setStyle('width', maxTextLength + 'px');
  8482. }
  8483. }, {
  8484. key: 'open_',
  8485. value: function open_() {
  8486. this.disableScroll_();
  8487. var OPEN = MDCSelectFoundation.cssClasses.OPEN;
  8488. var focusIndex = this.selectedIndex_ < 0 ? 0 : this.selectedIndex_;
  8489. this.setMenuStylesForOpenAtIndex_(focusIndex);
  8490. this.adapter_.addClassToLabel(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].LABEL_FLOAT_ABOVE);
  8491. this.adapter_.addClassToBottomLine(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].BOTTOM_LINE_ACTIVE);
  8492. this.adapter_.addClass(OPEN);
  8493. this.adapter_.openMenu(focusIndex);
  8494. this.isFocused_ = true;
  8495. }
  8496. }, {
  8497. key: 'setBottomLineOrigin_',
  8498. value: function setBottomLineOrigin_(evt) {
  8499. var targetClientRect = evt.target.getBoundingClientRect();
  8500. var evtCoords = { x: evt.clientX, y: evt.clientY };
  8501. var normalizedX = evtCoords.x - targetClientRect.left;
  8502. var attributeString = 'transform-origin: ' + normalizedX + 'px bottom';
  8503. this.adapter_.setBottomLineAttr('style', attributeString);
  8504. }
  8505. }, {
  8506. key: 'setMenuStylesForOpenAtIndex_',
  8507. value: function setMenuStylesForOpenAtIndex_(index) {
  8508. var innerHeight = this.adapter_.getWindowInnerHeight();
  8509. var _adapter_$computeBoun = this.adapter_.computeBoundingRect(),
  8510. left = _adapter_$computeBoun.left,
  8511. top = _adapter_$computeBoun.top;
  8512. this.adapter_.setMenuElAttr('aria-hidden', 'true');
  8513. this.adapter_.setMenuElStyle('display', 'block');
  8514. var menuHeight = this.adapter_.getMenuElOffsetHeight();
  8515. var itemOffsetTop = this.adapter_.getOffsetTopForOptionAtIndex(index);
  8516. this.adapter_.setMenuElStyle('display', '');
  8517. this.adapter_.rmMenuElAttr('aria-hidden');
  8518. var adjustedTop = top - itemOffsetTop;
  8519. var overflowsTop = adjustedTop < 0;
  8520. var overflowsBottom = adjustedTop + menuHeight > innerHeight;
  8521. if (overflowsTop) {
  8522. adjustedTop = 0;
  8523. } else if (overflowsBottom) {
  8524. adjustedTop = Math.max(0, innerHeight - menuHeight);
  8525. };
  8526. this.adapter_.setMenuElStyle('left', left + 'px');
  8527. this.adapter_.setMenuElStyle('top', adjustedTop + 'px');
  8528. this.adapter_.setMenuElStyle('transform-origin', 'center ' + itemOffsetTop + 'px');
  8529. }
  8530. }, {
  8531. key: 'close_',
  8532. value: function close_() {
  8533. var OPEN = MDCSelectFoundation.cssClasses.OPEN;
  8534. this.adapter_.removeClass(OPEN);
  8535. this.adapter_.removeClassFromBottomLine(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].BOTTOM_LINE_ACTIVE);
  8536. this.adapter_.focus();
  8537. this.enableScroll_();
  8538. }
  8539. }, {
  8540. key: 'handleDisplayViaKeyboard_',
  8541. value: function handleDisplayViaKeyboard_(evt) {
  8542. // We use a hard-coded 2 instead of Event.AT_TARGET to avoid having to reference a browser
  8543. // global.
  8544. var EVENT_PHASE_AT_TARGET = 2;
  8545. if (evt.eventPhase !== EVENT_PHASE_AT_TARGET) {
  8546. return;
  8547. }
  8548. // Prevent pressing space down from scrolling the page
  8549. var isSpaceDown = evt.type === 'keydown' && (evt.key === 'Space' || evt.keyCode === 32);
  8550. if (isSpaceDown) {
  8551. evt.preventDefault();
  8552. }
  8553. var isOpenerKey = OPENER_KEYS.some(function (_ref2) {
  8554. var key = _ref2.key,
  8555. keyCode = _ref2.keyCode,
  8556. forType = _ref2.forType;
  8557. return evt.type === forType && (evt.key === key || evt.keyCode === keyCode);
  8558. });
  8559. if (isOpenerKey) {
  8560. this.displayHandler_(evt);
  8561. }
  8562. }
  8563. }, {
  8564. key: 'disableScroll_',
  8565. value: function disableScroll_() {
  8566. this.adapter_.addBodyClass(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].SCROLL_LOCK);
  8567. }
  8568. }, {
  8569. key: 'enableScroll_',
  8570. value: function enableScroll_() {
  8571. this.adapter_.removeBodyClass(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].SCROLL_LOCK);
  8572. }
  8573. }]);
  8574. return MDCSelectFoundation;
  8575. }(__WEBPACK_IMPORTED_MODULE_0__material_base__["MDCFoundation"]);
  8576. /* harmony default export */ __webpack_exports__["a"] = (MDCSelectFoundation);
  8577. /***/ }),
  8578. /* 70 */
  8579. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8580. "use strict";
  8581. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  8582. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSlider", function() { return MDCSlider; });
  8583. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(2);
  8584. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(15);
  8585. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(71);
  8586. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSliderFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  8587. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  8588. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8589. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  8590. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  8591. /**
  8592. * Copyright 2017 Google Inc. All Rights Reserved.
  8593. *
  8594. * Licensed under the Apache License, Version 2.0 (the "License");
  8595. * you may not use this file except in compliance with the License.
  8596. * You may obtain a copy of the License at
  8597. *
  8598. * http://www.apache.org/licenses/LICENSE-2.0
  8599. *
  8600. * Unless required by applicable law or agreed to in writing, software
  8601. * distributed under the License is distributed on an "AS IS" BASIS,
  8602. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8603. * See the License for the specific language governing permissions and
  8604. * limitations under the License.
  8605. */
  8606. var MDCSlider = function (_MDCComponent) {
  8607. _inherits(MDCSlider, _MDCComponent);
  8608. function MDCSlider() {
  8609. _classCallCheck(this, MDCSlider);
  8610. return _possibleConstructorReturn(this, (MDCSlider.__proto__ || Object.getPrototypeOf(MDCSlider)).apply(this, arguments));
  8611. }
  8612. _createClass(MDCSlider, [{
  8613. key: 'initialize',
  8614. value: function initialize() {
  8615. this.thumbContainer_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].THUMB_CONTAINER_SELECTOR);
  8616. this.track_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].TRACK_SELECTOR);
  8617. this.pinValueMarker_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].PIN_VALUE_MARKER_SELECTOR);
  8618. this.trackMarkerContainer_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].TRACK_MARKER_CONTAINER_SELECTOR);
  8619. }
  8620. }, {
  8621. key: 'getDefaultFoundation',
  8622. value: function getDefaultFoundation() {
  8623. var _this2 = this;
  8624. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]({
  8625. hasClass: function hasClass(className) {
  8626. return _this2.root_.classList.contains(className);
  8627. },
  8628. addClass: function addClass(className) {
  8629. return _this2.root_.classList.add(className);
  8630. },
  8631. removeClass: function removeClass(className) {
  8632. return _this2.root_.classList.remove(className);
  8633. },
  8634. getAttribute: function getAttribute(name) {
  8635. return _this2.root_.getAttribute(name);
  8636. },
  8637. setAttribute: function setAttribute(name, value) {
  8638. return _this2.root_.setAttribute(name, value);
  8639. },
  8640. removeAttribute: function removeAttribute(name) {
  8641. return _this2.root_.removeAttribute(name);
  8642. },
  8643. computeBoundingRect: function computeBoundingRect() {
  8644. return _this2.root_.getBoundingClientRect();
  8645. },
  8646. getTabIndex: function getTabIndex() {
  8647. return _this2.root_.tabIndex;
  8648. },
  8649. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  8650. _this2.root_.addEventListener(type, handler);
  8651. },
  8652. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  8653. _this2.root_.removeEventListener(type, handler);
  8654. },
  8655. registerThumbContainerInteractionHandler: function registerThumbContainerInteractionHandler(type, handler) {
  8656. _this2.thumbContainer_.addEventListener(type, handler);
  8657. },
  8658. deregisterThumbContainerInteractionHandler: function deregisterThumbContainerInteractionHandler(type, handler) {
  8659. _this2.thumbContainer_.removeEventListener(type, handler);
  8660. },
  8661. registerBodyInteractionHandler: function registerBodyInteractionHandler(type, handler) {
  8662. document.body.addEventListener(type, handler);
  8663. },
  8664. deregisterBodyInteractionHandler: function deregisterBodyInteractionHandler(type, handler) {
  8665. document.body.removeEventListener(type, handler);
  8666. },
  8667. registerResizeHandler: function registerResizeHandler(handler) {
  8668. window.addEventListener('resize', handler);
  8669. },
  8670. deregisterResizeHandler: function deregisterResizeHandler(handler) {
  8671. window.removeEventListener('resize', handler);
  8672. },
  8673. notifyInput: function notifyInput() {
  8674. _this2.emit(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].INPUT_EVENT, _this2);
  8675. },
  8676. notifyChange: function notifyChange() {
  8677. _this2.emit(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].CHANGE_EVENT, _this2);
  8678. },
  8679. setThumbContainerStyleProperty: function setThumbContainerStyleProperty(propertyName, value) {
  8680. _this2.thumbContainer_.style.setProperty(propertyName, value);
  8681. },
  8682. setTrackStyleProperty: function setTrackStyleProperty(propertyName, value) {
  8683. _this2.track_.style.setProperty(propertyName, value);
  8684. },
  8685. setMarkerValue: function setMarkerValue(value) {
  8686. _this2.pinValueMarker_.innerText = value;
  8687. },
  8688. appendTrackMarkers: function appendTrackMarkers(numMarkers) {
  8689. var frag = document.createDocumentFragment();
  8690. for (var i = 0; i < numMarkers; i++) {
  8691. var marker = document.createElement('div');
  8692. marker.classList.add('mdc-slider__track-marker');
  8693. frag.appendChild(marker);
  8694. }
  8695. _this2.trackMarkerContainer_.appendChild(frag);
  8696. },
  8697. removeTrackMarkers: function removeTrackMarkers() {
  8698. while (_this2.trackMarkerContainer_.firstChild) {
  8699. _this2.trackMarkerContainer_.removeChild(_this2.trackMarkerContainer_.firstChild);
  8700. }
  8701. },
  8702. setLastTrackMarkersStyleProperty: function setLastTrackMarkersStyleProperty(propertyName, value) {
  8703. // We remove and append new nodes, thus, the last track marker must be dynamically found.
  8704. var lastTrackMarker = _this2.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].LAST_TRACK_MARKER_SELECTOR);
  8705. lastTrackMarker.style.setProperty(propertyName, value);
  8706. },
  8707. isRTL: function isRTL() {
  8708. return getComputedStyle(_this2.root_).direction === 'rtl';
  8709. }
  8710. });
  8711. }
  8712. }, {
  8713. key: 'initialSyncWithDOM',
  8714. value: function initialSyncWithDOM() {
  8715. var origValueNow = parseFloat(this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].ARIA_VALUENOW));
  8716. this.min = parseFloat(this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].ARIA_VALUEMIN)) || this.min;
  8717. this.max = parseFloat(this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].ARIA_VALUEMAX)) || this.max;
  8718. this.step = parseFloat(this.root_.getAttribute(__WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */].STEP_DATA_ATTR)) || this.step;
  8719. this.value = origValueNow || this.value;
  8720. 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';
  8721. this.foundation_.setupTrackMarker();
  8722. }
  8723. }, {
  8724. key: 'layout',
  8725. value: function layout() {
  8726. this.foundation_.layout();
  8727. }
  8728. }, {
  8729. key: 'stepUp',
  8730. value: function stepUp() {
  8731. var amount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.step || 1;
  8732. this.value += amount;
  8733. }
  8734. }, {
  8735. key: 'stepDown',
  8736. value: function stepDown() {
  8737. var amount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.step || 1;
  8738. this.value -= amount;
  8739. }
  8740. }, {
  8741. key: 'value',
  8742. get: function get() {
  8743. return this.foundation_.getValue();
  8744. },
  8745. set: function set(value) {
  8746. this.foundation_.setValue(value);
  8747. }
  8748. }, {
  8749. key: 'min',
  8750. get: function get() {
  8751. return this.foundation_.getMin();
  8752. },
  8753. set: function set(min) {
  8754. this.foundation_.setMin(min);
  8755. }
  8756. }, {
  8757. key: 'max',
  8758. get: function get() {
  8759. return this.foundation_.getMax();
  8760. },
  8761. set: function set(max) {
  8762. this.foundation_.setMax(max);
  8763. }
  8764. }, {
  8765. key: 'step',
  8766. get: function get() {
  8767. return this.foundation_.getStep();
  8768. },
  8769. set: function set(step) {
  8770. this.foundation_.setStep(step);
  8771. }
  8772. }, {
  8773. key: 'disabled',
  8774. get: function get() {
  8775. return this.foundation_.isDisabled();
  8776. },
  8777. set: function set(disabled) {
  8778. this.foundation_.setDisabled(disabled);
  8779. }
  8780. }], [{
  8781. key: 'attachTo',
  8782. value: function attachTo(root) {
  8783. return new MDCSlider(root);
  8784. }
  8785. }]);
  8786. return MDCSlider;
  8787. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  8788. /***/ }),
  8789. /* 71 */
  8790. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8791. "use strict";
  8792. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__constants__ = __webpack_require__(15);
  8793. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_animation__ = __webpack_require__(5);
  8794. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_base_foundation__ = __webpack_require__(0);
  8795. 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; };
  8796. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  8797. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8798. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  8799. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  8800. /**
  8801. * Copyright 2017 Google Inc. All Rights Reserved.
  8802. *
  8803. * Licensed under the Apache License, Version 2.0 (the "License");
  8804. *you may not use this file except in compliance with the License.
  8805. * You may obtain a copy of the License at
  8806. *
  8807. * http://www.apache.org/licenses/LICENSE-2.0
  8808. *
  8809. * Unless required by applicable law or agreed to in writing, software
  8810. * distributed under the License is distributed on an "AS IS" BASIS,
  8811. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  8812. * See the License for the specific language governing permissions and
  8813. * limitations under the License.
  8814. */
  8815. var KEY_IDS = {
  8816. ARROW_LEFT: 'ArrowLeft',
  8817. ARROW_RIGHT: 'ArrowRight',
  8818. ARROW_UP: 'ArrowUp',
  8819. ARROW_DOWN: 'ArrowDown',
  8820. HOME: 'Home',
  8821. END: 'End',
  8822. PAGE_UP: 'PageUp',
  8823. PAGE_DOWN: 'PageDown'
  8824. };
  8825. // Events that can constitute the user releasing drag on a slider
  8826. var UP_EVENTS = ['mouseup', 'pointerup', 'touchend'];
  8827. var MDCSliderFoundation = function (_MDCFoundation) {
  8828. _inherits(MDCSliderFoundation, _MDCFoundation);
  8829. _createClass(MDCSliderFoundation, null, [{
  8830. key: 'cssClasses',
  8831. get: function get() {
  8832. return __WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */];
  8833. }
  8834. }, {
  8835. key: 'strings',
  8836. get: function get() {
  8837. return __WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */];
  8838. }
  8839. }, {
  8840. key: 'numbers',
  8841. get: function get() {
  8842. return __WEBPACK_IMPORTED_MODULE_0__constants__["b" /* numbers */];
  8843. }
  8844. }, {
  8845. key: 'defaultAdapter',
  8846. get: function get() {
  8847. return {
  8848. hasClass: function hasClass() {
  8849. return (/* className: string */ /* boolean */false
  8850. );
  8851. },
  8852. addClass: function addClass() /* className: string */{},
  8853. removeClass: function removeClass() /* className: string */{},
  8854. getAttribute: function getAttribute() {
  8855. return (/* name: string */ /* string|null */null
  8856. );
  8857. },
  8858. setAttribute: function setAttribute() /* name: string, value: string */{},
  8859. removeAttribute: function removeAttribute() /* name: string */{},
  8860. computeBoundingRect: function computeBoundingRect() {
  8861. return (/* ClientRect */{
  8862. top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0
  8863. }
  8864. );
  8865. },
  8866. getTabIndex: function getTabIndex() {
  8867. return (/* number */0
  8868. );
  8869. },
  8870. registerInteractionHandler: function registerInteractionHandler() /* type: string, handler: EventListener */{},
  8871. deregisterInteractionHandler: function deregisterInteractionHandler() /* type: string, handler: EventListener */{},
  8872. registerThumbContainerInteractionHandler: function registerThumbContainerInteractionHandler() /* type: string, handler: EventListener */{},
  8873. deregisterThumbContainerInteractionHandler: function deregisterThumbContainerInteractionHandler() /* type: string, handler: EventListener */{},
  8874. registerBodyInteractionHandler: function registerBodyInteractionHandler() /* type: string, handler: EventListener */{},
  8875. deregisterBodyInteractionHandler: function deregisterBodyInteractionHandler() /* type: string, handler: EventListener */{},
  8876. registerResizeHandler: function registerResizeHandler() /* handler: EventListener */{},
  8877. deregisterResizeHandler: function deregisterResizeHandler() /* handler: EventListener */{},
  8878. notifyInput: function notifyInput() {},
  8879. notifyChange: function notifyChange() {},
  8880. setThumbContainerStyleProperty: function setThumbContainerStyleProperty() /* propertyName: string, value: string */{},
  8881. setTrackStyleProperty: function setTrackStyleProperty() /* propertyName: string, value: string */{},
  8882. setMarkerValue: function setMarkerValue() /* value: number */{},
  8883. appendTrackMarkers: function appendTrackMarkers() /* numMarkers: number */{},
  8884. removeTrackMarkers: function removeTrackMarkers() {},
  8885. setLastTrackMarkersStyleProperty: function setLastTrackMarkersStyleProperty() /* propertyName: string, value: string */{},
  8886. isRTL: function isRTL() {
  8887. return (/* boolean */false
  8888. );
  8889. }
  8890. };
  8891. }
  8892. }]);
  8893. function MDCSliderFoundation() {
  8894. var adapter = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  8895. _classCallCheck(this, MDCSliderFoundation);
  8896. var _this = _possibleConstructorReturn(this, (MDCSliderFoundation.__proto__ || Object.getPrototypeOf(MDCSliderFoundation)).call(this, _extends(MDCSliderFoundation.defaultAdapter, adapter)));
  8897. _this.rect_ = null;
  8898. // We set this to NaN since we want it to be a number, but we can't use '0' or '-1'
  8899. // because those could be valid tabindices set by the client code.
  8900. _this.savedTabIndex_ = NaN;
  8901. _this.active_ = false;
  8902. _this.inTransit_ = false;
  8903. _this.isDiscrete_ = false;
  8904. _this.hasTrackMarker_ = false;
  8905. _this.handlingThumbTargetEvt_ = false;
  8906. _this.min_ = 0;
  8907. _this.max_ = 100;
  8908. _this.step_ = 0;
  8909. _this.value_ = 0;
  8910. _this.disabled_ = false;
  8911. _this.preventFocusState_ = false;
  8912. _this.updateUIFrame_ = 0;
  8913. _this.thumbContainerPointerHandler_ = function () {
  8914. _this.handlingThumbTargetEvt_ = true;
  8915. };
  8916. _this.mousedownHandler_ = _this.createDownHandler_('mousemove');
  8917. _this.pointerdownHandler_ = _this.createDownHandler_('pointermove');
  8918. _this.touchstartHandler_ = _this.createDownHandler_('touchmove', function (_ref) {
  8919. var targetTouches = _ref.targetTouches;
  8920. return targetTouches[0].pageX;
  8921. });
  8922. _this.keydownHandler_ = function (evt) {
  8923. return _this.handleKeydown_(evt);
  8924. };
  8925. _this.focusHandler_ = function () {
  8926. return _this.handleFocus_();
  8927. };
  8928. _this.blurHandler_ = function () {
  8929. return _this.handleBlur_();
  8930. };
  8931. _this.resizeHandler_ = function () {
  8932. return _this.layout();
  8933. };
  8934. return _this;
  8935. }
  8936. _createClass(MDCSliderFoundation, [{
  8937. key: 'init',
  8938. value: function init() {
  8939. var _this2 = this;
  8940. this.isDiscrete_ = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].IS_DISCRETE);
  8941. this.hasTrackMarker_ = this.adapter_.hasClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].HAS_TRACK_MARKER);
  8942. this.adapter_.registerInteractionHandler('mousedown', this.mousedownHandler_);
  8943. this.adapter_.registerInteractionHandler('pointerdown', this.pointerdownHandler_);
  8944. this.adapter_.registerInteractionHandler('touchstart', this.touchstartHandler_);
  8945. this.adapter_.registerInteractionHandler('keydown', this.keydownHandler_);
  8946. this.adapter_.registerInteractionHandler('focus', this.focusHandler_);
  8947. this.adapter_.registerInteractionHandler('blur', this.blurHandler_);
  8948. ['mousedown', 'pointerdown', 'touchstart'].forEach(function (evtName) {
  8949. _this2.adapter_.registerThumbContainerInteractionHandler(evtName, _this2.thumbContainerPointerHandler_);
  8950. });
  8951. this.adapter_.registerResizeHandler(this.resizeHandler_);
  8952. this.layout();
  8953. // At last step, provide a reasonable default value to discrete slider
  8954. if (this.isDiscrete_ && this.getStep() == 0) {
  8955. this.step_ = 1;
  8956. }
  8957. }
  8958. }, {
  8959. key: 'destroy',
  8960. value: function destroy() {
  8961. var _this3 = this;
  8962. this.adapter_.deregisterInteractionHandler('mousedown', this.mousedownHandler_);
  8963. this.adapter_.deregisterInteractionHandler('pointerdown', this.pointerdownHandler_);
  8964. this.adapter_.deregisterInteractionHandler('touchstart', this.touchstartHandler_);
  8965. this.adapter_.deregisterInteractionHandler('keydown', this.keydownHandler_);
  8966. this.adapter_.deregisterInteractionHandler('focus', this.focusHandler_);
  8967. this.adapter_.deregisterInteractionHandler('blur', this.blurHandler_);
  8968. ['mousedown', 'pointerdown', 'touchstart'].forEach(function (evtName) {
  8969. _this3.adapter_.deregisterThumbContainerInteractionHandler(evtName, _this3.thumbContainerPointerHandler_);
  8970. });
  8971. this.adapter_.deregisterResizeHandler(this.resizeHandler_);
  8972. }
  8973. }, {
  8974. key: 'setupTrackMarker',
  8975. value: function setupTrackMarker() {
  8976. if (this.isDiscrete_ && this.hasTrackMarker_ && this.getStep() != 0) {
  8977. var min = this.getMin();
  8978. var max = this.getMax();
  8979. var step = this.getStep();
  8980. var numMarkers = (max - min) / step;
  8981. // In case distance between max & min is indivisible to step,
  8982. // we place the secondary to last marker proportionally at where thumb
  8983. // could reach and place the last marker at max value
  8984. var indivisible = Math.ceil(numMarkers) !== numMarkers;
  8985. if (indivisible) {
  8986. numMarkers = Math.ceil(numMarkers);
  8987. }
  8988. this.adapter_.removeTrackMarkers();
  8989. this.adapter_.appendTrackMarkers(numMarkers);
  8990. if (indivisible) {
  8991. var lastStepRatio = (max - numMarkers * step) / step + 1;
  8992. var flex = Object(__WEBPACK_IMPORTED_MODULE_1__material_animation__["b" /* getCorrectPropertyName */])(window, 'flex');
  8993. this.adapter_.setLastTrackMarkersStyleProperty(flex, lastStepRatio);
  8994. }
  8995. }
  8996. }
  8997. }, {
  8998. key: 'layout',
  8999. value: function layout() {
  9000. this.rect_ = this.adapter_.computeBoundingRect();
  9001. this.updateUIForCurrentValue_();
  9002. }
  9003. }, {
  9004. key: 'getValue',
  9005. value: function getValue() {
  9006. return this.value_;
  9007. }
  9008. }, {
  9009. key: 'setValue',
  9010. value: function setValue(value) {
  9011. this.setValue_(value, false);
  9012. }
  9013. }, {
  9014. key: 'getMax',
  9015. value: function getMax() {
  9016. return this.max_;
  9017. }
  9018. }, {
  9019. key: 'setMax',
  9020. value: function setMax(max) {
  9021. if (max < this.min_) {
  9022. throw new Error('Cannot set max to be less than the slider\'s minimum value');
  9023. }
  9024. this.max_ = max;
  9025. this.setValue_(this.value_, false, true);
  9026. this.adapter_.setAttribute(__WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */].ARIA_VALUEMAX, String(this.max_));
  9027. this.setupTrackMarker();
  9028. }
  9029. }, {
  9030. key: 'getMin',
  9031. value: function getMin() {
  9032. return this.min_;
  9033. }
  9034. }, {
  9035. key: 'setMin',
  9036. value: function setMin(min) {
  9037. if (min > this.max_) {
  9038. throw new Error('Cannot set min to be greater than the slider\'s maximum value');
  9039. }
  9040. this.min_ = min;
  9041. this.setValue_(this.value_, false, true);
  9042. this.adapter_.setAttribute(__WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */].ARIA_VALUEMIN, String(this.min_));
  9043. this.setupTrackMarker();
  9044. }
  9045. }, {
  9046. key: 'getStep',
  9047. value: function getStep() {
  9048. return this.step_;
  9049. }
  9050. }, {
  9051. key: 'setStep',
  9052. value: function setStep(step) {
  9053. if (step < 0) {
  9054. throw new Error('Step cannot be set to a negative number');
  9055. }
  9056. if (this.isDiscrete_ && (typeof step !== 'number' || step < 1)) {
  9057. step = 1;
  9058. }
  9059. this.step_ = step;
  9060. this.setValue_(this.value_, false, true);
  9061. this.setupTrackMarker();
  9062. }
  9063. }, {
  9064. key: 'isDisabled',
  9065. value: function isDisabled() {
  9066. return this.disabled_;
  9067. }
  9068. }, {
  9069. key: 'setDisabled',
  9070. value: function setDisabled(disabled) {
  9071. this.disabled_ = disabled;
  9072. this.toggleClass_(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].DISABLED, this.disabled_);
  9073. if (this.disabled_) {
  9074. this.savedTabIndex_ = this.adapter_.getTabIndex();
  9075. this.adapter_.setAttribute(__WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */].ARIA_DISABLED, 'true');
  9076. this.adapter_.removeAttribute('tabindex');
  9077. } else {
  9078. this.adapter_.removeAttribute(__WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */].ARIA_DISABLED);
  9079. if (!isNaN(this.savedTabIndex_)) {
  9080. this.adapter_.setAttribute('tabindex', String(this.savedTabIndex_));
  9081. }
  9082. }
  9083. }
  9084. }, {
  9085. key: 'createDownHandler_',
  9086. value: function createDownHandler_(moveEvt) {
  9087. var _this4 = this;
  9088. var getPageX = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (_ref2) {
  9089. var pageX = _ref2.pageX;
  9090. return pageX;
  9091. };
  9092. var moveHandler = function moveHandler(evt) {
  9093. evt.preventDefault();
  9094. _this4.setValueFromEvt_(evt, getPageX);
  9095. };
  9096. // Note: upHandler is [de]registered on ALL potential pointer-related release event types, since some browsers
  9097. // do not always fire these consistently in pairs.
  9098. // (See https://github.com/material-components/material-components-web/issues/1192)
  9099. var upHandler = function upHandler() {
  9100. _this4.setActive_(false);
  9101. _this4.adapter_.deregisterBodyInteractionHandler(moveEvt, moveHandler);
  9102. UP_EVENTS.forEach(function (type) {
  9103. return _this4.adapter_.deregisterBodyInteractionHandler(type, upHandler);
  9104. });
  9105. _this4.adapter_.notifyChange();
  9106. };
  9107. var downHandler = function downHandler(evt) {
  9108. if (_this4.disabled_) {
  9109. return;
  9110. }
  9111. _this4.preventFocusState_ = true;
  9112. _this4.setInTransit_(!_this4.handlingThumbTargetEvt_);
  9113. _this4.handlingThumbTargetEvt_ = false;
  9114. _this4.setActive_(true);
  9115. _this4.adapter_.registerBodyInteractionHandler(moveEvt, moveHandler);
  9116. UP_EVENTS.forEach(function (type) {
  9117. return _this4.adapter_.registerBodyInteractionHandler(type, upHandler);
  9118. });
  9119. _this4.setValueFromEvt_(evt, getPageX);
  9120. };
  9121. return downHandler;
  9122. }
  9123. }, {
  9124. key: 'setValueFromEvt_',
  9125. value: function setValueFromEvt_(evt, getPageX) {
  9126. var pageX = getPageX(evt);
  9127. var value = this.computeValueFromPageX_(pageX);
  9128. this.setValue_(value, true);
  9129. }
  9130. }, {
  9131. key: 'computeValueFromPageX_',
  9132. value: function computeValueFromPageX_(pageX) {
  9133. var max = this.max_,
  9134. min = this.min_;
  9135. var xPos = pageX - this.rect_.left;
  9136. var pctComplete = xPos / this.rect_.width;
  9137. if (this.adapter_.isRTL()) {
  9138. pctComplete = 1 - pctComplete;
  9139. }
  9140. // Fit the percentage complete between the range [min,max]
  9141. // by remapping from [0, 1] to [min, min+(max-min)].
  9142. return min + pctComplete * (max - min);
  9143. }
  9144. }, {
  9145. key: 'handleKeydown_',
  9146. value: function handleKeydown_(evt) {
  9147. var keyId = this.getKeyId_(evt);
  9148. var value = this.getValueForKeyId_(keyId);
  9149. if (isNaN(value)) {
  9150. return;
  9151. }
  9152. // Prevent page from scrolling due to key presses that would normally scroll the page
  9153. evt.preventDefault();
  9154. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].FOCUS);
  9155. this.setValue_(value, true);
  9156. this.adapter_.notifyChange();
  9157. }
  9158. }, {
  9159. key: 'getKeyId_',
  9160. value: function getKeyId_(kbdEvt) {
  9161. if (kbdEvt.key === KEY_IDS.ARROW_LEFT || kbdEvt.keyCode === 37) {
  9162. return KEY_IDS.ARROW_LEFT;
  9163. }
  9164. if (kbdEvt.key === KEY_IDS.ARROW_RIGHT || kbdEvt.keyCode === 39) {
  9165. return KEY_IDS.ARROW_RIGHT;
  9166. }
  9167. if (kbdEvt.key === KEY_IDS.ARROW_UP || kbdEvt.keyCode === 38) {
  9168. return KEY_IDS.ARROW_UP;
  9169. }
  9170. if (kbdEvt.key === KEY_IDS.ARROW_DOWN || kbdEvt.keyCode === 40) {
  9171. return KEY_IDS.ARROW_DOWN;
  9172. }
  9173. if (kbdEvt.key === KEY_IDS.HOME || kbdEvt.keyCode === 36) {
  9174. return KEY_IDS.HOME;
  9175. }
  9176. if (kbdEvt.key === KEY_IDS.END || kbdEvt.keyCode === 35) {
  9177. return KEY_IDS.END;
  9178. }
  9179. if (kbdEvt.key === KEY_IDS.PAGE_UP || kbdEvt.keyCode === 33) {
  9180. return KEY_IDS.PAGE_UP;
  9181. }
  9182. if (kbdEvt.key === KEY_IDS.PAGE_DOWN || kbdEvt.keyCode === 34) {
  9183. return KEY_IDS.PAGE_DOWN;
  9184. }
  9185. return '';
  9186. }
  9187. }, {
  9188. key: 'getValueForKeyId_',
  9189. value: function getValueForKeyId_(keyId) {
  9190. var max = this.max_,
  9191. min = this.min_,
  9192. step = this.step_;
  9193. var delta = step || (max - min) / 100;
  9194. var valueNeedsToBeFlipped = this.adapter_.isRTL() && (keyId === KEY_IDS.ARROW_LEFT || keyId === KEY_IDS.ARROW_RIGHT);
  9195. if (valueNeedsToBeFlipped) {
  9196. delta = -delta;
  9197. }
  9198. switch (keyId) {
  9199. case KEY_IDS.ARROW_LEFT:
  9200. case KEY_IDS.ARROW_DOWN:
  9201. return this.value_ - delta;
  9202. case KEY_IDS.ARROW_RIGHT:
  9203. case KEY_IDS.ARROW_UP:
  9204. return this.value_ + delta;
  9205. case KEY_IDS.HOME:
  9206. return this.min_;
  9207. case KEY_IDS.END:
  9208. return this.max_;
  9209. case KEY_IDS.PAGE_UP:
  9210. return this.value_ + delta * __WEBPACK_IMPORTED_MODULE_0__constants__["b" /* numbers */].PAGE_FACTOR;
  9211. case KEY_IDS.PAGE_DOWN:
  9212. return this.value_ - delta * __WEBPACK_IMPORTED_MODULE_0__constants__["b" /* numbers */].PAGE_FACTOR;
  9213. default:
  9214. return NaN;
  9215. }
  9216. }
  9217. }, {
  9218. key: 'handleFocus_',
  9219. value: function handleFocus_() {
  9220. if (this.preventFocusState_) {
  9221. return;
  9222. }
  9223. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].FOCUS);
  9224. }
  9225. }, {
  9226. key: 'handleBlur_',
  9227. value: function handleBlur_() {
  9228. this.preventFocusState_ = false;
  9229. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].FOCUS);
  9230. }
  9231. }, {
  9232. key: 'setValue_',
  9233. value: function setValue_(value, shouldFireInput) {
  9234. var force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  9235. if (value === this.value_ && !force) {
  9236. return;
  9237. }
  9238. var min = this.min_,
  9239. max = this.max_;
  9240. var valueSetToBoundary = value === min || value === max;
  9241. if (this.step_ && !valueSetToBoundary) {
  9242. value = this.quantize_(value);
  9243. }
  9244. if (value < min) {
  9245. value = min;
  9246. } else if (value > max) {
  9247. value = max;
  9248. }
  9249. this.value_ = value;
  9250. this.adapter_.setAttribute(__WEBPACK_IMPORTED_MODULE_0__constants__["c" /* strings */].ARIA_VALUENOW, String(this.value_));
  9251. this.updateUIForCurrentValue_();
  9252. if (shouldFireInput) {
  9253. this.adapter_.notifyInput();
  9254. if (this.isDiscrete_) {
  9255. this.adapter_.setMarkerValue(value);
  9256. }
  9257. }
  9258. }
  9259. }, {
  9260. key: 'quantize_',
  9261. value: function quantize_(value) {
  9262. var numSteps = Math.round(value / this.step_);
  9263. var quantizedVal = numSteps * this.step_;
  9264. return quantizedVal;
  9265. }
  9266. }, {
  9267. key: 'updateUIForCurrentValue_',
  9268. value: function updateUIForCurrentValue_() {
  9269. var _this5 = this;
  9270. var max = this.max_,
  9271. min = this.min_,
  9272. value = this.value_;
  9273. var pctComplete = (value - min) / (max - min);
  9274. var translatePx = pctComplete * this.rect_.width;
  9275. if (this.adapter_.isRTL()) {
  9276. translatePx = this.rect_.width - translatePx;
  9277. }
  9278. var transformProp = Object(__WEBPACK_IMPORTED_MODULE_1__material_animation__["b" /* getCorrectPropertyName */])(window, 'transform');
  9279. var transitionendEvtName = Object(__WEBPACK_IMPORTED_MODULE_1__material_animation__["a" /* getCorrectEventName */])(window, 'transitionend');
  9280. if (this.inTransit_) {
  9281. var onTransitionEnd = function onTransitionEnd() {
  9282. _this5.setInTransit_(false);
  9283. _this5.adapter_.deregisterThumbContainerInteractionHandler(transitionendEvtName, onTransitionEnd);
  9284. };
  9285. this.adapter_.registerThumbContainerInteractionHandler(transitionendEvtName, onTransitionEnd);
  9286. }
  9287. this.updateUIFrame_ = requestAnimationFrame(function () {
  9288. // NOTE(traviskaufman): It would be nice to use calc() here,
  9289. // but IE cannot handle calcs in transforms correctly.
  9290. // See: https://goo.gl/NC2itk
  9291. // Also note that the -50% offset is used to center the slider thumb.
  9292. _this5.adapter_.setThumbContainerStyleProperty(transformProp, 'translateX(' + translatePx + 'px) translateX(-50%)');
  9293. _this5.adapter_.setTrackStyleProperty(transformProp, 'scaleX(' + pctComplete + ')');
  9294. });
  9295. }
  9296. }, {
  9297. key: 'setActive_',
  9298. value: function setActive_(active) {
  9299. this.active_ = active;
  9300. this.toggleClass_(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].ACTIVE, this.active_);
  9301. }
  9302. }, {
  9303. key: 'setInTransit_',
  9304. value: function setInTransit_(inTransit) {
  9305. this.inTransit_ = inTransit;
  9306. this.toggleClass_(__WEBPACK_IMPORTED_MODULE_0__constants__["a" /* cssClasses */].IN_TRANSIT, this.inTransit_);
  9307. }
  9308. }, {
  9309. key: 'toggleClass_',
  9310. value: function toggleClass_(className, shouldBePresent) {
  9311. if (shouldBePresent) {
  9312. this.adapter_.addClass(className);
  9313. } else {
  9314. this.adapter_.removeClass(className);
  9315. }
  9316. }
  9317. }]);
  9318. return MDCSliderFoundation;
  9319. }(__WEBPACK_IMPORTED_MODULE_2__material_base_foundation__["a" /* default */]);
  9320. /* harmony default export */ __webpack_exports__["a"] = (MDCSliderFoundation);
  9321. /***/ }),
  9322. /* 72 */
  9323. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9324. "use strict";
  9325. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  9326. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSnackbar", function() { return MDCSnackbar; });
  9327. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base__ = __webpack_require__(1);
  9328. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(73);
  9329. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_animation__ = __webpack_require__(5);
  9330. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCSnackbarFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  9331. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  9332. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9333. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  9334. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  9335. /**
  9336. * Copyright 2016 Google Inc. All Rights Reserved.
  9337. *
  9338. * Licensed under the Apache License, Version 2.0 (the "License");
  9339. * you may not use this file except in compliance with the License.
  9340. * You may obtain a copy of the License at
  9341. *
  9342. * http://www.apache.org/licenses/LICENSE-2.0
  9343. *
  9344. * Unless required by applicable law or agreed to in writing, software
  9345. * distributed under the License is distributed on an "AS IS" BASIS,
  9346. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9347. * See the License for the specific language governing permissions and
  9348. * limitations under the License.
  9349. */
  9350. var MDCSnackbar = function (_MDCComponent) {
  9351. _inherits(MDCSnackbar, _MDCComponent);
  9352. function MDCSnackbar() {
  9353. _classCallCheck(this, MDCSnackbar);
  9354. return _possibleConstructorReturn(this, (MDCSnackbar.__proto__ || Object.getPrototypeOf(MDCSnackbar)).apply(this, arguments));
  9355. }
  9356. _createClass(MDCSnackbar, [{
  9357. key: 'show',
  9358. value: function show(data) {
  9359. this.foundation_.show(data);
  9360. }
  9361. }, {
  9362. key: 'getDefaultFoundation',
  9363. value: function getDefaultFoundation() {
  9364. var _this2 = this;
  9365. var _MDCSnackbarFoundatio = __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings,
  9366. TEXT_SELECTOR = _MDCSnackbarFoundatio.TEXT_SELECTOR,
  9367. ACTION_BUTTON_SELECTOR = _MDCSnackbarFoundatio.ACTION_BUTTON_SELECTOR;
  9368. var getText = function getText() {
  9369. return _this2.root_.querySelector(TEXT_SELECTOR);
  9370. };
  9371. var getActionButton = function getActionButton() {
  9372. return _this2.root_.querySelector(ACTION_BUTTON_SELECTOR);
  9373. };
  9374. /* eslint brace-style: "off" */
  9375. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]({
  9376. addClass: function addClass(className) {
  9377. return _this2.root_.classList.add(className);
  9378. },
  9379. removeClass: function removeClass(className) {
  9380. return _this2.root_.classList.remove(className);
  9381. },
  9382. setAriaHidden: function setAriaHidden() {
  9383. return _this2.root_.setAttribute('aria-hidden', 'true');
  9384. },
  9385. unsetAriaHidden: function unsetAriaHidden() {
  9386. return _this2.root_.removeAttribute('aria-hidden');
  9387. },
  9388. setActionAriaHidden: function setActionAriaHidden() {
  9389. return getActionButton().setAttribute('aria-hidden', 'true');
  9390. },
  9391. unsetActionAriaHidden: function unsetActionAriaHidden() {
  9392. return getActionButton().removeAttribute('aria-hidden');
  9393. },
  9394. setActionText: function setActionText(text) {
  9395. getActionButton().textContent = text;
  9396. },
  9397. setMessageText: function setMessageText(text) {
  9398. getText().textContent = text;
  9399. },
  9400. setFocus: function setFocus() {
  9401. return getActionButton().focus();
  9402. },
  9403. visibilityIsHidden: function visibilityIsHidden() {
  9404. return document.hidden;
  9405. },
  9406. registerCapturedBlurHandler: function registerCapturedBlurHandler(handler) {
  9407. return getActionButton().addEventListener('blur', handler, true);
  9408. },
  9409. deregisterCapturedBlurHandler: function deregisterCapturedBlurHandler(handler) {
  9410. return getActionButton().removeEventListener('blur', handler, true);
  9411. },
  9412. registerVisibilityChangeHandler: function registerVisibilityChangeHandler(handler) {
  9413. return document.addEventListener('visibilitychange', handler);
  9414. },
  9415. deregisterVisibilityChangeHandler: function deregisterVisibilityChangeHandler(handler) {
  9416. return document.removeEventListener('visibilitychange', handler);
  9417. },
  9418. registerCapturedInteractionHandler: function registerCapturedInteractionHandler(evt, handler) {
  9419. return document.body.addEventListener(evt, handler, true);
  9420. },
  9421. deregisterCapturedInteractionHandler: function deregisterCapturedInteractionHandler(evt, handler) {
  9422. return document.body.removeEventListener(evt, handler, true);
  9423. },
  9424. registerActionClickHandler: function registerActionClickHandler(handler) {
  9425. return getActionButton().addEventListener('click', handler);
  9426. },
  9427. deregisterActionClickHandler: function deregisterActionClickHandler(handler) {
  9428. return getActionButton().removeEventListener('click', handler);
  9429. },
  9430. registerTransitionEndHandler: function registerTransitionEndHandler(handler) {
  9431. return _this2.root_.addEventListener(Object(__WEBPACK_IMPORTED_MODULE_2__material_animation__["a" /* getCorrectEventName */])(window, 'transitionend'), handler);
  9432. },
  9433. deregisterTransitionEndHandler: function deregisterTransitionEndHandler(handler) {
  9434. return _this2.root_.removeEventListener(Object(__WEBPACK_IMPORTED_MODULE_2__material_animation__["a" /* getCorrectEventName */])(window, 'transitionend'), handler);
  9435. }
  9436. });
  9437. }
  9438. }, {
  9439. key: 'dismissesOnAction',
  9440. get: function get() {
  9441. return this.foundation_.dismissesOnAction();
  9442. },
  9443. set: function set(dismissesOnAction) {
  9444. this.foundation_.setDismissOnAction(dismissesOnAction);
  9445. }
  9446. }], [{
  9447. key: 'attachTo',
  9448. value: function attachTo(root) {
  9449. return new MDCSnackbar(root);
  9450. }
  9451. }]);
  9452. return MDCSnackbar;
  9453. }(__WEBPACK_IMPORTED_MODULE_0__material_base__["MDCComponent"]);
  9454. /***/ }),
  9455. /* 73 */
  9456. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9457. "use strict";
  9458. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base__ = __webpack_require__(1);
  9459. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(74);
  9460. 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; };
  9461. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  9462. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9463. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  9464. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  9465. /**
  9466. * Copyright 2016 Google Inc. All Rights Reserved.
  9467. *
  9468. * Licensed under the Apache License, Version 2.0 (the "License");
  9469. * you may not use this file except in compliance with the License.
  9470. * You may obtain a copy of the License at
  9471. *
  9472. * http://www.apache.org/licenses/LICENSE-2.0
  9473. *
  9474. * Unless required by applicable law or agreed to in writing, software
  9475. * distributed under the License is distributed on an "AS IS" BASIS,
  9476. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9477. * See the License for the specific language governing permissions and
  9478. * limitations under the License.
  9479. */
  9480. var MDCSnackbarFoundation = function (_MDCFoundation) {
  9481. _inherits(MDCSnackbarFoundation, _MDCFoundation);
  9482. _createClass(MDCSnackbarFoundation, [{
  9483. key: 'active',
  9484. get: function get() {
  9485. return this.active_;
  9486. }
  9487. }], [{
  9488. key: 'cssClasses',
  9489. get: function get() {
  9490. return __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */];
  9491. }
  9492. }, {
  9493. key: 'strings',
  9494. get: function get() {
  9495. return __WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */];
  9496. }
  9497. }, {
  9498. key: 'defaultAdapter',
  9499. get: function get() {
  9500. return {
  9501. addClass: function addClass() /* className: string */{},
  9502. removeClass: function removeClass() /* className: string */{},
  9503. setAriaHidden: function setAriaHidden() {},
  9504. unsetAriaHidden: function unsetAriaHidden() {},
  9505. setActionAriaHidden: function setActionAriaHidden() {},
  9506. unsetActionAriaHidden: function unsetActionAriaHidden() {},
  9507. setActionText: function setActionText() /* actionText: string */{},
  9508. setMessageText: function setMessageText() /* message: string */{},
  9509. setFocus: function setFocus() {},
  9510. visibilityIsHidden: function visibilityIsHidden() {
  9511. return (/* boolean */false
  9512. );
  9513. },
  9514. registerCapturedBlurHandler: function registerCapturedBlurHandler() /* handler: EventListener */{},
  9515. deregisterCapturedBlurHandler: function deregisterCapturedBlurHandler() /* handler: EventListener */{},
  9516. registerVisibilityChangeHandler: function registerVisibilityChangeHandler() /* handler: EventListener */{},
  9517. deregisterVisibilityChangeHandler: function deregisterVisibilityChangeHandler() /* handler: EventListener */{},
  9518. registerCapturedInteractionHandler: function registerCapturedInteractionHandler() /* evtType: string, handler: EventListener */{},
  9519. deregisterCapturedInteractionHandler: function deregisterCapturedInteractionHandler() /* evtType: string, handler: EventListener */{},
  9520. registerActionClickHandler: function registerActionClickHandler() /* handler: EventListener */{},
  9521. deregisterActionClickHandler: function deregisterActionClickHandler() /* handler: EventListener */{},
  9522. registerTransitionEndHandler: function registerTransitionEndHandler() /* handler: EventListener */{},
  9523. deregisterTransitionEndHandler: function deregisterTransitionEndHandler() /* handler: EventListener */{}
  9524. };
  9525. }
  9526. }]);
  9527. function MDCSnackbarFoundation(adapter) {
  9528. _classCallCheck(this, MDCSnackbarFoundation);
  9529. var _this = _possibleConstructorReturn(this, (MDCSnackbarFoundation.__proto__ || Object.getPrototypeOf(MDCSnackbarFoundation)).call(this, _extends(MDCSnackbarFoundation.defaultAdapter, adapter)));
  9530. _this.active_ = false;
  9531. _this.actionWasClicked_ = false;
  9532. _this.dismissOnAction_ = true;
  9533. _this.firstFocus_ = true;
  9534. _this.pointerDownRecognized_ = false;
  9535. _this.snackbarHasFocus_ = false;
  9536. _this.snackbarData_ = null;
  9537. _this.queue_ = [];
  9538. _this.actionClickHandler_ = function () {
  9539. _this.actionWasClicked_ = true;
  9540. _this.invokeAction_();
  9541. };
  9542. _this.visibilitychangeHandler_ = function () {
  9543. clearTimeout(_this.timeoutId_);
  9544. _this.snackbarHasFocus_ = true;
  9545. if (!_this.adapter_.visibilityIsHidden()) {
  9546. setTimeout(_this.cleanup_.bind(_this), _this.snackbarData_.timeout || __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* numbers */].MESSAGE_TIMEOUT);
  9547. }
  9548. };
  9549. _this.interactionHandler_ = function (evt) {
  9550. if (evt.type == 'touchstart' || evt.type == 'mousedown') {
  9551. _this.pointerDownRecognized_ = true;
  9552. }
  9553. _this.handlePossibleTabKeyboardFocus_(evt);
  9554. if (evt.type == 'focus') {
  9555. _this.pointerDownRecognized_ = false;
  9556. }
  9557. };
  9558. _this.blurHandler_ = function () {
  9559. clearTimeout(_this.timeoutId_);
  9560. _this.snackbarHasFocus_ = false;
  9561. _this.timeoutId_ = setTimeout(_this.cleanup_.bind(_this), _this.snackbarData_.timeout || __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* numbers */].MESSAGE_TIMEOUT);
  9562. };
  9563. return _this;
  9564. }
  9565. _createClass(MDCSnackbarFoundation, [{
  9566. key: 'init',
  9567. value: function init() {
  9568. this.adapter_.registerActionClickHandler(this.actionClickHandler_);
  9569. this.adapter_.setAriaHidden();
  9570. this.adapter_.setActionAriaHidden();
  9571. }
  9572. }, {
  9573. key: 'destroy',
  9574. value: function destroy() {
  9575. var _this2 = this;
  9576. this.adapter_.deregisterActionClickHandler(this.actionClickHandler_);
  9577. this.adapter_.deregisterCapturedBlurHandler(this.blurHandler_);
  9578. this.adapter_.deregisterVisibilityChangeHandler(this.visibilitychangeHandler_);
  9579. ['touchstart', 'mousedown', 'focus'].forEach(function (evtType) {
  9580. _this2.adapter_.deregisterCapturedInteractionHandler(evtType, _this2.interactionHandler_);
  9581. });
  9582. }
  9583. }, {
  9584. key: 'dismissesOnAction',
  9585. value: function dismissesOnAction() {
  9586. return this.dismissOnAction_;
  9587. }
  9588. }, {
  9589. key: 'setDismissOnAction',
  9590. value: function setDismissOnAction(dismissOnAction) {
  9591. this.dismissOnAction_ = !!dismissOnAction;
  9592. }
  9593. }, {
  9594. key: 'show',
  9595. value: function show(data) {
  9596. var _this3 = this;
  9597. if (!data) {
  9598. throw new Error('Please provide a data object with at least a message to display.');
  9599. }
  9600. if (!data.message) {
  9601. throw new Error('Please provide a message to be displayed.');
  9602. }
  9603. if (data.actionHandler && !data.actionText) {
  9604. throw new Error('Please provide action text with the handler.');
  9605. }
  9606. if (this.active) {
  9607. this.queue_.push(data);
  9608. return;
  9609. }
  9610. clearTimeout(this.timeoutId_);
  9611. this.snackbarData_ = data;
  9612. this.firstFocus_ = true;
  9613. this.adapter_.registerVisibilityChangeHandler(this.visibilitychangeHandler_);
  9614. this.adapter_.registerCapturedBlurHandler(this.blurHandler_);
  9615. ['touchstart', 'mousedown', 'focus'].forEach(function (evtType) {
  9616. _this3.adapter_.registerCapturedInteractionHandler(evtType, _this3.interactionHandler_);
  9617. });
  9618. var ACTIVE = __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].ACTIVE,
  9619. MULTILINE = __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].MULTILINE,
  9620. ACTION_ON_BOTTOM = __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].ACTION_ON_BOTTOM;
  9621. this.adapter_.setMessageText(this.snackbarData_.message);
  9622. if (this.snackbarData_.multiline) {
  9623. this.adapter_.addClass(MULTILINE);
  9624. if (this.snackbarData_.actionOnBottom) {
  9625. this.adapter_.addClass(ACTION_ON_BOTTOM);
  9626. }
  9627. }
  9628. if (this.snackbarData_.actionHandler) {
  9629. this.adapter_.setActionText(this.snackbarData_.actionText);
  9630. this.actionHandler_ = this.snackbarData_.actionHandler;
  9631. this.setActionHidden_(false);
  9632. } else {
  9633. this.setActionHidden_(true);
  9634. this.actionHandler_ = null;
  9635. this.adapter_.setActionText(null);
  9636. }
  9637. this.active_ = true;
  9638. this.adapter_.addClass(ACTIVE);
  9639. this.adapter_.unsetAriaHidden();
  9640. this.timeoutId_ = setTimeout(this.cleanup_.bind(this), this.snackbarData_.timeout || __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* numbers */].MESSAGE_TIMEOUT);
  9641. }
  9642. }, {
  9643. key: 'handlePossibleTabKeyboardFocus_',
  9644. value: function handlePossibleTabKeyboardFocus_() {
  9645. var hijackFocus = this.firstFocus_ && !this.pointerDownRecognized_;
  9646. if (hijackFocus) {
  9647. this.setFocusOnAction_();
  9648. }
  9649. this.firstFocus_ = false;
  9650. }
  9651. }, {
  9652. key: 'setFocusOnAction_',
  9653. value: function setFocusOnAction_() {
  9654. this.adapter_.setFocus();
  9655. this.snackbarHasFocus_ = true;
  9656. this.firstFocus_ = false;
  9657. }
  9658. }, {
  9659. key: 'invokeAction_',
  9660. value: function invokeAction_() {
  9661. try {
  9662. if (!this.actionHandler_) {
  9663. return;
  9664. }
  9665. this.actionHandler_();
  9666. } finally {
  9667. if (this.dismissOnAction_) {
  9668. this.cleanup_();
  9669. }
  9670. }
  9671. }
  9672. }, {
  9673. key: 'cleanup_',
  9674. value: function cleanup_() {
  9675. var _this4 = this;
  9676. var allowDismissal = !this.snackbarHasFocus_ || this.actionWasClicked_;
  9677. if (allowDismissal) {
  9678. var ACTIVE = __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].ACTIVE,
  9679. MULTILINE = __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].MULTILINE,
  9680. ACTION_ON_BOTTOM = __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].ACTION_ON_BOTTOM;
  9681. this.adapter_.removeClass(ACTIVE);
  9682. var handler = function handler() {
  9683. clearTimeout(_this4.timeoutId_);
  9684. _this4.adapter_.deregisterTransitionEndHandler(handler);
  9685. _this4.adapter_.removeClass(MULTILINE);
  9686. _this4.adapter_.removeClass(ACTION_ON_BOTTOM);
  9687. _this4.setActionHidden_(true);
  9688. _this4.adapter_.setAriaHidden();
  9689. _this4.active_ = false;
  9690. _this4.snackbarHasFocus_ = false;
  9691. _this4.showNext_();
  9692. };
  9693. this.adapter_.registerTransitionEndHandler(handler);
  9694. }
  9695. }
  9696. }, {
  9697. key: 'showNext_',
  9698. value: function showNext_() {
  9699. if (!this.queue_.length) {
  9700. return;
  9701. }
  9702. this.show(this.queue_.shift());
  9703. }
  9704. }, {
  9705. key: 'setActionHidden_',
  9706. value: function setActionHidden_(isHidden) {
  9707. if (isHidden) {
  9708. this.adapter_.setActionAriaHidden();
  9709. } else {
  9710. this.adapter_.unsetActionAriaHidden();
  9711. }
  9712. }
  9713. }]);
  9714. return MDCSnackbarFoundation;
  9715. }(__WEBPACK_IMPORTED_MODULE_0__material_base__["MDCFoundation"]);
  9716. /* harmony default export */ __webpack_exports__["a"] = (MDCSnackbarFoundation);
  9717. /***/ }),
  9718. /* 74 */
  9719. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9720. "use strict";
  9721. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  9722. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  9723. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  9724. /**
  9725. * Copyright 2016 Google Inc. All Rights Reserved.
  9726. *
  9727. * Licensed under the Apache License, Version 2.0 (the "License");
  9728. * you may not use this file except in compliance with the License.
  9729. * You may obtain a copy of the License at
  9730. *
  9731. * http://www.apache.org/licenses/LICENSE-2.0
  9732. *
  9733. * Unless required by applicable law or agreed to in writing, software
  9734. * distributed under the License is distributed on an "AS IS" BASIS,
  9735. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9736. * See the License for the specific language governing permissions and
  9737. * limitations under the License.
  9738. */
  9739. var cssClasses = {
  9740. ROOT: 'mdc-snackbar',
  9741. TEXT: 'mdc-snackbar__text',
  9742. ACTION_WRAPPER: 'mdc-snackbar__action-wrapper',
  9743. ACTION_BUTTON: 'mdc-snackbar__action-button',
  9744. ACTIVE: 'mdc-snackbar--active',
  9745. MULTILINE: 'mdc-snackbar--multiline',
  9746. ACTION_ON_BOTTOM: 'mdc-snackbar--action-on-bottom'
  9747. };
  9748. var strings = {
  9749. TEXT_SELECTOR: '.mdc-snackbar__text',
  9750. ACTION_WRAPPER_SELECTOR: '.mdc-snackbar__action-wrapper',
  9751. ACTION_BUTTON_SELECTOR: '.mdc-snackbar__action-button'
  9752. };
  9753. var numbers = {
  9754. MESSAGE_TIMEOUT: 2750
  9755. };
  9756. /***/ }),
  9757. /* 75 */
  9758. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9759. "use strict";
  9760. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  9761. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tab__ = __webpack_require__(16);
  9762. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTabFoundation", function() { return __WEBPACK_IMPORTED_MODULE_0__tab__["b"]; });
  9763. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTab", function() { return __WEBPACK_IMPORTED_MODULE_0__tab__["a"]; });
  9764. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__tab_bar__ = __webpack_require__(18);
  9765. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTabBarFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__tab_bar__["b"]; });
  9766. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTabBar", function() { return __WEBPACK_IMPORTED_MODULE_1__tab_bar__["a"]; });
  9767. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__tab_bar_scroller__ = __webpack_require__(79);
  9768. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTabBarScrollerFoundation", function() { return __WEBPACK_IMPORTED_MODULE_2__tab_bar_scroller__["b"]; });
  9769. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTabBarScroller", function() { return __WEBPACK_IMPORTED_MODULE_2__tab_bar_scroller__["a"]; });
  9770. /**
  9771. * Copyright 2017 Google Inc. All Rights Reserved.
  9772. *
  9773. * Licensed under the Apache License, Version 2.0 (the "License");
  9774. * you may not use this file except in compliance with the License.
  9775. * You may obtain a copy of the License at
  9776. *
  9777. * http://www.apache.org/licenses/LICENSE-2.0
  9778. *
  9779. * Unless required by applicable law or agreed to in writing, software
  9780. * distributed under the License is distributed on an "AS IS" BASIS,
  9781. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9782. * See the License for the specific language governing permissions and
  9783. * limitations under the License.
  9784. */
  9785. /***/ }),
  9786. /* 76 */
  9787. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9788. "use strict";
  9789. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  9790. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(17);
  9791. 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; };
  9792. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  9793. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9794. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  9795. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  9796. /**
  9797. * Copyright 2017 Google Inc. All Rights Reserved.
  9798. *
  9799. * Licensed under the Apache License, Version 2.0 (the "License");
  9800. * you may not use this file except in compliance with the License.
  9801. * You may obtain a copy of the License at
  9802. *
  9803. * http://www.apache.org/licenses/LICENSE-2.0
  9804. *
  9805. * Unless required by applicable law or agreed to in writing, software
  9806. * distributed under the License is distributed on an "AS IS" BASIS,
  9807. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9808. * See the License for the specific language governing permissions and
  9809. * limitations under the License.
  9810. */
  9811. var MDCTabFoundation = function (_MDCFoundation) {
  9812. _inherits(MDCTabFoundation, _MDCFoundation);
  9813. _createClass(MDCTabFoundation, null, [{
  9814. key: 'cssClasses',
  9815. get: function get() {
  9816. return __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */];
  9817. }
  9818. }, {
  9819. key: 'strings',
  9820. get: function get() {
  9821. return __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */];
  9822. }
  9823. }, {
  9824. key: 'defaultAdapter',
  9825. get: function get() {
  9826. return {
  9827. addClass: function addClass() /* className: string */{},
  9828. removeClass: function removeClass() /* className: string */{},
  9829. registerInteractionHandler: function registerInteractionHandler() /* type: string, handler: EventListener */{},
  9830. deregisterInteractionHandler: function deregisterInteractionHandler() /* type: string, handler: EventListener */{},
  9831. getOffsetWidth: function getOffsetWidth() {
  9832. return (/* number */0
  9833. );
  9834. },
  9835. getOffsetLeft: function getOffsetLeft() {
  9836. return (/* number */0
  9837. );
  9838. },
  9839. notifySelected: function notifySelected() {}
  9840. };
  9841. }
  9842. }]);
  9843. function MDCTabFoundation() {
  9844. var adapter = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  9845. _classCallCheck(this, MDCTabFoundation);
  9846. var _this = _possibleConstructorReturn(this, (MDCTabFoundation.__proto__ || Object.getPrototypeOf(MDCTabFoundation)).call(this, _extends(MDCTabFoundation.defaultAdapter, adapter)));
  9847. _this.computedWidth_ = 0;
  9848. _this.computedLeft_ = 0;
  9849. _this.isActive_ = false;
  9850. _this.preventDefaultOnClick_ = false;
  9851. _this.clickHandler_ = function (evt) {
  9852. if (_this.preventDefaultOnClick_) {
  9853. evt.preventDefault();
  9854. }
  9855. _this.adapter_.notifySelected();
  9856. };
  9857. _this.keydownHandler_ = function (evt) {
  9858. if (evt.key && evt.key === 'Enter' || evt.keyCode === 13) {
  9859. _this.adapter_.notifySelected();
  9860. }
  9861. };
  9862. return _this;
  9863. }
  9864. _createClass(MDCTabFoundation, [{
  9865. key: 'init',
  9866. value: function init() {
  9867. this.adapter_.registerInteractionHandler('click', this.clickHandler_);
  9868. this.adapter_.registerInteractionHandler('keydown', this.keydownHandler_);
  9869. }
  9870. }, {
  9871. key: 'destroy',
  9872. value: function destroy() {
  9873. this.adapter_.deregisterInteractionHandler('click', this.clickHandler_);
  9874. this.adapter_.deregisterInteractionHandler('keydown', this.keydownHandler_);
  9875. }
  9876. }, {
  9877. key: 'getComputedWidth',
  9878. value: function getComputedWidth() {
  9879. return this.computedWidth_;
  9880. }
  9881. }, {
  9882. key: 'getComputedLeft',
  9883. value: function getComputedLeft() {
  9884. return this.computedLeft_;
  9885. }
  9886. }, {
  9887. key: 'isActive',
  9888. value: function isActive() {
  9889. return this.isActive_;
  9890. }
  9891. }, {
  9892. key: 'setActive',
  9893. value: function setActive(isActive) {
  9894. this.isActive_ = isActive;
  9895. if (this.isActive_) {
  9896. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].ACTIVE);
  9897. } else {
  9898. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].ACTIVE);
  9899. }
  9900. }
  9901. }, {
  9902. key: 'preventsDefaultOnClick',
  9903. value: function preventsDefaultOnClick() {
  9904. return this.preventDefaultOnClick_;
  9905. }
  9906. }, {
  9907. key: 'setPreventDefaultOnClick',
  9908. value: function setPreventDefaultOnClick(preventDefaultOnClick) {
  9909. this.preventDefaultOnClick_ = preventDefaultOnClick;
  9910. }
  9911. }, {
  9912. key: 'measureSelf',
  9913. value: function measureSelf() {
  9914. this.computedWidth_ = this.adapter_.getOffsetWidth();
  9915. this.computedLeft_ = this.adapter_.getOffsetLeft();
  9916. }
  9917. }]);
  9918. return MDCTabFoundation;
  9919. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  9920. /* harmony default export */ __webpack_exports__["a"] = (MDCTabFoundation);
  9921. /***/ }),
  9922. /* 77 */
  9923. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9924. "use strict";
  9925. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  9926. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_animation__ = __webpack_require__(5);
  9927. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__constants__ = __webpack_require__(78);
  9928. 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; };
  9929. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  9930. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9931. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  9932. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  9933. /**
  9934. * Copyright 2017 Google Inc. All Rights Reserved.
  9935. *
  9936. * Licensed under the Apache License, Version 2.0 (the "License");
  9937. * you may not use this file except in compliance with the License.
  9938. * You may obtain a copy of the License at
  9939. *
  9940. * http://www.apache.org/licenses/LICENSE-2.0
  9941. *
  9942. * Unless required by applicable law or agreed to in writing, software
  9943. * distributed under the License is distributed on an "AS IS" BASIS,
  9944. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9945. * See the License for the specific language governing permissions and
  9946. * limitations under the License.
  9947. */
  9948. var MDCTabBarFoundation = function (_MDCFoundation) {
  9949. _inherits(MDCTabBarFoundation, _MDCFoundation);
  9950. _createClass(MDCTabBarFoundation, null, [{
  9951. key: 'cssClasses',
  9952. get: function get() {
  9953. return __WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */];
  9954. }
  9955. }, {
  9956. key: 'strings',
  9957. get: function get() {
  9958. return __WEBPACK_IMPORTED_MODULE_2__constants__["b" /* strings */];
  9959. }
  9960. }, {
  9961. key: 'defaultAdapter',
  9962. get: function get() {
  9963. return {
  9964. addClass: function addClass() /* className: string */{},
  9965. removeClass: function removeClass() /* className: string */{},
  9966. bindOnMDCTabSelectedEvent: function bindOnMDCTabSelectedEvent() {},
  9967. unbindOnMDCTabSelectedEvent: function unbindOnMDCTabSelectedEvent() {},
  9968. registerResizeHandler: function registerResizeHandler() /* handler: EventListener */{},
  9969. deregisterResizeHandler: function deregisterResizeHandler() /* handler: EventListener */{},
  9970. getOffsetWidth: function getOffsetWidth() {
  9971. return (/* number */0
  9972. );
  9973. },
  9974. setStyleForIndicator: function setStyleForIndicator() /* propertyName: string, value: string */{},
  9975. getOffsetWidthForIndicator: function getOffsetWidthForIndicator() {
  9976. return (/* number */0
  9977. );
  9978. },
  9979. notifyChange: function notifyChange() /* evtData: {activeTabIndex: number} */{},
  9980. getNumberOfTabs: function getNumberOfTabs() {
  9981. return (/* number */0
  9982. );
  9983. },
  9984. isTabActiveAtIndex: function isTabActiveAtIndex() {
  9985. return (/* index: number */ /* boolean */false
  9986. );
  9987. },
  9988. setTabActiveAtIndex: function setTabActiveAtIndex() /* index: number, isActive: true */{},
  9989. isDefaultPreventedOnClickForTabAtIndex: function isDefaultPreventedOnClickForTabAtIndex() {
  9990. return (/* index: number */ /* boolean */false
  9991. );
  9992. },
  9993. setPreventDefaultOnClickForTabAtIndex: function setPreventDefaultOnClickForTabAtIndex() /* index: number, preventDefaultOnClick: boolean */{},
  9994. measureTabAtIndex: function measureTabAtIndex() /* index: number */{},
  9995. getComputedWidthForTabAtIndex: function getComputedWidthForTabAtIndex() {
  9996. return (/* index: number */ /* number */0
  9997. );
  9998. },
  9999. getComputedLeftForTabAtIndex: function getComputedLeftForTabAtIndex() {
  10000. return (/* index: number */ /* number */0
  10001. );
  10002. }
  10003. };
  10004. }
  10005. }]);
  10006. function MDCTabBarFoundation(adapter) {
  10007. _classCallCheck(this, MDCTabBarFoundation);
  10008. var _this = _possibleConstructorReturn(this, (MDCTabBarFoundation.__proto__ || Object.getPrototypeOf(MDCTabBarFoundation)).call(this, _extends(MDCTabBarFoundation.defaultAdapter, adapter)));
  10009. _this.isIndicatorShown_ = false;
  10010. _this.computedWidth_ = 0;
  10011. _this.computedLeft_ = 0;
  10012. _this.activeTabIndex_ = 0;
  10013. _this.layoutFrame_ = 0;
  10014. _this.resizeHandler_ = function () {
  10015. return _this.layout();
  10016. };
  10017. return _this;
  10018. }
  10019. _createClass(MDCTabBarFoundation, [{
  10020. key: 'init',
  10021. value: function init() {
  10022. this.adapter_.addClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].UPGRADED);
  10023. this.adapter_.bindOnMDCTabSelectedEvent();
  10024. this.adapter_.registerResizeHandler(this.resizeHandler_);
  10025. var activeTabIndex = this.findActiveTabIndex_();
  10026. if (activeTabIndex >= 0) {
  10027. this.activeTabIndex_ = activeTabIndex;
  10028. }
  10029. this.layout();
  10030. }
  10031. }, {
  10032. key: 'destroy',
  10033. value: function destroy() {
  10034. this.adapter_.removeClass(__WEBPACK_IMPORTED_MODULE_2__constants__["a" /* cssClasses */].UPGRADED);
  10035. this.adapter_.unbindOnMDCTabSelectedEvent();
  10036. this.adapter_.deregisterResizeHandler(this.resizeHandler_);
  10037. }
  10038. }, {
  10039. key: 'layoutInternal_',
  10040. value: function layoutInternal_() {
  10041. var _this2 = this;
  10042. this.forEachTabIndex_(function (index) {
  10043. return _this2.adapter_.measureTabAtIndex(index);
  10044. });
  10045. this.computedWidth_ = this.adapter_.getOffsetWidth();
  10046. this.layoutIndicator_();
  10047. }
  10048. }, {
  10049. key: 'layoutIndicator_',
  10050. value: function layoutIndicator_() {
  10051. var isIndicatorFirstRender = !this.isIndicatorShown_;
  10052. // Ensure that indicator appears in the right position immediately for correct first render.
  10053. if (isIndicatorFirstRender) {
  10054. this.adapter_.setStyleForIndicator('transition', 'none');
  10055. }
  10056. var translateAmtForActiveTabLeft = this.adapter_.getComputedLeftForTabAtIndex(this.activeTabIndex_);
  10057. var scaleAmtForActiveTabWidth = this.adapter_.getComputedWidthForTabAtIndex(this.activeTabIndex_) / this.adapter_.getOffsetWidth();
  10058. var transformValue = 'translateX(' + translateAmtForActiveTabLeft + 'px) scale(' + scaleAmtForActiveTabWidth + ', 1)';
  10059. this.adapter_.setStyleForIndicator(Object(__WEBPACK_IMPORTED_MODULE_1__material_animation__["b" /* getCorrectPropertyName */])(window, 'transform'), transformValue);
  10060. if (isIndicatorFirstRender) {
  10061. // Force layout so that transform styles to take effect.
  10062. this.adapter_.getOffsetWidthForIndicator();
  10063. this.adapter_.setStyleForIndicator('transition', '');
  10064. this.adapter_.setStyleForIndicator('visibility', 'visible');
  10065. this.isIndicatorShown_ = true;
  10066. }
  10067. }
  10068. }, {
  10069. key: 'findActiveTabIndex_',
  10070. value: function findActiveTabIndex_() {
  10071. var _this3 = this;
  10072. var activeTabIndex = -1;
  10073. this.forEachTabIndex_(function (index) {
  10074. if (_this3.adapter_.isTabActiveAtIndex(index)) {
  10075. activeTabIndex = index;
  10076. return true;
  10077. }
  10078. });
  10079. return activeTabIndex;
  10080. }
  10081. }, {
  10082. key: 'forEachTabIndex_',
  10083. value: function forEachTabIndex_(iterator) {
  10084. var numTabs = this.adapter_.getNumberOfTabs();
  10085. for (var index = 0; index < numTabs; index++) {
  10086. var shouldBreak = iterator(index);
  10087. if (shouldBreak) {
  10088. break;
  10089. }
  10090. }
  10091. }
  10092. }, {
  10093. key: 'layout',
  10094. value: function layout() {
  10095. var _this4 = this;
  10096. if (this.layoutFrame_) {
  10097. cancelAnimationFrame(this.layoutFrame_);
  10098. }
  10099. this.layoutFrame_ = requestAnimationFrame(function () {
  10100. _this4.layoutInternal_();
  10101. _this4.layoutFrame_ = 0;
  10102. });
  10103. }
  10104. }, {
  10105. key: 'switchToTabAtIndex',
  10106. value: function switchToTabAtIndex(index, shouldNotify) {
  10107. var _this5 = this;
  10108. if (index === this.activeTabIndex_) {
  10109. return;
  10110. }
  10111. if (index < 0 || index >= this.adapter_.getNumberOfTabs()) {
  10112. throw new Error('Out of bounds index specified for tab: ' + index);
  10113. }
  10114. var prevActiveTabIndex = this.activeTabIndex_;
  10115. this.activeTabIndex_ = index;
  10116. requestAnimationFrame(function () {
  10117. if (prevActiveTabIndex >= 0) {
  10118. _this5.adapter_.setTabActiveAtIndex(prevActiveTabIndex, false);
  10119. }
  10120. _this5.adapter_.setTabActiveAtIndex(_this5.activeTabIndex_, true);
  10121. _this5.layoutIndicator_();
  10122. if (shouldNotify) {
  10123. _this5.adapter_.notifyChange({ activeTabIndex: _this5.activeTabIndex_ });
  10124. }
  10125. });
  10126. }
  10127. }, {
  10128. key: 'getActiveTabIndex',
  10129. value: function getActiveTabIndex() {
  10130. return this.findActiveTabIndex_();
  10131. }
  10132. }]);
  10133. return MDCTabBarFoundation;
  10134. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  10135. /* harmony default export */ __webpack_exports__["a"] = (MDCTabBarFoundation);
  10136. /***/ }),
  10137. /* 78 */
  10138. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10139. "use strict";
  10140. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  10141. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  10142. /**
  10143. * Copyright 2017 Google Inc. All Rights Reserved.
  10144. *
  10145. * Licensed under the Apache License, Version 2.0 (the "License");
  10146. * you may not use this file except in compliance with the License.
  10147. * You may obtain a copy of the License at
  10148. *
  10149. * http://www.apache.org/licenses/LICENSE-2.0
  10150. *
  10151. * Unless required by applicable law or agreed to in writing, software
  10152. * distributed under the License is distributed on an "AS IS" BASIS,
  10153. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10154. * See the License for the specific language governing permissions and
  10155. * limitations under the License.
  10156. */
  10157. var cssClasses = {
  10158. UPGRADED: 'mdc-tab-bar-upgraded'
  10159. };
  10160. var strings = {
  10161. TAB_SELECTOR: '.mdc-tab',
  10162. INDICATOR_SELECTOR: '.mdc-tab-bar__indicator',
  10163. CHANGE_EVENT: 'MDCTabBar:change'
  10164. };
  10165. /***/ }),
  10166. /* 79 */
  10167. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10168. "use strict";
  10169. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTabBarScroller; });
  10170. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_animation__ = __webpack_require__(5);
  10171. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_base_component__ = __webpack_require__(2);
  10172. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__tab_bar__ = __webpack_require__(18);
  10173. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__foundation__ = __webpack_require__(80);
  10174. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_3__foundation__["a"]; });
  10175. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  10176. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10177. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  10178. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  10179. /**
  10180. * Copyright 2017 Google Inc. All Rights Reserved.
  10181. *
  10182. * Licensed under the Apache License, Version 2.0 (the "License");
  10183. * you may not use this file except in compliance with the License.
  10184. * You may obtain a copy of the License at
  10185. *
  10186. * http://www.apache.org/licenses/LICENSE-2.0
  10187. *
  10188. * Unless required by applicable law or agreed to in writing, software
  10189. * distributed under the License is distributed on an "AS IS" BASIS,
  10190. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10191. * See the License for the specific language governing permissions and
  10192. * limitations under the License.
  10193. */
  10194. var MDCTabBarScroller = function (_MDCComponent) {
  10195. _inherits(MDCTabBarScroller, _MDCComponent);
  10196. function MDCTabBarScroller() {
  10197. _classCallCheck(this, MDCTabBarScroller);
  10198. return _possibleConstructorReturn(this, (MDCTabBarScroller.__proto__ || Object.getPrototypeOf(MDCTabBarScroller)).apply(this, arguments));
  10199. }
  10200. _createClass(MDCTabBarScroller, [{
  10201. key: 'initialize',
  10202. value: function initialize() {
  10203. var tabBarFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (root) {
  10204. return new __WEBPACK_IMPORTED_MODULE_2__tab_bar__["a" /* MDCTabBar */](root);
  10205. };
  10206. this.scrollFrame_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__foundation__["a" /* default */].strings.FRAME_SELECTOR);
  10207. this.tabBarEl_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__foundation__["a" /* default */].strings.TABS_SELECTOR);
  10208. this.forwardIndicator_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__foundation__["a" /* default */].strings.INDICATOR_FORWARD_SELECTOR);
  10209. this.backIndicator_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__foundation__["a" /* default */].strings.INDICATOR_BACK_SELECTOR);
  10210. this.tabBar_ = tabBarFactory(this.tabBarEl_);
  10211. }
  10212. }, {
  10213. key: 'getDefaultFoundation',
  10214. value: function getDefaultFoundation() {
  10215. var _this2 = this;
  10216. return new __WEBPACK_IMPORTED_MODULE_3__foundation__["a" /* default */]({
  10217. addClass: function addClass(className) {
  10218. return _this2.root_.classList.add(className);
  10219. },
  10220. removeClass: function removeClass(className) {
  10221. return _this2.root_.classList.remove(className);
  10222. },
  10223. eventTargetHasClass: function eventTargetHasClass(target, className) {
  10224. return target.classList.contains(className);
  10225. },
  10226. addClassToForwardIndicator: function addClassToForwardIndicator(className) {
  10227. return _this2.forwardIndicator_.classList.add(className);
  10228. },
  10229. removeClassFromForwardIndicator: function removeClassFromForwardIndicator(className) {
  10230. return _this2.forwardIndicator_.classList.remove(className);
  10231. },
  10232. addClassToBackIndicator: function addClassToBackIndicator(className) {
  10233. return _this2.backIndicator_.classList.add(className);
  10234. },
  10235. removeClassFromBackIndicator: function removeClassFromBackIndicator(className) {
  10236. return _this2.backIndicator_.classList.remove(className);
  10237. },
  10238. isRTL: function isRTL() {
  10239. return getComputedStyle(_this2.root_).getPropertyValue('direction') === 'rtl';
  10240. },
  10241. registerBackIndicatorClickHandler: function registerBackIndicatorClickHandler(handler) {
  10242. return _this2.backIndicator_.addEventListener('click', handler);
  10243. },
  10244. deregisterBackIndicatorClickHandler: function deregisterBackIndicatorClickHandler(handler) {
  10245. return _this2.backIndicator_.removeEventListener('click', handler);
  10246. },
  10247. registerForwardIndicatorClickHandler: function registerForwardIndicatorClickHandler(handler) {
  10248. return _this2.forwardIndicator_.addEventListener('click', handler);
  10249. },
  10250. deregisterForwardIndicatorClickHandler: function deregisterForwardIndicatorClickHandler(handler) {
  10251. return _this2.forwardIndicator_.removeEventListener('click', handler);
  10252. },
  10253. registerCapturedInteractionHandler: function registerCapturedInteractionHandler(evt, handler) {
  10254. return _this2.root_.addEventListener(evt, handler, true);
  10255. },
  10256. deregisterCapturedInteractionHandler: function deregisterCapturedInteractionHandler(evt, handler) {
  10257. return _this2.root_.removeEventListener(evt, handler, true);
  10258. },
  10259. registerWindowResizeHandler: function registerWindowResizeHandler(handler) {
  10260. return window.addEventListener('resize', handler);
  10261. },
  10262. deregisterWindowResizeHandler: function deregisterWindowResizeHandler(handler) {
  10263. return window.removeEventListener('resize', handler);
  10264. },
  10265. getNumberOfTabs: function getNumberOfTabs() {
  10266. return _this2.tabBar.tabs.length;
  10267. },
  10268. getComputedWidthForTabAtIndex: function getComputedWidthForTabAtIndex(index) {
  10269. return _this2.tabBar.tabs[index].computedWidth;
  10270. },
  10271. getComputedLeftForTabAtIndex: function getComputedLeftForTabAtIndex(index) {
  10272. return _this2.tabBar.tabs[index].computedLeft;
  10273. },
  10274. getOffsetWidthForScrollFrame: function getOffsetWidthForScrollFrame() {
  10275. return _this2.scrollFrame_.offsetWidth;
  10276. },
  10277. getScrollLeftForScrollFrame: function getScrollLeftForScrollFrame() {
  10278. return _this2.scrollFrame_.scrollLeft;
  10279. },
  10280. setScrollLeftForScrollFrame: function setScrollLeftForScrollFrame(scrollLeftAmount) {
  10281. return _this2.scrollFrame_.scrollLeft = scrollLeftAmount;
  10282. },
  10283. getOffsetWidthForTabBar: function getOffsetWidthForTabBar() {
  10284. return _this2.tabBarEl_.offsetWidth;
  10285. },
  10286. setTransformStyleForTabBar: function setTransformStyleForTabBar(value) {
  10287. _this2.tabBarEl_.style.setProperty(Object(__WEBPACK_IMPORTED_MODULE_0__material_animation__["b" /* getCorrectPropertyName */])(window, 'transform'), value);
  10288. },
  10289. getOffsetLeftForEventTarget: function getOffsetLeftForEventTarget(target) {
  10290. return target.offsetLeft;
  10291. },
  10292. getOffsetWidthForEventTarget: function getOffsetWidthForEventTarget(target) {
  10293. return target.offsetWidth;
  10294. }
  10295. });
  10296. }
  10297. }, {
  10298. key: 'layout',
  10299. value: function layout() {
  10300. this.foundation_.layout();
  10301. }
  10302. }, {
  10303. key: 'tabBar',
  10304. get: function get() {
  10305. return this.tabBar_;
  10306. }
  10307. }], [{
  10308. key: 'attachTo',
  10309. value: function attachTo(root) {
  10310. return new MDCTabBarScroller(root);
  10311. }
  10312. }]);
  10313. return MDCTabBarScroller;
  10314. }(__WEBPACK_IMPORTED_MODULE_1__material_base_component__["a" /* default */]);
  10315. /***/ }),
  10316. /* 80 */
  10317. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10318. "use strict";
  10319. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  10320. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(81);
  10321. 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; };
  10322. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  10323. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10324. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  10325. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  10326. /**
  10327. * Copyright 2017 Google Inc. All Rights Reserved.
  10328. *
  10329. * Licensed under the Apache License, Version 2.0 (the "License");
  10330. * you may not use this file except in compliance with the License.
  10331. * You may obtain a copy of the License at
  10332. *
  10333. * http://www.apache.org/licenses/LICENSE-2.0
  10334. *
  10335. * Unless required by applicable law or agreed to in writing, software
  10336. * distributed under the License is distributed on an "AS IS" BASIS,
  10337. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10338. * See the License for the specific language governing permissions and
  10339. * limitations under the License.
  10340. */
  10341. var MDCTabBarScrollerFoundation = function (_MDCFoundation) {
  10342. _inherits(MDCTabBarScrollerFoundation, _MDCFoundation);
  10343. _createClass(MDCTabBarScrollerFoundation, null, [{
  10344. key: 'cssClasses',
  10345. get: function get() {
  10346. return __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */];
  10347. }
  10348. }, {
  10349. key: 'strings',
  10350. get: function get() {
  10351. return __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* strings */];
  10352. }
  10353. }, {
  10354. key: 'defaultAdapter',
  10355. get: function get() {
  10356. return {
  10357. addClass: function addClass() /* className: string */{},
  10358. removeClass: function removeClass() /* className: string */{},
  10359. eventTargetHasClass: function eventTargetHasClass() {
  10360. return (/* target: EventTarget, className: string */ /* boolean */false
  10361. );
  10362. },
  10363. addClassToForwardIndicator: function addClassToForwardIndicator() /* className: string */{},
  10364. removeClassFromForwardIndicator: function removeClassFromForwardIndicator() /* className: string */{},
  10365. addClassToBackIndicator: function addClassToBackIndicator() /* className: string */{},
  10366. removeClassFromBackIndicator: function removeClassFromBackIndicator() /* className: string */{},
  10367. isRTL: function isRTL() {
  10368. return (/* boolean */false
  10369. );
  10370. },
  10371. registerBackIndicatorClickHandler: function registerBackIndicatorClickHandler() /* handler: EventListener */{},
  10372. deregisterBackIndicatorClickHandler: function deregisterBackIndicatorClickHandler() /* handler: EventListener */{},
  10373. registerForwardIndicatorClickHandler: function registerForwardIndicatorClickHandler() /* handler: EventListener */{},
  10374. deregisterForwardIndicatorClickHandler: function deregisterForwardIndicatorClickHandler() /* handler: EventListener */{},
  10375. registerCapturedInteractionHandler: function registerCapturedInteractionHandler() /* evt: string, handler: EventListener */{},
  10376. deregisterCapturedInteractionHandler: function deregisterCapturedInteractionHandler() /* evt: string, handler: EventListener */{},
  10377. registerWindowResizeHandler: function registerWindowResizeHandler() /* handler: EventListener */{},
  10378. deregisterWindowResizeHandler: function deregisterWindowResizeHandler() /* handler: EventListener */{},
  10379. getNumberOfTabs: function getNumberOfTabs() {
  10380. return (/* number */0
  10381. );
  10382. },
  10383. getComputedWidthForTabAtIndex: function getComputedWidthForTabAtIndex() {
  10384. return (/* number */0
  10385. );
  10386. },
  10387. getComputedLeftForTabAtIndex: function getComputedLeftForTabAtIndex() {
  10388. return (/* number */0
  10389. );
  10390. },
  10391. getOffsetWidthForScrollFrame: function getOffsetWidthForScrollFrame() {
  10392. return (/* number */0
  10393. );
  10394. },
  10395. getScrollLeftForScrollFrame: function getScrollLeftForScrollFrame() {
  10396. return (/* number */0
  10397. );
  10398. },
  10399. setScrollLeftForScrollFrame: function setScrollLeftForScrollFrame() /* scrollLeftAmount: number */{},
  10400. getOffsetWidthForTabBar: function getOffsetWidthForTabBar() {
  10401. return (/* number */0
  10402. );
  10403. },
  10404. setTransformStyleForTabBar: function setTransformStyleForTabBar() /* value: string */{},
  10405. getOffsetLeftForEventTarget: function getOffsetLeftForEventTarget() {
  10406. return (/* target: EventTarget */ /* number */0
  10407. );
  10408. },
  10409. getOffsetWidthForEventTarget: function getOffsetWidthForEventTarget() {
  10410. return (/* target: EventTarget */ /* number */0
  10411. );
  10412. }
  10413. };
  10414. }
  10415. }]);
  10416. function MDCTabBarScrollerFoundation(adapter) {
  10417. _classCallCheck(this, MDCTabBarScrollerFoundation);
  10418. var _this = _possibleConstructorReturn(this, (MDCTabBarScrollerFoundation.__proto__ || Object.getPrototypeOf(MDCTabBarScrollerFoundation)).call(this, _extends(MDCTabBarScrollerFoundation.defaultAdapter, adapter)));
  10419. _this.pointerDownRecognized_ = false;
  10420. _this.currentTranslateOffset_ = 0;
  10421. _this.focusedTarget_ = null;
  10422. _this.layoutFrame_ = 0;
  10423. _this.scrollFrameScrollLeft_ = 0;
  10424. _this.forwardIndicatorClickHandler_ = function (evt) {
  10425. return _this.scrollForward(evt);
  10426. };
  10427. _this.backIndicatorClickHandler_ = function (evt) {
  10428. return _this.scrollBack(evt);
  10429. };
  10430. _this.resizeHandler_ = function () {
  10431. return _this.layout();
  10432. };
  10433. _this.interactionHandler_ = function (evt) {
  10434. if (evt.type == 'touchstart' || evt.type == 'mousedown') {
  10435. _this.pointerDownRecognized_ = true;
  10436. }
  10437. _this.handlePossibleTabKeyboardFocus_(evt);
  10438. if (evt.type == 'focus') {
  10439. _this.pointerDownRecognized_ = false;
  10440. }
  10441. };
  10442. return _this;
  10443. }
  10444. _createClass(MDCTabBarScrollerFoundation, [{
  10445. key: 'init',
  10446. value: function init() {
  10447. var _this2 = this;
  10448. this.adapter_.registerBackIndicatorClickHandler(this.backIndicatorClickHandler_);
  10449. this.adapter_.registerForwardIndicatorClickHandler(this.forwardIndicatorClickHandler_);
  10450. this.adapter_.registerWindowResizeHandler(this.resizeHandler_);
  10451. ['touchstart', 'mousedown', 'focus'].forEach(function (evtType) {
  10452. _this2.adapter_.registerCapturedInteractionHandler(evtType, _this2.interactionHandler_);
  10453. });
  10454. this.layout();
  10455. }
  10456. }, {
  10457. key: 'destroy',
  10458. value: function destroy() {
  10459. var _this3 = this;
  10460. this.adapter_.deregisterBackIndicatorClickHandler(this.backIndicatorClickHandler_);
  10461. this.adapter_.deregisterForwardIndicatorClickHandler(this.forwardIndicatorClickHandler_);
  10462. this.adapter_.deregisterWindowResizeHandler(this.resizeHandler_);
  10463. ['touchstart', 'mousedown', 'focus'].forEach(function (evtType) {
  10464. _this3.adapter_.deregisterCapturedInteractionHandler(evtType, _this3.interactionHandler_);
  10465. });
  10466. }
  10467. }, {
  10468. key: 'scrollBack',
  10469. value: function scrollBack() {
  10470. var evt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  10471. if (evt) {
  10472. evt.preventDefault();
  10473. }
  10474. var tabWidthAccumulator = 0;
  10475. var scrollTargetIndex = 0;
  10476. for (var i = this.adapter_.getNumberOfTabs() - 1; i > 0; i--) {
  10477. var tabOffsetLeft = this.adapter_.getComputedLeftForTabAtIndex(i);
  10478. var tabBarWidthLessTabOffsetLeft = this.adapter_.getOffsetWidthForTabBar() - tabOffsetLeft;
  10479. var tabIsNotOccluded = tabOffsetLeft > this.currentTranslateOffset_;
  10480. if (this.isRTL_()) {
  10481. tabIsNotOccluded = tabBarWidthLessTabOffsetLeft > this.currentTranslateOffset_;
  10482. }
  10483. if (tabIsNotOccluded) {
  10484. continue;
  10485. }
  10486. tabWidthAccumulator += this.adapter_.getComputedWidthForTabAtIndex(i);
  10487. var scrollTargetDetermined = tabWidthAccumulator > this.adapter_.getOffsetWidthForScrollFrame();
  10488. if (scrollTargetDetermined) {
  10489. scrollTargetIndex = this.isRTL_() ? i + 1 : i;
  10490. break;
  10491. }
  10492. }
  10493. this.scrollToTabAtIndex(scrollTargetIndex);
  10494. }
  10495. }, {
  10496. key: 'scrollForward',
  10497. value: function scrollForward() {
  10498. var evt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  10499. if (evt) {
  10500. evt.preventDefault();
  10501. }
  10502. var scrollFrameOffsetWidth = this.adapter_.getOffsetWidthForScrollFrame() + this.currentTranslateOffset_;
  10503. var scrollTargetIndex = 0;
  10504. for (var i = 0; i < this.adapter_.getNumberOfTabs(); i++) {
  10505. var tabOffsetLeftAndWidth = this.adapter_.getComputedLeftForTabAtIndex(i) + this.adapter_.getComputedWidthForTabAtIndex(i);
  10506. var scrollTargetDetermined = tabOffsetLeftAndWidth > scrollFrameOffsetWidth;
  10507. if (this.isRTL_()) {
  10508. var frameOffsetAndTabWidth = scrollFrameOffsetWidth - this.adapter_.getComputedWidthForTabAtIndex(i);
  10509. var _tabOffsetLeftAndWidth = this.adapter_.getComputedLeftForTabAtIndex(i) + this.adapter_.getComputedWidthForTabAtIndex(i);
  10510. var tabRightOffset = this.adapter_.getOffsetWidthForTabBar() - _tabOffsetLeftAndWidth;
  10511. scrollTargetDetermined = tabRightOffset > frameOffsetAndTabWidth;
  10512. }
  10513. if (scrollTargetDetermined) {
  10514. scrollTargetIndex = i;
  10515. break;
  10516. }
  10517. }
  10518. this.scrollToTabAtIndex(scrollTargetIndex);
  10519. }
  10520. }, {
  10521. key: 'layout',
  10522. value: function layout() {
  10523. var _this4 = this;
  10524. cancelAnimationFrame(this.layoutFrame_);
  10525. this.scrollFrameScrollLeft_ = this.adapter_.getScrollLeftForScrollFrame();
  10526. this.layoutFrame_ = requestAnimationFrame(function () {
  10527. return _this4.layout_();
  10528. });
  10529. }
  10530. }, {
  10531. key: 'isRTL_',
  10532. value: function isRTL_() {
  10533. return this.adapter_.isRTL();
  10534. }
  10535. }, {
  10536. key: 'handlePossibleTabKeyboardFocus_',
  10537. value: function handlePossibleTabKeyboardFocus_(evt) {
  10538. if (!this.adapter_.eventTargetHasClass(evt.target, __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].TAB) || this.pointerDownRecognized_) {
  10539. return;
  10540. }
  10541. var resetAmt = this.isRTL_() ? this.scrollFrameScrollLeft_ : 0;
  10542. this.adapter_.setScrollLeftForScrollFrame(resetAmt);
  10543. this.focusedTarget_ = evt.target;
  10544. var scrollFrameWidth = this.adapter_.getOffsetWidthForScrollFrame();
  10545. var tabBarWidth = this.adapter_.getOffsetWidthForTabBar();
  10546. var leftEdge = this.adapter_.getOffsetLeftForEventTarget(this.focusedTarget_);
  10547. var rightEdge = leftEdge + this.adapter_.getOffsetWidthForEventTarget(this.focusedTarget_);
  10548. var shouldScrollBack = rightEdge <= this.currentTranslateOffset_;
  10549. var shouldScrollForward = rightEdge > this.currentTranslateOffset_ + scrollFrameWidth;
  10550. if (this.isRTL_()) {
  10551. var normalizedLeftOffset = tabBarWidth - leftEdge;
  10552. shouldScrollBack = leftEdge >= tabBarWidth - this.currentTranslateOffset_;
  10553. shouldScrollForward = normalizedLeftOffset > scrollFrameWidth + this.currentTranslateOffset_;
  10554. }
  10555. if (shouldScrollForward) {
  10556. this.scrollForward();
  10557. } else if (shouldScrollBack) {
  10558. this.scrollBack();
  10559. }
  10560. this.pointerDownRecognized_ = false;
  10561. }
  10562. }, {
  10563. key: 'layout_',
  10564. value: function layout_() {
  10565. var frameWidth = this.adapter_.getOffsetWidthForScrollFrame();
  10566. var isOverflowing = this.adapter_.getOffsetWidthForTabBar() > frameWidth;
  10567. if (!isOverflowing) {
  10568. this.currentTranslateOffset_ = 0;
  10569. }
  10570. this.shiftFrame_();
  10571. this.updateIndicatorEnabledStates_();
  10572. }
  10573. }, {
  10574. key: 'scrollToTabAtIndex',
  10575. value: function scrollToTabAtIndex(index) {
  10576. var _this5 = this;
  10577. var scrollTargetOffsetLeft = this.adapter_.getComputedLeftForTabAtIndex(index);
  10578. var scrollTargetOffsetWidth = this.adapter_.getComputedWidthForTabAtIndex(index);
  10579. this.currentTranslateOffset_ = this.normalizeForRTL_(scrollTargetOffsetLeft, scrollTargetOffsetWidth);
  10580. requestAnimationFrame(function () {
  10581. return _this5.shiftFrame_();
  10582. });
  10583. }
  10584. }, {
  10585. key: 'normalizeForRTL_',
  10586. value: function normalizeForRTL_(left, width) {
  10587. return this.isRTL_() ? this.adapter_.getOffsetWidthForTabBar() - (left + width) : left;
  10588. }
  10589. }, {
  10590. key: 'shiftFrame_',
  10591. value: function shiftFrame_() {
  10592. var shiftAmount = this.isRTL_() ? this.currentTranslateOffset_ : -this.currentTranslateOffset_;
  10593. this.adapter_.setTransformStyleForTabBar('translateX(' + shiftAmount + 'px)');
  10594. this.updateIndicatorEnabledStates_();
  10595. }
  10596. }, {
  10597. key: 'updateIndicatorEnabledStates_',
  10598. value: function updateIndicatorEnabledStates_() {
  10599. var INDICATOR_ENABLED = __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */].INDICATOR_ENABLED;
  10600. if (this.currentTranslateOffset_ === 0) {
  10601. this.adapter_.removeClassFromBackIndicator(INDICATOR_ENABLED);
  10602. } else {
  10603. this.adapter_.addClassToBackIndicator(INDICATOR_ENABLED);
  10604. }
  10605. var remainingTabBarWidth = this.adapter_.getOffsetWidthForTabBar() - this.currentTranslateOffset_;
  10606. if (remainingTabBarWidth > this.adapter_.getOffsetWidthForScrollFrame()) {
  10607. this.adapter_.addClassToForwardIndicator(INDICATOR_ENABLED);
  10608. } else {
  10609. this.adapter_.removeClassFromForwardIndicator(INDICATOR_ENABLED);
  10610. }
  10611. }
  10612. }]);
  10613. return MDCTabBarScrollerFoundation;
  10614. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  10615. /* harmony default export */ __webpack_exports__["a"] = (MDCTabBarScrollerFoundation);
  10616. /***/ }),
  10617. /* 81 */
  10618. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10619. "use strict";
  10620. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  10621. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  10622. /**
  10623. * Copyright 2017 Google Inc. All Rights Reserved.
  10624. *
  10625. * Licensed under the Apache License, Version 2.0 (the "License");
  10626. * you may not use this file except in compliance with the License.
  10627. * You may obtain a copy of the License at
  10628. *
  10629. * http://www.apache.org/licenses/LICENSE-2.0
  10630. *
  10631. * Unless required by applicable law or agreed to in writing, software
  10632. * distributed under the License is distributed on an "AS IS" BASIS,
  10633. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10634. * See the License for the specific language governing permissions and
  10635. * limitations under the License.
  10636. */
  10637. var cssClasses = {
  10638. INDICATOR_FORWARD: 'mdc-tab-bar-scroller__indicator--forward',
  10639. INDICATOR_BACK: 'mdc-tab-bar-scroller__indicator--back',
  10640. INDICATOR_ENABLED: 'mdc-tab-bar-scroller__indicator--enabled',
  10641. TAB: 'mdc-tab'
  10642. };
  10643. var strings = {
  10644. FRAME_SELECTOR: '.mdc-tab-bar-scroller__scroll-frame',
  10645. TABS_SELECTOR: '.mdc-tab-bar-scroller__scroll-frame__tabs',
  10646. TAB_SELECTOR: '.mdc-tab',
  10647. INDICATOR_FORWARD_SELECTOR: '.mdc-tab-bar-scroller__indicator--forward',
  10648. INDICATOR_BACK_SELECTOR: '.mdc-tab-bar-scroller__indicator--back'
  10649. };
  10650. /***/ }),
  10651. /* 82 */
  10652. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10653. "use strict";
  10654. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  10655. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextField", function() { return MDCTextField; });
  10656. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(2);
  10657. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__material_ripple__ = __webpack_require__(3);
  10658. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__material_ripple_util__ = __webpack_require__(6);
  10659. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__constants__ = __webpack_require__(19);
  10660. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__adapter__ = __webpack_require__(20);
  10661. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__foundation__ = __webpack_require__(85);
  10662. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__bottom_line__ = __webpack_require__(86);
  10663. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__helper_text__ = __webpack_require__(87);
  10664. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextFieldFoundation", function() { return __WEBPACK_IMPORTED_MODULE_5__foundation__["a"]; });
  10665. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextFieldBottomLine", function() { return __WEBPACK_IMPORTED_MODULE_6__bottom_line__["a"]; });
  10666. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextFieldBottomLineFoundation", function() { return __WEBPACK_IMPORTED_MODULE_6__bottom_line__["b"]; });
  10667. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextFieldHelperText", function() { return __WEBPACK_IMPORTED_MODULE_7__helper_text__["a"]; });
  10668. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCTextFieldHelperTextFoundation", function() { return __WEBPACK_IMPORTED_MODULE_7__helper_text__["b"]; });
  10669. 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; };
  10670. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  10671. 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); } };
  10672. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10673. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  10674. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  10675. /**
  10676. * @license
  10677. * Copyright 2016 Google Inc. All Rights Reserved.
  10678. *
  10679. * Licensed under the Apache License, Version 2.0 (the "License");
  10680. * you may not use this file except in compliance with the License.
  10681. * You may obtain a copy of the License at
  10682. *
  10683. * http://www.apache.org/licenses/LICENSE-2.0
  10684. *
  10685. * Unless required by applicable law or agreed to in writing, software
  10686. * distributed under the License is distributed on an "AS IS" BASIS,
  10687. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10688. * See the License for the specific language governing permissions and
  10689. * limitations under the License.
  10690. */
  10691. /* eslint-disable no-unused-vars */
  10692. /* eslint-enable no-unused-vars */
  10693. /**
  10694. * @extends {MDCComponent<!MDCTextFieldFoundation>}
  10695. * @final
  10696. */
  10697. var MDCTextField = function (_MDCComponent) {
  10698. _inherits(MDCTextField, _MDCComponent);
  10699. /**
  10700. * @param {...?} args
  10701. */
  10702. function MDCTextField() {
  10703. var _ref;
  10704. _classCallCheck(this, MDCTextField);
  10705. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  10706. args[_key] = arguments[_key];
  10707. }
  10708. /** @private {?Element} */
  10709. var _this = _possibleConstructorReturn(this, (_ref = MDCTextField.__proto__ || Object.getPrototypeOf(MDCTextField)).call.apply(_ref, [this].concat(args)));
  10710. _this.input_;
  10711. /** @private {?Element} */
  10712. _this.label_;
  10713. /** @type {?MDCRipple} */
  10714. _this.ripple;
  10715. /** @private {?MDCTextFieldBottomLine} */
  10716. _this.bottomLine_;
  10717. /** @private {?MDCTextFieldHelperText} */
  10718. _this.helperText_;
  10719. /** @private {?Element} */
  10720. _this.icon_;
  10721. return _this;
  10722. }
  10723. /**
  10724. * @param {!Element} root
  10725. * @return {!MDCTextField}
  10726. */
  10727. _createClass(MDCTextField, [{
  10728. key: 'initialize',
  10729. /**
  10730. * @param {(function(!Element): !MDCRipple)=} rippleFactory A function which
  10731. * creates a new MDCRipple.
  10732. * @param {(function(!Element): !MDCTextFieldBottomLine)=} bottomLineFactory A function which
  10733. * creates a new MDCTextFieldBottomLine.
  10734. */
  10735. value: function initialize() {
  10736. var _this2 = this;
  10737. var rippleFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function (el, foundation) {
  10738. return new __WEBPACK_IMPORTED_MODULE_1__material_ripple__["MDCRipple"](el, foundation);
  10739. };
  10740. var bottomLineFactory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (el) {
  10741. return new __WEBPACK_IMPORTED_MODULE_6__bottom_line__["a" /* MDCTextFieldBottomLine */](el);
  10742. };
  10743. this.input_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["b" /* strings */].INPUT_SELECTOR);
  10744. this.label_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["b" /* strings */].LABEL_SELECTOR);
  10745. this.ripple = null;
  10746. if (this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].BOX)) {
  10747. var MATCHES = Object(__WEBPACK_IMPORTED_MODULE_2__material_ripple_util__["getMatchesProperty"])(HTMLElement.prototype);
  10748. var adapter = _extends(__WEBPACK_IMPORTED_MODULE_1__material_ripple__["MDCRipple"].createAdapter(this), {
  10749. isSurfaceActive: function isSurfaceActive() {
  10750. return _this2.input_[MATCHES](':active');
  10751. },
  10752. registerInteractionHandler: function registerInteractionHandler(type, handler) {
  10753. return _this2.input_.addEventListener(type, handler);
  10754. },
  10755. deregisterInteractionHandler: function deregisterInteractionHandler(type, handler) {
  10756. return _this2.input_.removeEventListener(type, handler);
  10757. }
  10758. });
  10759. var foundation = new __WEBPACK_IMPORTED_MODULE_1__material_ripple__["MDCRippleFoundation"](adapter);
  10760. this.ripple = rippleFactory(this.root_, foundation);
  10761. };
  10762. if (!this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].TEXTAREA)) {
  10763. var bottomLineElement = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["b" /* strings */].BOTTOM_LINE_SELECTOR);
  10764. if (bottomLineElement) {
  10765. this.bottomLine_ = bottomLineFactory(bottomLineElement);
  10766. }
  10767. };
  10768. if (this.input_.hasAttribute(__WEBPACK_IMPORTED_MODULE_3__constants__["b" /* strings */].ARIA_CONTROLS)) {
  10769. var helperTextElement = document.getElementById(this.input_.getAttribute(__WEBPACK_IMPORTED_MODULE_3__constants__["b" /* strings */].ARIA_CONTROLS));
  10770. if (helperTextElement) {
  10771. this.helperText_ = new __WEBPACK_IMPORTED_MODULE_7__helper_text__["a" /* MDCTextFieldHelperText */](helperTextElement);
  10772. }
  10773. }
  10774. if (!this.root_.classList.contains(__WEBPACK_IMPORTED_MODULE_3__constants__["a" /* cssClasses */].TEXT_FIELD_ICON)) {
  10775. this.icon_ = this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_3__constants__["b" /* strings */].ICON_SELECTOR);
  10776. };
  10777. }
  10778. }, {
  10779. key: 'destroy',
  10780. value: function destroy() {
  10781. if (this.ripple) {
  10782. this.ripple.destroy();
  10783. }
  10784. if (this.bottomLine_) {
  10785. this.bottomLine_.destroy();
  10786. }
  10787. if (this.helperText_) {
  10788. this.helperText_.destroy();
  10789. }
  10790. _get(MDCTextField.prototype.__proto__ || Object.getPrototypeOf(MDCTextField.prototype), 'destroy', this).call(this);
  10791. }
  10792. /**
  10793. * Initiliazes the Text Field's internal state based on the environment's
  10794. * state.
  10795. */
  10796. }, {
  10797. key: 'initialSyncWithDom',
  10798. value: function initialSyncWithDom() {
  10799. this.disabled = this.input_.disabled;
  10800. }
  10801. /**
  10802. * @return {boolean} True if the Text Field is disabled.
  10803. */
  10804. }, {
  10805. key: 'getDefaultFoundation',
  10806. /**
  10807. * @return {!MDCTextFieldFoundation}
  10808. */
  10809. value: function getDefaultFoundation() {
  10810. var _this3 = this;
  10811. return new __WEBPACK_IMPORTED_MODULE_5__foundation__["a" /* default */](
  10812. /** @type {!MDCTextFieldAdapter} */_extends({
  10813. addClass: function addClass(className) {
  10814. return _this3.root_.classList.add(className);
  10815. },
  10816. removeClass: function removeClass(className) {
  10817. return _this3.root_.classList.remove(className);
  10818. },
  10819. addClassToLabel: function addClassToLabel(className) {
  10820. var label = _this3.label_;
  10821. if (label) {
  10822. label.classList.add(className);
  10823. }
  10824. },
  10825. removeClassFromLabel: function removeClassFromLabel(className) {
  10826. var label = _this3.label_;
  10827. if (label) {
  10828. label.classList.remove(className);
  10829. }
  10830. },
  10831. eventTargetHasClass: function eventTargetHasClass(target, className) {
  10832. return target.classList.contains(className);
  10833. },
  10834. registerTextFieldInteractionHandler: function registerTextFieldInteractionHandler(evtType, handler) {
  10835. return _this3.root_.addEventListener(evtType, handler);
  10836. },
  10837. deregisterTextFieldInteractionHandler: function deregisterTextFieldInteractionHandler(evtType, handler) {
  10838. return _this3.root_.removeEventListener(evtType, handler);
  10839. },
  10840. notifyIconAction: function notifyIconAction() {
  10841. return _this3.emit(__WEBPACK_IMPORTED_MODULE_5__foundation__["a" /* default */].strings.ICON_EVENT, {});
  10842. },
  10843. registerBottomLineEventHandler: function registerBottomLineEventHandler(evtType, handler) {
  10844. if (_this3.bottomLine_) {
  10845. _this3.bottomLine_.listen(evtType, handler);
  10846. }
  10847. },
  10848. deregisterBottomLineEventHandler: function deregisterBottomLineEventHandler(evtType, handler) {
  10849. if (_this3.bottomLine_) {
  10850. _this3.bottomLine_.unlisten(evtType, handler);
  10851. }
  10852. }
  10853. }, this.getInputAdapterMethods_(), this.getIconAdapterMethods_()), this.getFoundationMap_());
  10854. }
  10855. /**
  10856. * @return {!{
  10857. * setIconAttr: function(string, string): undefined,
  10858. * }}
  10859. */
  10860. }, {
  10861. key: 'getIconAdapterMethods_',
  10862. value: function getIconAdapterMethods_() {
  10863. var _this4 = this;
  10864. return {
  10865. setIconAttr: function setIconAttr(name, value) {
  10866. if (_this4.icon_) {
  10867. _this4.icon_.setAttribute(name, value);
  10868. }
  10869. }
  10870. };
  10871. }
  10872. /**
  10873. * @return {!{
  10874. * registerInputInteractionHandler: function(string, function()): undefined,
  10875. * deregisterInputInteractionHandler: function(string, function()): undefined,
  10876. * getNativeInput: function(): ?Element,
  10877. * }}
  10878. */
  10879. }, {
  10880. key: 'getInputAdapterMethods_',
  10881. value: function getInputAdapterMethods_() {
  10882. var _this5 = this;
  10883. return {
  10884. registerInputInteractionHandler: function registerInputInteractionHandler(evtType, handler) {
  10885. return _this5.input_.addEventListener(evtType, handler);
  10886. },
  10887. deregisterInputInteractionHandler: function deregisterInputInteractionHandler(evtType, handler) {
  10888. return _this5.input_.removeEventListener(evtType, handler);
  10889. },
  10890. getNativeInput: function getNativeInput() {
  10891. return _this5.input_;
  10892. }
  10893. };
  10894. }
  10895. /**
  10896. * Returns a map of all subcomponents to subfoundations.
  10897. * @return {!FoundationMapType}
  10898. */
  10899. }, {
  10900. key: 'getFoundationMap_',
  10901. value: function getFoundationMap_() {
  10902. return {
  10903. bottomLine: this.bottomLine_ ? this.bottomLine_.foundation : undefined,
  10904. helperText: this.helperText_ ? this.helperText_.foundation : undefined
  10905. };
  10906. }
  10907. }, {
  10908. key: 'disabled',
  10909. get: function get() {
  10910. return this.foundation_.isDisabled();
  10911. }
  10912. /**
  10913. * @param {boolean} disabled Sets the Text Field disabled or enabled.
  10914. */
  10915. ,
  10916. set: function set(disabled) {
  10917. this.foundation_.setDisabled(disabled);
  10918. }
  10919. /**
  10920. * @param {boolean} valid Sets the Text Field valid or invalid.
  10921. */
  10922. }, {
  10923. key: 'valid',
  10924. set: function set(valid) {
  10925. this.foundation_.setValid(valid);
  10926. }
  10927. /**
  10928. * Sets the helper text element content.
  10929. * @param {string} content
  10930. */
  10931. }, {
  10932. key: 'helperTextContent',
  10933. set: function set(content) {
  10934. this.foundation_.setHelperTextContent(content);
  10935. }
  10936. }], [{
  10937. key: 'attachTo',
  10938. value: function attachTo(root) {
  10939. return new MDCTextField(root);
  10940. }
  10941. }]);
  10942. return MDCTextField;
  10943. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  10944. /***/ }),
  10945. /* 83 */
  10946. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10947. "use strict";
  10948. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  10949. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  10950. /**
  10951. * @license
  10952. * Copyright 2017 Google Inc. All Rights Reserved.
  10953. *
  10954. * Licensed under the Apache License, Version 2.0 (the "License");
  10955. * you may not use this file except in compliance with the License.
  10956. * You may obtain a copy of the License at
  10957. *
  10958. * http://www.apache.org/licenses/LICENSE-2.0
  10959. *
  10960. * Unless required by applicable law or agreed to in writing, software
  10961. * distributed under the License is distributed on an "AS IS" BASIS,
  10962. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10963. * See the License for the specific language governing permissions and
  10964. * limitations under the License.
  10965. */
  10966. /** @enum {string} */
  10967. var strings = {
  10968. ANIMATION_END_EVENT: 'MDCTextFieldBottomLine:animation-end'
  10969. };
  10970. /** @enum {string} */
  10971. var cssClasses = {
  10972. BOTTOM_LINE_ACTIVE: 'mdc-text-field__bottom-line--active'
  10973. };
  10974. /***/ }),
  10975. /* 84 */
  10976. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  10977. "use strict";
  10978. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return strings; });
  10979. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  10980. /**
  10981. * @license
  10982. * Copyright 2016 Google Inc. All Rights Reserved.
  10983. *
  10984. * Licensed under the Apache License, Version 2.0 (the "License");
  10985. * you may not use this file except in compliance with the License.
  10986. * You may obtain a copy of the License at
  10987. *
  10988. * http://www.apache.org/licenses/LICENSE-2.0
  10989. *
  10990. * Unless required by applicable law or agreed to in writing, software
  10991. * distributed under the License is distributed on an "AS IS" BASIS,
  10992. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10993. * See the License for the specific language governing permissions and
  10994. * limitations under the License.
  10995. */
  10996. /** @enum {string} */
  10997. var strings = {
  10998. ARIA_HIDDEN: 'aria-hidden',
  10999. ROLE: 'role'
  11000. };
  11001. /** @enum {string} */
  11002. var cssClasses = {
  11003. HELPER_TEXT_PERSISTENT: 'mdc-text-field-helper-text--persistent',
  11004. HELPER_TEXT_VALIDATION_MSG: 'mdc-text-field-helper-text--validation-msg'
  11005. };
  11006. /***/ }),
  11007. /* 85 */
  11008. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11009. "use strict";
  11010. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  11011. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(20);
  11012. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__bottom_line_foundation__ = __webpack_require__(11);
  11013. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__helper_text_foundation__ = __webpack_require__(12);
  11014. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__constants__ = __webpack_require__(19);
  11015. 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; };
  11016. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  11017. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11018. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  11019. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  11020. /**
  11021. * @license
  11022. * Copyright 2016 Google Inc. All Rights Reserved.
  11023. *
  11024. * Licensed under the Apache License, Version 2.0 (the "License");
  11025. * you may not use this file except in compliance with the License.
  11026. * You may obtain a copy of the License at
  11027. *
  11028. * http://www.apache.org/licenses/LICENSE-2.0
  11029. *
  11030. * Unless required by applicable law or agreed to in writing, software
  11031. * distributed under the License is distributed on an "AS IS" BASIS,
  11032. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11033. * See the License for the specific language governing permissions and
  11034. * limitations under the License.
  11035. */
  11036. // eslint-disable-next-line no-unused-vars
  11037. /**
  11038. * @extends {MDCFoundation<!MDCTextFieldAdapter>}
  11039. * @final
  11040. */
  11041. var MDCTextFieldFoundation = function (_MDCFoundation) {
  11042. _inherits(MDCTextFieldFoundation, _MDCFoundation);
  11043. _createClass(MDCTextFieldFoundation, null, [{
  11044. key: 'cssClasses',
  11045. /** @return enum {string} */
  11046. get: function get() {
  11047. return __WEBPACK_IMPORTED_MODULE_4__constants__["a" /* cssClasses */];
  11048. }
  11049. /** @return enum {string} */
  11050. }, {
  11051. key: 'strings',
  11052. get: function get() {
  11053. return __WEBPACK_IMPORTED_MODULE_4__constants__["b" /* strings */];
  11054. }
  11055. /**
  11056. * {@see MDCTextFieldAdapter} for typing information on parameters and return
  11057. * types.
  11058. * @return {!MDCTextFieldAdapter}
  11059. */
  11060. }, {
  11061. key: 'defaultAdapter',
  11062. get: function get() {
  11063. return (/** @type {!MDCTextFieldAdapter} */{
  11064. addClass: function addClass() {},
  11065. removeClass: function removeClass() {},
  11066. addClassToLabel: function addClassToLabel() {},
  11067. removeClassFromLabel: function removeClassFromLabel() {},
  11068. setIconAttr: function setIconAttr() {},
  11069. eventTargetHasClass: function eventTargetHasClass() {},
  11070. registerTextFieldInteractionHandler: function registerTextFieldInteractionHandler() {},
  11071. deregisterTextFieldInteractionHandler: function deregisterTextFieldInteractionHandler() {},
  11072. notifyIconAction: function notifyIconAction() {},
  11073. registerInputInteractionHandler: function registerInputInteractionHandler() {},
  11074. deregisterInputInteractionHandler: function deregisterInputInteractionHandler() {},
  11075. registerBottomLineEventHandler: function registerBottomLineEventHandler() {},
  11076. deregisterBottomLineEventHandler: function deregisterBottomLineEventHandler() {},
  11077. getNativeInput: function getNativeInput() {}
  11078. }
  11079. );
  11080. }
  11081. /**
  11082. * @param {!MDCTextFieldAdapter=} adapter
  11083. * @param {!FoundationMapType=} foundationMap Map from subcomponent names to their subfoundations.
  11084. */
  11085. }]);
  11086. function MDCTextFieldFoundation() {
  11087. var adapter = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : /** @type {!MDCTextFieldAdapter} */{};
  11088. var foundationMap = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : /** @type {!FoundationMapType} */{};
  11089. _classCallCheck(this, MDCTextFieldFoundation);
  11090. /** @type {!MDCTextFieldBottomLineFoundation|undefined} */
  11091. var _this = _possibleConstructorReturn(this, (MDCTextFieldFoundation.__proto__ || Object.getPrototypeOf(MDCTextFieldFoundation)).call(this, _extends(MDCTextFieldFoundation.defaultAdapter, adapter)));
  11092. _this.bottomLine_ = foundationMap.bottomLine;
  11093. /** @type {!MDCTextFieldHelperTextFoundation|undefined} */
  11094. _this.helperText_ = foundationMap.helperText;
  11095. /** @private {boolean} */
  11096. _this.isFocused_ = false;
  11097. /** @private {boolean} */
  11098. _this.receivedUserInput_ = false;
  11099. /** @private {boolean} */
  11100. _this.useCustomValidityChecking_ = false;
  11101. /** @private {function(): undefined} */
  11102. _this.inputFocusHandler_ = function () {
  11103. return _this.activateFocus();
  11104. };
  11105. /** @private {function(): undefined} */
  11106. _this.inputBlurHandler_ = function () {
  11107. return _this.deactivateFocus();
  11108. };
  11109. /** @private {function(): undefined} */
  11110. _this.inputInputHandler_ = function () {
  11111. return _this.autoCompleteFocus();
  11112. };
  11113. /** @private {function(!Event): undefined} */
  11114. _this.setPointerXOffset_ = function (evt) {
  11115. return _this.setBottomLineTransformOrigin(evt);
  11116. };
  11117. /** @private {function(!Event): undefined} */
  11118. _this.textFieldInteractionHandler_ = function (evt) {
  11119. return _this.handleTextFieldInteraction(evt);
  11120. };
  11121. /** @private {function(!Event): undefined} */
  11122. _this.bottomLineAnimationEndHandler_ = function () {
  11123. return _this.handleBottomLineAnimationEnd();
  11124. };
  11125. return _this;
  11126. }
  11127. _createClass(MDCTextFieldFoundation, [{
  11128. key: 'init',
  11129. value: function init() {
  11130. var _this2 = this;
  11131. this.adapter_.addClass(MDCTextFieldFoundation.cssClasses.UPGRADED);
  11132. // Ensure label does not collide with any pre-filled value.
  11133. if (this.getNativeInput_().value) {
  11134. this.adapter_.addClassToLabel(MDCTextFieldFoundation.cssClasses.LABEL_FLOAT_ABOVE);
  11135. }
  11136. this.adapter_.registerInputInteractionHandler('focus', this.inputFocusHandler_);
  11137. this.adapter_.registerInputInteractionHandler('blur', this.inputBlurHandler_);
  11138. this.adapter_.registerInputInteractionHandler('input', this.inputInputHandler_);
  11139. ['mousedown', 'touchstart'].forEach(function (evtType) {
  11140. _this2.adapter_.registerInputInteractionHandler(evtType, _this2.setPointerXOffset_);
  11141. });
  11142. ['click', 'keydown'].forEach(function (evtType) {
  11143. _this2.adapter_.registerTextFieldInteractionHandler(evtType, _this2.textFieldInteractionHandler_);
  11144. });
  11145. this.adapter_.registerBottomLineEventHandler(__WEBPACK_IMPORTED_MODULE_2__bottom_line_foundation__["a" /* default */].strings.ANIMATION_END_EVENT, this.bottomLineAnimationEndHandler_);
  11146. }
  11147. }, {
  11148. key: 'destroy',
  11149. value: function destroy() {
  11150. var _this3 = this;
  11151. this.adapter_.removeClass(MDCTextFieldFoundation.cssClasses.UPGRADED);
  11152. this.adapter_.deregisterInputInteractionHandler('focus', this.inputFocusHandler_);
  11153. this.adapter_.deregisterInputInteractionHandler('blur', this.inputBlurHandler_);
  11154. this.adapter_.deregisterInputInteractionHandler('input', this.inputInputHandler_);
  11155. ['mousedown', 'touchstart'].forEach(function (evtType) {
  11156. _this3.adapter_.deregisterInputInteractionHandler(evtType, _this3.setPointerXOffset_);
  11157. });
  11158. ['click', 'keydown'].forEach(function (evtType) {
  11159. _this3.adapter_.deregisterTextFieldInteractionHandler(evtType, _this3.textFieldInteractionHandler_);
  11160. });
  11161. this.adapter_.deregisterBottomLineEventHandler(__WEBPACK_IMPORTED_MODULE_2__bottom_line_foundation__["a" /* default */].strings.ANIMATION_END_EVENT, this.bottomLineAnimationEndHandler_);
  11162. }
  11163. /**
  11164. * Handles all user interactions with the Text Field.
  11165. * @param {!Event} evt
  11166. */
  11167. }, {
  11168. key: 'handleTextFieldInteraction',
  11169. value: function handleTextFieldInteraction(evt) {
  11170. if (this.adapter_.getNativeInput().disabled) {
  11171. return;
  11172. }
  11173. this.receivedUserInput_ = true;
  11174. var target = evt.target,
  11175. type = evt.type;
  11176. var TEXT_FIELD_ICON = MDCTextFieldFoundation.cssClasses.TEXT_FIELD_ICON;
  11177. var targetIsIcon = this.adapter_.eventTargetHasClass(target, TEXT_FIELD_ICON);
  11178. var eventTriggersNotification = type === 'click' || evt.key === 'Enter' || evt.keyCode === 13;
  11179. if (targetIsIcon && eventTriggersNotification) {
  11180. this.adapter_.notifyIconAction();
  11181. }
  11182. }
  11183. /**
  11184. * Activates the text field focus state.
  11185. */
  11186. }, {
  11187. key: 'activateFocus',
  11188. value: function activateFocus() {
  11189. var _MDCTextFieldFoundati = MDCTextFieldFoundation.cssClasses,
  11190. FOCUSED = _MDCTextFieldFoundati.FOCUSED,
  11191. LABEL_FLOAT_ABOVE = _MDCTextFieldFoundati.LABEL_FLOAT_ABOVE,
  11192. LABEL_SHAKE = _MDCTextFieldFoundati.LABEL_SHAKE;
  11193. this.adapter_.addClass(FOCUSED);
  11194. if (this.bottomLine_) {
  11195. this.bottomLine_.activate();
  11196. }
  11197. this.adapter_.addClassToLabel(LABEL_FLOAT_ABOVE);
  11198. this.adapter_.removeClassFromLabel(LABEL_SHAKE);
  11199. if (this.helperText_) {
  11200. this.helperText_.showToScreenReader();
  11201. }
  11202. this.isFocused_ = true;
  11203. }
  11204. /**
  11205. * Sets the bottom line's transform origin, so that the bottom line activate
  11206. * animation will animate out from the user's click location.
  11207. * @param {!Event} evt
  11208. */
  11209. }, {
  11210. key: 'setBottomLineTransformOrigin',
  11211. value: function setBottomLineTransformOrigin(evt) {
  11212. if (this.bottomLine_) {
  11213. this.bottomLine_.setTransformOrigin(evt);
  11214. }
  11215. }
  11216. /**
  11217. * Activates the Text Field's focus state in cases when the input value
  11218. * changes without user input (e.g. programatically).
  11219. */
  11220. }, {
  11221. key: 'autoCompleteFocus',
  11222. value: function autoCompleteFocus() {
  11223. if (!this.receivedUserInput_) {
  11224. this.activateFocus();
  11225. }
  11226. }
  11227. /**
  11228. * Handles when bottom line animation ends, performing actions that must wait
  11229. * for animations to finish.
  11230. */
  11231. }, {
  11232. key: 'handleBottomLineAnimationEnd',
  11233. value: function handleBottomLineAnimationEnd() {
  11234. // We need to wait for the bottom line to be entirely transparent
  11235. // before removing the class. If we do not, we see the line start to
  11236. // scale down before disappearing
  11237. if (!this.isFocused_ && this.bottomLine_) {
  11238. this.bottomLine_.deactivate();
  11239. }
  11240. }
  11241. /**
  11242. * Deactives the Text Field's focus state.
  11243. */
  11244. }, {
  11245. key: 'deactivateFocus',
  11246. value: function deactivateFocus() {
  11247. var _MDCTextFieldFoundati2 = MDCTextFieldFoundation.cssClasses,
  11248. FOCUSED = _MDCTextFieldFoundati2.FOCUSED,
  11249. LABEL_FLOAT_ABOVE = _MDCTextFieldFoundati2.LABEL_FLOAT_ABOVE,
  11250. LABEL_SHAKE = _MDCTextFieldFoundati2.LABEL_SHAKE;
  11251. var input = this.getNativeInput_();
  11252. this.isFocused_ = false;
  11253. this.adapter_.removeClass(FOCUSED);
  11254. this.adapter_.removeClassFromLabel(LABEL_SHAKE);
  11255. if (!input.value && !this.isBadInput_()) {
  11256. this.adapter_.removeClassFromLabel(LABEL_FLOAT_ABOVE);
  11257. this.receivedUserInput_ = false;
  11258. }
  11259. if (!this.useCustomValidityChecking_) {
  11260. this.changeValidity_(input.checkValidity());
  11261. }
  11262. }
  11263. /**
  11264. * Updates the Text Field's valid state based on the supplied validity.
  11265. * @param {boolean} isValid
  11266. * @private
  11267. */
  11268. }, {
  11269. key: 'changeValidity_',
  11270. value: function changeValidity_(isValid) {
  11271. var _MDCTextFieldFoundati3 = MDCTextFieldFoundation.cssClasses,
  11272. INVALID = _MDCTextFieldFoundati3.INVALID,
  11273. LABEL_SHAKE = _MDCTextFieldFoundati3.LABEL_SHAKE;
  11274. if (isValid) {
  11275. this.adapter_.removeClass(INVALID);
  11276. } else {
  11277. this.adapter_.addClassToLabel(LABEL_SHAKE);
  11278. this.adapter_.addClass(INVALID);
  11279. }
  11280. if (this.helperText_) {
  11281. this.helperText_.setValidity(isValid);
  11282. }
  11283. }
  11284. /**
  11285. * @return {boolean} True if the Text Field input fails validity checks.
  11286. * @private
  11287. */
  11288. }, {
  11289. key: 'isBadInput_',
  11290. value: function isBadInput_() {
  11291. var input = this.getNativeInput_();
  11292. return input.validity ? input.validity.badInput : input.badInput;
  11293. }
  11294. /**
  11295. * @return {boolean} True if the Text Field is disabled.
  11296. */
  11297. }, {
  11298. key: 'isDisabled',
  11299. value: function isDisabled() {
  11300. return this.getNativeInput_().disabled;
  11301. }
  11302. /**
  11303. * @param {boolean} disabled Sets the text-field disabled or enabled.
  11304. */
  11305. }, {
  11306. key: 'setDisabled',
  11307. value: function setDisabled(disabled) {
  11308. var _MDCTextFieldFoundati4 = MDCTextFieldFoundation.cssClasses,
  11309. DISABLED = _MDCTextFieldFoundati4.DISABLED,
  11310. INVALID = _MDCTextFieldFoundati4.INVALID;
  11311. this.getNativeInput_().disabled = disabled;
  11312. if (disabled) {
  11313. this.adapter_.addClass(DISABLED);
  11314. this.adapter_.removeClass(INVALID);
  11315. this.adapter_.setIconAttr('tabindex', '-1');
  11316. } else {
  11317. this.adapter_.removeClass(DISABLED);
  11318. this.adapter_.setIconAttr('tabindex', '0');
  11319. }
  11320. }
  11321. /**
  11322. * @param {string} content Sets the content of the helper text.
  11323. */
  11324. }, {
  11325. key: 'setHelperTextContent',
  11326. value: function setHelperTextContent(content) {
  11327. if (this.helperText_) {
  11328. this.helperText_.setContent(content);
  11329. }
  11330. }
  11331. /**
  11332. * @return {!Element|!NativeInputType} The native text input from the
  11333. * host environment, or a dummy if none exists.
  11334. * @private
  11335. */
  11336. }, {
  11337. key: 'getNativeInput_',
  11338. value: function getNativeInput_() {
  11339. return this.adapter_.getNativeInput() ||
  11340. /** @type {!NativeInputType} */{
  11341. checkValidity: function checkValidity() {
  11342. return true;
  11343. },
  11344. value: '',
  11345. disabled: false,
  11346. badInput: false
  11347. };
  11348. }
  11349. /**
  11350. * @param {boolean} isValid Sets the validity state of the Text Field.
  11351. */
  11352. }, {
  11353. key: 'setValid',
  11354. value: function setValid(isValid) {
  11355. this.useCustomValidityChecking_ = true;
  11356. this.changeValidity_(isValid);
  11357. }
  11358. }]);
  11359. return MDCTextFieldFoundation;
  11360. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  11361. /* harmony default export */ __webpack_exports__["a"] = (MDCTextFieldFoundation);
  11362. /***/ }),
  11363. /* 86 */
  11364. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11365. "use strict";
  11366. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTextFieldBottomLine; });
  11367. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(2);
  11368. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(21);
  11369. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(11);
  11370. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  11371. 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; };
  11372. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  11373. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11374. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  11375. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  11376. /**
  11377. * @license
  11378. * Copyright 2017 Google Inc. All Rights Reserved.
  11379. *
  11380. * Licensed under the Apache License, Version 2.0 (the "License");
  11381. * you may not use this file except in compliance with the License.
  11382. * You may obtain a copy of the License at
  11383. *
  11384. * http://www.apache.org/licenses/LICENSE-2.0
  11385. *
  11386. * Unless required by applicable law or agreed to in writing, software
  11387. * distributed under the License is distributed on an "AS IS" BASIS,
  11388. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11389. * See the License for the specific language governing permissions and
  11390. * limitations under the License.
  11391. */
  11392. /**
  11393. * @extends {MDCComponent<!MDCTextFieldBottomLineFoundation>}
  11394. * @final
  11395. */
  11396. var MDCTextFieldBottomLine = function (_MDCComponent) {
  11397. _inherits(MDCTextFieldBottomLine, _MDCComponent);
  11398. function MDCTextFieldBottomLine() {
  11399. _classCallCheck(this, MDCTextFieldBottomLine);
  11400. return _possibleConstructorReturn(this, (MDCTextFieldBottomLine.__proto__ || Object.getPrototypeOf(MDCTextFieldBottomLine)).apply(this, arguments));
  11401. }
  11402. _createClass(MDCTextFieldBottomLine, [{
  11403. key: 'getDefaultFoundation',
  11404. /**
  11405. * @return {!MDCTextFieldBottomLineFoundation}
  11406. */
  11407. value: function getDefaultFoundation() {
  11408. var _this2 = this;
  11409. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]( /** @type {!MDCTextFieldBottomLineAdapter} */_extends({
  11410. addClass: function addClass(className) {
  11411. return _this2.root_.classList.add(className);
  11412. },
  11413. removeClass: function removeClass(className) {
  11414. return _this2.root_.classList.remove(className);
  11415. },
  11416. setAttr: function setAttr(attr, value) {
  11417. return _this2.root_.setAttribute(attr, value);
  11418. },
  11419. registerEventHandler: function registerEventHandler(evtType, handler) {
  11420. return _this2.root_.addEventListener(evtType, handler);
  11421. },
  11422. deregisterEventHandler: function deregisterEventHandler(evtType, handler) {
  11423. return _this2.root_.removeEventListener(evtType, handler);
  11424. },
  11425. notifyAnimationEnd: function notifyAnimationEnd() {
  11426. _this2.emit(__WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */].strings.ANIMATION_END_EVENT, {});
  11427. }
  11428. }));
  11429. }
  11430. }, {
  11431. key: 'foundation',
  11432. /**
  11433. * @return {!MDCTextFieldBottomLineFoundation}
  11434. */
  11435. get: function get() {
  11436. return this.foundation_;
  11437. }
  11438. }], [{
  11439. key: 'attachTo',
  11440. /**
  11441. * @param {!Element} root
  11442. * @return {!MDCTextFieldBottomLine}
  11443. */
  11444. value: function attachTo(root) {
  11445. return new MDCTextFieldBottomLine(root);
  11446. }
  11447. }]);
  11448. return MDCTextFieldBottomLine;
  11449. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  11450. /***/ }),
  11451. /* 87 */
  11452. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11453. "use strict";
  11454. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return MDCTextFieldHelperText; });
  11455. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_component__ = __webpack_require__(2);
  11456. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__adapter__ = __webpack_require__(22);
  11457. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__foundation__ = __webpack_require__(12);
  11458. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2__foundation__["a"]; });
  11459. 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; };
  11460. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  11461. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11462. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  11463. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  11464. /**
  11465. * @license
  11466. * Copyright 2017 Google Inc. All Rights Reserved.
  11467. *
  11468. * Licensed under the Apache License, Version 2.0 (the "License");
  11469. * you may not use this file except in compliance with the License.
  11470. * You may obtain a copy of the License at
  11471. *
  11472. * http://www.apache.org/licenses/LICENSE-2.0
  11473. *
  11474. * Unless required by applicable law or agreed to in writing, software
  11475. * distributed under the License is distributed on an "AS IS" BASIS,
  11476. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11477. * See the License for the specific language governing permissions and
  11478. * limitations under the License.
  11479. */
  11480. /**
  11481. * @extends {MDCComponent<!MDCTextFieldHelperTextFoundation>}
  11482. * @final
  11483. */
  11484. var MDCTextFieldHelperText = function (_MDCComponent) {
  11485. _inherits(MDCTextFieldHelperText, _MDCComponent);
  11486. function MDCTextFieldHelperText() {
  11487. _classCallCheck(this, MDCTextFieldHelperText);
  11488. return _possibleConstructorReturn(this, (MDCTextFieldHelperText.__proto__ || Object.getPrototypeOf(MDCTextFieldHelperText)).apply(this, arguments));
  11489. }
  11490. _createClass(MDCTextFieldHelperText, [{
  11491. key: 'getDefaultFoundation',
  11492. /**
  11493. * @return {!MDCTextFieldHelperTextFoundation}
  11494. */
  11495. value: function getDefaultFoundation() {
  11496. var _this2 = this;
  11497. return new __WEBPACK_IMPORTED_MODULE_2__foundation__["a" /* default */]( /** @type {!MDCTextFieldHelperTextAdapter} */_extends({
  11498. addClass: function addClass(className) {
  11499. return _this2.root_.classList.add(className);
  11500. },
  11501. removeClass: function removeClass(className) {
  11502. return _this2.root_.classList.remove(className);
  11503. },
  11504. hasClass: function hasClass(className) {
  11505. return _this2.root_.classList.contains(className);
  11506. },
  11507. setAttr: function setAttr(attr, value) {
  11508. return _this2.root_.setAttribute(attr, value);
  11509. },
  11510. removeAttr: function removeAttr(attr) {
  11511. return _this2.root_.removeAttribute(attr);
  11512. },
  11513. setContent: function setContent(content) {
  11514. _this2.root_.textContent = content;
  11515. }
  11516. }));
  11517. }
  11518. }, {
  11519. key: 'foundation',
  11520. /**
  11521. * @return {!MDCTextFieldHelperTextFoundation}
  11522. */
  11523. get: function get() {
  11524. return this.foundation_;
  11525. }
  11526. }], [{
  11527. key: 'attachTo',
  11528. /**
  11529. * @param {!Element} root
  11530. * @return {!MDCTextFieldHelperText}
  11531. */
  11532. value: function attachTo(root) {
  11533. return new MDCTextFieldHelperText(root);
  11534. }
  11535. }]);
  11536. return MDCTextFieldHelperText;
  11537. }(__WEBPACK_IMPORTED_MODULE_0__material_base_component__["a" /* default */]);
  11538. /***/ }),
  11539. /* 88 */
  11540. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11541. "use strict";
  11542. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  11543. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MDCToolbar", function() { return MDCToolbar; });
  11544. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base__ = __webpack_require__(1);
  11545. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__foundation__ = __webpack_require__(89);
  11546. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util__ = __webpack_require__(91);
  11547. /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "MDCToolbarFoundation", function() { return __WEBPACK_IMPORTED_MODULE_1__foundation__["a"]; });
  11548. /* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, "util", function() { return __WEBPACK_IMPORTED_MODULE_2__util__; });
  11549. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  11550. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11551. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  11552. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  11553. /**
  11554. * Copyright 2017 Google Inc. All Rights Reserved.
  11555. *
  11556. * Licensed under the Apache License, Version 2.0 (the "License");
  11557. * you may not use this file except in compliance with the License.
  11558. * You may obtain a copy of the License at
  11559. *
  11560. * http://www.apache.org/licenses/LICENSE-2.0
  11561. *
  11562. * Unless required by applicable law or agreed to in writing, software
  11563. * distributed under the License is distributed on an "AS IS" BASIS,
  11564. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11565. * See the License for the specific language governing permissions and
  11566. * limitations under the License.
  11567. */
  11568. var MDCToolbar = function (_MDCComponent) {
  11569. _inherits(MDCToolbar, _MDCComponent);
  11570. function MDCToolbar() {
  11571. _classCallCheck(this, MDCToolbar);
  11572. return _possibleConstructorReturn(this, (MDCToolbar.__proto__ || Object.getPrototypeOf(MDCToolbar)).apply(this, arguments));
  11573. }
  11574. _createClass(MDCToolbar, [{
  11575. key: 'getDefaultFoundation',
  11576. value: function getDefaultFoundation() {
  11577. var _this2 = this;
  11578. return new __WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */]({
  11579. hasClass: function hasClass(className) {
  11580. return _this2.root_.classList.contains(className);
  11581. },
  11582. addClass: function addClass(className) {
  11583. return _this2.root_.classList.add(className);
  11584. },
  11585. removeClass: function removeClass(className) {
  11586. return _this2.root_.classList.remove(className);
  11587. },
  11588. registerScrollHandler: function registerScrollHandler(handler) {
  11589. return window.addEventListener('scroll', handler, __WEBPACK_IMPORTED_MODULE_2__util__["applyPassive"]());
  11590. },
  11591. deregisterScrollHandler: function deregisterScrollHandler(handler) {
  11592. return window.removeEventListener('scroll', handler, __WEBPACK_IMPORTED_MODULE_2__util__["applyPassive"]());
  11593. },
  11594. registerResizeHandler: function registerResizeHandler(handler) {
  11595. return window.addEventListener('resize', handler);
  11596. },
  11597. deregisterResizeHandler: function deregisterResizeHandler(handler) {
  11598. return window.removeEventListener('resize', handler);
  11599. },
  11600. getViewportWidth: function getViewportWidth() {
  11601. return window.innerWidth;
  11602. },
  11603. getViewportScrollY: function getViewportScrollY() {
  11604. return window.pageYOffset;
  11605. },
  11606. getOffsetHeight: function getOffsetHeight() {
  11607. return _this2.root_.offsetHeight;
  11608. },
  11609. getFirstRowElementOffsetHeight: function getFirstRowElementOffsetHeight() {
  11610. return _this2.firstRowElement_.offsetHeight;
  11611. },
  11612. notifyChange: function notifyChange(evtData) {
  11613. return _this2.emit(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.CHANGE_EVENT, evtData);
  11614. },
  11615. setStyle: function setStyle(property, value) {
  11616. return _this2.root_.style.setProperty(property, value);
  11617. },
  11618. setStyleForTitleElement: function setStyleForTitleElement(property, value) {
  11619. return _this2.titleElement_.style.setProperty(property, value);
  11620. },
  11621. setStyleForFlexibleRowElement: function setStyleForFlexibleRowElement(property, value) {
  11622. return _this2.firstRowElement_.style.setProperty(property, value);
  11623. },
  11624. setStyleForFixedAdjustElement: function setStyleForFixedAdjustElement(property, value) {
  11625. if (_this2.fixedAdjustElement) {
  11626. _this2.fixedAdjustElement.style.setProperty(property, value);
  11627. }
  11628. }
  11629. });
  11630. }
  11631. }, {
  11632. key: 'firstRowElement_',
  11633. get: function get() {
  11634. return this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.FIRST_ROW_SELECTOR);
  11635. }
  11636. }, {
  11637. key: 'titleElement_',
  11638. get: function get() {
  11639. return this.root_.querySelector(__WEBPACK_IMPORTED_MODULE_1__foundation__["a" /* default */].strings.TITLE_SELECTOR);
  11640. }
  11641. }, {
  11642. key: 'fixedAdjustElement',
  11643. set: function set(fixedAdjustElement) {
  11644. this.fixedAdjustElement_ = fixedAdjustElement;
  11645. this.foundation_.updateAdjustElementStyles();
  11646. },
  11647. get: function get() {
  11648. return this.fixedAdjustElement_;
  11649. }
  11650. }], [{
  11651. key: 'attachTo',
  11652. value: function attachTo(root) {
  11653. return new MDCToolbar(root);
  11654. }
  11655. }]);
  11656. return MDCToolbar;
  11657. }(__WEBPACK_IMPORTED_MODULE_0__material_base__["MDCComponent"]);
  11658. /***/ }),
  11659. /* 89 */
  11660. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11661. "use strict";
  11662. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__material_base_foundation__ = __webpack_require__(0);
  11663. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__constants__ = __webpack_require__(90);
  11664. 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; };
  11665. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  11666. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11667. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  11668. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  11669. /**
  11670. * Copyright 2017 Google Inc. All Rights Reserved.
  11671. *
  11672. * Licensed under the Apache License, Version 2.0 (the "License");
  11673. * you may not use this file except in compliance with the License.
  11674. * You may obtain a copy of the License at
  11675. *
  11676. * http://www.apache.org/licenses/LICENSE-2.0
  11677. *
  11678. * Unless required by applicable law or agreed to in writing, software
  11679. * distributed under the License is distributed on an "AS IS" BASIS,
  11680. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11681. * See the License for the specific language governing permissions and
  11682. * limitations under the License.
  11683. */
  11684. var MDCToolbarFoundation = function (_MDCFoundation) {
  11685. _inherits(MDCToolbarFoundation, _MDCFoundation);
  11686. _createClass(MDCToolbarFoundation, null, [{
  11687. key: 'cssClasses',
  11688. get: function get() {
  11689. return __WEBPACK_IMPORTED_MODULE_1__constants__["a" /* cssClasses */];
  11690. }
  11691. }, {
  11692. key: 'strings',
  11693. get: function get() {
  11694. return __WEBPACK_IMPORTED_MODULE_1__constants__["c" /* strings */];
  11695. }
  11696. }, {
  11697. key: 'numbers',
  11698. get: function get() {
  11699. return __WEBPACK_IMPORTED_MODULE_1__constants__["b" /* numbers */];
  11700. }
  11701. }, {
  11702. key: 'defaultAdapter',
  11703. get: function get() {
  11704. return {
  11705. hasClass: function hasClass() {
  11706. return (/* className: string */ /* boolean */false
  11707. );
  11708. },
  11709. addClass: function addClass() /* className: string */{},
  11710. removeClass: function removeClass() /* className: string */{},
  11711. registerScrollHandler: function registerScrollHandler() /* handler: EventListener */{},
  11712. deregisterScrollHandler: function deregisterScrollHandler() /* handler: EventListener */{},
  11713. registerResizeHandler: function registerResizeHandler() /* handler: EventListener */{},
  11714. deregisterResizeHandler: function deregisterResizeHandler() /* handler: EventListener */{},
  11715. getViewportWidth: function getViewportWidth() {
  11716. return (/* number */0
  11717. );
  11718. },
  11719. getViewportScrollY: function getViewportScrollY() {
  11720. return (/* number */0
  11721. );
  11722. },
  11723. getOffsetHeight: function getOffsetHeight() {
  11724. return (/* number */0
  11725. );
  11726. },
  11727. getFirstRowElementOffsetHeight: function getFirstRowElementOffsetHeight() {
  11728. return (/* number */0
  11729. );
  11730. },
  11731. notifyChange: function notifyChange() /* evtData: {flexibleExpansionRatio: number} */{},
  11732. setStyle: function setStyle() /* property: string, value: string */{},
  11733. setStyleForTitleElement: function setStyleForTitleElement() /* property: string, value: string */{},
  11734. setStyleForFlexibleRowElement: function setStyleForFlexibleRowElement() /* property: string, value: string */{},
  11735. setStyleForFixedAdjustElement: function setStyleForFixedAdjustElement() /* property: string, value: string */{}
  11736. };
  11737. }
  11738. }]);
  11739. function MDCToolbarFoundation(adapter) {
  11740. _classCallCheck(this, MDCToolbarFoundation);
  11741. var _this = _possibleConstructorReturn(this, (MDCToolbarFoundation.__proto__ || Object.getPrototypeOf(MDCToolbarFoundation)).call(this, _extends(MDCToolbarFoundation.defaultAdapter, adapter)));
  11742. _this.resizeHandler_ = function () {
  11743. return _this.checkRowHeight_();
  11744. };
  11745. _this.scrollHandler_ = function () {
  11746. return _this.updateToolbarStyles_();
  11747. };
  11748. _this.checkRowHeightFrame_ = 0;
  11749. _this.scrollFrame_ = 0;
  11750. _this.executedLastChange_ = false;
  11751. _this.calculations_ = {
  11752. toolbarRowHeight: 0,
  11753. // Calculated Height ratio. We use ratio to calculate corresponding heights in resize event.
  11754. toolbarRatio: 0, // The ratio of toolbar height to row height
  11755. flexibleExpansionRatio: 0, // The ratio of flexible space height to row height
  11756. maxTranslateYRatio: 0, // The ratio of max toolbar move up distance to row height
  11757. scrollThresholdRatio: 0, // The ratio of max scrollTop that we should listen to to row height
  11758. // Derived Heights based on the above key ratios.
  11759. toolbarHeight: 0,
  11760. flexibleExpansionHeight: 0, // Flexible row minus toolbar height (derived)
  11761. maxTranslateYDistance: 0, // When toolbar only fix last row (derived)
  11762. scrollThreshold: 0
  11763. };
  11764. // Toolbar fixed behavior
  11765. // If toolbar is fixed
  11766. _this.fixed_ = false;
  11767. // If fixed is targeted only at the last row
  11768. _this.fixedLastrow_ = false;
  11769. // Toolbar flexible behavior
  11770. // If the first row is flexible
  11771. _this.hasFlexibleRow_ = false;
  11772. // If use the default behavior
  11773. _this.useFlexDefaultBehavior_ = false;
  11774. return _this;
  11775. }
  11776. _createClass(MDCToolbarFoundation, [{
  11777. key: 'init',
  11778. value: function init() {
  11779. this.fixed_ = this.adapter_.hasClass(MDCToolbarFoundation.cssClasses.FIXED);
  11780. this.fixedLastrow_ = this.adapter_.hasClass(MDCToolbarFoundation.cssClasses.FIXED_LASTROW) & this.fixed_;
  11781. this.hasFlexibleRow_ = this.adapter_.hasClass(MDCToolbarFoundation.cssClasses.TOOLBAR_ROW_FLEXIBLE);
  11782. if (this.hasFlexibleRow_) {
  11783. this.useFlexDefaultBehavior_ = this.adapter_.hasClass(MDCToolbarFoundation.cssClasses.FLEXIBLE_DEFAULT_BEHAVIOR);
  11784. }
  11785. this.initKeyRatio_();
  11786. this.setKeyHeights_();
  11787. this.adapter_.registerResizeHandler(this.resizeHandler_);
  11788. this.adapter_.registerScrollHandler(this.scrollHandler_);
  11789. }
  11790. }, {
  11791. key: 'destroy',
  11792. value: function destroy() {
  11793. this.adapter_.deregisterResizeHandler(this.resizeHandler_);
  11794. this.adapter_.deregisterScrollHandler(this.scrollHandler_);
  11795. }
  11796. }, {
  11797. key: 'updateAdjustElementStyles',
  11798. value: function updateAdjustElementStyles() {
  11799. if (this.fixed_) {
  11800. this.adapter_.setStyleForFixedAdjustElement('margin-top', this.calculations_.toolbarHeight + 'px');
  11801. }
  11802. }
  11803. }, {
  11804. key: 'getFlexibleExpansionRatio_',
  11805. value: function getFlexibleExpansionRatio_(scrollTop) {
  11806. // To prevent division by zero when there is no flexibleExpansionHeight
  11807. var delta = 0.0001;
  11808. return Math.max(0, 1 - scrollTop / (this.calculations_.flexibleExpansionHeight + delta));
  11809. }
  11810. }, {
  11811. key: 'checkRowHeight_',
  11812. value: function checkRowHeight_() {
  11813. var _this2 = this;
  11814. cancelAnimationFrame(this.checkRowHeightFrame_);
  11815. this.checkRowHeightFrame_ = requestAnimationFrame(function () {
  11816. return _this2.setKeyHeights_();
  11817. });
  11818. }
  11819. }, {
  11820. key: 'setKeyHeights_',
  11821. value: function setKeyHeights_() {
  11822. var newToolbarRowHeight = this.getRowHeight_();
  11823. if (newToolbarRowHeight !== this.calculations_.toolbarRowHeight) {
  11824. this.calculations_.toolbarRowHeight = newToolbarRowHeight;
  11825. this.calculations_.toolbarHeight = this.calculations_.toolbarRatio * this.calculations_.toolbarRowHeight;
  11826. this.calculations_.flexibleExpansionHeight = this.calculations_.flexibleExpansionRatio * this.calculations_.toolbarRowHeight;
  11827. this.calculations_.maxTranslateYDistance = this.calculations_.maxTranslateYRatio * this.calculations_.toolbarRowHeight;
  11828. this.calculations_.scrollThreshold = this.calculations_.scrollThresholdRatio * this.calculations_.toolbarRowHeight;
  11829. this.updateAdjustElementStyles();
  11830. this.updateToolbarStyles_();
  11831. }
  11832. }
  11833. }, {
  11834. key: 'updateToolbarStyles_',
  11835. value: function updateToolbarStyles_() {
  11836. var _this3 = this;
  11837. cancelAnimationFrame(this.scrollFrame_);
  11838. this.scrollFrame_ = requestAnimationFrame(function () {
  11839. var scrollTop = _this3.adapter_.getViewportScrollY();
  11840. var hasScrolledOutOfThreshold = _this3.scrolledOutOfThreshold_(scrollTop);
  11841. if (hasScrolledOutOfThreshold && _this3.executedLastChange_) {
  11842. return;
  11843. }
  11844. var flexibleExpansionRatio = _this3.getFlexibleExpansionRatio_(scrollTop);
  11845. _this3.updateToolbarFlexibleState_(flexibleExpansionRatio);
  11846. if (_this3.fixedLastrow_) {
  11847. _this3.updateToolbarFixedState_(scrollTop);
  11848. }
  11849. if (_this3.hasFlexibleRow_) {
  11850. _this3.updateFlexibleRowElementStyles_(flexibleExpansionRatio);
  11851. }
  11852. _this3.executedLastChange_ = hasScrolledOutOfThreshold;
  11853. _this3.adapter_.notifyChange({ flexibleExpansionRatio: flexibleExpansionRatio });
  11854. });
  11855. }
  11856. }, {
  11857. key: 'scrolledOutOfThreshold_',
  11858. value: function scrolledOutOfThreshold_(scrollTop) {
  11859. return scrollTop > this.calculations_.scrollThreshold;
  11860. }
  11861. }, {
  11862. key: 'initKeyRatio_',
  11863. value: function initKeyRatio_() {
  11864. var toolbarRowHeight = this.getRowHeight_();
  11865. var firstRowMaxRatio = this.adapter_.getFirstRowElementOffsetHeight() / toolbarRowHeight;
  11866. this.calculations_.toolbarRatio = this.adapter_.getOffsetHeight() / toolbarRowHeight;
  11867. this.calculations_.flexibleExpansionRatio = firstRowMaxRatio - 1;
  11868. this.calculations_.maxTranslateYRatio = this.fixedLastrow_ ? this.calculations_.toolbarRatio - firstRowMaxRatio : 0;
  11869. this.calculations_.scrollThresholdRatio = (this.fixedLastrow_ ? this.calculations_.toolbarRatio : firstRowMaxRatio) - 1;
  11870. }
  11871. }, {
  11872. key: 'getRowHeight_',
  11873. value: function getRowHeight_() {
  11874. var breakpoint = MDCToolbarFoundation.numbers.TOOLBAR_MOBILE_BREAKPOINT;
  11875. return this.adapter_.getViewportWidth() < breakpoint ? MDCToolbarFoundation.numbers.TOOLBAR_ROW_MOBILE_HEIGHT : MDCToolbarFoundation.numbers.TOOLBAR_ROW_HEIGHT;
  11876. }
  11877. }, {
  11878. key: 'updateToolbarFlexibleState_',
  11879. value: function updateToolbarFlexibleState_(flexibleExpansionRatio) {
  11880. this.adapter_.removeClass(MDCToolbarFoundation.cssClasses.FLEXIBLE_MAX);
  11881. this.adapter_.removeClass(MDCToolbarFoundation.cssClasses.FLEXIBLE_MIN);
  11882. if (flexibleExpansionRatio === 1) {
  11883. this.adapter_.addClass(MDCToolbarFoundation.cssClasses.FLEXIBLE_MAX);
  11884. } else if (flexibleExpansionRatio === 0) {
  11885. this.adapter_.addClass(MDCToolbarFoundation.cssClasses.FLEXIBLE_MIN);
  11886. }
  11887. }
  11888. }, {
  11889. key: 'updateToolbarFixedState_',
  11890. value: function updateToolbarFixedState_(scrollTop) {
  11891. var translateDistance = Math.max(0, Math.min(scrollTop - this.calculations_.flexibleExpansionHeight, this.calculations_.maxTranslateYDistance));
  11892. this.adapter_.setStyle('transform', 'translateY(' + -translateDistance + 'px)');
  11893. if (translateDistance === this.calculations_.maxTranslateYDistance) {
  11894. this.adapter_.addClass(MDCToolbarFoundation.cssClasses.FIXED_AT_LAST_ROW);
  11895. } else {
  11896. this.adapter_.removeClass(MDCToolbarFoundation.cssClasses.FIXED_AT_LAST_ROW);
  11897. }
  11898. }
  11899. }, {
  11900. key: 'updateFlexibleRowElementStyles_',
  11901. value: function updateFlexibleRowElementStyles_(flexibleExpansionRatio) {
  11902. if (this.fixed_) {
  11903. var height = this.calculations_.flexibleExpansionHeight * flexibleExpansionRatio;
  11904. this.adapter_.setStyleForFlexibleRowElement('height', height + this.calculations_.toolbarRowHeight + 'px');
  11905. }
  11906. if (this.useFlexDefaultBehavior_) {
  11907. this.updateElementStylesDefaultBehavior_(flexibleExpansionRatio);
  11908. }
  11909. }
  11910. }, {
  11911. key: 'updateElementStylesDefaultBehavior_',
  11912. value: function updateElementStylesDefaultBehavior_(flexibleExpansionRatio) {
  11913. var maxTitleSize = MDCToolbarFoundation.numbers.MAX_TITLE_SIZE;
  11914. var minTitleSize = MDCToolbarFoundation.numbers.MIN_TITLE_SIZE;
  11915. var currentTitleSize = (maxTitleSize - minTitleSize) * flexibleExpansionRatio + minTitleSize;
  11916. this.adapter_.setStyleForTitleElement('font-size', currentTitleSize + 'rem');
  11917. }
  11918. }]);
  11919. return MDCToolbarFoundation;
  11920. }(__WEBPACK_IMPORTED_MODULE_0__material_base_foundation__["a" /* default */]);
  11921. /* harmony default export */ __webpack_exports__["a"] = (MDCToolbarFoundation);
  11922. /***/ }),
  11923. /* 90 */
  11924. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11925. "use strict";
  11926. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cssClasses; });
  11927. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return strings; });
  11928. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return numbers; });
  11929. /**
  11930. * Copyright 2017 Google Inc. All Rights Reserved.
  11931. *
  11932. * Licensed under the Apache License, Version 2.0 (the "License");
  11933. * you may not use this file except in compliance with the License.
  11934. * You may obtain a copy of the License at
  11935. *
  11936. * http://www.apache.org/licenses/LICENSE-2.0
  11937. *
  11938. * Unless required by applicable law or agreed to in writing, software
  11939. * distributed under the License is distributed on an "AS IS" BASIS,
  11940. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11941. * See the License for the specific language governing permissions and
  11942. * limitations under the License.
  11943. */
  11944. var cssClasses = {
  11945. FIXED: 'mdc-toolbar--fixed',
  11946. FIXED_LASTROW: 'mdc-toolbar--fixed-lastrow-only',
  11947. FIXED_AT_LAST_ROW: 'mdc-toolbar--fixed-at-last-row',
  11948. TOOLBAR_ROW_FLEXIBLE: 'mdc-toolbar--flexible',
  11949. FLEXIBLE_DEFAULT_BEHAVIOR: 'mdc-toolbar--flexible-default-behavior',
  11950. FLEXIBLE_MAX: 'mdc-toolbar--flexible-space-maximized',
  11951. FLEXIBLE_MIN: 'mdc-toolbar--flexible-space-minimized'
  11952. };
  11953. var strings = {
  11954. TITLE_SELECTOR: '.mdc-toolbar__title',
  11955. FIRST_ROW_SELECTOR: '.mdc-toolbar__row:first-child',
  11956. CHANGE_EVENT: 'MDCToolbar:change'
  11957. };
  11958. var numbers = {
  11959. MAX_TITLE_SIZE: 2.125,
  11960. MIN_TITLE_SIZE: 1.25,
  11961. TOOLBAR_ROW_HEIGHT: 64,
  11962. TOOLBAR_ROW_MOBILE_HEIGHT: 56,
  11963. TOOLBAR_MOBILE_BREAKPOINT: 600
  11964. };
  11965. /***/ }),
  11966. /* 91 */
  11967. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11968. "use strict";
  11969. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  11970. /* harmony export (immutable) */ __webpack_exports__["applyPassive"] = applyPassive;
  11971. /**
  11972. * Copyright 2016 Google Inc. All Rights Reserved.
  11973. *
  11974. * Licensed under the Apache License, Version 2.0 (the "License");
  11975. * you may not use this file except in compliance with the License.
  11976. * You may obtain a copy of the License at
  11977. *
  11978. * http://www.apache.org/licenses/LICENSE-2.0
  11979. *
  11980. * Unless required by applicable law or agreed to in writing, software
  11981. * distributed under the License is distributed on an "AS IS" BASIS,
  11982. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11983. * See the License for the specific language governing permissions and
  11984. * limitations under the License.
  11985. */
  11986. var supportsPassive_ = void 0;
  11987. // Determine whether the current browser supports passive event listeners, and if so, use them.
  11988. function applyPassive() {
  11989. var globalObj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
  11990. var forceRefresh = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  11991. if (supportsPassive_ === undefined || forceRefresh) {
  11992. var isSupported = false;
  11993. try {
  11994. globalObj.document.addEventListener('test', null, { get passive() {
  11995. isSupported = true;
  11996. } });
  11997. } catch (e) {}
  11998. supportsPassive_ = isSupported;
  11999. }
  12000. return supportsPassive_ ? { passive: true } : false;
  12001. }
  12002. /***/ })
  12003. /******/ ]);
  12004. });