element-ui.common.js 1.2 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907
  1. module.exports =
  2. /******/ (function(modules) { // webpackBootstrap
  3. /******/ // The module cache
  4. /******/ var installedModules = {};
  5. /******/
  6. /******/ // The require function
  7. /******/ function __webpack_require__(moduleId) {
  8. /******/
  9. /******/ // Check if module is in cache
  10. /******/ if(installedModules[moduleId]) {
  11. /******/ return installedModules[moduleId].exports;
  12. /******/ }
  13. /******/ // Create a new module (and put it into the cache)
  14. /******/ var module = installedModules[moduleId] = {
  15. /******/ i: moduleId,
  16. /******/ l: false,
  17. /******/ exports: {}
  18. /******/ };
  19. /******/
  20. /******/ // Execute the module function
  21. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  22. /******/
  23. /******/ // Flag the module as loaded
  24. /******/ module.l = true;
  25. /******/
  26. /******/ // Return the exports of the module
  27. /******/ return module.exports;
  28. /******/ }
  29. /******/
  30. /******/
  31. /******/ // expose the modules object (__webpack_modules__)
  32. /******/ __webpack_require__.m = modules;
  33. /******/
  34. /******/ // expose the module cache
  35. /******/ __webpack_require__.c = installedModules;
  36. /******/
  37. /******/ // define getter function for harmony exports
  38. /******/ __webpack_require__.d = function(exports, name, getter) {
  39. /******/ if(!__webpack_require__.o(exports, name)) {
  40. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  41. /******/ }
  42. /******/ };
  43. /******/
  44. /******/ // define __esModule on exports
  45. /******/ __webpack_require__.r = function(exports) {
  46. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  47. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  48. /******/ }
  49. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  50. /******/ };
  51. /******/
  52. /******/ // create a fake namespace object
  53. /******/ // mode & 1: value is a module id, require it
  54. /******/ // mode & 2: merge all properties of value into the ns
  55. /******/ // mode & 4: return value when already ns object
  56. /******/ // mode & 8|1: behave like require
  57. /******/ __webpack_require__.t = function(value, mode) {
  58. /******/ if(mode & 1) value = __webpack_require__(value);
  59. /******/ if(mode & 8) return value;
  60. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  61. /******/ var ns = Object.create(null);
  62. /******/ __webpack_require__.r(ns);
  63. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  64. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  65. /******/ return ns;
  66. /******/ };
  67. /******/
  68. /******/ // getDefaultExport function for compatibility with non-harmony modules
  69. /******/ __webpack_require__.n = function(module) {
  70. /******/ var getter = module && module.__esModule ?
  71. /******/ function getDefault() { return module['default']; } :
  72. /******/ function getModuleExports() { return module; };
  73. /******/ __webpack_require__.d(getter, 'a', getter);
  74. /******/ return getter;
  75. /******/ };
  76. /******/
  77. /******/ // Object.prototype.hasOwnProperty.call
  78. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  79. /******/
  80. /******/ // __webpack_public_path__
  81. /******/ __webpack_require__.p = "/dist/";
  82. /******/
  83. /******/
  84. /******/ // Load entry module and return exports
  85. /******/ return __webpack_require__(__webpack_require__.s = 46);
  86. /******/ })
  87. /************************************************************************/
  88. /******/ ([
  89. /* 0 */
  90. /***/ (function(module, exports) {
  91. module.exports = require("element-ui/lib/utils/date-util");
  92. /***/ }),
  93. /* 1 */
  94. /***/ (function(module, exports) {
  95. module.exports = require("element-ui/lib/utils/dom");
  96. /***/ }),
  97. /* 2 */
  98. /***/ (function(module, exports) {
  99. module.exports = require("element-ui/lib/utils/util");
  100. /***/ }),
  101. /* 3 */
  102. /***/ (function(module, exports) {
  103. module.exports = require("element-ui/lib/mixins/emitter");
  104. /***/ }),
  105. /* 4 */
  106. /***/ (function(module, exports) {
  107. module.exports = require("element-ui/lib/mixins/locale");
  108. /***/ }),
  109. /* 5 */
  110. /***/ (function(module, exports) {
  111. module.exports = require("element-ui/lib/utils/vue-popper");
  112. /***/ }),
  113. /* 6 */
  114. /***/ (function(module, exports) {
  115. module.exports = require("vue");
  116. /***/ }),
  117. /* 7 */
  118. /***/ (function(module, exports) {
  119. module.exports = require("element-ui/lib/utils/merge");
  120. /***/ }),
  121. /* 8 */
  122. /***/ (function(module, exports) {
  123. module.exports = require("element-ui/lib/input");
  124. /***/ }),
  125. /* 9 */
  126. /***/ (function(module, exports) {
  127. module.exports = require("element-ui/lib/mixins/migrating");
  128. /***/ }),
  129. /* 10 */
  130. /***/ (function(module, exports) {
  131. module.exports = require("element-ui/lib/utils/clickoutside");
  132. /***/ }),
  133. /* 11 */
  134. /***/ (function(module, exports) {
  135. module.exports = require("element-ui/lib/utils/popup");
  136. /***/ }),
  137. /* 12 */
  138. /***/ (function(module, exports) {
  139. module.exports = require("element-ui/lib/locale");
  140. /***/ }),
  141. /* 13 */
  142. /***/ (function(module, exports) {
  143. module.exports = require("element-ui/lib/button");
  144. /***/ }),
  145. /* 14 */
  146. /***/ (function(module, exports) {
  147. module.exports = require("element-ui/lib/checkbox");
  148. /***/ }),
  149. /* 15 */
  150. /***/ (function(module, exports) {
  151. module.exports = require("element-ui/lib/utils/resize-event");
  152. /***/ }),
  153. /* 16 */
  154. /***/ (function(module, exports) {
  155. module.exports = require("element-ui/lib/utils/types");
  156. /***/ }),
  157. /* 17 */
  158. /***/ (function(module, exports) {
  159. module.exports = require("throttle-debounce/debounce");
  160. /***/ }),
  161. /* 18 */
  162. /***/ (function(module, exports) {
  163. module.exports = require("element-ui/lib/scrollbar");
  164. /***/ }),
  165. /* 19 */
  166. /***/ (function(module, exports) {
  167. module.exports = require("element-ui/lib/utils/shared");
  168. /***/ }),
  169. /* 20 */
  170. /***/ (function(module, exports) {
  171. module.exports = require("element-ui/lib/utils/date");
  172. /***/ }),
  173. /* 21 */
  174. /***/ (function(module, exports) {
  175. module.exports = require("element-ui/lib/transitions/collapse-transition");
  176. /***/ }),
  177. /* 22 */
  178. /***/ (function(module, exports) {
  179. module.exports = require("element-ui/lib/utils/vdom");
  180. /***/ }),
  181. /* 23 */
  182. /***/ (function(module, exports) {
  183. module.exports = require("element-ui/lib/mixins/focus");
  184. /***/ }),
  185. /* 24 */
  186. /***/ (function(module, exports) {
  187. module.exports = require("babel-helper-vue-jsx-merge-props");
  188. /***/ }),
  189. /* 25 */
  190. /***/ (function(module, exports) {
  191. module.exports = require("throttle-debounce/throttle");
  192. /***/ }),
  193. /* 26 */
  194. /***/ (function(module, exports) {
  195. module.exports = require("element-ui/lib/tooltip");
  196. /***/ }),
  197. /* 27 */
  198. /***/ (function(module, exports) {
  199. module.exports = require("element-ui/lib/utils/scroll-into-view");
  200. /***/ }),
  201. /* 28 */
  202. /***/ (function(module, exports) {
  203. module.exports = require("element-ui/lib/utils/lodash");
  204. /***/ }),
  205. /* 29 */
  206. /***/ (function(module, exports) {
  207. module.exports = require("element-ui/lib/button-group");
  208. /***/ }),
  209. /* 30 */
  210. /***/ (function(module, exports) {
  211. module.exports = require("element-ui/lib/tag");
  212. /***/ }),
  213. /* 31 */
  214. /***/ (function(module, exports) {
  215. module.exports = require("element-ui/lib/utils/scrollbar-width");
  216. /***/ }),
  217. /* 32 */
  218. /***/ (function(module, exports) {
  219. module.exports = require("element-ui/lib/checkbox-group");
  220. /***/ }),
  221. /* 33 */
  222. /***/ (function(module, exports) {
  223. module.exports = require("element-ui/lib/utils/after-leave");
  224. /***/ }),
  225. /* 34 */
  226. /***/ (function(module, exports) {
  227. module.exports = require("element-ui/lib/progress");
  228. /***/ }),
  229. /* 35 */
  230. /***/ (function(module, exports) {
  231. module.exports = require("element-ui/lib/utils/aria-utils");
  232. /***/ }),
  233. /* 36 */
  234. /***/ (function(module, exports) {
  235. module.exports = require("throttle-debounce");
  236. /***/ }),
  237. /* 37 */
  238. /***/ (function(module, exports) {
  239. module.exports = require("element-ui/lib/select");
  240. /***/ }),
  241. /* 38 */
  242. /***/ (function(module, exports) {
  243. module.exports = require("element-ui/lib/option");
  244. /***/ }),
  245. /* 39 */
  246. /***/ (function(module, exports) {
  247. module.exports = require("normalize-wheel");
  248. /***/ }),
  249. /* 40 */
  250. /***/ (function(module, exports) {
  251. module.exports = require("element-ui/lib/utils/aria-dialog");
  252. /***/ }),
  253. /* 41 */
  254. /***/ (function(module, exports) {
  255. module.exports = require("async-validator");
  256. /***/ }),
  257. /* 42 */
  258. /***/ (function(module, exports) {
  259. module.exports = require("element-ui/lib/input-number");
  260. /***/ }),
  261. /* 43 */
  262. /***/ (function(module, exports) {
  263. module.exports = require("element-ui/lib/cascader-panel");
  264. /***/ }),
  265. /* 44 */
  266. /***/ (function(module, exports) {
  267. module.exports = require("element-ui/lib/radio");
  268. /***/ }),
  269. /* 45 */
  270. /***/ (function(module, exports) {
  271. module.exports = require("element-ui/lib/popover");
  272. /***/ }),
  273. /* 46 */
  274. /***/ (function(module, exports, __webpack_require__) {
  275. module.exports = __webpack_require__(47);
  276. /***/ }),
  277. /* 47 */
  278. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  279. "use strict";
  280. __webpack_require__.r(__webpack_exports__);
  281. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/pagination/src/pager.vue?vue&type=template&id=7274f267&
  282. var pagervue_type_template_id_7274f267_render = function() {
  283. var _vm = this
  284. var _h = _vm.$createElement
  285. var _c = _vm._self._c || _h
  286. return _c(
  287. "ul",
  288. { staticClass: "el-pager", on: { click: _vm.onPagerClick } },
  289. [
  290. _vm.pageCount > 0
  291. ? _c(
  292. "li",
  293. {
  294. staticClass: "number",
  295. class: { active: _vm.currentPage === 1, disabled: _vm.disabled }
  296. },
  297. [_vm._v("1")]
  298. )
  299. : _vm._e(),
  300. _vm.showPrevMore
  301. ? _c("li", {
  302. staticClass: "el-icon more btn-quickprev",
  303. class: [_vm.quickprevIconClass, { disabled: _vm.disabled }],
  304. on: {
  305. mouseenter: function($event) {
  306. _vm.onMouseenter("left")
  307. },
  308. mouseleave: function($event) {
  309. _vm.quickprevIconClass = "el-icon-more"
  310. }
  311. }
  312. })
  313. : _vm._e(),
  314. _vm._l(_vm.pagers, function(pager) {
  315. return _c(
  316. "li",
  317. {
  318. key: pager,
  319. staticClass: "number",
  320. class: { active: _vm.currentPage === pager, disabled: _vm.disabled }
  321. },
  322. [_vm._v(_vm._s(pager))]
  323. )
  324. }),
  325. _vm.showNextMore
  326. ? _c("li", {
  327. staticClass: "el-icon more btn-quicknext",
  328. class: [_vm.quicknextIconClass, { disabled: _vm.disabled }],
  329. on: {
  330. mouseenter: function($event) {
  331. _vm.onMouseenter("right")
  332. },
  333. mouseleave: function($event) {
  334. _vm.quicknextIconClass = "el-icon-more"
  335. }
  336. }
  337. })
  338. : _vm._e(),
  339. _vm.pageCount > 1
  340. ? _c(
  341. "li",
  342. {
  343. staticClass: "number",
  344. class: {
  345. active: _vm.currentPage === _vm.pageCount,
  346. disabled: _vm.disabled
  347. }
  348. },
  349. [_vm._v(_vm._s(_vm.pageCount))]
  350. )
  351. : _vm._e()
  352. ],
  353. 2
  354. )
  355. }
  356. var staticRenderFns = []
  357. pagervue_type_template_id_7274f267_render._withStripped = true
  358. // CONCATENATED MODULE: ./packages/pagination/src/pager.vue?vue&type=template&id=7274f267&
  359. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/pagination/src/pager.vue?vue&type=script&lang=js&
  360. //
  361. //
  362. //
  363. //
  364. //
  365. //
  366. //
  367. //
  368. //
  369. //
  370. //
  371. //
  372. //
  373. //
  374. //
  375. //
  376. //
  377. //
  378. //
  379. //
  380. //
  381. //
  382. //
  383. //
  384. //
  385. //
  386. //
  387. //
  388. //
  389. //
  390. //
  391. //
  392. /* harmony default export */ var pagervue_type_script_lang_js_ = ({
  393. name: 'ElPager',
  394. props: {
  395. currentPage: Number,
  396. pageCount: Number,
  397. pagerCount: Number,
  398. disabled: Boolean
  399. },
  400. watch: {
  401. showPrevMore: function showPrevMore(val) {
  402. if (!val) this.quickprevIconClass = 'el-icon-more';
  403. },
  404. showNextMore: function showNextMore(val) {
  405. if (!val) this.quicknextIconClass = 'el-icon-more';
  406. }
  407. },
  408. methods: {
  409. onPagerClick: function onPagerClick(event) {
  410. var target = event.target;
  411. if (target.tagName === 'UL' || this.disabled) {
  412. return;
  413. }
  414. var newPage = Number(event.target.textContent);
  415. var pageCount = this.pageCount;
  416. var currentPage = this.currentPage;
  417. var pagerCountOffset = this.pagerCount - 2;
  418. if (target.className.indexOf('more') !== -1) {
  419. if (target.className.indexOf('quickprev') !== -1) {
  420. newPage = currentPage - pagerCountOffset;
  421. } else if (target.className.indexOf('quicknext') !== -1) {
  422. newPage = currentPage + pagerCountOffset;
  423. }
  424. }
  425. /* istanbul ignore if */
  426. if (!isNaN(newPage)) {
  427. if (newPage < 1) {
  428. newPage = 1;
  429. }
  430. if (newPage > pageCount) {
  431. newPage = pageCount;
  432. }
  433. }
  434. if (newPage !== currentPage) {
  435. this.$emit('change', newPage);
  436. }
  437. },
  438. onMouseenter: function onMouseenter(direction) {
  439. if (this.disabled) return;
  440. if (direction === 'left') {
  441. this.quickprevIconClass = 'el-icon-d-arrow-left';
  442. } else {
  443. this.quicknextIconClass = 'el-icon-d-arrow-right';
  444. }
  445. }
  446. },
  447. computed: {
  448. pagers: function pagers() {
  449. var pagerCount = this.pagerCount;
  450. var halfPagerCount = (pagerCount - 1) / 2;
  451. var currentPage = Number(this.currentPage);
  452. var pageCount = Number(this.pageCount);
  453. var showPrevMore = false;
  454. var showNextMore = false;
  455. if (pageCount > pagerCount) {
  456. if (currentPage > pagerCount - halfPagerCount) {
  457. showPrevMore = true;
  458. }
  459. if (currentPage < pageCount - halfPagerCount) {
  460. showNextMore = true;
  461. }
  462. }
  463. var array = [];
  464. if (showPrevMore && !showNextMore) {
  465. var startPage = pageCount - (pagerCount - 2);
  466. for (var i = startPage; i < pageCount; i++) {
  467. array.push(i);
  468. }
  469. } else if (!showPrevMore && showNextMore) {
  470. for (var _i = 2; _i < pagerCount; _i++) {
  471. array.push(_i);
  472. }
  473. } else if (showPrevMore && showNextMore) {
  474. var offset = Math.floor(pagerCount / 2) - 1;
  475. for (var _i2 = currentPage - offset; _i2 <= currentPage + offset; _i2++) {
  476. array.push(_i2);
  477. }
  478. } else {
  479. for (var _i3 = 2; _i3 < pageCount; _i3++) {
  480. array.push(_i3);
  481. }
  482. }
  483. this.showPrevMore = showPrevMore;
  484. this.showNextMore = showNextMore;
  485. return array;
  486. }
  487. },
  488. data: function data() {
  489. return {
  490. current: null,
  491. showPrevMore: false,
  492. showNextMore: false,
  493. quicknextIconClass: 'el-icon-more',
  494. quickprevIconClass: 'el-icon-more'
  495. };
  496. }
  497. });
  498. // CONCATENATED MODULE: ./packages/pagination/src/pager.vue?vue&type=script&lang=js&
  499. /* harmony default export */ var src_pagervue_type_script_lang_js_ = (pagervue_type_script_lang_js_);
  500. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  501. /* globals __VUE_SSR_CONTEXT__ */
  502. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  503. // This module is a runtime utility for cleaner component module output and will
  504. // be included in the final webpack user bundle.
  505. function normalizeComponent (
  506. scriptExports,
  507. render,
  508. staticRenderFns,
  509. functionalTemplate,
  510. injectStyles,
  511. scopeId,
  512. moduleIdentifier, /* server only */
  513. shadowMode /* vue-cli only */
  514. ) {
  515. // Vue.extend constructor export interop
  516. var options = typeof scriptExports === 'function'
  517. ? scriptExports.options
  518. : scriptExports
  519. // render functions
  520. if (render) {
  521. options.render = render
  522. options.staticRenderFns = staticRenderFns
  523. options._compiled = true
  524. }
  525. // functional template
  526. if (functionalTemplate) {
  527. options.functional = true
  528. }
  529. // scopedId
  530. if (scopeId) {
  531. options._scopeId = 'data-v-' + scopeId
  532. }
  533. var hook
  534. if (moduleIdentifier) { // server build
  535. hook = function (context) {
  536. // 2.3 injection
  537. context =
  538. context || // cached call
  539. (this.$vnode && this.$vnode.ssrContext) || // stateful
  540. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  541. // 2.2 with runInNewContext: true
  542. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  543. context = __VUE_SSR_CONTEXT__
  544. }
  545. // inject component styles
  546. if (injectStyles) {
  547. injectStyles.call(this, context)
  548. }
  549. // register component module identifier for async chunk inferrence
  550. if (context && context._registeredComponents) {
  551. context._registeredComponents.add(moduleIdentifier)
  552. }
  553. }
  554. // used by ssr in case component is cached and beforeCreate
  555. // never gets called
  556. options._ssrRegister = hook
  557. } else if (injectStyles) {
  558. hook = shadowMode
  559. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  560. : injectStyles
  561. }
  562. if (hook) {
  563. if (options.functional) {
  564. // for template-only hot-reload because in that case the render fn doesn't
  565. // go through the normalizer
  566. options._injectStyles = hook
  567. // register for functioal component in vue file
  568. var originalRender = options.render
  569. options.render = function renderWithStyleInjection (h, context) {
  570. hook.call(context)
  571. return originalRender(h, context)
  572. }
  573. } else {
  574. // inject component registration as beforeCreate hook
  575. var existing = options.beforeCreate
  576. options.beforeCreate = existing
  577. ? [].concat(existing, hook)
  578. : [hook]
  579. }
  580. }
  581. return {
  582. exports: scriptExports,
  583. options: options
  584. }
  585. }
  586. // CONCATENATED MODULE: ./packages/pagination/src/pager.vue
  587. /* normalize component */
  588. var component = normalizeComponent(
  589. src_pagervue_type_script_lang_js_,
  590. pagervue_type_template_id_7274f267_render,
  591. staticRenderFns,
  592. false,
  593. null,
  594. null,
  595. null
  596. )
  597. /* hot reload */
  598. if (false) { var api; }
  599. component.options.__file = "packages/pagination/src/pager.vue"
  600. /* harmony default export */ var pager = (component.exports);
  601. // EXTERNAL MODULE: external "element-ui/lib/select"
  602. var select_ = __webpack_require__(37);
  603. var select_default = /*#__PURE__*/__webpack_require__.n(select_);
  604. // EXTERNAL MODULE: external "element-ui/lib/option"
  605. var option_ = __webpack_require__(38);
  606. var option_default = /*#__PURE__*/__webpack_require__.n(option_);
  607. // EXTERNAL MODULE: external "element-ui/lib/input"
  608. var input_ = __webpack_require__(8);
  609. var input_default = /*#__PURE__*/__webpack_require__.n(input_);
  610. // EXTERNAL MODULE: external "element-ui/lib/mixins/locale"
  611. var locale_ = __webpack_require__(4);
  612. var locale_default = /*#__PURE__*/__webpack_require__.n(locale_);
  613. // EXTERNAL MODULE: external "element-ui/lib/utils/util"
  614. var util_ = __webpack_require__(2);
  615. // CONCATENATED MODULE: ./packages/pagination/src/pagination.js
  616. /* harmony default export */ var pagination = ({
  617. name: 'ElPagination',
  618. props: {
  619. pageSize: {
  620. type: Number,
  621. default: 10
  622. },
  623. small: Boolean,
  624. total: Number,
  625. pageCount: Number,
  626. pagerCount: {
  627. type: Number,
  628. validator: function validator(value) {
  629. return (value | 0) === value && value > 4 && value < 22 && value % 2 === 1;
  630. },
  631. default: 7
  632. },
  633. currentPage: {
  634. type: Number,
  635. default: 1
  636. },
  637. layout: {
  638. default: 'prev, pager, next, jumper, ->, total'
  639. },
  640. pageSizes: {
  641. type: Array,
  642. default: function _default() {
  643. return [10, 20, 30, 40, 50, 100];
  644. }
  645. },
  646. popperClass: String,
  647. prevText: String,
  648. nextText: String,
  649. background: Boolean,
  650. disabled: Boolean,
  651. hideOnSinglePage: Boolean
  652. },
  653. data: function data() {
  654. return {
  655. internalCurrentPage: 1,
  656. internalPageSize: 0,
  657. lastEmittedPage: -1,
  658. userChangePageSize: false
  659. };
  660. },
  661. render: function render(h) {
  662. var layout = this.layout;
  663. if (!layout) return null;
  664. if (this.hideOnSinglePage && (!this.internalPageCount || this.internalPageCount === 1)) return null;
  665. var template = h('div', { 'class': ['el-pagination', {
  666. 'is-background': this.background,
  667. 'el-pagination--small': this.small
  668. }] });
  669. var TEMPLATE_MAP = {
  670. prev: h('prev'),
  671. jumper: h('jumper'),
  672. pager: h('pager', {
  673. attrs: { currentPage: this.internalCurrentPage, pageCount: this.internalPageCount, pagerCount: this.pagerCount, disabled: this.disabled },
  674. on: {
  675. 'change': this.handleCurrentChange
  676. }
  677. }),
  678. next: h('next'),
  679. sizes: h('sizes', {
  680. attrs: { pageSizes: this.pageSizes }
  681. }),
  682. slot: h('slot', [this.$slots.default ? this.$slots.default : '']),
  683. total: h('total')
  684. };
  685. var components = layout.split(',').map(function (item) {
  686. return item.trim();
  687. });
  688. var rightWrapper = h('div', { 'class': 'el-pagination__rightwrapper' });
  689. var haveRightWrapper = false;
  690. template.children = template.children || [];
  691. rightWrapper.children = rightWrapper.children || [];
  692. components.forEach(function (compo) {
  693. if (compo === '->') {
  694. haveRightWrapper = true;
  695. return;
  696. }
  697. if (!haveRightWrapper) {
  698. template.children.push(TEMPLATE_MAP[compo]);
  699. } else {
  700. rightWrapper.children.push(TEMPLATE_MAP[compo]);
  701. }
  702. });
  703. if (haveRightWrapper) {
  704. template.children.unshift(rightWrapper);
  705. }
  706. return template;
  707. },
  708. components: {
  709. Prev: {
  710. render: function render(h) {
  711. return h(
  712. 'button',
  713. {
  714. attrs: {
  715. type: 'button',
  716. disabled: this.$parent.disabled || this.$parent.internalCurrentPage <= 1
  717. },
  718. 'class': 'btn-prev', on: {
  719. 'click': this.$parent.prev
  720. }
  721. },
  722. [this.$parent.prevText ? h('span', [this.$parent.prevText]) : h('i', { 'class': 'el-icon el-icon-arrow-left' })]
  723. );
  724. }
  725. },
  726. Next: {
  727. render: function render(h) {
  728. return h(
  729. 'button',
  730. {
  731. attrs: {
  732. type: 'button',
  733. disabled: this.$parent.disabled || this.$parent.internalCurrentPage === this.$parent.internalPageCount || this.$parent.internalPageCount === 0
  734. },
  735. 'class': 'btn-next', on: {
  736. 'click': this.$parent.next
  737. }
  738. },
  739. [this.$parent.nextText ? h('span', [this.$parent.nextText]) : h('i', { 'class': 'el-icon el-icon-arrow-right' })]
  740. );
  741. }
  742. },
  743. Sizes: {
  744. mixins: [locale_default.a],
  745. props: {
  746. pageSizes: Array
  747. },
  748. watch: {
  749. pageSizes: {
  750. immediate: true,
  751. handler: function handler(newVal, oldVal) {
  752. if (Object(util_["valueEquals"])(newVal, oldVal)) return;
  753. if (Array.isArray(newVal)) {
  754. this.$parent.internalPageSize = newVal.indexOf(this.$parent.pageSize) > -1 ? this.$parent.pageSize : this.pageSizes[0];
  755. }
  756. }
  757. }
  758. },
  759. render: function render(h) {
  760. var _this = this;
  761. return h(
  762. 'span',
  763. { 'class': 'el-pagination__sizes' },
  764. [h(
  765. 'el-select',
  766. {
  767. attrs: {
  768. value: this.$parent.internalPageSize,
  769. popperClass: this.$parent.popperClass || '',
  770. size: 'mini',
  771. disabled: this.$parent.disabled },
  772. on: {
  773. 'input': this.handleChange
  774. }
  775. },
  776. [this.pageSizes.map(function (item) {
  777. return h('el-option', {
  778. attrs: {
  779. value: item,
  780. label: item + _this.t('el.pagination.pagesize') }
  781. });
  782. })]
  783. )]
  784. );
  785. },
  786. components: {
  787. ElSelect: select_default.a,
  788. ElOption: option_default.a
  789. },
  790. methods: {
  791. handleChange: function handleChange(val) {
  792. if (val !== this.$parent.internalPageSize) {
  793. this.$parent.internalPageSize = val = parseInt(val, 10);
  794. this.$parent.userChangePageSize = true;
  795. this.$parent.$emit('update:pageSize', val);
  796. this.$parent.$emit('size-change', val);
  797. }
  798. }
  799. }
  800. },
  801. Jumper: {
  802. mixins: [locale_default.a],
  803. components: { ElInput: input_default.a },
  804. data: function data() {
  805. return {
  806. userInput: null
  807. };
  808. },
  809. watch: {
  810. '$parent.internalCurrentPage': function $parentInternalCurrentPage() {
  811. this.userInput = null;
  812. }
  813. },
  814. methods: {
  815. handleKeyup: function handleKeyup(_ref) {
  816. var keyCode = _ref.keyCode,
  817. target = _ref.target;
  818. // Chrome, Safari, Firefox triggers change event on Enter
  819. // Hack for IE: https://github.com/ElemeFE/element/issues/11710
  820. // Drop this method when we no longer supports IE
  821. if (keyCode === 13) {
  822. this.handleChange(target.value);
  823. }
  824. },
  825. handleInput: function handleInput(value) {
  826. this.userInput = value;
  827. },
  828. handleChange: function handleChange(value) {
  829. this.$parent.internalCurrentPage = this.$parent.getValidCurrentPage(value);
  830. this.$parent.emitChange();
  831. this.userInput = null;
  832. }
  833. },
  834. render: function render(h) {
  835. return h(
  836. 'span',
  837. { 'class': 'el-pagination__jump' },
  838. [this.t('el.pagination.goto'), h('el-input', {
  839. 'class': 'el-pagination__editor is-in-pagination',
  840. attrs: { min: 1,
  841. max: this.$parent.internalPageCount,
  842. value: this.userInput !== null ? this.userInput : this.$parent.internalCurrentPage,
  843. type: 'number',
  844. disabled: this.$parent.disabled
  845. },
  846. nativeOn: {
  847. 'keyup': this.handleKeyup
  848. },
  849. on: {
  850. 'input': this.handleInput,
  851. 'change': this.handleChange
  852. }
  853. }), this.t('el.pagination.pageClassifier')]
  854. );
  855. }
  856. },
  857. Total: {
  858. mixins: [locale_default.a],
  859. render: function render(h) {
  860. return typeof this.$parent.total === 'number' ? h(
  861. 'span',
  862. { 'class': 'el-pagination__total' },
  863. [this.t('el.pagination.total', { total: this.$parent.total })]
  864. ) : '';
  865. }
  866. },
  867. Pager: pager
  868. },
  869. methods: {
  870. handleCurrentChange: function handleCurrentChange(val) {
  871. this.internalCurrentPage = this.getValidCurrentPage(val);
  872. this.userChangePageSize = true;
  873. this.emitChange();
  874. },
  875. prev: function prev() {
  876. if (this.disabled) return;
  877. var newVal = this.internalCurrentPage - 1;
  878. this.internalCurrentPage = this.getValidCurrentPage(newVal);
  879. this.$emit('prev-click', this.internalCurrentPage);
  880. this.emitChange();
  881. },
  882. next: function next() {
  883. if (this.disabled) return;
  884. var newVal = this.internalCurrentPage + 1;
  885. this.internalCurrentPage = this.getValidCurrentPage(newVal);
  886. this.$emit('next-click', this.internalCurrentPage);
  887. this.emitChange();
  888. },
  889. getValidCurrentPage: function getValidCurrentPage(value) {
  890. value = parseInt(value, 10);
  891. var havePageCount = typeof this.internalPageCount === 'number';
  892. var resetValue = void 0;
  893. if (!havePageCount) {
  894. if (isNaN(value) || value < 1) resetValue = 1;
  895. } else {
  896. if (value < 1) {
  897. resetValue = 1;
  898. } else if (value > this.internalPageCount) {
  899. resetValue = this.internalPageCount;
  900. }
  901. }
  902. if (resetValue === undefined && isNaN(value)) {
  903. resetValue = 1;
  904. } else if (resetValue === 0) {
  905. resetValue = 1;
  906. }
  907. return resetValue === undefined ? value : resetValue;
  908. },
  909. emitChange: function emitChange() {
  910. var _this2 = this;
  911. this.$nextTick(function () {
  912. if (_this2.internalCurrentPage !== _this2.lastEmittedPage || _this2.userChangePageSize) {
  913. _this2.$emit('current-change', _this2.internalCurrentPage);
  914. _this2.lastEmittedPage = _this2.internalCurrentPage;
  915. _this2.userChangePageSize = false;
  916. }
  917. });
  918. }
  919. },
  920. computed: {
  921. internalPageCount: function internalPageCount() {
  922. if (typeof this.total === 'number') {
  923. return Math.max(1, Math.ceil(this.total / this.internalPageSize));
  924. } else if (typeof this.pageCount === 'number') {
  925. return Math.max(1, this.pageCount);
  926. }
  927. return null;
  928. }
  929. },
  930. watch: {
  931. currentPage: {
  932. immediate: true,
  933. handler: function handler(val) {
  934. this.internalCurrentPage = this.getValidCurrentPage(val);
  935. }
  936. },
  937. pageSize: {
  938. immediate: true,
  939. handler: function handler(val) {
  940. this.internalPageSize = isNaN(val) ? 10 : val;
  941. }
  942. },
  943. internalCurrentPage: {
  944. immediate: true,
  945. handler: function handler(newVal) {
  946. this.$emit('update:currentPage', newVal);
  947. this.lastEmittedPage = -1;
  948. }
  949. },
  950. internalPageCount: function internalPageCount(newVal) {
  951. /* istanbul ignore if */
  952. var oldPage = this.internalCurrentPage;
  953. if (newVal > 0 && oldPage === 0) {
  954. this.internalCurrentPage = 1;
  955. } else if (oldPage > newVal) {
  956. this.internalCurrentPage = newVal === 0 ? 1 : newVal;
  957. this.userChangePageSize && this.emitChange();
  958. }
  959. this.userChangePageSize = false;
  960. }
  961. }
  962. });
  963. // CONCATENATED MODULE: ./packages/pagination/index.js
  964. /* istanbul ignore next */
  965. pagination.install = function (Vue) {
  966. Vue.component(pagination.name, pagination);
  967. };
  968. /* harmony default export */ var packages_pagination = (pagination);
  969. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/dialog/src/component.vue?vue&type=template&id=60140e62&
  970. var componentvue_type_template_id_60140e62_render = function() {
  971. var _vm = this
  972. var _h = _vm.$createElement
  973. var _c = _vm._self._c || _h
  974. return _c(
  975. "transition",
  976. {
  977. attrs: { name: "dialog-fade" },
  978. on: { "after-enter": _vm.afterEnter, "after-leave": _vm.afterLeave }
  979. },
  980. [
  981. _c(
  982. "div",
  983. {
  984. directives: [
  985. {
  986. name: "show",
  987. rawName: "v-show",
  988. value: _vm.visible,
  989. expression: "visible"
  990. }
  991. ],
  992. staticClass: "el-dialog__wrapper",
  993. on: {
  994. click: function($event) {
  995. if ($event.target !== $event.currentTarget) {
  996. return null
  997. }
  998. return _vm.handleWrapperClick($event)
  999. }
  1000. }
  1001. },
  1002. [
  1003. _c(
  1004. "div",
  1005. {
  1006. key: _vm.key,
  1007. ref: "dialog",
  1008. class: [
  1009. "el-dialog",
  1010. {
  1011. "is-fullscreen": _vm.fullscreen,
  1012. "el-dialog--center": _vm.center
  1013. },
  1014. _vm.customClass
  1015. ],
  1016. style: _vm.style,
  1017. attrs: {
  1018. role: "dialog",
  1019. "aria-modal": "true",
  1020. "aria-label": _vm.title || "dialog"
  1021. }
  1022. },
  1023. [
  1024. _c(
  1025. "div",
  1026. { staticClass: "el-dialog__header" },
  1027. [
  1028. _vm._t("title", [
  1029. _c("span", { staticClass: "el-dialog__title" }, [
  1030. _vm._v(_vm._s(_vm.title))
  1031. ])
  1032. ]),
  1033. _vm.showClose
  1034. ? _c(
  1035. "button",
  1036. {
  1037. staticClass: "el-dialog__headerbtn",
  1038. attrs: { type: "button", "aria-label": "Close" },
  1039. on: { click: _vm.handleClose }
  1040. },
  1041. [
  1042. _c("i", {
  1043. staticClass:
  1044. "el-dialog__close el-icon el-icon-close"
  1045. })
  1046. ]
  1047. )
  1048. : _vm._e()
  1049. ],
  1050. 2
  1051. ),
  1052. _vm.rendered
  1053. ? _c(
  1054. "div",
  1055. { staticClass: "el-dialog__body" },
  1056. [_vm._t("default")],
  1057. 2
  1058. )
  1059. : _vm._e(),
  1060. _vm.$slots.footer
  1061. ? _c(
  1062. "div",
  1063. { staticClass: "el-dialog__footer" },
  1064. [_vm._t("footer")],
  1065. 2
  1066. )
  1067. : _vm._e()
  1068. ]
  1069. )
  1070. ]
  1071. )
  1072. ]
  1073. )
  1074. }
  1075. var componentvue_type_template_id_60140e62_staticRenderFns = []
  1076. componentvue_type_template_id_60140e62_render._withStripped = true
  1077. // CONCATENATED MODULE: ./packages/dialog/src/component.vue?vue&type=template&id=60140e62&
  1078. // EXTERNAL MODULE: external "element-ui/lib/utils/popup"
  1079. var popup_ = __webpack_require__(11);
  1080. var popup_default = /*#__PURE__*/__webpack_require__.n(popup_);
  1081. // EXTERNAL MODULE: external "element-ui/lib/mixins/migrating"
  1082. var migrating_ = __webpack_require__(9);
  1083. var migrating_default = /*#__PURE__*/__webpack_require__.n(migrating_);
  1084. // EXTERNAL MODULE: external "element-ui/lib/mixins/emitter"
  1085. var emitter_ = __webpack_require__(3);
  1086. var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
  1087. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/dialog/src/component.vue?vue&type=script&lang=js&
  1088. //
  1089. //
  1090. //
  1091. //
  1092. //
  1093. //
  1094. //
  1095. //
  1096. //
  1097. //
  1098. //
  1099. //
  1100. //
  1101. //
  1102. //
  1103. //
  1104. //
  1105. //
  1106. //
  1107. //
  1108. //
  1109. //
  1110. //
  1111. //
  1112. //
  1113. //
  1114. //
  1115. //
  1116. //
  1117. //
  1118. //
  1119. //
  1120. //
  1121. //
  1122. //
  1123. //
  1124. //
  1125. //
  1126. //
  1127. /* harmony default export */ var componentvue_type_script_lang_js_ = ({
  1128. name: 'ElDialog',
  1129. mixins: [popup_default.a, emitter_default.a, migrating_default.a],
  1130. props: {
  1131. title: {
  1132. type: String,
  1133. default: ''
  1134. },
  1135. modal: {
  1136. type: Boolean,
  1137. default: true
  1138. },
  1139. modalAppendToBody: {
  1140. type: Boolean,
  1141. default: true
  1142. },
  1143. appendToBody: {
  1144. type: Boolean,
  1145. default: false
  1146. },
  1147. lockScroll: {
  1148. type: Boolean,
  1149. default: true
  1150. },
  1151. closeOnClickModal: {
  1152. type: Boolean,
  1153. default: true
  1154. },
  1155. closeOnPressEscape: {
  1156. type: Boolean,
  1157. default: true
  1158. },
  1159. showClose: {
  1160. type: Boolean,
  1161. default: true
  1162. },
  1163. width: String,
  1164. fullscreen: Boolean,
  1165. customClass: {
  1166. type: String,
  1167. default: ''
  1168. },
  1169. top: {
  1170. type: String,
  1171. default: '15vh'
  1172. },
  1173. beforeClose: Function,
  1174. center: {
  1175. type: Boolean,
  1176. default: false
  1177. },
  1178. destroyOnClose: Boolean
  1179. },
  1180. data: function data() {
  1181. return {
  1182. closed: false,
  1183. key: 0
  1184. };
  1185. },
  1186. watch: {
  1187. visible: function visible(val) {
  1188. var _this = this;
  1189. if (val) {
  1190. this.closed = false;
  1191. this.$emit('open');
  1192. this.$el.addEventListener('scroll', this.updatePopper);
  1193. this.$nextTick(function () {
  1194. _this.$refs.dialog.scrollTop = 0;
  1195. });
  1196. if (this.appendToBody) {
  1197. document.body.appendChild(this.$el);
  1198. }
  1199. } else {
  1200. this.$el.removeEventListener('scroll', this.updatePopper);
  1201. if (!this.closed) this.$emit('close');
  1202. if (this.destroyOnClose) {
  1203. this.$nextTick(function () {
  1204. _this.key++;
  1205. });
  1206. }
  1207. }
  1208. }
  1209. },
  1210. computed: {
  1211. style: function style() {
  1212. var style = {};
  1213. if (!this.fullscreen) {
  1214. style.marginTop = this.top;
  1215. if (this.width) {
  1216. style.width = this.width;
  1217. }
  1218. }
  1219. return style;
  1220. }
  1221. },
  1222. methods: {
  1223. getMigratingConfig: function getMigratingConfig() {
  1224. return {
  1225. props: {
  1226. 'size': 'size is removed.'
  1227. }
  1228. };
  1229. },
  1230. handleWrapperClick: function handleWrapperClick() {
  1231. if (!this.closeOnClickModal) return;
  1232. this.handleClose();
  1233. },
  1234. handleClose: function handleClose() {
  1235. if (typeof this.beforeClose === 'function') {
  1236. this.beforeClose(this.hide);
  1237. } else {
  1238. this.hide();
  1239. }
  1240. },
  1241. hide: function hide(cancel) {
  1242. if (cancel !== false) {
  1243. this.$emit('update:visible', false);
  1244. this.$emit('close');
  1245. this.closed = true;
  1246. }
  1247. },
  1248. updatePopper: function updatePopper() {
  1249. this.broadcast('ElSelectDropdown', 'updatePopper');
  1250. this.broadcast('ElDropdownMenu', 'updatePopper');
  1251. },
  1252. afterEnter: function afterEnter() {
  1253. this.$emit('opened');
  1254. },
  1255. afterLeave: function afterLeave() {
  1256. this.$emit('closed');
  1257. }
  1258. },
  1259. mounted: function mounted() {
  1260. if (this.visible) {
  1261. this.rendered = true;
  1262. this.open();
  1263. if (this.appendToBody) {
  1264. document.body.appendChild(this.$el);
  1265. }
  1266. }
  1267. },
  1268. destroyed: function destroyed() {
  1269. // if appendToBody is true, remove DOM node after destroy
  1270. if (this.appendToBody && this.$el && this.$el.parentNode) {
  1271. this.$el.parentNode.removeChild(this.$el);
  1272. }
  1273. }
  1274. });
  1275. // CONCATENATED MODULE: ./packages/dialog/src/component.vue?vue&type=script&lang=js&
  1276. /* harmony default export */ var src_componentvue_type_script_lang_js_ = (componentvue_type_script_lang_js_);
  1277. // CONCATENATED MODULE: ./packages/dialog/src/component.vue
  1278. /* normalize component */
  1279. var component_component = normalizeComponent(
  1280. src_componentvue_type_script_lang_js_,
  1281. componentvue_type_template_id_60140e62_render,
  1282. componentvue_type_template_id_60140e62_staticRenderFns,
  1283. false,
  1284. null,
  1285. null,
  1286. null
  1287. )
  1288. /* hot reload */
  1289. if (false) { var component_api; }
  1290. component_component.options.__file = "packages/dialog/src/component.vue"
  1291. /* harmony default export */ var src_component = (component_component.exports);
  1292. // CONCATENATED MODULE: ./packages/dialog/index.js
  1293. /* istanbul ignore next */
  1294. src_component.install = function (Vue) {
  1295. Vue.component(src_component.name, src_component);
  1296. };
  1297. /* harmony default export */ var dialog = (src_component);
  1298. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/autocomplete/src/autocomplete.vue?vue&type=template&id=152f2ee6&
  1299. var autocompletevue_type_template_id_152f2ee6_render = function() {
  1300. var _vm = this
  1301. var _h = _vm.$createElement
  1302. var _c = _vm._self._c || _h
  1303. return _c(
  1304. "div",
  1305. {
  1306. directives: [
  1307. {
  1308. name: "clickoutside",
  1309. rawName: "v-clickoutside",
  1310. value: _vm.close,
  1311. expression: "close"
  1312. }
  1313. ],
  1314. staticClass: "el-autocomplete",
  1315. attrs: {
  1316. "aria-haspopup": "listbox",
  1317. role: "combobox",
  1318. "aria-expanded": _vm.suggestionVisible,
  1319. "aria-owns": _vm.id
  1320. }
  1321. },
  1322. [
  1323. _c(
  1324. "el-input",
  1325. _vm._b(
  1326. {
  1327. ref: "input",
  1328. on: {
  1329. input: _vm.handleInput,
  1330. change: _vm.handleChange,
  1331. focus: _vm.handleFocus,
  1332. blur: _vm.handleBlur,
  1333. clear: _vm.handleClear
  1334. },
  1335. nativeOn: {
  1336. keydown: [
  1337. function($event) {
  1338. if (
  1339. !("button" in $event) &&
  1340. _vm._k($event.keyCode, "up", 38, $event.key, [
  1341. "Up",
  1342. "ArrowUp"
  1343. ])
  1344. ) {
  1345. return null
  1346. }
  1347. $event.preventDefault()
  1348. _vm.highlight(_vm.highlightedIndex - 1)
  1349. },
  1350. function($event) {
  1351. if (
  1352. !("button" in $event) &&
  1353. _vm._k($event.keyCode, "down", 40, $event.key, [
  1354. "Down",
  1355. "ArrowDown"
  1356. ])
  1357. ) {
  1358. return null
  1359. }
  1360. $event.preventDefault()
  1361. _vm.highlight(_vm.highlightedIndex + 1)
  1362. },
  1363. function($event) {
  1364. if (
  1365. !("button" in $event) &&
  1366. _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")
  1367. ) {
  1368. return null
  1369. }
  1370. return _vm.handleKeyEnter($event)
  1371. },
  1372. function($event) {
  1373. if (
  1374. !("button" in $event) &&
  1375. _vm._k($event.keyCode, "tab", 9, $event.key, "Tab")
  1376. ) {
  1377. return null
  1378. }
  1379. return _vm.close($event)
  1380. }
  1381. ]
  1382. }
  1383. },
  1384. "el-input",
  1385. [_vm.$props, _vm.$attrs],
  1386. false
  1387. ),
  1388. [
  1389. _vm.$slots.prepend
  1390. ? _c("template", { slot: "prepend" }, [_vm._t("prepend")], 2)
  1391. : _vm._e(),
  1392. _vm.$slots.append
  1393. ? _c("template", { slot: "append" }, [_vm._t("append")], 2)
  1394. : _vm._e(),
  1395. _vm.$slots.prefix
  1396. ? _c("template", { slot: "prefix" }, [_vm._t("prefix")], 2)
  1397. : _vm._e(),
  1398. _vm.$slots.suffix
  1399. ? _c("template", { slot: "suffix" }, [_vm._t("suffix")], 2)
  1400. : _vm._e()
  1401. ],
  1402. 2
  1403. ),
  1404. _c(
  1405. "el-autocomplete-suggestions",
  1406. {
  1407. ref: "suggestions",
  1408. class: [_vm.popperClass ? _vm.popperClass : ""],
  1409. attrs: {
  1410. "visible-arrow": "",
  1411. "popper-options": _vm.popperOptions,
  1412. "append-to-body": _vm.popperAppendToBody,
  1413. placement: _vm.placement,
  1414. id: _vm.id
  1415. }
  1416. },
  1417. _vm._l(_vm.suggestions, function(item, index) {
  1418. return _c(
  1419. "li",
  1420. {
  1421. key: index,
  1422. class: { highlighted: _vm.highlightedIndex === index },
  1423. attrs: {
  1424. id: _vm.id + "-item-" + index,
  1425. role: "option",
  1426. "aria-selected": _vm.highlightedIndex === index
  1427. },
  1428. on: {
  1429. click: function($event) {
  1430. _vm.select(item)
  1431. }
  1432. }
  1433. },
  1434. [
  1435. _vm._t(
  1436. "default",
  1437. [
  1438. _vm._v("\n " + _vm._s(item[_vm.valueKey]) + "\n ")
  1439. ],
  1440. { item: item }
  1441. )
  1442. ],
  1443. 2
  1444. )
  1445. }),
  1446. 0
  1447. )
  1448. ],
  1449. 1
  1450. )
  1451. }
  1452. var autocompletevue_type_template_id_152f2ee6_staticRenderFns = []
  1453. autocompletevue_type_template_id_152f2ee6_render._withStripped = true
  1454. // CONCATENATED MODULE: ./packages/autocomplete/src/autocomplete.vue?vue&type=template&id=152f2ee6&
  1455. // EXTERNAL MODULE: external "throttle-debounce/debounce"
  1456. var debounce_ = __webpack_require__(17);
  1457. var debounce_default = /*#__PURE__*/__webpack_require__.n(debounce_);
  1458. // EXTERNAL MODULE: external "element-ui/lib/utils/clickoutside"
  1459. var clickoutside_ = __webpack_require__(10);
  1460. var clickoutside_default = /*#__PURE__*/__webpack_require__.n(clickoutside_);
  1461. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/autocomplete/src/autocomplete-suggestions.vue?vue&type=template&id=cd10dcf0&
  1462. var autocomplete_suggestionsvue_type_template_id_cd10dcf0_render = function() {
  1463. var _vm = this
  1464. var _h = _vm.$createElement
  1465. var _c = _vm._self._c || _h
  1466. return _c(
  1467. "transition",
  1468. { attrs: { name: "el-zoom-in-top" }, on: { "after-leave": _vm.doDestroy } },
  1469. [
  1470. _c(
  1471. "div",
  1472. {
  1473. directives: [
  1474. {
  1475. name: "show",
  1476. rawName: "v-show",
  1477. value: _vm.showPopper,
  1478. expression: "showPopper"
  1479. }
  1480. ],
  1481. staticClass: "el-autocomplete-suggestion el-popper",
  1482. class: {
  1483. "is-loading": !_vm.parent.hideLoading && _vm.parent.loading
  1484. },
  1485. style: { width: _vm.dropdownWidth },
  1486. attrs: { role: "region" }
  1487. },
  1488. [
  1489. _c(
  1490. "el-scrollbar",
  1491. {
  1492. attrs: {
  1493. tag: "ul",
  1494. "wrap-class": "el-autocomplete-suggestion__wrap",
  1495. "view-class": "el-autocomplete-suggestion__list"
  1496. }
  1497. },
  1498. [
  1499. !_vm.parent.hideLoading && _vm.parent.loading
  1500. ? _c("li", [_c("i", { staticClass: "el-icon-loading" })])
  1501. : _vm._t("default")
  1502. ],
  1503. 2
  1504. )
  1505. ],
  1506. 1
  1507. )
  1508. ]
  1509. )
  1510. }
  1511. var autocomplete_suggestionsvue_type_template_id_cd10dcf0_staticRenderFns = []
  1512. autocomplete_suggestionsvue_type_template_id_cd10dcf0_render._withStripped = true
  1513. // CONCATENATED MODULE: ./packages/autocomplete/src/autocomplete-suggestions.vue?vue&type=template&id=cd10dcf0&
  1514. // EXTERNAL MODULE: external "element-ui/lib/utils/vue-popper"
  1515. var vue_popper_ = __webpack_require__(5);
  1516. var vue_popper_default = /*#__PURE__*/__webpack_require__.n(vue_popper_);
  1517. // EXTERNAL MODULE: external "element-ui/lib/scrollbar"
  1518. var scrollbar_ = __webpack_require__(18);
  1519. var scrollbar_default = /*#__PURE__*/__webpack_require__.n(scrollbar_);
  1520. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/autocomplete/src/autocomplete-suggestions.vue?vue&type=script&lang=js&
  1521. //
  1522. //
  1523. //
  1524. //
  1525. //
  1526. //
  1527. //
  1528. //
  1529. //
  1530. //
  1531. //
  1532. //
  1533. //
  1534. //
  1535. //
  1536. //
  1537. //
  1538. //
  1539. //
  1540. /* harmony default export */ var autocomplete_suggestionsvue_type_script_lang_js_ = ({
  1541. components: { ElScrollbar: scrollbar_default.a },
  1542. mixins: [vue_popper_default.a, emitter_default.a],
  1543. componentName: 'ElAutocompleteSuggestions',
  1544. data: function data() {
  1545. return {
  1546. parent: this.$parent,
  1547. dropdownWidth: ''
  1548. };
  1549. },
  1550. props: {
  1551. options: {
  1552. default: function _default() {
  1553. return {
  1554. gpuAcceleration: false
  1555. };
  1556. }
  1557. },
  1558. id: String
  1559. },
  1560. methods: {
  1561. select: function select(item) {
  1562. this.dispatch('ElAutocomplete', 'item-click', item);
  1563. }
  1564. },
  1565. updated: function updated() {
  1566. var _this = this;
  1567. this.$nextTick(function (_) {
  1568. _this.popperJS && _this.updatePopper();
  1569. });
  1570. },
  1571. mounted: function mounted() {
  1572. this.$parent.popperElm = this.popperElm = this.$el;
  1573. this.referenceElm = this.$parent.$refs.input.$refs.input || this.$parent.$refs.input.$refs.textarea;
  1574. this.referenceList = this.$el.querySelector('.el-autocomplete-suggestion__list');
  1575. this.referenceList.setAttribute('role', 'listbox');
  1576. this.referenceList.setAttribute('id', this.id);
  1577. },
  1578. created: function created() {
  1579. var _this2 = this;
  1580. this.$on('visible', function (val, inputWidth) {
  1581. _this2.dropdownWidth = inputWidth + 'px';
  1582. _this2.showPopper = val;
  1583. });
  1584. }
  1585. });
  1586. // CONCATENATED MODULE: ./packages/autocomplete/src/autocomplete-suggestions.vue?vue&type=script&lang=js&
  1587. /* harmony default export */ var src_autocomplete_suggestionsvue_type_script_lang_js_ = (autocomplete_suggestionsvue_type_script_lang_js_);
  1588. // CONCATENATED MODULE: ./packages/autocomplete/src/autocomplete-suggestions.vue
  1589. /* normalize component */
  1590. var autocomplete_suggestions_component = normalizeComponent(
  1591. src_autocomplete_suggestionsvue_type_script_lang_js_,
  1592. autocomplete_suggestionsvue_type_template_id_cd10dcf0_render,
  1593. autocomplete_suggestionsvue_type_template_id_cd10dcf0_staticRenderFns,
  1594. false,
  1595. null,
  1596. null,
  1597. null
  1598. )
  1599. /* hot reload */
  1600. if (false) { var autocomplete_suggestions_api; }
  1601. autocomplete_suggestions_component.options.__file = "packages/autocomplete/src/autocomplete-suggestions.vue"
  1602. /* harmony default export */ var autocomplete_suggestions = (autocomplete_suggestions_component.exports);
  1603. // EXTERNAL MODULE: external "element-ui/lib/mixins/focus"
  1604. var focus_ = __webpack_require__(23);
  1605. var focus_default = /*#__PURE__*/__webpack_require__.n(focus_);
  1606. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/autocomplete/src/autocomplete.vue?vue&type=script&lang=js&
  1607. //
  1608. //
  1609. //
  1610. //
  1611. //
  1612. //
  1613. //
  1614. //
  1615. //
  1616. //
  1617. //
  1618. //
  1619. //
  1620. //
  1621. //
  1622. //
  1623. //
  1624. //
  1625. //
  1626. //
  1627. //
  1628. //
  1629. //
  1630. //
  1631. //
  1632. //
  1633. //
  1634. //
  1635. //
  1636. //
  1637. //
  1638. //
  1639. //
  1640. //
  1641. //
  1642. //
  1643. //
  1644. //
  1645. //
  1646. //
  1647. //
  1648. //
  1649. //
  1650. //
  1651. //
  1652. //
  1653. //
  1654. //
  1655. //
  1656. //
  1657. //
  1658. //
  1659. //
  1660. //
  1661. //
  1662. //
  1663. //
  1664. //
  1665. //
  1666. /* harmony default export */ var autocompletevue_type_script_lang_js_ = ({
  1667. name: 'ElAutocomplete',
  1668. mixins: [emitter_default.a, focus_default()('input'), migrating_default.a],
  1669. inheritAttrs: false,
  1670. componentName: 'ElAutocomplete',
  1671. components: {
  1672. ElInput: input_default.a,
  1673. ElAutocompleteSuggestions: autocomplete_suggestions
  1674. },
  1675. directives: { Clickoutside: clickoutside_default.a },
  1676. props: {
  1677. valueKey: {
  1678. type: String,
  1679. default: 'value'
  1680. },
  1681. popperClass: String,
  1682. popperOptions: Object,
  1683. placeholder: String,
  1684. clearable: {
  1685. type: Boolean,
  1686. default: false
  1687. },
  1688. disabled: Boolean,
  1689. name: String,
  1690. size: String,
  1691. value: String,
  1692. maxlength: Number,
  1693. minlength: Number,
  1694. autofocus: Boolean,
  1695. fetchSuggestions: Function,
  1696. triggerOnFocus: {
  1697. type: Boolean,
  1698. default: true
  1699. },
  1700. customItem: String,
  1701. selectWhenUnmatched: {
  1702. type: Boolean,
  1703. default: false
  1704. },
  1705. prefixIcon: String,
  1706. suffixIcon: String,
  1707. label: String,
  1708. debounce: {
  1709. type: Number,
  1710. default: 300
  1711. },
  1712. placement: {
  1713. type: String,
  1714. default: 'bottom-start'
  1715. },
  1716. hideLoading: Boolean,
  1717. popperAppendToBody: {
  1718. type: Boolean,
  1719. default: true
  1720. },
  1721. highlightFirstItem: {
  1722. type: Boolean,
  1723. default: false
  1724. }
  1725. },
  1726. data: function data() {
  1727. return {
  1728. activated: false,
  1729. suggestions: [],
  1730. loading: false,
  1731. highlightedIndex: -1,
  1732. suggestionDisabled: false
  1733. };
  1734. },
  1735. computed: {
  1736. suggestionVisible: function suggestionVisible() {
  1737. var suggestions = this.suggestions;
  1738. var isValidData = Array.isArray(suggestions) && suggestions.length > 0;
  1739. return (isValidData || this.loading) && this.activated;
  1740. },
  1741. id: function id() {
  1742. return 'el-autocomplete-' + Object(util_["generateId"])();
  1743. }
  1744. },
  1745. watch: {
  1746. suggestionVisible: function suggestionVisible(val) {
  1747. var $input = this.getInput();
  1748. if ($input) {
  1749. this.broadcast('ElAutocompleteSuggestions', 'visible', [val, $input.offsetWidth]);
  1750. }
  1751. }
  1752. },
  1753. methods: {
  1754. getMigratingConfig: function getMigratingConfig() {
  1755. return {
  1756. props: {
  1757. 'custom-item': 'custom-item is removed, use scoped slot instead.',
  1758. 'props': 'props is removed, use value-key instead.'
  1759. }
  1760. };
  1761. },
  1762. getData: function getData(queryString) {
  1763. var _this = this;
  1764. if (this.suggestionDisabled) {
  1765. return;
  1766. }
  1767. this.loading = true;
  1768. this.fetchSuggestions(queryString, function (suggestions) {
  1769. _this.loading = false;
  1770. if (_this.suggestionDisabled) {
  1771. return;
  1772. }
  1773. if (Array.isArray(suggestions)) {
  1774. _this.suggestions = suggestions;
  1775. _this.highlightedIndex = _this.highlightFirstItem ? 0 : -1;
  1776. } else {
  1777. console.error('[Element Error][Autocomplete]autocomplete suggestions must be an array');
  1778. }
  1779. });
  1780. },
  1781. handleInput: function handleInput(value) {
  1782. this.$emit('input', value);
  1783. this.suggestionDisabled = false;
  1784. if (!this.triggerOnFocus && !value) {
  1785. this.suggestionDisabled = true;
  1786. this.suggestions = [];
  1787. return;
  1788. }
  1789. this.debouncedGetData(value);
  1790. },
  1791. handleChange: function handleChange(value) {
  1792. this.$emit('change', value);
  1793. },
  1794. handleFocus: function handleFocus(event) {
  1795. this.activated = true;
  1796. this.$emit('focus', event);
  1797. if (this.triggerOnFocus) {
  1798. this.debouncedGetData(this.value);
  1799. }
  1800. },
  1801. handleBlur: function handleBlur(event) {
  1802. this.$emit('blur', event);
  1803. },
  1804. handleClear: function handleClear() {
  1805. this.activated = false;
  1806. this.$emit('clear');
  1807. },
  1808. close: function close(e) {
  1809. this.activated = false;
  1810. },
  1811. handleKeyEnter: function handleKeyEnter(e) {
  1812. var _this2 = this;
  1813. if (this.suggestionVisible && this.highlightedIndex >= 0 && this.highlightedIndex < this.suggestions.length) {
  1814. e.preventDefault();
  1815. this.select(this.suggestions[this.highlightedIndex]);
  1816. } else if (this.selectWhenUnmatched) {
  1817. this.$emit('select', { value: this.value });
  1818. this.$nextTick(function (_) {
  1819. _this2.suggestions = [];
  1820. _this2.highlightedIndex = -1;
  1821. });
  1822. }
  1823. },
  1824. select: function select(item) {
  1825. var _this3 = this;
  1826. this.$emit('input', item[this.valueKey]);
  1827. this.$emit('select', item);
  1828. this.$nextTick(function (_) {
  1829. _this3.suggestions = [];
  1830. _this3.highlightedIndex = -1;
  1831. });
  1832. },
  1833. highlight: function highlight(index) {
  1834. if (!this.suggestionVisible || this.loading) {
  1835. return;
  1836. }
  1837. if (index < 0) {
  1838. this.highlightedIndex = -1;
  1839. return;
  1840. }
  1841. if (index >= this.suggestions.length) {
  1842. index = this.suggestions.length - 1;
  1843. }
  1844. var suggestion = this.$refs.suggestions.$el.querySelector('.el-autocomplete-suggestion__wrap');
  1845. var suggestionList = suggestion.querySelectorAll('.el-autocomplete-suggestion__list li');
  1846. var highlightItem = suggestionList[index];
  1847. var scrollTop = suggestion.scrollTop;
  1848. var offsetTop = highlightItem.offsetTop;
  1849. if (offsetTop + highlightItem.scrollHeight > scrollTop + suggestion.clientHeight) {
  1850. suggestion.scrollTop += highlightItem.scrollHeight;
  1851. }
  1852. if (offsetTop < scrollTop) {
  1853. suggestion.scrollTop -= highlightItem.scrollHeight;
  1854. }
  1855. this.highlightedIndex = index;
  1856. var $input = this.getInput();
  1857. $input.setAttribute('aria-activedescendant', this.id + '-item-' + this.highlightedIndex);
  1858. },
  1859. getInput: function getInput() {
  1860. return this.$refs.input.getInput();
  1861. }
  1862. },
  1863. mounted: function mounted() {
  1864. var _this4 = this;
  1865. this.debouncedGetData = debounce_default()(this.debounce, this.getData);
  1866. this.$on('item-click', function (item) {
  1867. _this4.select(item);
  1868. });
  1869. var $input = this.getInput();
  1870. $input.setAttribute('role', 'textbox');
  1871. $input.setAttribute('aria-autocomplete', 'list');
  1872. $input.setAttribute('aria-controls', 'id');
  1873. $input.setAttribute('aria-activedescendant', this.id + '-item-' + this.highlightedIndex);
  1874. },
  1875. beforeDestroy: function beforeDestroy() {
  1876. this.$refs.suggestions.$destroy();
  1877. }
  1878. });
  1879. // CONCATENATED MODULE: ./packages/autocomplete/src/autocomplete.vue?vue&type=script&lang=js&
  1880. /* harmony default export */ var src_autocompletevue_type_script_lang_js_ = (autocompletevue_type_script_lang_js_);
  1881. // CONCATENATED MODULE: ./packages/autocomplete/src/autocomplete.vue
  1882. /* normalize component */
  1883. var autocomplete_component = normalizeComponent(
  1884. src_autocompletevue_type_script_lang_js_,
  1885. autocompletevue_type_template_id_152f2ee6_render,
  1886. autocompletevue_type_template_id_152f2ee6_staticRenderFns,
  1887. false,
  1888. null,
  1889. null,
  1890. null
  1891. )
  1892. /* hot reload */
  1893. if (false) { var autocomplete_api; }
  1894. autocomplete_component.options.__file = "packages/autocomplete/src/autocomplete.vue"
  1895. /* harmony default export */ var autocomplete = (autocomplete_component.exports);
  1896. // CONCATENATED MODULE: ./packages/autocomplete/index.js
  1897. /* istanbul ignore next */
  1898. autocomplete.install = function (Vue) {
  1899. Vue.component(autocomplete.name, autocomplete);
  1900. };
  1901. /* harmony default export */ var packages_autocomplete = (autocomplete);
  1902. // EXTERNAL MODULE: external "element-ui/lib/button"
  1903. var button_ = __webpack_require__(13);
  1904. var button_default = /*#__PURE__*/__webpack_require__.n(button_);
  1905. // EXTERNAL MODULE: external "element-ui/lib/button-group"
  1906. var button_group_ = __webpack_require__(29);
  1907. var button_group_default = /*#__PURE__*/__webpack_require__.n(button_group_);
  1908. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/dropdown/src/dropdown.vue?vue&type=script&lang=js&
  1909. /* harmony default export */ var dropdownvue_type_script_lang_js_ = ({
  1910. name: 'ElDropdown',
  1911. componentName: 'ElDropdown',
  1912. mixins: [emitter_default.a, migrating_default.a],
  1913. directives: { Clickoutside: clickoutside_default.a },
  1914. components: {
  1915. ElButton: button_default.a,
  1916. ElButtonGroup: button_group_default.a
  1917. },
  1918. provide: function provide() {
  1919. return {
  1920. dropdown: this
  1921. };
  1922. },
  1923. props: {
  1924. trigger: {
  1925. type: String,
  1926. default: 'hover'
  1927. },
  1928. type: String,
  1929. size: {
  1930. type: String,
  1931. default: ''
  1932. },
  1933. splitButton: Boolean,
  1934. hideOnClick: {
  1935. type: Boolean,
  1936. default: true
  1937. },
  1938. placement: {
  1939. type: String,
  1940. default: 'bottom-end'
  1941. },
  1942. visibleArrow: {
  1943. default: true
  1944. },
  1945. showTimeout: {
  1946. type: Number,
  1947. default: 250
  1948. },
  1949. hideTimeout: {
  1950. type: Number,
  1951. default: 150
  1952. },
  1953. tabindex: {
  1954. type: Number,
  1955. default: 0
  1956. },
  1957. disabled: {
  1958. type: Boolean,
  1959. default: false
  1960. }
  1961. },
  1962. data: function data() {
  1963. return {
  1964. timeout: null,
  1965. visible: false,
  1966. triggerElm: null,
  1967. menuItems: null,
  1968. menuItemsArray: null,
  1969. dropdownElm: null,
  1970. focusing: false,
  1971. listId: 'dropdown-menu-' + Object(util_["generateId"])()
  1972. };
  1973. },
  1974. computed: {
  1975. dropdownSize: function dropdownSize() {
  1976. return this.size || (this.$ELEMENT || {}).size;
  1977. }
  1978. },
  1979. mounted: function mounted() {
  1980. this.$on('menu-item-click', this.handleMenuItemClick);
  1981. },
  1982. watch: {
  1983. visible: function visible(val) {
  1984. this.broadcast('ElDropdownMenu', 'visible', val);
  1985. this.$emit('visible-change', val);
  1986. },
  1987. focusing: function focusing(val) {
  1988. var selfDefine = this.$el.querySelector('.el-dropdown-selfdefine');
  1989. if (selfDefine) {
  1990. // 自定义
  1991. if (val) {
  1992. selfDefine.className += ' focusing';
  1993. } else {
  1994. selfDefine.className = selfDefine.className.replace('focusing', '');
  1995. }
  1996. }
  1997. }
  1998. },
  1999. methods: {
  2000. getMigratingConfig: function getMigratingConfig() {
  2001. return {
  2002. props: {
  2003. 'menu-align': 'menu-align is renamed to placement.'
  2004. }
  2005. };
  2006. },
  2007. show: function show() {
  2008. var _this = this;
  2009. if (this.disabled) return;
  2010. clearTimeout(this.timeout);
  2011. this.timeout = setTimeout(function () {
  2012. _this.visible = true;
  2013. }, this.trigger === 'click' ? 0 : this.showTimeout);
  2014. },
  2015. hide: function hide() {
  2016. var _this2 = this;
  2017. if (this.disabled) return;
  2018. this.removeTabindex();
  2019. if (this.tabindex >= 0) {
  2020. this.resetTabindex(this.triggerElm);
  2021. }
  2022. clearTimeout(this.timeout);
  2023. this.timeout = setTimeout(function () {
  2024. _this2.visible = false;
  2025. }, this.trigger === 'click' ? 0 : this.hideTimeout);
  2026. },
  2027. handleClick: function handleClick() {
  2028. if (this.disabled) return;
  2029. if (this.visible) {
  2030. this.hide();
  2031. } else {
  2032. this.show();
  2033. }
  2034. },
  2035. handleTriggerKeyDown: function handleTriggerKeyDown(ev) {
  2036. var keyCode = ev.keyCode;
  2037. if ([38, 40].indexOf(keyCode) > -1) {
  2038. // up/down
  2039. this.removeTabindex();
  2040. this.resetTabindex(this.menuItems[0]);
  2041. this.menuItems[0].focus();
  2042. ev.preventDefault();
  2043. ev.stopPropagation();
  2044. } else if (keyCode === 13) {
  2045. // space enter选中
  2046. this.handleClick();
  2047. } else if ([9, 27].indexOf(keyCode) > -1) {
  2048. // tab || esc
  2049. this.hide();
  2050. }
  2051. },
  2052. handleItemKeyDown: function handleItemKeyDown(ev) {
  2053. var keyCode = ev.keyCode;
  2054. var target = ev.target;
  2055. var currentIndex = this.menuItemsArray.indexOf(target);
  2056. var max = this.menuItemsArray.length - 1;
  2057. var nextIndex = void 0;
  2058. if ([38, 40].indexOf(keyCode) > -1) {
  2059. // up/down
  2060. if (keyCode === 38) {
  2061. // up
  2062. nextIndex = currentIndex !== 0 ? currentIndex - 1 : 0;
  2063. } else {
  2064. // down
  2065. nextIndex = currentIndex < max ? currentIndex + 1 : max;
  2066. }
  2067. this.removeTabindex();
  2068. this.resetTabindex(this.menuItems[nextIndex]);
  2069. this.menuItems[nextIndex].focus();
  2070. ev.preventDefault();
  2071. ev.stopPropagation();
  2072. } else if (keyCode === 13) {
  2073. // enter选中
  2074. this.triggerElmFocus();
  2075. target.click();
  2076. if (this.hideOnClick) {
  2077. // click关闭
  2078. this.visible = false;
  2079. }
  2080. } else if ([9, 27].indexOf(keyCode) > -1) {
  2081. // tab // esc
  2082. this.hide();
  2083. this.triggerElmFocus();
  2084. }
  2085. },
  2086. resetTabindex: function resetTabindex(ele) {
  2087. // 下次tab时组件聚焦元素
  2088. this.removeTabindex();
  2089. ele.setAttribute('tabindex', '0'); // 下次期望的聚焦元素
  2090. },
  2091. removeTabindex: function removeTabindex() {
  2092. this.triggerElm.setAttribute('tabindex', '-1');
  2093. this.menuItemsArray.forEach(function (item) {
  2094. item.setAttribute('tabindex', '-1');
  2095. });
  2096. },
  2097. initAria: function initAria() {
  2098. this.dropdownElm.setAttribute('id', this.listId);
  2099. this.triggerElm.setAttribute('aria-haspopup', 'list');
  2100. this.triggerElm.setAttribute('aria-controls', this.listId);
  2101. if (!this.splitButton) {
  2102. // 自定义
  2103. this.triggerElm.setAttribute('role', 'button');
  2104. this.triggerElm.setAttribute('tabindex', this.tabindex);
  2105. this.triggerElm.setAttribute('class', (this.triggerElm.getAttribute('class') || '') + ' el-dropdown-selfdefine'); // 控制
  2106. }
  2107. },
  2108. initEvent: function initEvent() {
  2109. var _this3 = this;
  2110. var trigger = this.trigger,
  2111. show = this.show,
  2112. hide = this.hide,
  2113. handleClick = this.handleClick,
  2114. splitButton = this.splitButton,
  2115. handleTriggerKeyDown = this.handleTriggerKeyDown,
  2116. handleItemKeyDown = this.handleItemKeyDown;
  2117. this.triggerElm = splitButton ? this.$refs.trigger.$el : this.$slots.default[0].elm;
  2118. var dropdownElm = this.dropdownElm;
  2119. this.triggerElm.addEventListener('keydown', handleTriggerKeyDown); // triggerElm keydown
  2120. dropdownElm.addEventListener('keydown', handleItemKeyDown, true); // item keydown
  2121. // 控制自定义元素的样式
  2122. if (!splitButton) {
  2123. this.triggerElm.addEventListener('focus', function () {
  2124. _this3.focusing = true;
  2125. });
  2126. this.triggerElm.addEventListener('blur', function () {
  2127. _this3.focusing = false;
  2128. });
  2129. this.triggerElm.addEventListener('click', function () {
  2130. _this3.focusing = false;
  2131. });
  2132. }
  2133. if (trigger === 'hover') {
  2134. this.triggerElm.addEventListener('mouseenter', show);
  2135. this.triggerElm.addEventListener('mouseleave', hide);
  2136. dropdownElm.addEventListener('mouseenter', show);
  2137. dropdownElm.addEventListener('mouseleave', hide);
  2138. } else if (trigger === 'click') {
  2139. this.triggerElm.addEventListener('click', handleClick);
  2140. }
  2141. },
  2142. handleMenuItemClick: function handleMenuItemClick(command, instance) {
  2143. if (this.hideOnClick) {
  2144. this.visible = false;
  2145. }
  2146. this.$emit('command', command, instance);
  2147. },
  2148. triggerElmFocus: function triggerElmFocus() {
  2149. this.triggerElm.focus && this.triggerElm.focus();
  2150. },
  2151. initDomOperation: function initDomOperation() {
  2152. this.dropdownElm = this.popperElm;
  2153. this.menuItems = this.dropdownElm.querySelectorAll("[tabindex='-1']");
  2154. this.menuItemsArray = [].slice.call(this.menuItems);
  2155. this.initEvent();
  2156. this.initAria();
  2157. }
  2158. },
  2159. render: function render(h) {
  2160. var _this4 = this;
  2161. var hide = this.hide,
  2162. splitButton = this.splitButton,
  2163. type = this.type,
  2164. dropdownSize = this.dropdownSize,
  2165. disabled = this.disabled;
  2166. var handleMainButtonClick = function handleMainButtonClick(event) {
  2167. _this4.$emit('click', event);
  2168. hide();
  2169. };
  2170. var triggerElm = null;
  2171. if (splitButton) {
  2172. triggerElm = h('el-button-group', [h(
  2173. 'el-button',
  2174. {
  2175. attrs: { type: type, size: dropdownSize, disabled: disabled },
  2176. nativeOn: {
  2177. 'click': handleMainButtonClick
  2178. }
  2179. },
  2180. [this.$slots.default]
  2181. ), h(
  2182. 'el-button',
  2183. { ref: 'trigger', attrs: { type: type, size: dropdownSize, disabled: disabled },
  2184. 'class': 'el-dropdown__caret-button' },
  2185. [h('i', { 'class': 'el-dropdown__icon el-icon-arrow-down' })]
  2186. )]);
  2187. } else {
  2188. triggerElm = this.$slots.default;
  2189. var vnodeData = triggerElm[0].data || {};
  2190. var _vnodeData$attrs = vnodeData.attrs,
  2191. attrs = _vnodeData$attrs === undefined ? {} : _vnodeData$attrs;
  2192. if (disabled && !attrs.disabled) {
  2193. attrs.disabled = true;
  2194. vnodeData.attrs = attrs;
  2195. }
  2196. }
  2197. var menuElm = disabled ? null : this.$slots.dropdown;
  2198. return h(
  2199. 'div',
  2200. { 'class': 'el-dropdown', directives: [{
  2201. name: 'clickoutside',
  2202. value: hide
  2203. }],
  2204. attrs: { 'aria-disabled': disabled }
  2205. },
  2206. [triggerElm, menuElm]
  2207. );
  2208. }
  2209. });
  2210. // CONCATENATED MODULE: ./packages/dropdown/src/dropdown.vue?vue&type=script&lang=js&
  2211. /* harmony default export */ var src_dropdownvue_type_script_lang_js_ = (dropdownvue_type_script_lang_js_);
  2212. // CONCATENATED MODULE: ./packages/dropdown/src/dropdown.vue
  2213. var dropdown_render, dropdown_staticRenderFns
  2214. /* normalize component */
  2215. var dropdown_component = normalizeComponent(
  2216. src_dropdownvue_type_script_lang_js_,
  2217. dropdown_render,
  2218. dropdown_staticRenderFns,
  2219. false,
  2220. null,
  2221. null,
  2222. null
  2223. )
  2224. /* hot reload */
  2225. if (false) { var dropdown_api; }
  2226. dropdown_component.options.__file = "packages/dropdown/src/dropdown.vue"
  2227. /* harmony default export */ var dropdown = (dropdown_component.exports);
  2228. // CONCATENATED MODULE: ./packages/dropdown/index.js
  2229. /* istanbul ignore next */
  2230. dropdown.install = function (Vue) {
  2231. Vue.component(dropdown.name, dropdown);
  2232. };
  2233. /* harmony default export */ var packages_dropdown = (dropdown);
  2234. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/dropdown/src/dropdown-menu.vue?vue&type=template&id=0da6b714&
  2235. var dropdown_menuvue_type_template_id_0da6b714_render = function() {
  2236. var _vm = this
  2237. var _h = _vm.$createElement
  2238. var _c = _vm._self._c || _h
  2239. return _c(
  2240. "transition",
  2241. { attrs: { name: "el-zoom-in-top" }, on: { "after-leave": _vm.doDestroy } },
  2242. [
  2243. _c(
  2244. "ul",
  2245. {
  2246. directives: [
  2247. {
  2248. name: "show",
  2249. rawName: "v-show",
  2250. value: _vm.showPopper,
  2251. expression: "showPopper"
  2252. }
  2253. ],
  2254. staticClass: "el-dropdown-menu el-popper",
  2255. class: [_vm.size && "el-dropdown-menu--" + _vm.size]
  2256. },
  2257. [_vm._t("default")],
  2258. 2
  2259. )
  2260. ]
  2261. )
  2262. }
  2263. var dropdown_menuvue_type_template_id_0da6b714_staticRenderFns = []
  2264. dropdown_menuvue_type_template_id_0da6b714_render._withStripped = true
  2265. // CONCATENATED MODULE: ./packages/dropdown/src/dropdown-menu.vue?vue&type=template&id=0da6b714&
  2266. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/dropdown/src/dropdown-menu.vue?vue&type=script&lang=js&
  2267. //
  2268. //
  2269. //
  2270. //
  2271. //
  2272. //
  2273. //
  2274. /* harmony default export */ var dropdown_menuvue_type_script_lang_js_ = ({
  2275. name: 'ElDropdownMenu',
  2276. componentName: 'ElDropdownMenu',
  2277. mixins: [vue_popper_default.a],
  2278. props: {
  2279. visibleArrow: {
  2280. type: Boolean,
  2281. default: true
  2282. },
  2283. arrowOffset: {
  2284. type: Number,
  2285. default: 0
  2286. }
  2287. },
  2288. data: function data() {
  2289. return {
  2290. size: this.dropdown.dropdownSize
  2291. };
  2292. },
  2293. inject: ['dropdown'],
  2294. created: function created() {
  2295. var _this = this;
  2296. this.$on('updatePopper', function () {
  2297. if (_this.showPopper) _this.updatePopper();
  2298. });
  2299. this.$on('visible', function (val) {
  2300. _this.showPopper = val;
  2301. });
  2302. },
  2303. mounted: function mounted() {
  2304. this.dropdown.popperElm = this.popperElm = this.$el;
  2305. this.referenceElm = this.dropdown.$el;
  2306. // compatible with 2.6 new v-slot syntax
  2307. // issue link https://github.com/ElemeFE/element/issues/14345
  2308. this.dropdown.initDomOperation();
  2309. },
  2310. watch: {
  2311. 'dropdown.placement': {
  2312. immediate: true,
  2313. handler: function handler(val) {
  2314. this.currentPlacement = val;
  2315. }
  2316. }
  2317. }
  2318. });
  2319. // CONCATENATED MODULE: ./packages/dropdown/src/dropdown-menu.vue?vue&type=script&lang=js&
  2320. /* harmony default export */ var src_dropdown_menuvue_type_script_lang_js_ = (dropdown_menuvue_type_script_lang_js_);
  2321. // CONCATENATED MODULE: ./packages/dropdown/src/dropdown-menu.vue
  2322. /* normalize component */
  2323. var dropdown_menu_component = normalizeComponent(
  2324. src_dropdown_menuvue_type_script_lang_js_,
  2325. dropdown_menuvue_type_template_id_0da6b714_render,
  2326. dropdown_menuvue_type_template_id_0da6b714_staticRenderFns,
  2327. false,
  2328. null,
  2329. null,
  2330. null
  2331. )
  2332. /* hot reload */
  2333. if (false) { var dropdown_menu_api; }
  2334. dropdown_menu_component.options.__file = "packages/dropdown/src/dropdown-menu.vue"
  2335. /* harmony default export */ var dropdown_menu = (dropdown_menu_component.exports);
  2336. // CONCATENATED MODULE: ./packages/dropdown-menu/index.js
  2337. /* istanbul ignore next */
  2338. dropdown_menu.install = function (Vue) {
  2339. Vue.component(dropdown_menu.name, dropdown_menu);
  2340. };
  2341. /* harmony default export */ var packages_dropdown_menu = (dropdown_menu);
  2342. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/dropdown/src/dropdown-item.vue?vue&type=template&id=6359102a&
  2343. var dropdown_itemvue_type_template_id_6359102a_render = function() {
  2344. var _vm = this
  2345. var _h = _vm.$createElement
  2346. var _c = _vm._self._c || _h
  2347. return _c(
  2348. "li",
  2349. {
  2350. staticClass: "el-dropdown-menu__item",
  2351. class: {
  2352. "is-disabled": _vm.disabled,
  2353. "el-dropdown-menu__item--divided": _vm.divided
  2354. },
  2355. attrs: {
  2356. "aria-disabled": _vm.disabled,
  2357. tabindex: _vm.disabled ? null : -1
  2358. },
  2359. on: { click: _vm.handleClick }
  2360. },
  2361. [_vm.icon ? _c("i", { class: _vm.icon }) : _vm._e(), _vm._t("default")],
  2362. 2
  2363. )
  2364. }
  2365. var dropdown_itemvue_type_template_id_6359102a_staticRenderFns = []
  2366. dropdown_itemvue_type_template_id_6359102a_render._withStripped = true
  2367. // CONCATENATED MODULE: ./packages/dropdown/src/dropdown-item.vue?vue&type=template&id=6359102a&
  2368. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/dropdown/src/dropdown-item.vue?vue&type=script&lang=js&
  2369. //
  2370. //
  2371. //
  2372. //
  2373. //
  2374. //
  2375. //
  2376. //
  2377. //
  2378. //
  2379. //
  2380. //
  2381. //
  2382. //
  2383. //
  2384. /* harmony default export */ var dropdown_itemvue_type_script_lang_js_ = ({
  2385. name: 'ElDropdownItem',
  2386. mixins: [emitter_default.a],
  2387. props: {
  2388. command: {},
  2389. disabled: Boolean,
  2390. divided: Boolean,
  2391. icon: String
  2392. },
  2393. methods: {
  2394. handleClick: function handleClick(e) {
  2395. this.dispatch('ElDropdown', 'menu-item-click', [this.command, this]);
  2396. }
  2397. }
  2398. });
  2399. // CONCATENATED MODULE: ./packages/dropdown/src/dropdown-item.vue?vue&type=script&lang=js&
  2400. /* harmony default export */ var src_dropdown_itemvue_type_script_lang_js_ = (dropdown_itemvue_type_script_lang_js_);
  2401. // CONCATENATED MODULE: ./packages/dropdown/src/dropdown-item.vue
  2402. /* normalize component */
  2403. var dropdown_item_component = normalizeComponent(
  2404. src_dropdown_itemvue_type_script_lang_js_,
  2405. dropdown_itemvue_type_template_id_6359102a_render,
  2406. dropdown_itemvue_type_template_id_6359102a_staticRenderFns,
  2407. false,
  2408. null,
  2409. null,
  2410. null
  2411. )
  2412. /* hot reload */
  2413. if (false) { var dropdown_item_api; }
  2414. dropdown_item_component.options.__file = "packages/dropdown/src/dropdown-item.vue"
  2415. /* harmony default export */ var dropdown_item = (dropdown_item_component.exports);
  2416. // CONCATENATED MODULE: ./packages/dropdown-item/index.js
  2417. /* istanbul ignore next */
  2418. dropdown_item.install = function (Vue) {
  2419. Vue.component(dropdown_item.name, dropdown_item);
  2420. };
  2421. /* harmony default export */ var packages_dropdown_item = (dropdown_item);
  2422. // CONCATENATED MODULE: ./src/utils/aria-utils.js
  2423. var aria = aria || {};
  2424. aria.Utils = aria.Utils || {};
  2425. /**
  2426. * @desc Set focus on descendant nodes until the first focusable element is
  2427. * found.
  2428. * @param element
  2429. * DOM node for which to find the first focusable descendant.
  2430. * @returns
  2431. * true if a focusable element is found and focus is set.
  2432. */
  2433. aria.Utils.focusFirstDescendant = function (element) {
  2434. for (var i = 0; i < element.childNodes.length; i++) {
  2435. var child = element.childNodes[i];
  2436. if (aria.Utils.attemptFocus(child) || aria.Utils.focusFirstDescendant(child)) {
  2437. return true;
  2438. }
  2439. }
  2440. return false;
  2441. };
  2442. /**
  2443. * @desc Find the last descendant node that is focusable.
  2444. * @param element
  2445. * DOM node for which to find the last focusable descendant.
  2446. * @returns
  2447. * true if a focusable element is found and focus is set.
  2448. */
  2449. aria.Utils.focusLastDescendant = function (element) {
  2450. for (var i = element.childNodes.length - 1; i >= 0; i--) {
  2451. var child = element.childNodes[i];
  2452. if (aria.Utils.attemptFocus(child) || aria.Utils.focusLastDescendant(child)) {
  2453. return true;
  2454. }
  2455. }
  2456. return false;
  2457. };
  2458. /**
  2459. * @desc Set Attempt to set focus on the current node.
  2460. * @param element
  2461. * The node to attempt to focus on.
  2462. * @returns
  2463. * true if element is focused.
  2464. */
  2465. aria.Utils.attemptFocus = function (element) {
  2466. if (!aria.Utils.isFocusable(element)) {
  2467. return false;
  2468. }
  2469. aria.Utils.IgnoreUtilFocusChanges = true;
  2470. try {
  2471. element.focus();
  2472. } catch (e) {}
  2473. aria.Utils.IgnoreUtilFocusChanges = false;
  2474. return document.activeElement === element;
  2475. };
  2476. aria.Utils.isFocusable = function (element) {
  2477. if (element.tabIndex > 0 || element.tabIndex === 0 && element.getAttribute('tabIndex') !== null) {
  2478. return true;
  2479. }
  2480. if (element.disabled) {
  2481. return false;
  2482. }
  2483. switch (element.nodeName) {
  2484. case 'A':
  2485. return !!element.href && element.rel !== 'ignore';
  2486. case 'INPUT':
  2487. return element.type !== 'hidden' && element.type !== 'file';
  2488. case 'BUTTON':
  2489. case 'SELECT':
  2490. case 'TEXTAREA':
  2491. return true;
  2492. default:
  2493. return false;
  2494. }
  2495. };
  2496. /**
  2497. * 触发一个事件
  2498. * mouseenter, mouseleave, mouseover, keyup, change, click 等
  2499. * @param {Element} elm
  2500. * @param {String} name
  2501. * @param {*} opts
  2502. */
  2503. aria.Utils.triggerEvent = function (elm, name) {
  2504. var eventName = void 0;
  2505. if (/^mouse|click/.test(name)) {
  2506. eventName = 'MouseEvents';
  2507. } else if (/^key/.test(name)) {
  2508. eventName = 'KeyboardEvent';
  2509. } else {
  2510. eventName = 'HTMLEvents';
  2511. }
  2512. var evt = document.createEvent(eventName);
  2513. for (var _len = arguments.length, opts = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
  2514. opts[_key - 2] = arguments[_key];
  2515. }
  2516. evt.initEvent.apply(evt, [name].concat(opts));
  2517. elm.dispatchEvent ? elm.dispatchEvent(evt) : elm.fireEvent('on' + name, evt);
  2518. return elm;
  2519. };
  2520. aria.Utils.keys = {
  2521. tab: 9,
  2522. enter: 13,
  2523. space: 32,
  2524. left: 37,
  2525. up: 38,
  2526. right: 39,
  2527. down: 40,
  2528. esc: 27
  2529. };
  2530. /* harmony default export */ var aria_utils = (aria.Utils);
  2531. // CONCATENATED MODULE: ./src/utils/menu/aria-submenu.js
  2532. var SubMenu = function SubMenu(parent, domNode) {
  2533. this.domNode = domNode;
  2534. this.parent = parent;
  2535. this.subMenuItems = [];
  2536. this.subIndex = 0;
  2537. this.init();
  2538. };
  2539. SubMenu.prototype.init = function () {
  2540. this.subMenuItems = this.domNode.querySelectorAll('li');
  2541. this.addListeners();
  2542. };
  2543. SubMenu.prototype.gotoSubIndex = function (idx) {
  2544. if (idx === this.subMenuItems.length) {
  2545. idx = 0;
  2546. } else if (idx < 0) {
  2547. idx = this.subMenuItems.length - 1;
  2548. }
  2549. this.subMenuItems[idx].focus();
  2550. this.subIndex = idx;
  2551. };
  2552. SubMenu.prototype.addListeners = function () {
  2553. var _this = this;
  2554. var keys = aria_utils.keys;
  2555. var parentNode = this.parent.domNode;
  2556. Array.prototype.forEach.call(this.subMenuItems, function (el) {
  2557. el.addEventListener('keydown', function (event) {
  2558. var prevDef = false;
  2559. switch (event.keyCode) {
  2560. case keys.down:
  2561. _this.gotoSubIndex(_this.subIndex + 1);
  2562. prevDef = true;
  2563. break;
  2564. case keys.up:
  2565. _this.gotoSubIndex(_this.subIndex - 1);
  2566. prevDef = true;
  2567. break;
  2568. case keys.tab:
  2569. aria_utils.triggerEvent(parentNode, 'mouseleave');
  2570. break;
  2571. case keys.enter:
  2572. case keys.space:
  2573. prevDef = true;
  2574. event.currentTarget.click();
  2575. break;
  2576. }
  2577. if (prevDef) {
  2578. event.preventDefault();
  2579. event.stopPropagation();
  2580. }
  2581. return false;
  2582. });
  2583. });
  2584. };
  2585. /* harmony default export */ var aria_submenu = (SubMenu);
  2586. // CONCATENATED MODULE: ./src/utils/menu/aria-menuitem.js
  2587. var MenuItem = function MenuItem(domNode) {
  2588. this.domNode = domNode;
  2589. this.submenu = null;
  2590. this.init();
  2591. };
  2592. MenuItem.prototype.init = function () {
  2593. this.domNode.setAttribute('tabindex', '0');
  2594. var menuChild = this.domNode.querySelector('.el-menu');
  2595. if (menuChild) {
  2596. this.submenu = new aria_submenu(this, menuChild);
  2597. }
  2598. this.addListeners();
  2599. };
  2600. MenuItem.prototype.addListeners = function () {
  2601. var _this = this;
  2602. var keys = aria_utils.keys;
  2603. this.domNode.addEventListener('keydown', function (event) {
  2604. var prevDef = false;
  2605. switch (event.keyCode) {
  2606. case keys.down:
  2607. aria_utils.triggerEvent(event.currentTarget, 'mouseenter');
  2608. _this.submenu && _this.submenu.gotoSubIndex(0);
  2609. prevDef = true;
  2610. break;
  2611. case keys.up:
  2612. aria_utils.triggerEvent(event.currentTarget, 'mouseenter');
  2613. _this.submenu && _this.submenu.gotoSubIndex(_this.submenu.subMenuItems.length - 1);
  2614. prevDef = true;
  2615. break;
  2616. case keys.tab:
  2617. aria_utils.triggerEvent(event.currentTarget, 'mouseleave');
  2618. break;
  2619. case keys.enter:
  2620. case keys.space:
  2621. prevDef = true;
  2622. event.currentTarget.click();
  2623. break;
  2624. }
  2625. if (prevDef) {
  2626. event.preventDefault();
  2627. }
  2628. });
  2629. };
  2630. /* harmony default export */ var aria_menuitem = (MenuItem);
  2631. // CONCATENATED MODULE: ./src/utils/menu/aria-menubar.js
  2632. var Menu = function Menu(domNode) {
  2633. this.domNode = domNode;
  2634. this.init();
  2635. };
  2636. Menu.prototype.init = function () {
  2637. var menuChildren = this.domNode.childNodes;
  2638. [].filter.call(menuChildren, function (child) {
  2639. return child.nodeType === 1;
  2640. }).forEach(function (child) {
  2641. new aria_menuitem(child); // eslint-disable-line
  2642. });
  2643. };
  2644. /* harmony default export */ var aria_menubar = (Menu);
  2645. // EXTERNAL MODULE: external "element-ui/lib/utils/dom"
  2646. var dom_ = __webpack_require__(1);
  2647. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/menu/src/menu.vue?vue&type=script&lang=js&
  2648. /* harmony default export */ var menuvue_type_script_lang_js_ = ({
  2649. name: 'ElMenu',
  2650. render: function render(h) {
  2651. var component = h(
  2652. 'ul',
  2653. {
  2654. attrs: {
  2655. role: 'menubar'
  2656. },
  2657. key: +this.collapse,
  2658. style: { backgroundColor: this.backgroundColor || '' },
  2659. 'class': {
  2660. 'el-menu--horizontal': this.mode === 'horizontal',
  2661. 'el-menu--collapse': this.collapse,
  2662. "el-menu": true
  2663. }
  2664. },
  2665. [this.$slots.default]
  2666. );
  2667. if (this.collapseTransition) {
  2668. return h('el-menu-collapse-transition', [component]);
  2669. } else {
  2670. return component;
  2671. }
  2672. },
  2673. componentName: 'ElMenu',
  2674. mixins: [emitter_default.a, migrating_default.a],
  2675. provide: function provide() {
  2676. return {
  2677. rootMenu: this
  2678. };
  2679. },
  2680. components: {
  2681. 'el-menu-collapse-transition': {
  2682. functional: true,
  2683. render: function render(createElement, context) {
  2684. var data = {
  2685. props: {
  2686. mode: 'out-in'
  2687. },
  2688. on: {
  2689. beforeEnter: function beforeEnter(el) {
  2690. el.style.opacity = 0.2;
  2691. },
  2692. enter: function enter(el) {
  2693. Object(dom_["addClass"])(el, 'el-opacity-transition');
  2694. el.style.opacity = 1;
  2695. },
  2696. afterEnter: function afterEnter(el) {
  2697. Object(dom_["removeClass"])(el, 'el-opacity-transition');
  2698. el.style.opacity = '';
  2699. },
  2700. beforeLeave: function beforeLeave(el) {
  2701. if (!el.dataset) el.dataset = {};
  2702. if (Object(dom_["hasClass"])(el, 'el-menu--collapse')) {
  2703. Object(dom_["removeClass"])(el, 'el-menu--collapse');
  2704. el.dataset.oldOverflow = el.style.overflow;
  2705. el.dataset.scrollWidth = el.clientWidth;
  2706. Object(dom_["addClass"])(el, 'el-menu--collapse');
  2707. } else {
  2708. Object(dom_["addClass"])(el, 'el-menu--collapse');
  2709. el.dataset.oldOverflow = el.style.overflow;
  2710. el.dataset.scrollWidth = el.clientWidth;
  2711. Object(dom_["removeClass"])(el, 'el-menu--collapse');
  2712. }
  2713. el.style.width = el.scrollWidth + 'px';
  2714. el.style.overflow = 'hidden';
  2715. },
  2716. leave: function leave(el) {
  2717. Object(dom_["addClass"])(el, 'horizontal-collapse-transition');
  2718. el.style.width = el.dataset.scrollWidth + 'px';
  2719. }
  2720. }
  2721. };
  2722. return createElement('transition', data, context.children);
  2723. }
  2724. }
  2725. },
  2726. props: {
  2727. mode: {
  2728. type: String,
  2729. default: 'vertical'
  2730. },
  2731. defaultActive: {
  2732. type: String,
  2733. default: ''
  2734. },
  2735. defaultOpeneds: Array,
  2736. uniqueOpened: Boolean,
  2737. router: Boolean,
  2738. menuTrigger: {
  2739. type: String,
  2740. default: 'hover'
  2741. },
  2742. collapse: Boolean,
  2743. backgroundColor: String,
  2744. textColor: String,
  2745. activeTextColor: String,
  2746. collapseTransition: {
  2747. type: Boolean,
  2748. default: true
  2749. }
  2750. },
  2751. data: function data() {
  2752. return {
  2753. activeIndex: this.defaultActive,
  2754. openedMenus: this.defaultOpeneds && !this.collapse ? this.defaultOpeneds.slice(0) : [],
  2755. items: {},
  2756. submenus: {}
  2757. };
  2758. },
  2759. computed: {
  2760. hoverBackground: function hoverBackground() {
  2761. return this.backgroundColor ? this.mixColor(this.backgroundColor, 0.2) : '';
  2762. },
  2763. isMenuPopup: function isMenuPopup() {
  2764. return this.mode === 'horizontal' || this.mode === 'vertical' && this.collapse;
  2765. }
  2766. },
  2767. watch: {
  2768. defaultActive: function defaultActive(value) {
  2769. if (!this.items[value]) {
  2770. this.activeIndex = null;
  2771. }
  2772. this.updateActiveIndex(value);
  2773. },
  2774. defaultOpeneds: function defaultOpeneds(value) {
  2775. if (!this.collapse) {
  2776. this.openedMenus = value;
  2777. }
  2778. },
  2779. collapse: function collapse(value) {
  2780. if (value) this.openedMenus = [];
  2781. this.broadcast('ElSubmenu', 'toggle-collapse', value);
  2782. }
  2783. },
  2784. methods: {
  2785. updateActiveIndex: function updateActiveIndex(val) {
  2786. var item = this.items[val] || this.items[this.activeIndex] || this.items[this.defaultActive];
  2787. if (item) {
  2788. this.activeIndex = item.index;
  2789. this.initOpenedMenu();
  2790. } else {
  2791. this.activeIndex = null;
  2792. }
  2793. },
  2794. getMigratingConfig: function getMigratingConfig() {
  2795. return {
  2796. props: {
  2797. 'theme': 'theme is removed.'
  2798. }
  2799. };
  2800. },
  2801. getColorChannels: function getColorChannels(color) {
  2802. color = color.replace('#', '');
  2803. if (/^[0-9a-fA-F]{3}$/.test(color)) {
  2804. color = color.split('');
  2805. for (var i = 2; i >= 0; i--) {
  2806. color.splice(i, 0, color[i]);
  2807. }
  2808. color = color.join('');
  2809. }
  2810. if (/^[0-9a-fA-F]{6}$/.test(color)) {
  2811. return {
  2812. red: parseInt(color.slice(0, 2), 16),
  2813. green: parseInt(color.slice(2, 4), 16),
  2814. blue: parseInt(color.slice(4, 6), 16)
  2815. };
  2816. } else {
  2817. return {
  2818. red: 255,
  2819. green: 255,
  2820. blue: 255
  2821. };
  2822. }
  2823. },
  2824. mixColor: function mixColor(color, percent) {
  2825. var _getColorChannels = this.getColorChannels(color),
  2826. red = _getColorChannels.red,
  2827. green = _getColorChannels.green,
  2828. blue = _getColorChannels.blue;
  2829. if (percent > 0) {
  2830. // shade given color
  2831. red *= 1 - percent;
  2832. green *= 1 - percent;
  2833. blue *= 1 - percent;
  2834. } else {
  2835. // tint given color
  2836. red += (255 - red) * percent;
  2837. green += (255 - green) * percent;
  2838. blue += (255 - blue) * percent;
  2839. }
  2840. return 'rgb(' + Math.round(red) + ', ' + Math.round(green) + ', ' + Math.round(blue) + ')';
  2841. },
  2842. addItem: function addItem(item) {
  2843. this.$set(this.items, item.index, item);
  2844. },
  2845. removeItem: function removeItem(item) {
  2846. delete this.items[item.index];
  2847. },
  2848. addSubmenu: function addSubmenu(item) {
  2849. this.$set(this.submenus, item.index, item);
  2850. },
  2851. removeSubmenu: function removeSubmenu(item) {
  2852. delete this.submenus[item.index];
  2853. },
  2854. openMenu: function openMenu(index, indexPath) {
  2855. var openedMenus = this.openedMenus;
  2856. if (openedMenus.indexOf(index) !== -1) return;
  2857. // 将不在该菜单路径下的其余菜单收起
  2858. // collapse all menu that are not under current menu item
  2859. if (this.uniqueOpened) {
  2860. this.openedMenus = openedMenus.filter(function (index) {
  2861. return indexPath.indexOf(index) !== -1;
  2862. });
  2863. }
  2864. this.openedMenus.push(index);
  2865. },
  2866. closeMenu: function closeMenu(index) {
  2867. var i = this.openedMenus.indexOf(index);
  2868. if (i !== -1) {
  2869. this.openedMenus.splice(i, 1);
  2870. }
  2871. },
  2872. handleSubmenuClick: function handleSubmenuClick(submenu) {
  2873. var index = submenu.index,
  2874. indexPath = submenu.indexPath;
  2875. var isOpened = this.openedMenus.indexOf(index) !== -1;
  2876. if (isOpened) {
  2877. this.closeMenu(index);
  2878. this.$emit('close', index, indexPath);
  2879. } else {
  2880. this.openMenu(index, indexPath);
  2881. this.$emit('open', index, indexPath);
  2882. }
  2883. },
  2884. handleItemClick: function handleItemClick(item) {
  2885. var _this = this;
  2886. var index = item.index,
  2887. indexPath = item.indexPath;
  2888. var oldActiveIndex = this.activeIndex;
  2889. var hasIndex = item.index !== null;
  2890. if (hasIndex) {
  2891. this.activeIndex = item.index;
  2892. }
  2893. this.$emit('select', index, indexPath, item);
  2894. if (this.mode === 'horizontal' || this.collapse) {
  2895. this.openedMenus = [];
  2896. }
  2897. if (this.router && hasIndex) {
  2898. this.routeToItem(item, function (error) {
  2899. _this.activeIndex = oldActiveIndex;
  2900. if (error) {
  2901. // vue-router 3.1.0+ push/replace cause NavigationDuplicated error
  2902. // https://github.com/ElemeFE/element/issues/17044
  2903. if (error.name === 'NavigationDuplicated') return;
  2904. console.error(error);
  2905. }
  2906. });
  2907. }
  2908. },
  2909. // 初始化展开菜单
  2910. // initialize opened menu
  2911. initOpenedMenu: function initOpenedMenu() {
  2912. var _this2 = this;
  2913. var index = this.activeIndex;
  2914. var activeItem = this.items[index];
  2915. if (!activeItem || this.mode === 'horizontal' || this.collapse) return;
  2916. var indexPath = activeItem.indexPath;
  2917. // 展开该菜单项的路径上所有子菜单
  2918. // expand all submenus of the menu item
  2919. indexPath.forEach(function (index) {
  2920. var submenu = _this2.submenus[index];
  2921. submenu && _this2.openMenu(index, submenu.indexPath);
  2922. });
  2923. },
  2924. routeToItem: function routeToItem(item, onError) {
  2925. var route = item.route || item.index;
  2926. try {
  2927. this.$router.push(route, function () {}, onError);
  2928. } catch (e) {
  2929. console.error(e);
  2930. }
  2931. },
  2932. open: function open(index) {
  2933. var _this3 = this;
  2934. var indexPath = this.submenus[index.toString()].indexPath;
  2935. indexPath.forEach(function (i) {
  2936. return _this3.openMenu(i, indexPath);
  2937. });
  2938. },
  2939. close: function close(index) {
  2940. this.closeMenu(index);
  2941. }
  2942. },
  2943. mounted: function mounted() {
  2944. this.initOpenedMenu();
  2945. this.$on('item-click', this.handleItemClick);
  2946. this.$on('submenu-click', this.handleSubmenuClick);
  2947. if (this.mode === 'horizontal') {
  2948. new aria_menubar(this.$el); // eslint-disable-line
  2949. }
  2950. this.$watch('items', this.updateActiveIndex);
  2951. }
  2952. });
  2953. // CONCATENATED MODULE: ./packages/menu/src/menu.vue?vue&type=script&lang=js&
  2954. /* harmony default export */ var src_menuvue_type_script_lang_js_ = (menuvue_type_script_lang_js_);
  2955. // CONCATENATED MODULE: ./packages/menu/src/menu.vue
  2956. var menu_render, menu_staticRenderFns
  2957. /* normalize component */
  2958. var menu_component = normalizeComponent(
  2959. src_menuvue_type_script_lang_js_,
  2960. menu_render,
  2961. menu_staticRenderFns,
  2962. false,
  2963. null,
  2964. null,
  2965. null
  2966. )
  2967. /* hot reload */
  2968. if (false) { var menu_api; }
  2969. menu_component.options.__file = "packages/menu/src/menu.vue"
  2970. /* harmony default export */ var src_menu = (menu_component.exports);
  2971. // CONCATENATED MODULE: ./packages/menu/index.js
  2972. /* istanbul ignore next */
  2973. src_menu.install = function (Vue) {
  2974. Vue.component(src_menu.name, src_menu);
  2975. };
  2976. /* harmony default export */ var packages_menu = (src_menu);
  2977. // EXTERNAL MODULE: external "element-ui/lib/transitions/collapse-transition"
  2978. var collapse_transition_ = __webpack_require__(21);
  2979. var collapse_transition_default = /*#__PURE__*/__webpack_require__.n(collapse_transition_);
  2980. // CONCATENATED MODULE: ./packages/menu/src/menu-mixin.js
  2981. /* harmony default export */ var menu_mixin = ({
  2982. inject: ['rootMenu'],
  2983. computed: {
  2984. indexPath: function indexPath() {
  2985. var path = [this.index];
  2986. var parent = this.$parent;
  2987. while (parent.$options.componentName !== 'ElMenu') {
  2988. if (parent.index) {
  2989. path.unshift(parent.index);
  2990. }
  2991. parent = parent.$parent;
  2992. }
  2993. return path;
  2994. },
  2995. parentMenu: function parentMenu() {
  2996. var parent = this.$parent;
  2997. while (parent && ['ElMenu', 'ElSubmenu'].indexOf(parent.$options.componentName) === -1) {
  2998. parent = parent.$parent;
  2999. }
  3000. return parent;
  3001. },
  3002. paddingStyle: function paddingStyle() {
  3003. if (this.rootMenu.mode !== 'vertical') return {};
  3004. var padding = 20;
  3005. var parent = this.$parent;
  3006. if (this.rootMenu.collapse) {
  3007. padding = 20;
  3008. } else {
  3009. while (parent && parent.$options.componentName !== 'ElMenu') {
  3010. if (parent.$options.componentName === 'ElSubmenu') {
  3011. padding += 20;
  3012. }
  3013. parent = parent.$parent;
  3014. }
  3015. }
  3016. return { paddingLeft: padding + 'px' };
  3017. }
  3018. }
  3019. });
  3020. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/menu/src/submenu.vue?vue&type=script&lang=js&
  3021. var poperMixins = {
  3022. props: {
  3023. transformOrigin: {
  3024. type: [Boolean, String],
  3025. default: false
  3026. },
  3027. offset: vue_popper_default.a.props.offset,
  3028. boundariesPadding: vue_popper_default.a.props.boundariesPadding,
  3029. popperOptions: vue_popper_default.a.props.popperOptions
  3030. },
  3031. data: vue_popper_default.a.data,
  3032. methods: vue_popper_default.a.methods,
  3033. beforeDestroy: vue_popper_default.a.beforeDestroy,
  3034. deactivated: vue_popper_default.a.deactivated
  3035. };
  3036. /* harmony default export */ var submenuvue_type_script_lang_js_ = ({
  3037. name: 'ElSubmenu',
  3038. componentName: 'ElSubmenu',
  3039. mixins: [menu_mixin, emitter_default.a, poperMixins],
  3040. components: { ElCollapseTransition: collapse_transition_default.a },
  3041. props: {
  3042. index: {
  3043. type: String,
  3044. required: true
  3045. },
  3046. showTimeout: {
  3047. type: Number,
  3048. default: 300
  3049. },
  3050. hideTimeout: {
  3051. type: Number,
  3052. default: 300
  3053. },
  3054. popperClass: String,
  3055. disabled: Boolean,
  3056. popperAppendToBody: {
  3057. type: Boolean,
  3058. default: undefined
  3059. }
  3060. },
  3061. data: function data() {
  3062. return {
  3063. popperJS: null,
  3064. timeout: null,
  3065. items: {},
  3066. submenus: {},
  3067. mouseInChild: false
  3068. };
  3069. },
  3070. watch: {
  3071. opened: function opened(val) {
  3072. var _this = this;
  3073. if (this.isMenuPopup) {
  3074. this.$nextTick(function (_) {
  3075. _this.updatePopper();
  3076. });
  3077. }
  3078. }
  3079. },
  3080. computed: {
  3081. // popper option
  3082. appendToBody: function appendToBody() {
  3083. return this.popperAppendToBody === undefined ? this.isFirstLevel : this.popperAppendToBody;
  3084. },
  3085. menuTransitionName: function menuTransitionName() {
  3086. return this.rootMenu.collapse ? 'el-zoom-in-left' : 'el-zoom-in-top';
  3087. },
  3088. opened: function opened() {
  3089. return this.rootMenu.openedMenus.indexOf(this.index) > -1;
  3090. },
  3091. active: function active() {
  3092. var isActive = false;
  3093. var submenus = this.submenus;
  3094. var items = this.items;
  3095. Object.keys(items).forEach(function (index) {
  3096. if (items[index].active) {
  3097. isActive = true;
  3098. }
  3099. });
  3100. Object.keys(submenus).forEach(function (index) {
  3101. if (submenus[index].active) {
  3102. isActive = true;
  3103. }
  3104. });
  3105. return isActive;
  3106. },
  3107. hoverBackground: function hoverBackground() {
  3108. return this.rootMenu.hoverBackground;
  3109. },
  3110. backgroundColor: function backgroundColor() {
  3111. return this.rootMenu.backgroundColor || '';
  3112. },
  3113. activeTextColor: function activeTextColor() {
  3114. return this.rootMenu.activeTextColor || '';
  3115. },
  3116. textColor: function textColor() {
  3117. return this.rootMenu.textColor || '';
  3118. },
  3119. mode: function mode() {
  3120. return this.rootMenu.mode;
  3121. },
  3122. isMenuPopup: function isMenuPopup() {
  3123. return this.rootMenu.isMenuPopup;
  3124. },
  3125. titleStyle: function titleStyle() {
  3126. if (this.mode !== 'horizontal') {
  3127. return {
  3128. color: this.textColor
  3129. };
  3130. }
  3131. return {
  3132. borderBottomColor: this.active ? this.rootMenu.activeTextColor ? this.activeTextColor : '' : 'transparent',
  3133. color: this.active ? this.activeTextColor : this.textColor
  3134. };
  3135. },
  3136. isFirstLevel: function isFirstLevel() {
  3137. var isFirstLevel = true;
  3138. var parent = this.$parent;
  3139. while (parent && parent !== this.rootMenu) {
  3140. if (['ElSubmenu', 'ElMenuItemGroup'].indexOf(parent.$options.componentName) > -1) {
  3141. isFirstLevel = false;
  3142. break;
  3143. } else {
  3144. parent = parent.$parent;
  3145. }
  3146. }
  3147. return isFirstLevel;
  3148. }
  3149. },
  3150. methods: {
  3151. handleCollapseToggle: function handleCollapseToggle(value) {
  3152. if (value) {
  3153. this.initPopper();
  3154. } else {
  3155. this.doDestroy();
  3156. }
  3157. },
  3158. addItem: function addItem(item) {
  3159. this.$set(this.items, item.index, item);
  3160. },
  3161. removeItem: function removeItem(item) {
  3162. delete this.items[item.index];
  3163. },
  3164. addSubmenu: function addSubmenu(item) {
  3165. this.$set(this.submenus, item.index, item);
  3166. },
  3167. removeSubmenu: function removeSubmenu(item) {
  3168. delete this.submenus[item.index];
  3169. },
  3170. handleClick: function handleClick() {
  3171. var rootMenu = this.rootMenu,
  3172. disabled = this.disabled;
  3173. if (rootMenu.menuTrigger === 'hover' && rootMenu.mode === 'horizontal' || rootMenu.collapse && rootMenu.mode === 'vertical' || disabled) {
  3174. return;
  3175. }
  3176. this.dispatch('ElMenu', 'submenu-click', this);
  3177. },
  3178. handleMouseenter: function handleMouseenter(event) {
  3179. var _this2 = this;
  3180. var showTimeout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.showTimeout;
  3181. if (!('ActiveXObject' in window) && event.type === 'focus' && !event.relatedTarget) {
  3182. return;
  3183. }
  3184. var rootMenu = this.rootMenu,
  3185. disabled = this.disabled;
  3186. if (rootMenu.menuTrigger === 'click' && rootMenu.mode === 'horizontal' || !rootMenu.collapse && rootMenu.mode === 'vertical' || disabled) {
  3187. return;
  3188. }
  3189. this.dispatch('ElSubmenu', 'mouse-enter-child');
  3190. clearTimeout(this.timeout);
  3191. this.timeout = setTimeout(function () {
  3192. _this2.rootMenu.openMenu(_this2.index, _this2.indexPath);
  3193. }, showTimeout);
  3194. if (this.appendToBody) {
  3195. this.$parent.$el.dispatchEvent(new MouseEvent('mouseenter'));
  3196. }
  3197. },
  3198. handleMouseleave: function handleMouseleave() {
  3199. var _this3 = this;
  3200. var deepDispatch = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  3201. var rootMenu = this.rootMenu;
  3202. if (rootMenu.menuTrigger === 'click' && rootMenu.mode === 'horizontal' || !rootMenu.collapse && rootMenu.mode === 'vertical') {
  3203. return;
  3204. }
  3205. this.dispatch('ElSubmenu', 'mouse-leave-child');
  3206. clearTimeout(this.timeout);
  3207. this.timeout = setTimeout(function () {
  3208. !_this3.mouseInChild && _this3.rootMenu.closeMenu(_this3.index);
  3209. }, this.hideTimeout);
  3210. if (this.appendToBody && deepDispatch) {
  3211. if (this.$parent.$options.name === 'ElSubmenu') {
  3212. this.$parent.handleMouseleave(true);
  3213. }
  3214. }
  3215. },
  3216. handleTitleMouseenter: function handleTitleMouseenter() {
  3217. if (this.mode === 'horizontal' && !this.rootMenu.backgroundColor) return;
  3218. var title = this.$refs['submenu-title'];
  3219. title && (title.style.backgroundColor = this.rootMenu.hoverBackground);
  3220. },
  3221. handleTitleMouseleave: function handleTitleMouseleave() {
  3222. if (this.mode === 'horizontal' && !this.rootMenu.backgroundColor) return;
  3223. var title = this.$refs['submenu-title'];
  3224. title && (title.style.backgroundColor = this.rootMenu.backgroundColor || '');
  3225. },
  3226. updatePlacement: function updatePlacement() {
  3227. this.currentPlacement = this.mode === 'horizontal' && this.isFirstLevel ? 'bottom-start' : 'right-start';
  3228. },
  3229. initPopper: function initPopper() {
  3230. this.referenceElm = this.$el;
  3231. this.popperElm = this.$refs.menu;
  3232. this.updatePlacement();
  3233. }
  3234. },
  3235. created: function created() {
  3236. var _this4 = this;
  3237. this.$on('toggle-collapse', this.handleCollapseToggle);
  3238. this.$on('mouse-enter-child', function () {
  3239. _this4.mouseInChild = true;
  3240. clearTimeout(_this4.timeout);
  3241. });
  3242. this.$on('mouse-leave-child', function () {
  3243. _this4.mouseInChild = false;
  3244. clearTimeout(_this4.timeout);
  3245. });
  3246. },
  3247. mounted: function mounted() {
  3248. this.parentMenu.addSubmenu(this);
  3249. this.rootMenu.addSubmenu(this);
  3250. this.initPopper();
  3251. },
  3252. beforeDestroy: function beforeDestroy() {
  3253. this.parentMenu.removeSubmenu(this);
  3254. this.rootMenu.removeSubmenu(this);
  3255. },
  3256. render: function render(h) {
  3257. var _this5 = this;
  3258. var active = this.active,
  3259. opened = this.opened,
  3260. paddingStyle = this.paddingStyle,
  3261. titleStyle = this.titleStyle,
  3262. backgroundColor = this.backgroundColor,
  3263. rootMenu = this.rootMenu,
  3264. currentPlacement = this.currentPlacement,
  3265. menuTransitionName = this.menuTransitionName,
  3266. mode = this.mode,
  3267. disabled = this.disabled,
  3268. popperClass = this.popperClass,
  3269. $slots = this.$slots,
  3270. isFirstLevel = this.isFirstLevel;
  3271. var popupMenu = h(
  3272. 'transition',
  3273. {
  3274. attrs: { name: menuTransitionName }
  3275. },
  3276. [h(
  3277. 'div',
  3278. {
  3279. ref: 'menu',
  3280. directives: [{
  3281. name: 'show',
  3282. value: opened
  3283. }],
  3284. 'class': ['el-menu--' + mode, popperClass],
  3285. on: {
  3286. 'mouseenter': function mouseenter($event) {
  3287. return _this5.handleMouseenter($event, 100);
  3288. },
  3289. 'mouseleave': function mouseleave() {
  3290. return _this5.handleMouseleave(true);
  3291. },
  3292. 'focus': function focus($event) {
  3293. return _this5.handleMouseenter($event, 100);
  3294. }
  3295. }
  3296. },
  3297. [h(
  3298. 'ul',
  3299. {
  3300. attrs: {
  3301. role: 'menu'
  3302. },
  3303. 'class': ['el-menu el-menu--popup', 'el-menu--popup-' + currentPlacement],
  3304. style: { backgroundColor: rootMenu.backgroundColor || '' } },
  3305. [$slots.default]
  3306. )]
  3307. )]
  3308. );
  3309. var inlineMenu = h('el-collapse-transition', [h(
  3310. 'ul',
  3311. {
  3312. attrs: {
  3313. role: 'menu'
  3314. },
  3315. 'class': 'el-menu el-menu--inline',
  3316. directives: [{
  3317. name: 'show',
  3318. value: opened
  3319. }],
  3320. style: { backgroundColor: rootMenu.backgroundColor || '' } },
  3321. [$slots.default]
  3322. )]);
  3323. var submenuTitleIcon = rootMenu.mode === 'horizontal' && isFirstLevel || rootMenu.mode === 'vertical' && !rootMenu.collapse ? 'el-icon-arrow-down' : 'el-icon-arrow-right';
  3324. return h(
  3325. 'li',
  3326. {
  3327. 'class': {
  3328. 'el-submenu': true,
  3329. 'is-active': active,
  3330. 'is-opened': opened,
  3331. 'is-disabled': disabled
  3332. },
  3333. attrs: { role: 'menuitem',
  3334. 'aria-haspopup': 'true',
  3335. 'aria-expanded': opened
  3336. },
  3337. on: {
  3338. 'mouseenter': this.handleMouseenter,
  3339. 'mouseleave': function mouseleave() {
  3340. return _this5.handleMouseleave(false);
  3341. },
  3342. 'focus': this.handleMouseenter
  3343. }
  3344. },
  3345. [h(
  3346. 'div',
  3347. {
  3348. 'class': 'el-submenu__title',
  3349. ref: 'submenu-title',
  3350. on: {
  3351. 'click': this.handleClick,
  3352. 'mouseenter': this.handleTitleMouseenter,
  3353. 'mouseleave': this.handleTitleMouseleave
  3354. },
  3355. style: [paddingStyle, titleStyle, { backgroundColor: backgroundColor }]
  3356. },
  3357. [$slots.title, h('i', { 'class': ['el-submenu__icon-arrow', submenuTitleIcon] })]
  3358. ), this.isMenuPopup ? popupMenu : inlineMenu]
  3359. );
  3360. }
  3361. });
  3362. // CONCATENATED MODULE: ./packages/menu/src/submenu.vue?vue&type=script&lang=js&
  3363. /* harmony default export */ var src_submenuvue_type_script_lang_js_ = (submenuvue_type_script_lang_js_);
  3364. // CONCATENATED MODULE: ./packages/menu/src/submenu.vue
  3365. var submenu_render, submenu_staticRenderFns
  3366. /* normalize component */
  3367. var submenu_component = normalizeComponent(
  3368. src_submenuvue_type_script_lang_js_,
  3369. submenu_render,
  3370. submenu_staticRenderFns,
  3371. false,
  3372. null,
  3373. null,
  3374. null
  3375. )
  3376. /* hot reload */
  3377. if (false) { var submenu_api; }
  3378. submenu_component.options.__file = "packages/menu/src/submenu.vue"
  3379. /* harmony default export */ var submenu = (submenu_component.exports);
  3380. // CONCATENATED MODULE: ./packages/submenu/index.js
  3381. /* istanbul ignore next */
  3382. submenu.install = function (Vue) {
  3383. Vue.component(submenu.name, submenu);
  3384. };
  3385. /* harmony default export */ var packages_submenu = (submenu);
  3386. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/menu/src/menu-item.vue?vue&type=template&id=2a5dbfea&
  3387. var menu_itemvue_type_template_id_2a5dbfea_render = function() {
  3388. var _vm = this
  3389. var _h = _vm.$createElement
  3390. var _c = _vm._self._c || _h
  3391. return _c(
  3392. "li",
  3393. {
  3394. staticClass: "el-menu-item",
  3395. class: {
  3396. "is-active": _vm.active,
  3397. "is-disabled": _vm.disabled
  3398. },
  3399. style: [
  3400. _vm.paddingStyle,
  3401. _vm.itemStyle,
  3402. { backgroundColor: _vm.backgroundColor }
  3403. ],
  3404. attrs: { role: "menuitem", tabindex: "-1" },
  3405. on: {
  3406. click: _vm.handleClick,
  3407. mouseenter: _vm.onMouseEnter,
  3408. focus: _vm.onMouseEnter,
  3409. blur: _vm.onMouseLeave,
  3410. mouseleave: _vm.onMouseLeave
  3411. }
  3412. },
  3413. [
  3414. _vm.parentMenu.$options.componentName === "ElMenu" &&
  3415. _vm.rootMenu.collapse &&
  3416. _vm.$slots.title
  3417. ? _c("el-tooltip", { attrs: { effect: "dark", placement: "right" } }, [
  3418. _c(
  3419. "div",
  3420. { attrs: { slot: "content" }, slot: "content" },
  3421. [_vm._t("title")],
  3422. 2
  3423. ),
  3424. _c(
  3425. "div",
  3426. {
  3427. staticStyle: {
  3428. position: "absolute",
  3429. left: "0",
  3430. top: "0",
  3431. height: "100%",
  3432. width: "100%",
  3433. display: "inline-block",
  3434. "box-sizing": "border-box",
  3435. padding: "0 20px"
  3436. }
  3437. },
  3438. [_vm._t("default")],
  3439. 2
  3440. )
  3441. ])
  3442. : [_vm._t("default"), _vm._t("title")]
  3443. ],
  3444. 2
  3445. )
  3446. }
  3447. var menu_itemvue_type_template_id_2a5dbfea_staticRenderFns = []
  3448. menu_itemvue_type_template_id_2a5dbfea_render._withStripped = true
  3449. // CONCATENATED MODULE: ./packages/menu/src/menu-item.vue?vue&type=template&id=2a5dbfea&
  3450. // EXTERNAL MODULE: external "element-ui/lib/tooltip"
  3451. var tooltip_ = __webpack_require__(26);
  3452. var tooltip_default = /*#__PURE__*/__webpack_require__.n(tooltip_);
  3453. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/menu/src/menu-item.vue?vue&type=script&lang=js&
  3454. //
  3455. //
  3456. //
  3457. //
  3458. //
  3459. //
  3460. //
  3461. //
  3462. //
  3463. //
  3464. //
  3465. //
  3466. //
  3467. //
  3468. //
  3469. //
  3470. //
  3471. //
  3472. //
  3473. //
  3474. //
  3475. //
  3476. //
  3477. //
  3478. //
  3479. //
  3480. //
  3481. //
  3482. //
  3483. //
  3484. /* harmony default export */ var menu_itemvue_type_script_lang_js_ = ({
  3485. name: 'ElMenuItem',
  3486. componentName: 'ElMenuItem',
  3487. mixins: [menu_mixin, emitter_default.a],
  3488. components: { ElTooltip: tooltip_default.a },
  3489. props: {
  3490. index: {
  3491. default: null,
  3492. validator: function validator(val) {
  3493. return typeof val === 'string' || val === null;
  3494. }
  3495. },
  3496. route: [String, Object],
  3497. disabled: Boolean
  3498. },
  3499. computed: {
  3500. active: function active() {
  3501. return this.index === this.rootMenu.activeIndex;
  3502. },
  3503. hoverBackground: function hoverBackground() {
  3504. return this.rootMenu.hoverBackground;
  3505. },
  3506. backgroundColor: function backgroundColor() {
  3507. return this.rootMenu.backgroundColor || '';
  3508. },
  3509. activeTextColor: function activeTextColor() {
  3510. return this.rootMenu.activeTextColor || '';
  3511. },
  3512. textColor: function textColor() {
  3513. return this.rootMenu.textColor || '';
  3514. },
  3515. mode: function mode() {
  3516. return this.rootMenu.mode;
  3517. },
  3518. itemStyle: function itemStyle() {
  3519. var style = {
  3520. color: this.active ? this.activeTextColor : this.textColor
  3521. };
  3522. if (this.mode === 'horizontal' && !this.isNested) {
  3523. style.borderBottomColor = this.active ? this.rootMenu.activeTextColor ? this.activeTextColor : '' : 'transparent';
  3524. }
  3525. return style;
  3526. },
  3527. isNested: function isNested() {
  3528. return this.parentMenu !== this.rootMenu;
  3529. }
  3530. },
  3531. methods: {
  3532. onMouseEnter: function onMouseEnter() {
  3533. if (this.mode === 'horizontal' && !this.rootMenu.backgroundColor) return;
  3534. this.$el.style.backgroundColor = this.hoverBackground;
  3535. },
  3536. onMouseLeave: function onMouseLeave() {
  3537. if (this.mode === 'horizontal' && !this.rootMenu.backgroundColor) return;
  3538. this.$el.style.backgroundColor = this.backgroundColor;
  3539. },
  3540. handleClick: function handleClick() {
  3541. if (!this.disabled) {
  3542. this.dispatch('ElMenu', 'item-click', this);
  3543. this.$emit('click', this);
  3544. }
  3545. }
  3546. },
  3547. mounted: function mounted() {
  3548. this.parentMenu.addItem(this);
  3549. this.rootMenu.addItem(this);
  3550. },
  3551. beforeDestroy: function beforeDestroy() {
  3552. this.parentMenu.removeItem(this);
  3553. this.rootMenu.removeItem(this);
  3554. }
  3555. });
  3556. // CONCATENATED MODULE: ./packages/menu/src/menu-item.vue?vue&type=script&lang=js&
  3557. /* harmony default export */ var src_menu_itemvue_type_script_lang_js_ = (menu_itemvue_type_script_lang_js_);
  3558. // CONCATENATED MODULE: ./packages/menu/src/menu-item.vue
  3559. /* normalize component */
  3560. var menu_item_component = normalizeComponent(
  3561. src_menu_itemvue_type_script_lang_js_,
  3562. menu_itemvue_type_template_id_2a5dbfea_render,
  3563. menu_itemvue_type_template_id_2a5dbfea_staticRenderFns,
  3564. false,
  3565. null,
  3566. null,
  3567. null
  3568. )
  3569. /* hot reload */
  3570. if (false) { var menu_item_api; }
  3571. menu_item_component.options.__file = "packages/menu/src/menu-item.vue"
  3572. /* harmony default export */ var menu_item = (menu_item_component.exports);
  3573. // CONCATENATED MODULE: ./packages/menu-item/index.js
  3574. /* istanbul ignore next */
  3575. menu_item.install = function (Vue) {
  3576. Vue.component(menu_item.name, menu_item);
  3577. };
  3578. /* harmony default export */ var packages_menu_item = (menu_item);
  3579. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/menu/src/menu-item-group.vue?vue&type=template&id=543b7bdc&
  3580. var menu_item_groupvue_type_template_id_543b7bdc_render = function() {
  3581. var _vm = this
  3582. var _h = _vm.$createElement
  3583. var _c = _vm._self._c || _h
  3584. return _c("li", { staticClass: "el-menu-item-group" }, [
  3585. _c(
  3586. "div",
  3587. {
  3588. staticClass: "el-menu-item-group__title",
  3589. style: { paddingLeft: _vm.levelPadding + "px" }
  3590. },
  3591. [!_vm.$slots.title ? [_vm._v(_vm._s(_vm.title))] : _vm._t("title")],
  3592. 2
  3593. ),
  3594. _c("ul", [_vm._t("default")], 2)
  3595. ])
  3596. }
  3597. var menu_item_groupvue_type_template_id_543b7bdc_staticRenderFns = []
  3598. menu_item_groupvue_type_template_id_543b7bdc_render._withStripped = true
  3599. // CONCATENATED MODULE: ./packages/menu/src/menu-item-group.vue?vue&type=template&id=543b7bdc&
  3600. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/menu/src/menu-item-group.vue?vue&type=script&lang=js&
  3601. //
  3602. //
  3603. //
  3604. //
  3605. //
  3606. //
  3607. //
  3608. //
  3609. //
  3610. //
  3611. //
  3612. /* harmony default export */ var menu_item_groupvue_type_script_lang_js_ = ({
  3613. name: 'ElMenuItemGroup',
  3614. componentName: 'ElMenuItemGroup',
  3615. inject: ['rootMenu'],
  3616. props: {
  3617. title: {
  3618. type: String
  3619. }
  3620. },
  3621. data: function data() {
  3622. return {
  3623. paddingLeft: 20
  3624. };
  3625. },
  3626. computed: {
  3627. levelPadding: function levelPadding() {
  3628. var padding = 20;
  3629. var parent = this.$parent;
  3630. if (this.rootMenu.collapse) return 20;
  3631. while (parent && parent.$options.componentName !== 'ElMenu') {
  3632. if (parent.$options.componentName === 'ElSubmenu') {
  3633. padding += 20;
  3634. }
  3635. parent = parent.$parent;
  3636. }
  3637. return padding;
  3638. }
  3639. }
  3640. });
  3641. // CONCATENATED MODULE: ./packages/menu/src/menu-item-group.vue?vue&type=script&lang=js&
  3642. /* harmony default export */ var src_menu_item_groupvue_type_script_lang_js_ = (menu_item_groupvue_type_script_lang_js_);
  3643. // CONCATENATED MODULE: ./packages/menu/src/menu-item-group.vue
  3644. /* normalize component */
  3645. var menu_item_group_component = normalizeComponent(
  3646. src_menu_item_groupvue_type_script_lang_js_,
  3647. menu_item_groupvue_type_template_id_543b7bdc_render,
  3648. menu_item_groupvue_type_template_id_543b7bdc_staticRenderFns,
  3649. false,
  3650. null,
  3651. null,
  3652. null
  3653. )
  3654. /* hot reload */
  3655. if (false) { var menu_item_group_api; }
  3656. menu_item_group_component.options.__file = "packages/menu/src/menu-item-group.vue"
  3657. /* harmony default export */ var menu_item_group = (menu_item_group_component.exports);
  3658. // CONCATENATED MODULE: ./packages/menu-item-group/index.js
  3659. /* istanbul ignore next */
  3660. menu_item_group.install = function (Vue) {
  3661. Vue.component(menu_item_group.name, menu_item_group);
  3662. };
  3663. /* harmony default export */ var packages_menu_item_group = (menu_item_group);
  3664. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/input/src/input.vue?vue&type=template&id=343dd774&
  3665. var inputvue_type_template_id_343dd774_render = function() {
  3666. var _vm = this
  3667. var _h = _vm.$createElement
  3668. var _c = _vm._self._c || _h
  3669. return _c(
  3670. "div",
  3671. {
  3672. class: [
  3673. _vm.type === "textarea" ? "el-textarea" : "el-input",
  3674. _vm.inputSize ? "el-input--" + _vm.inputSize : "",
  3675. {
  3676. "is-disabled": _vm.inputDisabled,
  3677. "is-exceed": _vm.inputExceed,
  3678. "el-input-group": _vm.$slots.prepend || _vm.$slots.append,
  3679. "el-input-group--append": _vm.$slots.append,
  3680. "el-input-group--prepend": _vm.$slots.prepend,
  3681. "el-input--prefix": _vm.$slots.prefix || _vm.prefixIcon,
  3682. "el-input--suffix":
  3683. _vm.$slots.suffix ||
  3684. _vm.suffixIcon ||
  3685. _vm.clearable ||
  3686. _vm.showPassword
  3687. }
  3688. ],
  3689. on: {
  3690. mouseenter: function($event) {
  3691. _vm.hovering = true
  3692. },
  3693. mouseleave: function($event) {
  3694. _vm.hovering = false
  3695. }
  3696. }
  3697. },
  3698. [
  3699. _vm.type !== "textarea"
  3700. ? [
  3701. _vm.$slots.prepend
  3702. ? _c(
  3703. "div",
  3704. { staticClass: "el-input-group__prepend" },
  3705. [_vm._t("prepend")],
  3706. 2
  3707. )
  3708. : _vm._e(),
  3709. _vm.type !== "textarea"
  3710. ? _c(
  3711. "input",
  3712. _vm._b(
  3713. {
  3714. ref: "input",
  3715. staticClass: "el-input__inner",
  3716. attrs: {
  3717. tabindex: _vm.tabindex,
  3718. type: _vm.showPassword
  3719. ? _vm.passwordVisible
  3720. ? "text"
  3721. : "password"
  3722. : _vm.type,
  3723. disabled: _vm.inputDisabled,
  3724. readonly: _vm.readonly,
  3725. autocomplete: _vm.autoComplete || _vm.autocomplete,
  3726. "aria-label": _vm.label
  3727. },
  3728. on: {
  3729. compositionstart: _vm.handleCompositionStart,
  3730. compositionupdate: _vm.handleCompositionUpdate,
  3731. compositionend: _vm.handleCompositionEnd,
  3732. input: _vm.handleInput,
  3733. focus: _vm.handleFocus,
  3734. blur: _vm.handleBlur,
  3735. change: _vm.handleChange
  3736. }
  3737. },
  3738. "input",
  3739. _vm.$attrs,
  3740. false
  3741. )
  3742. )
  3743. : _vm._e(),
  3744. _vm.$slots.prefix || _vm.prefixIcon
  3745. ? _c(
  3746. "span",
  3747. { staticClass: "el-input__prefix" },
  3748. [
  3749. _vm._t("prefix"),
  3750. _vm.prefixIcon
  3751. ? _c("i", {
  3752. staticClass: "el-input__icon",
  3753. class: _vm.prefixIcon
  3754. })
  3755. : _vm._e()
  3756. ],
  3757. 2
  3758. )
  3759. : _vm._e(),
  3760. _vm.getSuffixVisible()
  3761. ? _c("span", { staticClass: "el-input__suffix" }, [
  3762. _c(
  3763. "span",
  3764. { staticClass: "el-input__suffix-inner" },
  3765. [
  3766. !_vm.showClear ||
  3767. !_vm.showPwdVisible ||
  3768. !_vm.isWordLimitVisible
  3769. ? [
  3770. _vm._t("suffix"),
  3771. _vm.suffixIcon
  3772. ? _c("i", {
  3773. staticClass: "el-input__icon",
  3774. class: _vm.suffixIcon
  3775. })
  3776. : _vm._e()
  3777. ]
  3778. : _vm._e(),
  3779. _vm.showClear
  3780. ? _c("i", {
  3781. staticClass:
  3782. "el-input__icon el-icon-circle-close el-input__clear",
  3783. on: {
  3784. mousedown: function($event) {
  3785. $event.preventDefault()
  3786. },
  3787. click: _vm.clear
  3788. }
  3789. })
  3790. : _vm._e(),
  3791. _vm.showPwdVisible
  3792. ? _c("i", {
  3793. staticClass:
  3794. "el-input__icon el-icon-view el-input__clear",
  3795. on: { click: _vm.handlePasswordVisible }
  3796. })
  3797. : _vm._e(),
  3798. _vm.isWordLimitVisible
  3799. ? _c("span", { staticClass: "el-input__count" }, [
  3800. _c(
  3801. "span",
  3802. { staticClass: "el-input__count-inner" },
  3803. [
  3804. _vm._v(
  3805. "\n " +
  3806. _vm._s(_vm.textLength) +
  3807. "/" +
  3808. _vm._s(_vm.upperLimit) +
  3809. "\n "
  3810. )
  3811. ]
  3812. )
  3813. ])
  3814. : _vm._e()
  3815. ],
  3816. 2
  3817. ),
  3818. _vm.validateState
  3819. ? _c("i", {
  3820. staticClass: "el-input__icon",
  3821. class: ["el-input__validateIcon", _vm.validateIcon]
  3822. })
  3823. : _vm._e()
  3824. ])
  3825. : _vm._e(),
  3826. _vm.$slots.append
  3827. ? _c(
  3828. "div",
  3829. { staticClass: "el-input-group__append" },
  3830. [_vm._t("append")],
  3831. 2
  3832. )
  3833. : _vm._e()
  3834. ]
  3835. : _c(
  3836. "textarea",
  3837. _vm._b(
  3838. {
  3839. ref: "textarea",
  3840. staticClass: "el-textarea__inner",
  3841. style: _vm.textareaStyle,
  3842. attrs: {
  3843. tabindex: _vm.tabindex,
  3844. disabled: _vm.inputDisabled,
  3845. readonly: _vm.readonly,
  3846. autocomplete: _vm.autoComplete || _vm.autocomplete,
  3847. "aria-label": _vm.label
  3848. },
  3849. on: {
  3850. compositionstart: _vm.handleCompositionStart,
  3851. compositionupdate: _vm.handleCompositionUpdate,
  3852. compositionend: _vm.handleCompositionEnd,
  3853. input: _vm.handleInput,
  3854. focus: _vm.handleFocus,
  3855. blur: _vm.handleBlur,
  3856. change: _vm.handleChange
  3857. }
  3858. },
  3859. "textarea",
  3860. _vm.$attrs,
  3861. false
  3862. )
  3863. ),
  3864. _vm.isWordLimitVisible && _vm.type === "textarea"
  3865. ? _c("span", { staticClass: "el-input__count" }, [
  3866. _vm._v(_vm._s(_vm.textLength) + "/" + _vm._s(_vm.upperLimit))
  3867. ])
  3868. : _vm._e()
  3869. ],
  3870. 2
  3871. )
  3872. }
  3873. var inputvue_type_template_id_343dd774_staticRenderFns = []
  3874. inputvue_type_template_id_343dd774_render._withStripped = true
  3875. // CONCATENATED MODULE: ./packages/input/src/input.vue?vue&type=template&id=343dd774&
  3876. // CONCATENATED MODULE: ./packages/input/src/calcTextareaHeight.js
  3877. var hiddenTextarea = void 0;
  3878. var HIDDEN_STYLE = '\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important\n';
  3879. var CONTEXT_STYLE = ['letter-spacing', 'line-height', 'padding-top', 'padding-bottom', 'font-family', 'font-weight', 'font-size', 'text-rendering', 'text-transform', 'width', 'text-indent', 'padding-left', 'padding-right', 'border-width', 'box-sizing'];
  3880. function calculateNodeStyling(targetElement) {
  3881. var style = window.getComputedStyle(targetElement);
  3882. var boxSizing = style.getPropertyValue('box-sizing');
  3883. var paddingSize = parseFloat(style.getPropertyValue('padding-bottom')) + parseFloat(style.getPropertyValue('padding-top'));
  3884. var borderSize = parseFloat(style.getPropertyValue('border-bottom-width')) + parseFloat(style.getPropertyValue('border-top-width'));
  3885. var contextStyle = CONTEXT_STYLE.map(function (name) {
  3886. return name + ':' + style.getPropertyValue(name);
  3887. }).join(';');
  3888. return { contextStyle: contextStyle, paddingSize: paddingSize, borderSize: borderSize, boxSizing: boxSizing };
  3889. }
  3890. function calcTextareaHeight(targetElement) {
  3891. var minRows = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
  3892. var maxRows = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  3893. if (!hiddenTextarea) {
  3894. hiddenTextarea = document.createElement('textarea');
  3895. document.body.appendChild(hiddenTextarea);
  3896. }
  3897. var _calculateNodeStyling = calculateNodeStyling(targetElement),
  3898. paddingSize = _calculateNodeStyling.paddingSize,
  3899. borderSize = _calculateNodeStyling.borderSize,
  3900. boxSizing = _calculateNodeStyling.boxSizing,
  3901. contextStyle = _calculateNodeStyling.contextStyle;
  3902. hiddenTextarea.setAttribute('style', contextStyle + ';' + HIDDEN_STYLE);
  3903. hiddenTextarea.value = targetElement.value || targetElement.placeholder || '';
  3904. var height = hiddenTextarea.scrollHeight;
  3905. var result = {};
  3906. if (boxSizing === 'border-box') {
  3907. height = height + borderSize;
  3908. } else if (boxSizing === 'content-box') {
  3909. height = height - paddingSize;
  3910. }
  3911. hiddenTextarea.value = '';
  3912. var singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
  3913. if (minRows !== null) {
  3914. var minHeight = singleRowHeight * minRows;
  3915. if (boxSizing === 'border-box') {
  3916. minHeight = minHeight + paddingSize + borderSize;
  3917. }
  3918. height = Math.max(minHeight, height);
  3919. result.minHeight = minHeight + 'px';
  3920. }
  3921. if (maxRows !== null) {
  3922. var maxHeight = singleRowHeight * maxRows;
  3923. if (boxSizing === 'border-box') {
  3924. maxHeight = maxHeight + paddingSize + borderSize;
  3925. }
  3926. height = Math.min(maxHeight, height);
  3927. }
  3928. result.height = height + 'px';
  3929. hiddenTextarea.parentNode && hiddenTextarea.parentNode.removeChild(hiddenTextarea);
  3930. hiddenTextarea = null;
  3931. return result;
  3932. };
  3933. // EXTERNAL MODULE: external "element-ui/lib/utils/merge"
  3934. var merge_ = __webpack_require__(7);
  3935. var merge_default = /*#__PURE__*/__webpack_require__.n(merge_);
  3936. // EXTERNAL MODULE: external "element-ui/lib/utils/shared"
  3937. var shared_ = __webpack_require__(19);
  3938. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/input/src/input.vue?vue&type=script&lang=js&
  3939. //
  3940. //
  3941. //
  3942. //
  3943. //
  3944. //
  3945. //
  3946. //
  3947. //
  3948. //
  3949. //
  3950. //
  3951. //
  3952. //
  3953. //
  3954. //
  3955. //
  3956. //
  3957. //
  3958. //
  3959. //
  3960. //
  3961. //
  3962. //
  3963. //
  3964. //
  3965. //
  3966. //
  3967. //
  3968. //
  3969. //
  3970. //
  3971. //
  3972. //
  3973. //
  3974. //
  3975. //
  3976. //
  3977. //
  3978. //
  3979. //
  3980. //
  3981. //
  3982. //
  3983. //
  3984. //
  3985. //
  3986. //
  3987. //
  3988. //
  3989. //
  3990. //
  3991. //
  3992. //
  3993. //
  3994. //
  3995. //
  3996. //
  3997. //
  3998. //
  3999. //
  4000. //
  4001. //
  4002. //
  4003. //
  4004. //
  4005. //
  4006. //
  4007. //
  4008. //
  4009. //
  4010. //
  4011. //
  4012. //
  4013. //
  4014. //
  4015. //
  4016. //
  4017. //
  4018. //
  4019. //
  4020. //
  4021. //
  4022. //
  4023. //
  4024. //
  4025. //
  4026. //
  4027. //
  4028. //
  4029. //
  4030. //
  4031. //
  4032. //
  4033. //
  4034. //
  4035. //
  4036. //
  4037. //
  4038. //
  4039. //
  4040. //
  4041. //
  4042. //
  4043. //
  4044. //
  4045. //
  4046. //
  4047. //
  4048. /* harmony default export */ var inputvue_type_script_lang_js_ = ({
  4049. name: 'ElInput',
  4050. componentName: 'ElInput',
  4051. mixins: [emitter_default.a, migrating_default.a],
  4052. inheritAttrs: false,
  4053. inject: {
  4054. elForm: {
  4055. default: ''
  4056. },
  4057. elFormItem: {
  4058. default: ''
  4059. }
  4060. },
  4061. data: function data() {
  4062. return {
  4063. textareaCalcStyle: {},
  4064. hovering: false,
  4065. focused: false,
  4066. isComposing: false,
  4067. passwordVisible: false
  4068. };
  4069. },
  4070. props: {
  4071. value: [String, Number],
  4072. size: String,
  4073. resize: String,
  4074. form: String,
  4075. disabled: Boolean,
  4076. readonly: Boolean,
  4077. type: {
  4078. type: String,
  4079. default: 'text'
  4080. },
  4081. autosize: {
  4082. type: [Boolean, Object],
  4083. default: false
  4084. },
  4085. autocomplete: {
  4086. type: String,
  4087. default: 'off'
  4088. },
  4089. /** @Deprecated in next major version */
  4090. autoComplete: {
  4091. type: String,
  4092. validator: function validator(val) {
  4093. false && false;
  4094. return true;
  4095. }
  4096. },
  4097. validateEvent: {
  4098. type: Boolean,
  4099. default: true
  4100. },
  4101. suffixIcon: String,
  4102. prefixIcon: String,
  4103. label: String,
  4104. clearable: {
  4105. type: Boolean,
  4106. default: false
  4107. },
  4108. showPassword: {
  4109. type: Boolean,
  4110. default: false
  4111. },
  4112. showWordLimit: {
  4113. type: Boolean,
  4114. default: false
  4115. },
  4116. tabindex: String
  4117. },
  4118. computed: {
  4119. _elFormItemSize: function _elFormItemSize() {
  4120. return (this.elFormItem || {}).elFormItemSize;
  4121. },
  4122. validateState: function validateState() {
  4123. return this.elFormItem ? this.elFormItem.validateState : '';
  4124. },
  4125. needStatusIcon: function needStatusIcon() {
  4126. return this.elForm ? this.elForm.statusIcon : false;
  4127. },
  4128. validateIcon: function validateIcon() {
  4129. return {
  4130. validating: 'el-icon-loading',
  4131. success: 'el-icon-circle-check',
  4132. error: 'el-icon-circle-close'
  4133. }[this.validateState];
  4134. },
  4135. textareaStyle: function textareaStyle() {
  4136. return merge_default()({}, this.textareaCalcStyle, { resize: this.resize });
  4137. },
  4138. inputSize: function inputSize() {
  4139. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  4140. },
  4141. inputDisabled: function inputDisabled() {
  4142. return this.disabled || (this.elForm || {}).disabled;
  4143. },
  4144. nativeInputValue: function nativeInputValue() {
  4145. return this.value === null || this.value === undefined ? '' : String(this.value);
  4146. },
  4147. showClear: function showClear() {
  4148. return this.clearable && !this.inputDisabled && !this.readonly && this.nativeInputValue && (this.focused || this.hovering);
  4149. },
  4150. showPwdVisible: function showPwdVisible() {
  4151. return this.showPassword && !this.inputDisabled && !this.readonly && (!!this.nativeInputValue || this.focused);
  4152. },
  4153. isWordLimitVisible: function isWordLimitVisible() {
  4154. return this.showWordLimit && this.$attrs.maxlength && (this.type === 'text' || this.type === 'textarea') && !this.inputDisabled && !this.readonly && !this.showPassword;
  4155. },
  4156. upperLimit: function upperLimit() {
  4157. return this.$attrs.maxlength;
  4158. },
  4159. textLength: function textLength() {
  4160. if (typeof this.value === 'number') {
  4161. return String(this.value).length;
  4162. }
  4163. return (this.value || '').length;
  4164. },
  4165. inputExceed: function inputExceed() {
  4166. // show exceed style if length of initial value greater then maxlength
  4167. return this.isWordLimitVisible && this.textLength > this.upperLimit;
  4168. }
  4169. },
  4170. watch: {
  4171. value: function value(val) {
  4172. this.$nextTick(this.resizeTextarea);
  4173. if (this.validateEvent) {
  4174. this.dispatch('ElFormItem', 'el.form.change', [val]);
  4175. }
  4176. },
  4177. // native input value is set explicitly
  4178. // do not use v-model / :value in template
  4179. // see: https://github.com/ElemeFE/element/issues/14521
  4180. nativeInputValue: function nativeInputValue() {
  4181. this.setNativeInputValue();
  4182. },
  4183. // when change between <input> and <textarea>,
  4184. // update DOM dependent value and styles
  4185. // https://github.com/ElemeFE/element/issues/14857
  4186. type: function type() {
  4187. var _this = this;
  4188. this.$nextTick(function () {
  4189. _this.setNativeInputValue();
  4190. _this.resizeTextarea();
  4191. _this.updateIconOffset();
  4192. });
  4193. }
  4194. },
  4195. methods: {
  4196. focus: function focus() {
  4197. this.getInput().focus();
  4198. },
  4199. blur: function blur() {
  4200. this.getInput().blur();
  4201. },
  4202. getMigratingConfig: function getMigratingConfig() {
  4203. return {
  4204. props: {
  4205. 'icon': 'icon is removed, use suffix-icon / prefix-icon instead.',
  4206. 'on-icon-click': 'on-icon-click is removed.'
  4207. },
  4208. events: {
  4209. 'click': 'click is removed.'
  4210. }
  4211. };
  4212. },
  4213. handleBlur: function handleBlur(event) {
  4214. this.focused = false;
  4215. this.$emit('blur', event);
  4216. if (this.validateEvent) {
  4217. this.dispatch('ElFormItem', 'el.form.blur', [this.value]);
  4218. }
  4219. },
  4220. select: function select() {
  4221. this.getInput().select();
  4222. },
  4223. resizeTextarea: function resizeTextarea() {
  4224. if (this.$isServer) return;
  4225. var autosize = this.autosize,
  4226. type = this.type;
  4227. if (type !== 'textarea') return;
  4228. if (!autosize) {
  4229. this.textareaCalcStyle = {
  4230. minHeight: calcTextareaHeight(this.$refs.textarea).minHeight
  4231. };
  4232. return;
  4233. }
  4234. var minRows = autosize.minRows;
  4235. var maxRows = autosize.maxRows;
  4236. this.textareaCalcStyle = calcTextareaHeight(this.$refs.textarea, minRows, maxRows);
  4237. },
  4238. setNativeInputValue: function setNativeInputValue() {
  4239. var input = this.getInput();
  4240. if (!input) return;
  4241. if (input.value === this.nativeInputValue) return;
  4242. input.value = this.nativeInputValue;
  4243. },
  4244. handleFocus: function handleFocus(event) {
  4245. this.focused = true;
  4246. this.$emit('focus', event);
  4247. },
  4248. handleCompositionStart: function handleCompositionStart(event) {
  4249. this.$emit('compositionstart', event);
  4250. this.isComposing = true;
  4251. },
  4252. handleCompositionUpdate: function handleCompositionUpdate(event) {
  4253. this.$emit('compositionupdate', event);
  4254. var text = event.target.value;
  4255. var lastCharacter = text[text.length - 1] || '';
  4256. this.isComposing = !Object(shared_["isKorean"])(lastCharacter);
  4257. },
  4258. handleCompositionEnd: function handleCompositionEnd(event) {
  4259. this.$emit('compositionend', event);
  4260. if (this.isComposing) {
  4261. this.isComposing = false;
  4262. this.handleInput(event);
  4263. }
  4264. },
  4265. handleInput: function handleInput(event) {
  4266. // should not emit input during composition
  4267. // see: https://github.com/ElemeFE/element/issues/10516
  4268. if (this.isComposing) return;
  4269. // hack for https://github.com/ElemeFE/element/issues/8548
  4270. // should remove the following line when we don't support IE
  4271. if (event.target.value === this.nativeInputValue) return;
  4272. this.$emit('input', event.target.value);
  4273. // ensure native input value is controlled
  4274. // see: https://github.com/ElemeFE/element/issues/12850
  4275. this.$nextTick(this.setNativeInputValue);
  4276. },
  4277. handleChange: function handleChange(event) {
  4278. this.$emit('change', event.target.value);
  4279. },
  4280. calcIconOffset: function calcIconOffset(place) {
  4281. var elList = [].slice.call(this.$el.querySelectorAll('.el-input__' + place) || []);
  4282. if (!elList.length) return;
  4283. var el = null;
  4284. for (var i = 0; i < elList.length; i++) {
  4285. if (elList[i].parentNode === this.$el) {
  4286. el = elList[i];
  4287. break;
  4288. }
  4289. }
  4290. if (!el) return;
  4291. var pendantMap = {
  4292. suffix: 'append',
  4293. prefix: 'prepend'
  4294. };
  4295. var pendant = pendantMap[place];
  4296. if (this.$slots[pendant]) {
  4297. el.style.transform = 'translateX(' + (place === 'suffix' ? '-' : '') + this.$el.querySelector('.el-input-group__' + pendant).offsetWidth + 'px)';
  4298. } else {
  4299. el.removeAttribute('style');
  4300. }
  4301. },
  4302. updateIconOffset: function updateIconOffset() {
  4303. this.calcIconOffset('prefix');
  4304. this.calcIconOffset('suffix');
  4305. },
  4306. clear: function clear() {
  4307. this.$emit('input', '');
  4308. this.$emit('change', '');
  4309. this.$emit('clear');
  4310. },
  4311. handlePasswordVisible: function handlePasswordVisible() {
  4312. var _this2 = this;
  4313. this.passwordVisible = !this.passwordVisible;
  4314. this.$nextTick(function () {
  4315. _this2.focus();
  4316. });
  4317. },
  4318. getInput: function getInput() {
  4319. return this.$refs.input || this.$refs.textarea;
  4320. },
  4321. getSuffixVisible: function getSuffixVisible() {
  4322. return this.$slots.suffix || this.suffixIcon || this.showClear || this.showPassword || this.isWordLimitVisible || this.validateState && this.needStatusIcon;
  4323. }
  4324. },
  4325. created: function created() {
  4326. this.$on('inputSelect', this.select);
  4327. },
  4328. mounted: function mounted() {
  4329. this.setNativeInputValue();
  4330. this.resizeTextarea();
  4331. this.updateIconOffset();
  4332. },
  4333. updated: function updated() {
  4334. this.$nextTick(this.updateIconOffset);
  4335. }
  4336. });
  4337. // CONCATENATED MODULE: ./packages/input/src/input.vue?vue&type=script&lang=js&
  4338. /* harmony default export */ var src_inputvue_type_script_lang_js_ = (inputvue_type_script_lang_js_);
  4339. // CONCATENATED MODULE: ./packages/input/src/input.vue
  4340. /* normalize component */
  4341. var input_component = normalizeComponent(
  4342. src_inputvue_type_script_lang_js_,
  4343. inputvue_type_template_id_343dd774_render,
  4344. inputvue_type_template_id_343dd774_staticRenderFns,
  4345. false,
  4346. null,
  4347. null,
  4348. null
  4349. )
  4350. /* hot reload */
  4351. if (false) { var input_api; }
  4352. input_component.options.__file = "packages/input/src/input.vue"
  4353. /* harmony default export */ var src_input = (input_component.exports);
  4354. // CONCATENATED MODULE: ./packages/input/index.js
  4355. /* istanbul ignore next */
  4356. src_input.install = function (Vue) {
  4357. Vue.component(src_input.name, src_input);
  4358. };
  4359. /* harmony default export */ var packages_input = (src_input);
  4360. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/input-number/src/input-number.vue?vue&type=template&id=42f8cf66&
  4361. var input_numbervue_type_template_id_42f8cf66_render = function() {
  4362. var _vm = this
  4363. var _h = _vm.$createElement
  4364. var _c = _vm._self._c || _h
  4365. return _c(
  4366. "div",
  4367. {
  4368. class: [
  4369. "el-input-number",
  4370. _vm.inputNumberSize ? "el-input-number--" + _vm.inputNumberSize : "",
  4371. { "is-disabled": _vm.inputNumberDisabled },
  4372. { "is-without-controls": !_vm.controls },
  4373. { "is-controls-right": _vm.controlsAtRight }
  4374. ],
  4375. on: {
  4376. dragstart: function($event) {
  4377. $event.preventDefault()
  4378. }
  4379. }
  4380. },
  4381. [
  4382. _vm.controls
  4383. ? _c(
  4384. "span",
  4385. {
  4386. directives: [
  4387. {
  4388. name: "repeat-click",
  4389. rawName: "v-repeat-click",
  4390. value: _vm.decrease,
  4391. expression: "decrease"
  4392. }
  4393. ],
  4394. staticClass: "el-input-number__decrease",
  4395. class: { "is-disabled": _vm.minDisabled },
  4396. attrs: { role: "button" },
  4397. on: {
  4398. keydown: function($event) {
  4399. if (
  4400. !("button" in $event) &&
  4401. _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")
  4402. ) {
  4403. return null
  4404. }
  4405. return _vm.decrease($event)
  4406. }
  4407. }
  4408. },
  4409. [
  4410. _c("i", {
  4411. class:
  4412. "el-icon-" + (_vm.controlsAtRight ? "arrow-down" : "minus")
  4413. })
  4414. ]
  4415. )
  4416. : _vm._e(),
  4417. _vm.controls
  4418. ? _c(
  4419. "span",
  4420. {
  4421. directives: [
  4422. {
  4423. name: "repeat-click",
  4424. rawName: "v-repeat-click",
  4425. value: _vm.increase,
  4426. expression: "increase"
  4427. }
  4428. ],
  4429. staticClass: "el-input-number__increase",
  4430. class: { "is-disabled": _vm.maxDisabled },
  4431. attrs: { role: "button" },
  4432. on: {
  4433. keydown: function($event) {
  4434. if (
  4435. !("button" in $event) &&
  4436. _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")
  4437. ) {
  4438. return null
  4439. }
  4440. return _vm.increase($event)
  4441. }
  4442. }
  4443. },
  4444. [
  4445. _c("i", {
  4446. class: "el-icon-" + (_vm.controlsAtRight ? "arrow-up" : "plus")
  4447. })
  4448. ]
  4449. )
  4450. : _vm._e(),
  4451. _c("el-input", {
  4452. ref: "input",
  4453. attrs: {
  4454. value: _vm.displayValue,
  4455. placeholder: _vm.placeholder,
  4456. disabled: _vm.inputNumberDisabled,
  4457. size: _vm.inputNumberSize,
  4458. max: _vm.max,
  4459. min: _vm.min,
  4460. name: _vm.name,
  4461. label: _vm.label
  4462. },
  4463. on: {
  4464. blur: _vm.handleBlur,
  4465. focus: _vm.handleFocus,
  4466. input: _vm.handleInput,
  4467. change: _vm.handleInputChange
  4468. },
  4469. nativeOn: {
  4470. keydown: [
  4471. function($event) {
  4472. if (
  4473. !("button" in $event) &&
  4474. _vm._k($event.keyCode, "up", 38, $event.key, ["Up", "ArrowUp"])
  4475. ) {
  4476. return null
  4477. }
  4478. $event.preventDefault()
  4479. return _vm.increase($event)
  4480. },
  4481. function($event) {
  4482. if (
  4483. !("button" in $event) &&
  4484. _vm._k($event.keyCode, "down", 40, $event.key, [
  4485. "Down",
  4486. "ArrowDown"
  4487. ])
  4488. ) {
  4489. return null
  4490. }
  4491. $event.preventDefault()
  4492. return _vm.decrease($event)
  4493. }
  4494. ]
  4495. }
  4496. })
  4497. ],
  4498. 1
  4499. )
  4500. }
  4501. var input_numbervue_type_template_id_42f8cf66_staticRenderFns = []
  4502. input_numbervue_type_template_id_42f8cf66_render._withStripped = true
  4503. // CONCATENATED MODULE: ./packages/input-number/src/input-number.vue?vue&type=template&id=42f8cf66&
  4504. // CONCATENATED MODULE: ./src/directives/repeat-click.js
  4505. /* harmony default export */ var repeat_click = ({
  4506. bind: function bind(el, binding, vnode) {
  4507. var interval = null;
  4508. var startTime = void 0;
  4509. var maxIntervals = Object(util_["isMac"])() ? 100 : 200;
  4510. var handler = function handler() {
  4511. return vnode.context[binding.expression].apply();
  4512. };
  4513. var clear = function clear() {
  4514. if (Date.now() - startTime < maxIntervals) {
  4515. handler();
  4516. }
  4517. clearInterval(interval);
  4518. interval = null;
  4519. };
  4520. Object(dom_["on"])(el, 'mousedown', function (e) {
  4521. if (e.button !== 0) return;
  4522. startTime = Date.now();
  4523. Object(dom_["once"])(document, 'mouseup', clear);
  4524. clearInterval(interval);
  4525. interval = setInterval(handler, maxIntervals);
  4526. });
  4527. }
  4528. });
  4529. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/input-number/src/input-number.vue?vue&type=script&lang=js&
  4530. //
  4531. //
  4532. //
  4533. //
  4534. //
  4535. //
  4536. //
  4537. //
  4538. //
  4539. //
  4540. //
  4541. //
  4542. //
  4543. //
  4544. //
  4545. //
  4546. //
  4547. //
  4548. //
  4549. //
  4550. //
  4551. //
  4552. //
  4553. //
  4554. //
  4555. //
  4556. //
  4557. //
  4558. //
  4559. //
  4560. //
  4561. //
  4562. //
  4563. //
  4564. //
  4565. //
  4566. //
  4567. //
  4568. //
  4569. //
  4570. //
  4571. //
  4572. //
  4573. //
  4574. //
  4575. //
  4576. //
  4577. /* harmony default export */ var input_numbervue_type_script_lang_js_ = ({
  4578. name: 'ElInputNumber',
  4579. mixins: [focus_default()('input')],
  4580. inject: {
  4581. elForm: {
  4582. default: ''
  4583. },
  4584. elFormItem: {
  4585. default: ''
  4586. }
  4587. },
  4588. directives: {
  4589. repeatClick: repeat_click
  4590. },
  4591. components: {
  4592. ElInput: input_default.a
  4593. },
  4594. props: {
  4595. step: {
  4596. type: Number,
  4597. default: 1
  4598. },
  4599. stepStrictly: {
  4600. type: Boolean,
  4601. default: false
  4602. },
  4603. max: {
  4604. type: Number,
  4605. default: Infinity
  4606. },
  4607. min: {
  4608. type: Number,
  4609. default: -Infinity
  4610. },
  4611. value: {},
  4612. disabled: Boolean,
  4613. size: String,
  4614. controls: {
  4615. type: Boolean,
  4616. default: true
  4617. },
  4618. controlsPosition: {
  4619. type: String,
  4620. default: ''
  4621. },
  4622. name: String,
  4623. label: String,
  4624. placeholder: String,
  4625. precision: {
  4626. type: Number,
  4627. validator: function validator(val) {
  4628. return val >= 0 && val === parseInt(val, 10);
  4629. }
  4630. }
  4631. },
  4632. data: function data() {
  4633. return {
  4634. currentValue: 0,
  4635. userInput: null
  4636. };
  4637. },
  4638. watch: {
  4639. value: {
  4640. immediate: true,
  4641. handler: function handler(value) {
  4642. var newVal = value === undefined ? value : Number(value);
  4643. if (newVal !== undefined) {
  4644. if (isNaN(newVal)) {
  4645. return;
  4646. }
  4647. if (this.stepStrictly) {
  4648. var stepPrecision = this.getPrecision(this.step);
  4649. var precisionFactor = Math.pow(10, stepPrecision);
  4650. newVal = Math.round(newVal / this.step) * precisionFactor * this.step / precisionFactor;
  4651. }
  4652. if (this.precision !== undefined) {
  4653. newVal = this.toPrecision(newVal, this.precision);
  4654. }
  4655. }
  4656. if (newVal >= this.max) newVal = this.max;
  4657. if (newVal <= this.min) newVal = this.min;
  4658. this.currentValue = newVal;
  4659. this.userInput = null;
  4660. this.$emit('input', newVal);
  4661. }
  4662. }
  4663. },
  4664. computed: {
  4665. minDisabled: function minDisabled() {
  4666. return this._decrease(this.value, this.step) < this.min;
  4667. },
  4668. maxDisabled: function maxDisabled() {
  4669. return this._increase(this.value, this.step) > this.max;
  4670. },
  4671. numPrecision: function numPrecision() {
  4672. var value = this.value,
  4673. step = this.step,
  4674. getPrecision = this.getPrecision,
  4675. precision = this.precision;
  4676. var stepPrecision = getPrecision(step);
  4677. if (precision !== undefined) {
  4678. if (stepPrecision > precision) {
  4679. console.warn('[Element Warn][InputNumber]precision should not be less than the decimal places of step');
  4680. }
  4681. return precision;
  4682. } else {
  4683. return Math.max(getPrecision(value), stepPrecision);
  4684. }
  4685. },
  4686. controlsAtRight: function controlsAtRight() {
  4687. return this.controls && this.controlsPosition === 'right';
  4688. },
  4689. _elFormItemSize: function _elFormItemSize() {
  4690. return (this.elFormItem || {}).elFormItemSize;
  4691. },
  4692. inputNumberSize: function inputNumberSize() {
  4693. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  4694. },
  4695. inputNumberDisabled: function inputNumberDisabled() {
  4696. return this.disabled || !!(this.elForm || {}).disabled;
  4697. },
  4698. displayValue: function displayValue() {
  4699. if (this.userInput !== null) {
  4700. return this.userInput;
  4701. }
  4702. var currentValue = this.currentValue;
  4703. if (typeof currentValue === 'number') {
  4704. if (this.stepStrictly) {
  4705. var stepPrecision = this.getPrecision(this.step);
  4706. var precisionFactor = Math.pow(10, stepPrecision);
  4707. currentValue = Math.round(currentValue / this.step) * precisionFactor * this.step / precisionFactor;
  4708. }
  4709. if (this.precision !== undefined) {
  4710. currentValue = currentValue.toFixed(this.precision);
  4711. }
  4712. }
  4713. return currentValue;
  4714. }
  4715. },
  4716. methods: {
  4717. toPrecision: function toPrecision(num, precision) {
  4718. if (precision === undefined) precision = this.numPrecision;
  4719. return parseFloat(Math.round(num * Math.pow(10, precision)) / Math.pow(10, precision));
  4720. },
  4721. getPrecision: function getPrecision(value) {
  4722. if (value === undefined) return 0;
  4723. var valueString = value.toString();
  4724. var dotPosition = valueString.indexOf('.');
  4725. var precision = 0;
  4726. if (dotPosition !== -1) {
  4727. precision = valueString.length - dotPosition - 1;
  4728. }
  4729. return precision;
  4730. },
  4731. _increase: function _increase(val, step) {
  4732. if (typeof val !== 'number' && val !== undefined) return this.currentValue;
  4733. var precisionFactor = Math.pow(10, this.numPrecision);
  4734. // Solve the accuracy problem of JS decimal calculation by converting the value to integer.
  4735. return this.toPrecision((precisionFactor * val + precisionFactor * step) / precisionFactor);
  4736. },
  4737. _decrease: function _decrease(val, step) {
  4738. if (typeof val !== 'number' && val !== undefined) return this.currentValue;
  4739. var precisionFactor = Math.pow(10, this.numPrecision);
  4740. return this.toPrecision((precisionFactor * val - precisionFactor * step) / precisionFactor);
  4741. },
  4742. increase: function increase() {
  4743. if (this.inputNumberDisabled || this.maxDisabled) return;
  4744. var value = this.value || 0;
  4745. var newVal = this._increase(value, this.step);
  4746. this.setCurrentValue(newVal);
  4747. },
  4748. decrease: function decrease() {
  4749. if (this.inputNumberDisabled || this.minDisabled) return;
  4750. var value = this.value || 0;
  4751. var newVal = this._decrease(value, this.step);
  4752. this.setCurrentValue(newVal);
  4753. },
  4754. handleBlur: function handleBlur(event) {
  4755. this.$emit('blur', event);
  4756. },
  4757. handleFocus: function handleFocus(event) {
  4758. this.$emit('focus', event);
  4759. },
  4760. setCurrentValue: function setCurrentValue(newVal) {
  4761. var oldVal = this.currentValue;
  4762. if (typeof newVal === 'number' && this.precision !== undefined) {
  4763. newVal = this.toPrecision(newVal, this.precision);
  4764. }
  4765. if (newVal >= this.max) newVal = this.max;
  4766. if (newVal <= this.min) newVal = this.min;
  4767. if (oldVal === newVal) return;
  4768. this.userInput = null;
  4769. this.$emit('input', newVal);
  4770. this.$emit('change', newVal, oldVal);
  4771. this.currentValue = newVal;
  4772. },
  4773. handleInput: function handleInput(value) {
  4774. this.userInput = value;
  4775. },
  4776. handleInputChange: function handleInputChange(value) {
  4777. var newVal = value === '' ? undefined : Number(value);
  4778. if (!isNaN(newVal) || value === '') {
  4779. this.setCurrentValue(newVal);
  4780. }
  4781. this.userInput = null;
  4782. },
  4783. select: function select() {
  4784. this.$refs.input.select();
  4785. }
  4786. },
  4787. mounted: function mounted() {
  4788. var innerInput = this.$refs.input.$refs.input;
  4789. innerInput.setAttribute('role', 'spinbutton');
  4790. innerInput.setAttribute('aria-valuemax', this.max);
  4791. innerInput.setAttribute('aria-valuemin', this.min);
  4792. innerInput.setAttribute('aria-valuenow', this.currentValue);
  4793. innerInput.setAttribute('aria-disabled', this.inputNumberDisabled);
  4794. },
  4795. updated: function updated() {
  4796. if (!this.$refs || !this.$refs.input) return;
  4797. var innerInput = this.$refs.input.$refs.input;
  4798. innerInput.setAttribute('aria-valuenow', this.currentValue);
  4799. }
  4800. });
  4801. // CONCATENATED MODULE: ./packages/input-number/src/input-number.vue?vue&type=script&lang=js&
  4802. /* harmony default export */ var src_input_numbervue_type_script_lang_js_ = (input_numbervue_type_script_lang_js_);
  4803. // CONCATENATED MODULE: ./packages/input-number/src/input-number.vue
  4804. /* normalize component */
  4805. var input_number_component = normalizeComponent(
  4806. src_input_numbervue_type_script_lang_js_,
  4807. input_numbervue_type_template_id_42f8cf66_render,
  4808. input_numbervue_type_template_id_42f8cf66_staticRenderFns,
  4809. false,
  4810. null,
  4811. null,
  4812. null
  4813. )
  4814. /* hot reload */
  4815. if (false) { var input_number_api; }
  4816. input_number_component.options.__file = "packages/input-number/src/input-number.vue"
  4817. /* harmony default export */ var input_number = (input_number_component.exports);
  4818. // CONCATENATED MODULE: ./packages/input-number/index.js
  4819. /* istanbul ignore next */
  4820. input_number.install = function (Vue) {
  4821. Vue.component(input_number.name, input_number);
  4822. };
  4823. /* harmony default export */ var packages_input_number = (input_number);
  4824. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/radio/src/radio.vue?vue&type=template&id=69cd6268&
  4825. var radiovue_type_template_id_69cd6268_render = function() {
  4826. var _vm = this
  4827. var _h = _vm.$createElement
  4828. var _c = _vm._self._c || _h
  4829. return _c(
  4830. "label",
  4831. {
  4832. staticClass: "el-radio",
  4833. class: [
  4834. _vm.border && _vm.radioSize ? "el-radio--" + _vm.radioSize : "",
  4835. { "is-disabled": _vm.isDisabled },
  4836. { "is-focus": _vm.focus },
  4837. { "is-bordered": _vm.border },
  4838. { "is-checked": _vm.model === _vm.label }
  4839. ],
  4840. attrs: {
  4841. role: "radio",
  4842. "aria-checked": _vm.model === _vm.label,
  4843. "aria-disabled": _vm.isDisabled,
  4844. tabindex: _vm.tabIndex
  4845. },
  4846. on: {
  4847. keydown: function($event) {
  4848. if (
  4849. !("button" in $event) &&
  4850. _vm._k($event.keyCode, "space", 32, $event.key, [" ", "Spacebar"])
  4851. ) {
  4852. return null
  4853. }
  4854. $event.stopPropagation()
  4855. $event.preventDefault()
  4856. _vm.model = _vm.isDisabled ? _vm.model : _vm.label
  4857. }
  4858. }
  4859. },
  4860. [
  4861. _c(
  4862. "span",
  4863. {
  4864. staticClass: "el-radio__input",
  4865. class: {
  4866. "is-disabled": _vm.isDisabled,
  4867. "is-checked": _vm.model === _vm.label
  4868. }
  4869. },
  4870. [
  4871. _c("span", { staticClass: "el-radio__inner" }),
  4872. _c("input", {
  4873. directives: [
  4874. {
  4875. name: "model",
  4876. rawName: "v-model",
  4877. value: _vm.model,
  4878. expression: "model"
  4879. }
  4880. ],
  4881. ref: "radio",
  4882. staticClass: "el-radio__original",
  4883. attrs: {
  4884. type: "radio",
  4885. "aria-hidden": "true",
  4886. name: _vm.name,
  4887. disabled: _vm.isDisabled,
  4888. tabindex: "-1",
  4889. autocomplete: "off"
  4890. },
  4891. domProps: {
  4892. value: _vm.label,
  4893. checked: _vm._q(_vm.model, _vm.label)
  4894. },
  4895. on: {
  4896. focus: function($event) {
  4897. _vm.focus = true
  4898. },
  4899. blur: function($event) {
  4900. _vm.focus = false
  4901. },
  4902. change: [
  4903. function($event) {
  4904. _vm.model = _vm.label
  4905. },
  4906. _vm.handleChange
  4907. ]
  4908. }
  4909. })
  4910. ]
  4911. ),
  4912. _c(
  4913. "span",
  4914. {
  4915. staticClass: "el-radio__label",
  4916. on: {
  4917. keydown: function($event) {
  4918. $event.stopPropagation()
  4919. }
  4920. }
  4921. },
  4922. [
  4923. _vm._t("default"),
  4924. !_vm.$slots.default ? [_vm._v(_vm._s(_vm.label))] : _vm._e()
  4925. ],
  4926. 2
  4927. )
  4928. ]
  4929. )
  4930. }
  4931. var radiovue_type_template_id_69cd6268_staticRenderFns = []
  4932. radiovue_type_template_id_69cd6268_render._withStripped = true
  4933. // CONCATENATED MODULE: ./packages/radio/src/radio.vue?vue&type=template&id=69cd6268&
  4934. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/radio/src/radio.vue?vue&type=script&lang=js&
  4935. //
  4936. //
  4937. //
  4938. //
  4939. //
  4940. //
  4941. //
  4942. //
  4943. //
  4944. //
  4945. //
  4946. //
  4947. //
  4948. //
  4949. //
  4950. //
  4951. //
  4952. //
  4953. //
  4954. //
  4955. //
  4956. //
  4957. //
  4958. //
  4959. //
  4960. //
  4961. //
  4962. //
  4963. //
  4964. //
  4965. //
  4966. //
  4967. //
  4968. //
  4969. //
  4970. //
  4971. //
  4972. //
  4973. //
  4974. //
  4975. //
  4976. //
  4977. //
  4978. //
  4979. //
  4980. /* harmony default export */ var radiovue_type_script_lang_js_ = ({
  4981. name: 'ElRadio',
  4982. mixins: [emitter_default.a],
  4983. inject: {
  4984. elForm: {
  4985. default: ''
  4986. },
  4987. elFormItem: {
  4988. default: ''
  4989. }
  4990. },
  4991. componentName: 'ElRadio',
  4992. props: {
  4993. value: {},
  4994. label: {},
  4995. disabled: Boolean,
  4996. name: String,
  4997. border: Boolean,
  4998. size: String
  4999. },
  5000. data: function data() {
  5001. return {
  5002. focus: false
  5003. };
  5004. },
  5005. computed: {
  5006. isGroup: function isGroup() {
  5007. var parent = this.$parent;
  5008. while (parent) {
  5009. if (parent.$options.componentName !== 'ElRadioGroup') {
  5010. parent = parent.$parent;
  5011. } else {
  5012. this._radioGroup = parent;
  5013. return true;
  5014. }
  5015. }
  5016. return false;
  5017. },
  5018. model: {
  5019. get: function get() {
  5020. return this.isGroup ? this._radioGroup.value : this.value;
  5021. },
  5022. set: function set(val) {
  5023. if (this.isGroup) {
  5024. this.dispatch('ElRadioGroup', 'input', [val]);
  5025. } else {
  5026. this.$emit('input', val);
  5027. }
  5028. this.$refs.radio && (this.$refs.radio.checked = this.model === this.label);
  5029. }
  5030. },
  5031. _elFormItemSize: function _elFormItemSize() {
  5032. return (this.elFormItem || {}).elFormItemSize;
  5033. },
  5034. radioSize: function radioSize() {
  5035. var temRadioSize = this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  5036. return this.isGroup ? this._radioGroup.radioGroupSize || temRadioSize : temRadioSize;
  5037. },
  5038. isDisabled: function isDisabled() {
  5039. return this.isGroup ? this._radioGroup.disabled || this.disabled || (this.elForm || {}).disabled : this.disabled || (this.elForm || {}).disabled;
  5040. },
  5041. tabIndex: function tabIndex() {
  5042. return this.isDisabled || this.isGroup && this.model !== this.label ? -1 : 0;
  5043. }
  5044. },
  5045. methods: {
  5046. handleChange: function handleChange() {
  5047. var _this = this;
  5048. this.$nextTick(function () {
  5049. _this.$emit('change', _this.model);
  5050. _this.isGroup && _this.dispatch('ElRadioGroup', 'handleChange', _this.model);
  5051. });
  5052. }
  5053. }
  5054. });
  5055. // CONCATENATED MODULE: ./packages/radio/src/radio.vue?vue&type=script&lang=js&
  5056. /* harmony default export */ var src_radiovue_type_script_lang_js_ = (radiovue_type_script_lang_js_);
  5057. // CONCATENATED MODULE: ./packages/radio/src/radio.vue
  5058. /* normalize component */
  5059. var radio_component = normalizeComponent(
  5060. src_radiovue_type_script_lang_js_,
  5061. radiovue_type_template_id_69cd6268_render,
  5062. radiovue_type_template_id_69cd6268_staticRenderFns,
  5063. false,
  5064. null,
  5065. null,
  5066. null
  5067. )
  5068. /* hot reload */
  5069. if (false) { var radio_api; }
  5070. radio_component.options.__file = "packages/radio/src/radio.vue"
  5071. /* harmony default export */ var src_radio = (radio_component.exports);
  5072. // CONCATENATED MODULE: ./packages/radio/index.js
  5073. /* istanbul ignore next */
  5074. src_radio.install = function (Vue) {
  5075. Vue.component(src_radio.name, src_radio);
  5076. };
  5077. /* harmony default export */ var packages_radio = (src_radio);
  5078. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/radio/src/radio-group.vue?vue&type=template&id=818a704c&
  5079. var radio_groupvue_type_template_id_818a704c_render = function() {
  5080. var _vm = this
  5081. var _h = _vm.$createElement
  5082. var _c = _vm._self._c || _h
  5083. return _c(
  5084. _vm._elTag,
  5085. {
  5086. tag: "component",
  5087. staticClass: "el-radio-group",
  5088. attrs: { role: "radiogroup" },
  5089. on: { keydown: _vm.handleKeydown }
  5090. },
  5091. [_vm._t("default")],
  5092. 2
  5093. )
  5094. }
  5095. var radio_groupvue_type_template_id_818a704c_staticRenderFns = []
  5096. radio_groupvue_type_template_id_818a704c_render._withStripped = true
  5097. // CONCATENATED MODULE: ./packages/radio/src/radio-group.vue?vue&type=template&id=818a704c&
  5098. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/radio/src/radio-group.vue?vue&type=script&lang=js&
  5099. //
  5100. //
  5101. //
  5102. //
  5103. //
  5104. //
  5105. //
  5106. //
  5107. //
  5108. //
  5109. var keyCode = Object.freeze({
  5110. LEFT: 37,
  5111. UP: 38,
  5112. RIGHT: 39,
  5113. DOWN: 40
  5114. });
  5115. /* harmony default export */ var radio_groupvue_type_script_lang_js_ = ({
  5116. name: 'ElRadioGroup',
  5117. componentName: 'ElRadioGroup',
  5118. inject: {
  5119. elFormItem: {
  5120. default: ''
  5121. }
  5122. },
  5123. mixins: [emitter_default.a],
  5124. props: {
  5125. value: {},
  5126. size: String,
  5127. fill: String,
  5128. textColor: String,
  5129. disabled: Boolean
  5130. },
  5131. computed: {
  5132. _elFormItemSize: function _elFormItemSize() {
  5133. return (this.elFormItem || {}).elFormItemSize;
  5134. },
  5135. _elTag: function _elTag() {
  5136. var tag = (this.$vnode.data || {}).tag;
  5137. if (!tag || tag === 'component') tag = 'div';
  5138. return tag;
  5139. },
  5140. radioGroupSize: function radioGroupSize() {
  5141. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  5142. }
  5143. },
  5144. created: function created() {
  5145. var _this = this;
  5146. this.$on('handleChange', function (value) {
  5147. _this.$emit('change', value);
  5148. });
  5149. },
  5150. mounted: function mounted() {
  5151. // 当radioGroup没有默认选项时,第一个可以选中Tab导航
  5152. var radios = this.$el.querySelectorAll('[type=radio]');
  5153. var firstLabel = this.$el.querySelectorAll('[role=radio]')[0];
  5154. if (![].some.call(radios, function (radio) {
  5155. return radio.checked;
  5156. }) && firstLabel) {
  5157. firstLabel.tabIndex = 0;
  5158. }
  5159. },
  5160. methods: {
  5161. handleKeydown: function handleKeydown(e) {
  5162. // 左右上下按键 可以在radio组内切换不同选项
  5163. var target = e.target;
  5164. var className = target.nodeName === 'INPUT' ? '[type=radio]' : '[role=radio]';
  5165. var radios = this.$el.querySelectorAll(className);
  5166. var length = radios.length;
  5167. var index = [].indexOf.call(radios, target);
  5168. var roleRadios = this.$el.querySelectorAll('[role=radio]');
  5169. switch (e.keyCode) {
  5170. case keyCode.LEFT:
  5171. case keyCode.UP:
  5172. e.stopPropagation();
  5173. e.preventDefault();
  5174. if (index === 0) {
  5175. roleRadios[length - 1].click();
  5176. roleRadios[length - 1].focus();
  5177. } else {
  5178. roleRadios[index - 1].click();
  5179. roleRadios[index - 1].focus();
  5180. }
  5181. break;
  5182. case keyCode.RIGHT:
  5183. case keyCode.DOWN:
  5184. if (index === length - 1) {
  5185. e.stopPropagation();
  5186. e.preventDefault();
  5187. roleRadios[0].click();
  5188. roleRadios[0].focus();
  5189. } else {
  5190. roleRadios[index + 1].click();
  5191. roleRadios[index + 1].focus();
  5192. }
  5193. break;
  5194. default:
  5195. break;
  5196. }
  5197. }
  5198. },
  5199. watch: {
  5200. value: function value(_value) {
  5201. this.dispatch('ElFormItem', 'el.form.change', [this.value]);
  5202. }
  5203. }
  5204. });
  5205. // CONCATENATED MODULE: ./packages/radio/src/radio-group.vue?vue&type=script&lang=js&
  5206. /* harmony default export */ var src_radio_groupvue_type_script_lang_js_ = (radio_groupvue_type_script_lang_js_);
  5207. // CONCATENATED MODULE: ./packages/radio/src/radio-group.vue
  5208. /* normalize component */
  5209. var radio_group_component = normalizeComponent(
  5210. src_radio_groupvue_type_script_lang_js_,
  5211. radio_groupvue_type_template_id_818a704c_render,
  5212. radio_groupvue_type_template_id_818a704c_staticRenderFns,
  5213. false,
  5214. null,
  5215. null,
  5216. null
  5217. )
  5218. /* hot reload */
  5219. if (false) { var radio_group_api; }
  5220. radio_group_component.options.__file = "packages/radio/src/radio-group.vue"
  5221. /* harmony default export */ var radio_group = (radio_group_component.exports);
  5222. // CONCATENATED MODULE: ./packages/radio-group/index.js
  5223. /* istanbul ignore next */
  5224. radio_group.install = function (Vue) {
  5225. Vue.component(radio_group.name, radio_group);
  5226. };
  5227. /* harmony default export */ var packages_radio_group = (radio_group);
  5228. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/radio/src/radio-button.vue?vue&type=template&id=18a77a32&
  5229. var radio_buttonvue_type_template_id_18a77a32_render = function() {
  5230. var _vm = this
  5231. var _h = _vm.$createElement
  5232. var _c = _vm._self._c || _h
  5233. return _c(
  5234. "label",
  5235. {
  5236. staticClass: "el-radio-button",
  5237. class: [
  5238. _vm.size ? "el-radio-button--" + _vm.size : "",
  5239. { "is-active": _vm.value === _vm.label },
  5240. { "is-disabled": _vm.isDisabled },
  5241. { "is-focus": _vm.focus }
  5242. ],
  5243. attrs: {
  5244. role: "radio",
  5245. "aria-checked": _vm.value === _vm.label,
  5246. "aria-disabled": _vm.isDisabled,
  5247. tabindex: _vm.tabIndex
  5248. },
  5249. on: {
  5250. keydown: function($event) {
  5251. if (
  5252. !("button" in $event) &&
  5253. _vm._k($event.keyCode, "space", 32, $event.key, [" ", "Spacebar"])
  5254. ) {
  5255. return null
  5256. }
  5257. $event.stopPropagation()
  5258. $event.preventDefault()
  5259. _vm.value = _vm.isDisabled ? _vm.value : _vm.label
  5260. }
  5261. }
  5262. },
  5263. [
  5264. _c("input", {
  5265. directives: [
  5266. {
  5267. name: "model",
  5268. rawName: "v-model",
  5269. value: _vm.value,
  5270. expression: "value"
  5271. }
  5272. ],
  5273. staticClass: "el-radio-button__orig-radio",
  5274. attrs: {
  5275. type: "radio",
  5276. name: _vm.name,
  5277. disabled: _vm.isDisabled,
  5278. tabindex: "-1",
  5279. autocomplete: "off"
  5280. },
  5281. domProps: { value: _vm.label, checked: _vm._q(_vm.value, _vm.label) },
  5282. on: {
  5283. change: [
  5284. function($event) {
  5285. _vm.value = _vm.label
  5286. },
  5287. _vm.handleChange
  5288. ],
  5289. focus: function($event) {
  5290. _vm.focus = true
  5291. },
  5292. blur: function($event) {
  5293. _vm.focus = false
  5294. }
  5295. }
  5296. }),
  5297. _c(
  5298. "span",
  5299. {
  5300. staticClass: "el-radio-button__inner",
  5301. style: _vm.value === _vm.label ? _vm.activeStyle : null,
  5302. on: {
  5303. keydown: function($event) {
  5304. $event.stopPropagation()
  5305. }
  5306. }
  5307. },
  5308. [
  5309. _vm._t("default"),
  5310. !_vm.$slots.default ? [_vm._v(_vm._s(_vm.label))] : _vm._e()
  5311. ],
  5312. 2
  5313. )
  5314. ]
  5315. )
  5316. }
  5317. var radio_buttonvue_type_template_id_18a77a32_staticRenderFns = []
  5318. radio_buttonvue_type_template_id_18a77a32_render._withStripped = true
  5319. // CONCATENATED MODULE: ./packages/radio/src/radio-button.vue?vue&type=template&id=18a77a32&
  5320. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/radio/src/radio-button.vue?vue&type=script&lang=js&
  5321. //
  5322. //
  5323. //
  5324. //
  5325. //
  5326. //
  5327. //
  5328. //
  5329. //
  5330. //
  5331. //
  5332. //
  5333. //
  5334. //
  5335. //
  5336. //
  5337. //
  5338. //
  5339. //
  5340. //
  5341. //
  5342. //
  5343. //
  5344. //
  5345. //
  5346. //
  5347. //
  5348. //
  5349. //
  5350. //
  5351. //
  5352. //
  5353. //
  5354. //
  5355. //
  5356. //
  5357. //
  5358. /* harmony default export */ var radio_buttonvue_type_script_lang_js_ = ({
  5359. name: 'ElRadioButton',
  5360. mixins: [emitter_default.a],
  5361. inject: {
  5362. elForm: {
  5363. default: ''
  5364. },
  5365. elFormItem: {
  5366. default: ''
  5367. }
  5368. },
  5369. props: {
  5370. label: {},
  5371. disabled: Boolean,
  5372. name: String
  5373. },
  5374. data: function data() {
  5375. return {
  5376. focus: false
  5377. };
  5378. },
  5379. computed: {
  5380. value: {
  5381. get: function get() {
  5382. return this._radioGroup.value;
  5383. },
  5384. set: function set(value) {
  5385. this._radioGroup.$emit('input', value);
  5386. }
  5387. },
  5388. _radioGroup: function _radioGroup() {
  5389. var parent = this.$parent;
  5390. while (parent) {
  5391. if (parent.$options.componentName !== 'ElRadioGroup') {
  5392. parent = parent.$parent;
  5393. } else {
  5394. return parent;
  5395. }
  5396. }
  5397. return false;
  5398. },
  5399. activeStyle: function activeStyle() {
  5400. return {
  5401. backgroundColor: this._radioGroup.fill || '',
  5402. borderColor: this._radioGroup.fill || '',
  5403. boxShadow: this._radioGroup.fill ? '-1px 0 0 0 ' + this._radioGroup.fill : '',
  5404. color: this._radioGroup.textColor || ''
  5405. };
  5406. },
  5407. _elFormItemSize: function _elFormItemSize() {
  5408. return (this.elFormItem || {}).elFormItemSize;
  5409. },
  5410. size: function size() {
  5411. return this._radioGroup.radioGroupSize || this._elFormItemSize || (this.$ELEMENT || {}).size;
  5412. },
  5413. isDisabled: function isDisabled() {
  5414. return this.disabled || this._radioGroup.disabled || (this.elForm || {}).disabled;
  5415. },
  5416. tabIndex: function tabIndex() {
  5417. return this.isDisabled || this._radioGroup && this.value !== this.label ? -1 : 0;
  5418. }
  5419. },
  5420. methods: {
  5421. handleChange: function handleChange() {
  5422. var _this = this;
  5423. this.$nextTick(function () {
  5424. _this.dispatch('ElRadioGroup', 'handleChange', _this.value);
  5425. });
  5426. }
  5427. }
  5428. });
  5429. // CONCATENATED MODULE: ./packages/radio/src/radio-button.vue?vue&type=script&lang=js&
  5430. /* harmony default export */ var src_radio_buttonvue_type_script_lang_js_ = (radio_buttonvue_type_script_lang_js_);
  5431. // CONCATENATED MODULE: ./packages/radio/src/radio-button.vue
  5432. /* normalize component */
  5433. var radio_button_component = normalizeComponent(
  5434. src_radio_buttonvue_type_script_lang_js_,
  5435. radio_buttonvue_type_template_id_18a77a32_render,
  5436. radio_buttonvue_type_template_id_18a77a32_staticRenderFns,
  5437. false,
  5438. null,
  5439. null,
  5440. null
  5441. )
  5442. /* hot reload */
  5443. if (false) { var radio_button_api; }
  5444. radio_button_component.options.__file = "packages/radio/src/radio-button.vue"
  5445. /* harmony default export */ var radio_button = (radio_button_component.exports);
  5446. // CONCATENATED MODULE: ./packages/radio-button/index.js
  5447. /* istanbul ignore next */
  5448. radio_button.install = function (Vue) {
  5449. Vue.component(radio_button.name, radio_button);
  5450. };
  5451. /* harmony default export */ var packages_radio_button = (radio_button);
  5452. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/checkbox/src/checkbox.vue?vue&type=template&id=d0387074&
  5453. var checkboxvue_type_template_id_d0387074_render = function() {
  5454. var _vm = this
  5455. var _h = _vm.$createElement
  5456. var _c = _vm._self._c || _h
  5457. return _c(
  5458. "label",
  5459. {
  5460. staticClass: "el-checkbox",
  5461. class: [
  5462. _vm.border && _vm.checkboxSize
  5463. ? "el-checkbox--" + _vm.checkboxSize
  5464. : "",
  5465. { "is-disabled": _vm.isDisabled },
  5466. { "is-bordered": _vm.border },
  5467. { "is-checked": _vm.isChecked }
  5468. ],
  5469. attrs: { id: _vm.id }
  5470. },
  5471. [
  5472. _c(
  5473. "span",
  5474. {
  5475. staticClass: "el-checkbox__input",
  5476. class: {
  5477. "is-disabled": _vm.isDisabled,
  5478. "is-checked": _vm.isChecked,
  5479. "is-indeterminate": _vm.indeterminate,
  5480. "is-focus": _vm.focus
  5481. },
  5482. attrs: {
  5483. tabindex: _vm.indeterminate ? 0 : false,
  5484. role: _vm.indeterminate ? "checkbox" : false,
  5485. "aria-checked": _vm.indeterminate ? "mixed" : false
  5486. }
  5487. },
  5488. [
  5489. _c("span", { staticClass: "el-checkbox__inner" }),
  5490. _vm.trueLabel || _vm.falseLabel
  5491. ? _c("input", {
  5492. directives: [
  5493. {
  5494. name: "model",
  5495. rawName: "v-model",
  5496. value: _vm.model,
  5497. expression: "model"
  5498. }
  5499. ],
  5500. staticClass: "el-checkbox__original",
  5501. attrs: {
  5502. type: "checkbox",
  5503. "aria-hidden": _vm.indeterminate ? "true" : "false",
  5504. name: _vm.name,
  5505. disabled: _vm.isDisabled,
  5506. "true-value": _vm.trueLabel,
  5507. "false-value": _vm.falseLabel
  5508. },
  5509. domProps: {
  5510. checked: Array.isArray(_vm.model)
  5511. ? _vm._i(_vm.model, null) > -1
  5512. : _vm._q(_vm.model, _vm.trueLabel)
  5513. },
  5514. on: {
  5515. change: [
  5516. function($event) {
  5517. var $$a = _vm.model,
  5518. $$el = $event.target,
  5519. $$c = $$el.checked ? _vm.trueLabel : _vm.falseLabel
  5520. if (Array.isArray($$a)) {
  5521. var $$v = null,
  5522. $$i = _vm._i($$a, $$v)
  5523. if ($$el.checked) {
  5524. $$i < 0 && (_vm.model = $$a.concat([$$v]))
  5525. } else {
  5526. $$i > -1 &&
  5527. (_vm.model = $$a
  5528. .slice(0, $$i)
  5529. .concat($$a.slice($$i + 1)))
  5530. }
  5531. } else {
  5532. _vm.model = $$c
  5533. }
  5534. },
  5535. _vm.handleChange
  5536. ],
  5537. focus: function($event) {
  5538. _vm.focus = true
  5539. },
  5540. blur: function($event) {
  5541. _vm.focus = false
  5542. }
  5543. }
  5544. })
  5545. : _c("input", {
  5546. directives: [
  5547. {
  5548. name: "model",
  5549. rawName: "v-model",
  5550. value: _vm.model,
  5551. expression: "model"
  5552. }
  5553. ],
  5554. staticClass: "el-checkbox__original",
  5555. attrs: {
  5556. type: "checkbox",
  5557. "aria-hidden": _vm.indeterminate ? "true" : "false",
  5558. disabled: _vm.isDisabled,
  5559. name: _vm.name
  5560. },
  5561. domProps: {
  5562. value: _vm.label,
  5563. checked: Array.isArray(_vm.model)
  5564. ? _vm._i(_vm.model, _vm.label) > -1
  5565. : _vm.model
  5566. },
  5567. on: {
  5568. change: [
  5569. function($event) {
  5570. var $$a = _vm.model,
  5571. $$el = $event.target,
  5572. $$c = $$el.checked ? true : false
  5573. if (Array.isArray($$a)) {
  5574. var $$v = _vm.label,
  5575. $$i = _vm._i($$a, $$v)
  5576. if ($$el.checked) {
  5577. $$i < 0 && (_vm.model = $$a.concat([$$v]))
  5578. } else {
  5579. $$i > -1 &&
  5580. (_vm.model = $$a
  5581. .slice(0, $$i)
  5582. .concat($$a.slice($$i + 1)))
  5583. }
  5584. } else {
  5585. _vm.model = $$c
  5586. }
  5587. },
  5588. _vm.handleChange
  5589. ],
  5590. focus: function($event) {
  5591. _vm.focus = true
  5592. },
  5593. blur: function($event) {
  5594. _vm.focus = false
  5595. }
  5596. }
  5597. })
  5598. ]
  5599. ),
  5600. _vm.$slots.default || _vm.label
  5601. ? _c(
  5602. "span",
  5603. { staticClass: "el-checkbox__label" },
  5604. [
  5605. _vm._t("default"),
  5606. !_vm.$slots.default ? [_vm._v(_vm._s(_vm.label))] : _vm._e()
  5607. ],
  5608. 2
  5609. )
  5610. : _vm._e()
  5611. ]
  5612. )
  5613. }
  5614. var checkboxvue_type_template_id_d0387074_staticRenderFns = []
  5615. checkboxvue_type_template_id_d0387074_render._withStripped = true
  5616. // CONCATENATED MODULE: ./packages/checkbox/src/checkbox.vue?vue&type=template&id=d0387074&
  5617. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/checkbox/src/checkbox.vue?vue&type=script&lang=js&
  5618. //
  5619. //
  5620. //
  5621. //
  5622. //
  5623. //
  5624. //
  5625. //
  5626. //
  5627. //
  5628. //
  5629. //
  5630. //
  5631. //
  5632. //
  5633. //
  5634. //
  5635. //
  5636. //
  5637. //
  5638. //
  5639. //
  5640. //
  5641. //
  5642. //
  5643. //
  5644. //
  5645. //
  5646. //
  5647. //
  5648. //
  5649. //
  5650. //
  5651. //
  5652. //
  5653. //
  5654. //
  5655. //
  5656. //
  5657. //
  5658. //
  5659. //
  5660. //
  5661. //
  5662. //
  5663. //
  5664. //
  5665. //
  5666. //
  5667. //
  5668. //
  5669. //
  5670. //
  5671. //
  5672. //
  5673. /* harmony default export */ var checkboxvue_type_script_lang_js_ = ({
  5674. name: 'ElCheckbox',
  5675. mixins: [emitter_default.a],
  5676. inject: {
  5677. elForm: {
  5678. default: ''
  5679. },
  5680. elFormItem: {
  5681. default: ''
  5682. }
  5683. },
  5684. componentName: 'ElCheckbox',
  5685. data: function data() {
  5686. return {
  5687. selfModel: false,
  5688. focus: false,
  5689. isLimitExceeded: false
  5690. };
  5691. },
  5692. computed: {
  5693. model: {
  5694. get: function get() {
  5695. return this.isGroup ? this.store : this.value !== undefined ? this.value : this.selfModel;
  5696. },
  5697. set: function set(val) {
  5698. if (this.isGroup) {
  5699. this.isLimitExceeded = false;
  5700. this._checkboxGroup.min !== undefined && val.length < this._checkboxGroup.min && (this.isLimitExceeded = true);
  5701. this._checkboxGroup.max !== undefined && val.length > this._checkboxGroup.max && (this.isLimitExceeded = true);
  5702. this.isLimitExceeded === false && this.dispatch('ElCheckboxGroup', 'input', [val]);
  5703. } else {
  5704. this.$emit('input', val);
  5705. this.selfModel = val;
  5706. }
  5707. }
  5708. },
  5709. isChecked: function isChecked() {
  5710. if ({}.toString.call(this.model) === '[object Boolean]') {
  5711. return this.model;
  5712. } else if (Array.isArray(this.model)) {
  5713. return this.model.indexOf(this.label) > -1;
  5714. } else if (this.model !== null && this.model !== undefined) {
  5715. return this.model === this.trueLabel;
  5716. }
  5717. },
  5718. isGroup: function isGroup() {
  5719. var parent = this.$parent;
  5720. while (parent) {
  5721. if (parent.$options.componentName !== 'ElCheckboxGroup') {
  5722. parent = parent.$parent;
  5723. } else {
  5724. this._checkboxGroup = parent;
  5725. return true;
  5726. }
  5727. }
  5728. return false;
  5729. },
  5730. store: function store() {
  5731. return this._checkboxGroup ? this._checkboxGroup.value : this.value;
  5732. },
  5733. /* used to make the isDisabled judgment under max/min props */
  5734. isLimitDisabled: function isLimitDisabled() {
  5735. var _checkboxGroup = this._checkboxGroup,
  5736. max = _checkboxGroup.max,
  5737. min = _checkboxGroup.min;
  5738. return !!(max || min) && this.model.length >= max && !this.isChecked || this.model.length <= min && this.isChecked;
  5739. },
  5740. isDisabled: function isDisabled() {
  5741. return this.isGroup ? this._checkboxGroup.disabled || this.disabled || (this.elForm || {}).disabled || this.isLimitDisabled : this.disabled || (this.elForm || {}).disabled;
  5742. },
  5743. _elFormItemSize: function _elFormItemSize() {
  5744. return (this.elFormItem || {}).elFormItemSize;
  5745. },
  5746. checkboxSize: function checkboxSize() {
  5747. var temCheckboxSize = this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  5748. return this.isGroup ? this._checkboxGroup.checkboxGroupSize || temCheckboxSize : temCheckboxSize;
  5749. }
  5750. },
  5751. props: {
  5752. value: {},
  5753. label: {},
  5754. indeterminate: Boolean,
  5755. disabled: Boolean,
  5756. checked: Boolean,
  5757. name: String,
  5758. trueLabel: [String, Number],
  5759. falseLabel: [String, Number],
  5760. id: String, /* 当indeterminate为真时,为controls提供相关连的checkbox的id,表明元素间的控制关系*/
  5761. controls: String, /* 当indeterminate为真时,为controls提供相关连的checkbox的id,表明元素间的控制关系*/
  5762. border: Boolean,
  5763. size: String
  5764. },
  5765. methods: {
  5766. addToStore: function addToStore() {
  5767. if (Array.isArray(this.model) && this.model.indexOf(this.label) === -1) {
  5768. this.model.push(this.label);
  5769. } else {
  5770. this.model = this.trueLabel || true;
  5771. }
  5772. },
  5773. handleChange: function handleChange(ev) {
  5774. var _this = this;
  5775. if (this.isLimitExceeded) return;
  5776. var value = void 0;
  5777. if (ev.target.checked) {
  5778. value = this.trueLabel === undefined ? true : this.trueLabel;
  5779. } else {
  5780. value = this.falseLabel === undefined ? false : this.falseLabel;
  5781. }
  5782. this.$emit('change', value, ev);
  5783. this.$nextTick(function () {
  5784. if (_this.isGroup) {
  5785. _this.dispatch('ElCheckboxGroup', 'change', [_this._checkboxGroup.value]);
  5786. }
  5787. });
  5788. }
  5789. },
  5790. created: function created() {
  5791. this.checked && this.addToStore();
  5792. },
  5793. mounted: function mounted() {
  5794. // 为indeterminate元素 添加aria-controls 属性
  5795. if (this.indeterminate) {
  5796. this.$el.setAttribute('aria-controls', this.controls);
  5797. }
  5798. },
  5799. watch: {
  5800. value: function value(_value) {
  5801. this.dispatch('ElFormItem', 'el.form.change', _value);
  5802. }
  5803. }
  5804. });
  5805. // CONCATENATED MODULE: ./packages/checkbox/src/checkbox.vue?vue&type=script&lang=js&
  5806. /* harmony default export */ var src_checkboxvue_type_script_lang_js_ = (checkboxvue_type_script_lang_js_);
  5807. // CONCATENATED MODULE: ./packages/checkbox/src/checkbox.vue
  5808. /* normalize component */
  5809. var checkbox_component = normalizeComponent(
  5810. src_checkboxvue_type_script_lang_js_,
  5811. checkboxvue_type_template_id_d0387074_render,
  5812. checkboxvue_type_template_id_d0387074_staticRenderFns,
  5813. false,
  5814. null,
  5815. null,
  5816. null
  5817. )
  5818. /* hot reload */
  5819. if (false) { var checkbox_api; }
  5820. checkbox_component.options.__file = "packages/checkbox/src/checkbox.vue"
  5821. /* harmony default export */ var src_checkbox = (checkbox_component.exports);
  5822. // CONCATENATED MODULE: ./packages/checkbox/index.js
  5823. /* istanbul ignore next */
  5824. src_checkbox.install = function (Vue) {
  5825. Vue.component(src_checkbox.name, src_checkbox);
  5826. };
  5827. /* harmony default export */ var packages_checkbox = (src_checkbox);
  5828. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/checkbox/src/checkbox-button.vue?vue&type=template&id=478e906e&
  5829. var checkbox_buttonvue_type_template_id_478e906e_render = function() {
  5830. var _vm = this
  5831. var _h = _vm.$createElement
  5832. var _c = _vm._self._c || _h
  5833. return _c(
  5834. "label",
  5835. {
  5836. staticClass: "el-checkbox-button",
  5837. class: [
  5838. _vm.size ? "el-checkbox-button--" + _vm.size : "",
  5839. { "is-disabled": _vm.isDisabled },
  5840. { "is-checked": _vm.isChecked },
  5841. { "is-focus": _vm.focus }
  5842. ],
  5843. attrs: {
  5844. role: "checkbox",
  5845. "aria-checked": _vm.isChecked,
  5846. "aria-disabled": _vm.isDisabled
  5847. }
  5848. },
  5849. [
  5850. _vm.trueLabel || _vm.falseLabel
  5851. ? _c("input", {
  5852. directives: [
  5853. {
  5854. name: "model",
  5855. rawName: "v-model",
  5856. value: _vm.model,
  5857. expression: "model"
  5858. }
  5859. ],
  5860. staticClass: "el-checkbox-button__original",
  5861. attrs: {
  5862. type: "checkbox",
  5863. name: _vm.name,
  5864. disabled: _vm.isDisabled,
  5865. "true-value": _vm.trueLabel,
  5866. "false-value": _vm.falseLabel
  5867. },
  5868. domProps: {
  5869. checked: Array.isArray(_vm.model)
  5870. ? _vm._i(_vm.model, null) > -1
  5871. : _vm._q(_vm.model, _vm.trueLabel)
  5872. },
  5873. on: {
  5874. change: [
  5875. function($event) {
  5876. var $$a = _vm.model,
  5877. $$el = $event.target,
  5878. $$c = $$el.checked ? _vm.trueLabel : _vm.falseLabel
  5879. if (Array.isArray($$a)) {
  5880. var $$v = null,
  5881. $$i = _vm._i($$a, $$v)
  5882. if ($$el.checked) {
  5883. $$i < 0 && (_vm.model = $$a.concat([$$v]))
  5884. } else {
  5885. $$i > -1 &&
  5886. (_vm.model = $$a
  5887. .slice(0, $$i)
  5888. .concat($$a.slice($$i + 1)))
  5889. }
  5890. } else {
  5891. _vm.model = $$c
  5892. }
  5893. },
  5894. _vm.handleChange
  5895. ],
  5896. focus: function($event) {
  5897. _vm.focus = true
  5898. },
  5899. blur: function($event) {
  5900. _vm.focus = false
  5901. }
  5902. }
  5903. })
  5904. : _c("input", {
  5905. directives: [
  5906. {
  5907. name: "model",
  5908. rawName: "v-model",
  5909. value: _vm.model,
  5910. expression: "model"
  5911. }
  5912. ],
  5913. staticClass: "el-checkbox-button__original",
  5914. attrs: {
  5915. type: "checkbox",
  5916. name: _vm.name,
  5917. disabled: _vm.isDisabled
  5918. },
  5919. domProps: {
  5920. value: _vm.label,
  5921. checked: Array.isArray(_vm.model)
  5922. ? _vm._i(_vm.model, _vm.label) > -1
  5923. : _vm.model
  5924. },
  5925. on: {
  5926. change: [
  5927. function($event) {
  5928. var $$a = _vm.model,
  5929. $$el = $event.target,
  5930. $$c = $$el.checked ? true : false
  5931. if (Array.isArray($$a)) {
  5932. var $$v = _vm.label,
  5933. $$i = _vm._i($$a, $$v)
  5934. if ($$el.checked) {
  5935. $$i < 0 && (_vm.model = $$a.concat([$$v]))
  5936. } else {
  5937. $$i > -1 &&
  5938. (_vm.model = $$a
  5939. .slice(0, $$i)
  5940. .concat($$a.slice($$i + 1)))
  5941. }
  5942. } else {
  5943. _vm.model = $$c
  5944. }
  5945. },
  5946. _vm.handleChange
  5947. ],
  5948. focus: function($event) {
  5949. _vm.focus = true
  5950. },
  5951. blur: function($event) {
  5952. _vm.focus = false
  5953. }
  5954. }
  5955. }),
  5956. _vm.$slots.default || _vm.label
  5957. ? _c(
  5958. "span",
  5959. {
  5960. staticClass: "el-checkbox-button__inner",
  5961. style: _vm.isChecked ? _vm.activeStyle : null
  5962. },
  5963. [_vm._t("default", [_vm._v(_vm._s(_vm.label))])],
  5964. 2
  5965. )
  5966. : _vm._e()
  5967. ]
  5968. )
  5969. }
  5970. var checkbox_buttonvue_type_template_id_478e906e_staticRenderFns = []
  5971. checkbox_buttonvue_type_template_id_478e906e_render._withStripped = true
  5972. // CONCATENATED MODULE: ./packages/checkbox/src/checkbox-button.vue?vue&type=template&id=478e906e&
  5973. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/checkbox/src/checkbox-button.vue?vue&type=script&lang=js&
  5974. //
  5975. //
  5976. //
  5977. //
  5978. //
  5979. //
  5980. //
  5981. //
  5982. //
  5983. //
  5984. //
  5985. //
  5986. //
  5987. //
  5988. //
  5989. //
  5990. //
  5991. //
  5992. //
  5993. //
  5994. //
  5995. //
  5996. //
  5997. //
  5998. //
  5999. //
  6000. //
  6001. //
  6002. //
  6003. //
  6004. //
  6005. //
  6006. //
  6007. //
  6008. //
  6009. //
  6010. //
  6011. //
  6012. //
  6013. //
  6014. //
  6015. //
  6016. //
  6017. //
  6018. //
  6019. /* harmony default export */ var checkbox_buttonvue_type_script_lang_js_ = ({
  6020. name: 'ElCheckboxButton',
  6021. mixins: [emitter_default.a],
  6022. inject: {
  6023. elForm: {
  6024. default: ''
  6025. },
  6026. elFormItem: {
  6027. default: ''
  6028. }
  6029. },
  6030. data: function data() {
  6031. return {
  6032. selfModel: false,
  6033. focus: false,
  6034. isLimitExceeded: false
  6035. };
  6036. },
  6037. props: {
  6038. value: {},
  6039. label: {},
  6040. disabled: Boolean,
  6041. checked: Boolean,
  6042. name: String,
  6043. trueLabel: [String, Number],
  6044. falseLabel: [String, Number]
  6045. },
  6046. computed: {
  6047. model: {
  6048. get: function get() {
  6049. return this._checkboxGroup ? this.store : this.value !== undefined ? this.value : this.selfModel;
  6050. },
  6051. set: function set(val) {
  6052. if (this._checkboxGroup) {
  6053. this.isLimitExceeded = false;
  6054. this._checkboxGroup.min !== undefined && val.length < this._checkboxGroup.min && (this.isLimitExceeded = true);
  6055. this._checkboxGroup.max !== undefined && val.length > this._checkboxGroup.max && (this.isLimitExceeded = true);
  6056. this.isLimitExceeded === false && this.dispatch('ElCheckboxGroup', 'input', [val]);
  6057. } else if (this.value !== undefined) {
  6058. this.$emit('input', val);
  6059. } else {
  6060. this.selfModel = val;
  6061. }
  6062. }
  6063. },
  6064. isChecked: function isChecked() {
  6065. if ({}.toString.call(this.model) === '[object Boolean]') {
  6066. return this.model;
  6067. } else if (Array.isArray(this.model)) {
  6068. return this.model.indexOf(this.label) > -1;
  6069. } else if (this.model !== null && this.model !== undefined) {
  6070. return this.model === this.trueLabel;
  6071. }
  6072. },
  6073. _checkboxGroup: function _checkboxGroup() {
  6074. var parent = this.$parent;
  6075. while (parent) {
  6076. if (parent.$options.componentName !== 'ElCheckboxGroup') {
  6077. parent = parent.$parent;
  6078. } else {
  6079. return parent;
  6080. }
  6081. }
  6082. return false;
  6083. },
  6084. store: function store() {
  6085. return this._checkboxGroup ? this._checkboxGroup.value : this.value;
  6086. },
  6087. activeStyle: function activeStyle() {
  6088. return {
  6089. backgroundColor: this._checkboxGroup.fill || '',
  6090. borderColor: this._checkboxGroup.fill || '',
  6091. color: this._checkboxGroup.textColor || '',
  6092. 'box-shadow': '-1px 0 0 0 ' + this._checkboxGroup.fill
  6093. };
  6094. },
  6095. _elFormItemSize: function _elFormItemSize() {
  6096. return (this.elFormItem || {}).elFormItemSize;
  6097. },
  6098. size: function size() {
  6099. return this._checkboxGroup.checkboxGroupSize || this._elFormItemSize || (this.$ELEMENT || {}).size;
  6100. },
  6101. /* used to make the isDisabled judgment under max/min props */
  6102. isLimitDisabled: function isLimitDisabled() {
  6103. var _checkboxGroup2 = this._checkboxGroup,
  6104. max = _checkboxGroup2.max,
  6105. min = _checkboxGroup2.min;
  6106. return !!(max || min) && this.model.length >= max && !this.isChecked || this.model.length <= min && this.isChecked;
  6107. },
  6108. isDisabled: function isDisabled() {
  6109. return this._checkboxGroup ? this._checkboxGroup.disabled || this.disabled || (this.elForm || {}).disabled || this.isLimitDisabled : this.disabled || (this.elForm || {}).disabled;
  6110. }
  6111. },
  6112. methods: {
  6113. addToStore: function addToStore() {
  6114. if (Array.isArray(this.model) && this.model.indexOf(this.label) === -1) {
  6115. this.model.push(this.label);
  6116. } else {
  6117. this.model = this.trueLabel || true;
  6118. }
  6119. },
  6120. handleChange: function handleChange(ev) {
  6121. var _this = this;
  6122. if (this.isLimitExceeded) return;
  6123. var value = void 0;
  6124. if (ev.target.checked) {
  6125. value = this.trueLabel === undefined ? true : this.trueLabel;
  6126. } else {
  6127. value = this.falseLabel === undefined ? false : this.falseLabel;
  6128. }
  6129. this.$emit('change', value, ev);
  6130. this.$nextTick(function () {
  6131. if (_this._checkboxGroup) {
  6132. _this.dispatch('ElCheckboxGroup', 'change', [_this._checkboxGroup.value]);
  6133. }
  6134. });
  6135. }
  6136. },
  6137. created: function created() {
  6138. this.checked && this.addToStore();
  6139. }
  6140. });
  6141. // CONCATENATED MODULE: ./packages/checkbox/src/checkbox-button.vue?vue&type=script&lang=js&
  6142. /* harmony default export */ var src_checkbox_buttonvue_type_script_lang_js_ = (checkbox_buttonvue_type_script_lang_js_);
  6143. // CONCATENATED MODULE: ./packages/checkbox/src/checkbox-button.vue
  6144. /* normalize component */
  6145. var checkbox_button_component = normalizeComponent(
  6146. src_checkbox_buttonvue_type_script_lang_js_,
  6147. checkbox_buttonvue_type_template_id_478e906e_render,
  6148. checkbox_buttonvue_type_template_id_478e906e_staticRenderFns,
  6149. false,
  6150. null,
  6151. null,
  6152. null
  6153. )
  6154. /* hot reload */
  6155. if (false) { var checkbox_button_api; }
  6156. checkbox_button_component.options.__file = "packages/checkbox/src/checkbox-button.vue"
  6157. /* harmony default export */ var checkbox_button = (checkbox_button_component.exports);
  6158. // CONCATENATED MODULE: ./packages/checkbox-button/index.js
  6159. /* istanbul ignore next */
  6160. checkbox_button.install = function (Vue) {
  6161. Vue.component(checkbox_button.name, checkbox_button);
  6162. };
  6163. /* harmony default export */ var packages_checkbox_button = (checkbox_button);
  6164. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/checkbox/src/checkbox-group.vue?vue&type=template&id=7289a290&
  6165. var checkbox_groupvue_type_template_id_7289a290_render = function() {
  6166. var _vm = this
  6167. var _h = _vm.$createElement
  6168. var _c = _vm._self._c || _h
  6169. return _c(
  6170. "div",
  6171. {
  6172. staticClass: "el-checkbox-group",
  6173. attrs: { role: "group", "aria-label": "checkbox-group" }
  6174. },
  6175. [_vm._t("default")],
  6176. 2
  6177. )
  6178. }
  6179. var checkbox_groupvue_type_template_id_7289a290_staticRenderFns = []
  6180. checkbox_groupvue_type_template_id_7289a290_render._withStripped = true
  6181. // CONCATENATED MODULE: ./packages/checkbox/src/checkbox-group.vue?vue&type=template&id=7289a290&
  6182. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/checkbox/src/checkbox-group.vue?vue&type=script&lang=js&
  6183. /* harmony default export */ var checkbox_groupvue_type_script_lang_js_ = ({
  6184. name: 'ElCheckboxGroup',
  6185. componentName: 'ElCheckboxGroup',
  6186. mixins: [emitter_default.a],
  6187. inject: {
  6188. elFormItem: {
  6189. default: ''
  6190. }
  6191. },
  6192. props: {
  6193. value: {},
  6194. disabled: Boolean,
  6195. min: Number,
  6196. max: Number,
  6197. size: String,
  6198. fill: String,
  6199. textColor: String
  6200. },
  6201. computed: {
  6202. _elFormItemSize: function _elFormItemSize() {
  6203. return (this.elFormItem || {}).elFormItemSize;
  6204. },
  6205. checkboxGroupSize: function checkboxGroupSize() {
  6206. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  6207. }
  6208. },
  6209. watch: {
  6210. value: function value(_value) {
  6211. this.dispatch('ElFormItem', 'el.form.change', [_value]);
  6212. }
  6213. }
  6214. });
  6215. // CONCATENATED MODULE: ./packages/checkbox/src/checkbox-group.vue?vue&type=script&lang=js&
  6216. /* harmony default export */ var src_checkbox_groupvue_type_script_lang_js_ = (checkbox_groupvue_type_script_lang_js_);
  6217. // CONCATENATED MODULE: ./packages/checkbox/src/checkbox-group.vue
  6218. /* normalize component */
  6219. var checkbox_group_component = normalizeComponent(
  6220. src_checkbox_groupvue_type_script_lang_js_,
  6221. checkbox_groupvue_type_template_id_7289a290_render,
  6222. checkbox_groupvue_type_template_id_7289a290_staticRenderFns,
  6223. false,
  6224. null,
  6225. null,
  6226. null
  6227. )
  6228. /* hot reload */
  6229. if (false) { var checkbox_group_api; }
  6230. checkbox_group_component.options.__file = "packages/checkbox/src/checkbox-group.vue"
  6231. /* harmony default export */ var checkbox_group = (checkbox_group_component.exports);
  6232. // CONCATENATED MODULE: ./packages/checkbox-group/index.js
  6233. /* istanbul ignore next */
  6234. checkbox_group.install = function (Vue) {
  6235. Vue.component(checkbox_group.name, checkbox_group);
  6236. };
  6237. /* harmony default export */ var packages_checkbox_group = (checkbox_group);
  6238. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/switch/src/component.vue?vue&type=template&id=2dcd8fbb&
  6239. var componentvue_type_template_id_2dcd8fbb_render = function() {
  6240. var _vm = this
  6241. var _h = _vm.$createElement
  6242. var _c = _vm._self._c || _h
  6243. return _c(
  6244. "div",
  6245. {
  6246. staticClass: "el-switch",
  6247. class: { "is-disabled": _vm.switchDisabled, "is-checked": _vm.checked },
  6248. attrs: {
  6249. role: "switch",
  6250. "aria-checked": _vm.checked,
  6251. "aria-disabled": _vm.switchDisabled
  6252. },
  6253. on: {
  6254. click: function($event) {
  6255. $event.preventDefault()
  6256. return _vm.switchValue($event)
  6257. }
  6258. }
  6259. },
  6260. [
  6261. _c("input", {
  6262. ref: "input",
  6263. staticClass: "el-switch__input",
  6264. attrs: {
  6265. type: "checkbox",
  6266. id: _vm.id,
  6267. name: _vm.name,
  6268. "true-value": _vm.activeValue,
  6269. "false-value": _vm.inactiveValue,
  6270. disabled: _vm.switchDisabled
  6271. },
  6272. on: {
  6273. change: _vm.handleChange,
  6274. keydown: function($event) {
  6275. if (
  6276. !("button" in $event) &&
  6277. _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")
  6278. ) {
  6279. return null
  6280. }
  6281. return _vm.switchValue($event)
  6282. }
  6283. }
  6284. }),
  6285. _vm.inactiveIconClass || _vm.inactiveText
  6286. ? _c(
  6287. "span",
  6288. {
  6289. class: [
  6290. "el-switch__label",
  6291. "el-switch__label--left",
  6292. !_vm.checked ? "is-active" : ""
  6293. ]
  6294. },
  6295. [
  6296. _vm.inactiveIconClass
  6297. ? _c("i", { class: [_vm.inactiveIconClass] })
  6298. : _vm._e(),
  6299. !_vm.inactiveIconClass && _vm.inactiveText
  6300. ? _c("span", { attrs: { "aria-hidden": _vm.checked } }, [
  6301. _vm._v(_vm._s(_vm.inactiveText))
  6302. ])
  6303. : _vm._e()
  6304. ]
  6305. )
  6306. : _vm._e(),
  6307. _c("span", {
  6308. ref: "core",
  6309. staticClass: "el-switch__core",
  6310. style: { width: _vm.coreWidth + "px" }
  6311. }),
  6312. _vm.activeIconClass || _vm.activeText
  6313. ? _c(
  6314. "span",
  6315. {
  6316. class: [
  6317. "el-switch__label",
  6318. "el-switch__label--right",
  6319. _vm.checked ? "is-active" : ""
  6320. ]
  6321. },
  6322. [
  6323. _vm.activeIconClass
  6324. ? _c("i", { class: [_vm.activeIconClass] })
  6325. : _vm._e(),
  6326. !_vm.activeIconClass && _vm.activeText
  6327. ? _c("span", { attrs: { "aria-hidden": !_vm.checked } }, [
  6328. _vm._v(_vm._s(_vm.activeText))
  6329. ])
  6330. : _vm._e()
  6331. ]
  6332. )
  6333. : _vm._e()
  6334. ]
  6335. )
  6336. }
  6337. var componentvue_type_template_id_2dcd8fbb_staticRenderFns = []
  6338. componentvue_type_template_id_2dcd8fbb_render._withStripped = true
  6339. // CONCATENATED MODULE: ./packages/switch/src/component.vue?vue&type=template&id=2dcd8fbb&
  6340. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/switch/src/component.vue?vue&type=script&lang=js&
  6341. //
  6342. //
  6343. //
  6344. //
  6345. //
  6346. //
  6347. //
  6348. //
  6349. //
  6350. //
  6351. //
  6352. //
  6353. //
  6354. //
  6355. //
  6356. //
  6357. //
  6358. //
  6359. //
  6360. //
  6361. //
  6362. //
  6363. //
  6364. //
  6365. //
  6366. //
  6367. //
  6368. //
  6369. //
  6370. //
  6371. //
  6372. //
  6373. //
  6374. //
  6375. //
  6376. //
  6377. //
  6378. /* harmony default export */ var switch_src_componentvue_type_script_lang_js_ = ({
  6379. name: 'ElSwitch',
  6380. mixins: [focus_default()('input'), migrating_default.a, emitter_default.a],
  6381. inject: {
  6382. elForm: {
  6383. default: ''
  6384. }
  6385. },
  6386. props: {
  6387. value: {
  6388. type: [Boolean, String, Number],
  6389. default: false
  6390. },
  6391. disabled: {
  6392. type: Boolean,
  6393. default: false
  6394. },
  6395. width: {
  6396. type: Number,
  6397. default: 40
  6398. },
  6399. activeIconClass: {
  6400. type: String,
  6401. default: ''
  6402. },
  6403. inactiveIconClass: {
  6404. type: String,
  6405. default: ''
  6406. },
  6407. activeText: String,
  6408. inactiveText: String,
  6409. activeColor: {
  6410. type: String,
  6411. default: ''
  6412. },
  6413. inactiveColor: {
  6414. type: String,
  6415. default: ''
  6416. },
  6417. activeValue: {
  6418. type: [Boolean, String, Number],
  6419. default: true
  6420. },
  6421. inactiveValue: {
  6422. type: [Boolean, String, Number],
  6423. default: false
  6424. },
  6425. name: {
  6426. type: String,
  6427. default: ''
  6428. },
  6429. validateEvent: {
  6430. type: Boolean,
  6431. default: true
  6432. },
  6433. id: String
  6434. },
  6435. data: function data() {
  6436. return {
  6437. coreWidth: this.width
  6438. };
  6439. },
  6440. created: function created() {
  6441. if (!~[this.activeValue, this.inactiveValue].indexOf(this.value)) {
  6442. this.$emit('input', this.inactiveValue);
  6443. }
  6444. },
  6445. computed: {
  6446. checked: function checked() {
  6447. return this.value === this.activeValue;
  6448. },
  6449. switchDisabled: function switchDisabled() {
  6450. return this.disabled || (this.elForm || {}).disabled;
  6451. }
  6452. },
  6453. watch: {
  6454. checked: function checked() {
  6455. this.$refs.input.checked = this.checked;
  6456. if (this.activeColor || this.inactiveColor) {
  6457. this.setBackgroundColor();
  6458. }
  6459. if (this.validateEvent) {
  6460. this.dispatch('ElFormItem', 'el.form.change', [this.value]);
  6461. }
  6462. }
  6463. },
  6464. methods: {
  6465. handleChange: function handleChange(event) {
  6466. var _this = this;
  6467. var val = this.checked ? this.inactiveValue : this.activeValue;
  6468. this.$emit('input', val);
  6469. this.$emit('change', val);
  6470. this.$nextTick(function () {
  6471. // set input's checked property
  6472. // in case parent refuses to change component's value
  6473. if (_this.$refs.input) {
  6474. _this.$refs.input.checked = _this.checked;
  6475. }
  6476. });
  6477. },
  6478. setBackgroundColor: function setBackgroundColor() {
  6479. var newColor = this.checked ? this.activeColor : this.inactiveColor;
  6480. this.$refs.core.style.borderColor = newColor;
  6481. this.$refs.core.style.backgroundColor = newColor;
  6482. },
  6483. switchValue: function switchValue() {
  6484. !this.switchDisabled && this.handleChange();
  6485. },
  6486. getMigratingConfig: function getMigratingConfig() {
  6487. return {
  6488. props: {
  6489. 'on-color': 'on-color is renamed to active-color.',
  6490. 'off-color': 'off-color is renamed to inactive-color.',
  6491. 'on-text': 'on-text is renamed to active-text.',
  6492. 'off-text': 'off-text is renamed to inactive-text.',
  6493. 'on-value': 'on-value is renamed to active-value.',
  6494. 'off-value': 'off-value is renamed to inactive-value.',
  6495. 'on-icon-class': 'on-icon-class is renamed to active-icon-class.',
  6496. 'off-icon-class': 'off-icon-class is renamed to inactive-icon-class.'
  6497. }
  6498. };
  6499. }
  6500. },
  6501. mounted: function mounted() {
  6502. /* istanbul ignore if */
  6503. this.coreWidth = this.width || 40;
  6504. if (this.activeColor || this.inactiveColor) {
  6505. this.setBackgroundColor();
  6506. }
  6507. this.$refs.input.checked = this.checked;
  6508. }
  6509. });
  6510. // CONCATENATED MODULE: ./packages/switch/src/component.vue?vue&type=script&lang=js&
  6511. /* harmony default export */ var packages_switch_src_componentvue_type_script_lang_js_ = (switch_src_componentvue_type_script_lang_js_);
  6512. // CONCATENATED MODULE: ./packages/switch/src/component.vue
  6513. /* normalize component */
  6514. var src_component_component = normalizeComponent(
  6515. packages_switch_src_componentvue_type_script_lang_js_,
  6516. componentvue_type_template_id_2dcd8fbb_render,
  6517. componentvue_type_template_id_2dcd8fbb_staticRenderFns,
  6518. false,
  6519. null,
  6520. null,
  6521. null
  6522. )
  6523. /* hot reload */
  6524. if (false) { var src_component_api; }
  6525. src_component_component.options.__file = "packages/switch/src/component.vue"
  6526. /* harmony default export */ var switch_src_component = (src_component_component.exports);
  6527. // CONCATENATED MODULE: ./packages/switch/index.js
  6528. /* istanbul ignore next */
  6529. switch_src_component.install = function (Vue) {
  6530. Vue.component(switch_src_component.name, switch_src_component);
  6531. };
  6532. /* harmony default export */ var packages_switch = (switch_src_component);
  6533. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/select/src/select.vue?vue&type=template&id=0e4aade6&
  6534. var selectvue_type_template_id_0e4aade6_render = function() {
  6535. var _vm = this
  6536. var _h = _vm.$createElement
  6537. var _c = _vm._self._c || _h
  6538. return _c(
  6539. "div",
  6540. {
  6541. directives: [
  6542. {
  6543. name: "clickoutside",
  6544. rawName: "v-clickoutside",
  6545. value: _vm.handleClose,
  6546. expression: "handleClose"
  6547. }
  6548. ],
  6549. staticClass: "el-select",
  6550. class: [_vm.selectSize ? "el-select--" + _vm.selectSize : ""],
  6551. on: {
  6552. click: function($event) {
  6553. $event.stopPropagation()
  6554. return _vm.toggleMenu($event)
  6555. }
  6556. }
  6557. },
  6558. [
  6559. _vm.multiple
  6560. ? _c(
  6561. "div",
  6562. {
  6563. ref: "tags",
  6564. staticClass: "el-select__tags",
  6565. style: { "max-width": _vm.inputWidth - 32 + "px", width: "100%" }
  6566. },
  6567. [
  6568. _vm.collapseTags && _vm.selected.length
  6569. ? _c(
  6570. "span",
  6571. [
  6572. _c(
  6573. "el-tag",
  6574. {
  6575. attrs: {
  6576. closable: !_vm.selectDisabled,
  6577. size: _vm.collapseTagSize,
  6578. hit: _vm.selected[0].hitState,
  6579. type: "info",
  6580. "disable-transitions": ""
  6581. },
  6582. on: {
  6583. close: function($event) {
  6584. _vm.deleteTag($event, _vm.selected[0])
  6585. }
  6586. }
  6587. },
  6588. [
  6589. _c("span", { staticClass: "el-select__tags-text" }, [
  6590. _vm._v(_vm._s(_vm.selected[0].currentLabel))
  6591. ])
  6592. ]
  6593. ),
  6594. _vm.selected.length > 1
  6595. ? _c(
  6596. "el-tag",
  6597. {
  6598. attrs: {
  6599. closable: false,
  6600. size: _vm.collapseTagSize,
  6601. type: "info",
  6602. "disable-transitions": ""
  6603. }
  6604. },
  6605. [
  6606. _c(
  6607. "span",
  6608. { staticClass: "el-select__tags-text" },
  6609. [_vm._v("+ " + _vm._s(_vm.selected.length - 1))]
  6610. )
  6611. ]
  6612. )
  6613. : _vm._e()
  6614. ],
  6615. 1
  6616. )
  6617. : _vm._e(),
  6618. !_vm.collapseTags
  6619. ? _c(
  6620. "transition-group",
  6621. { on: { "after-leave": _vm.resetInputHeight } },
  6622. _vm._l(_vm.selected, function(item) {
  6623. return _c(
  6624. "el-tag",
  6625. {
  6626. key: _vm.getValueKey(item),
  6627. attrs: {
  6628. closable: !_vm.selectDisabled,
  6629. size: _vm.collapseTagSize,
  6630. hit: item.hitState,
  6631. type: "info",
  6632. "disable-transitions": ""
  6633. },
  6634. on: {
  6635. close: function($event) {
  6636. _vm.deleteTag($event, item)
  6637. }
  6638. }
  6639. },
  6640. [
  6641. _c("span", { staticClass: "el-select__tags-text" }, [
  6642. _vm._v(_vm._s(item.currentLabel))
  6643. ])
  6644. ]
  6645. )
  6646. }),
  6647. 1
  6648. )
  6649. : _vm._e(),
  6650. _vm.filterable
  6651. ? _c("input", {
  6652. directives: [
  6653. {
  6654. name: "model",
  6655. rawName: "v-model",
  6656. value: _vm.query,
  6657. expression: "query"
  6658. }
  6659. ],
  6660. ref: "input",
  6661. staticClass: "el-select__input",
  6662. class: [_vm.selectSize ? "is-" + _vm.selectSize : ""],
  6663. style: {
  6664. "flex-grow": "1",
  6665. width: _vm.inputLength / (_vm.inputWidth - 32) + "%",
  6666. "max-width": _vm.inputWidth - 42 + "px"
  6667. },
  6668. attrs: {
  6669. type: "text",
  6670. disabled: _vm.selectDisabled,
  6671. autocomplete: _vm.autoComplete || _vm.autocomplete
  6672. },
  6673. domProps: { value: _vm.query },
  6674. on: {
  6675. focus: _vm.handleFocus,
  6676. blur: function($event) {
  6677. _vm.softFocus = false
  6678. },
  6679. keyup: _vm.managePlaceholder,
  6680. keydown: [
  6681. _vm.resetInputState,
  6682. function($event) {
  6683. if (
  6684. !("button" in $event) &&
  6685. _vm._k($event.keyCode, "down", 40, $event.key, [
  6686. "Down",
  6687. "ArrowDown"
  6688. ])
  6689. ) {
  6690. return null
  6691. }
  6692. $event.preventDefault()
  6693. _vm.handleNavigate("next")
  6694. },
  6695. function($event) {
  6696. if (
  6697. !("button" in $event) &&
  6698. _vm._k($event.keyCode, "up", 38, $event.key, [
  6699. "Up",
  6700. "ArrowUp"
  6701. ])
  6702. ) {
  6703. return null
  6704. }
  6705. $event.preventDefault()
  6706. _vm.handleNavigate("prev")
  6707. },
  6708. function($event) {
  6709. if (
  6710. !("button" in $event) &&
  6711. _vm._k(
  6712. $event.keyCode,
  6713. "enter",
  6714. 13,
  6715. $event.key,
  6716. "Enter"
  6717. )
  6718. ) {
  6719. return null
  6720. }
  6721. $event.preventDefault()
  6722. return _vm.selectOption($event)
  6723. },
  6724. function($event) {
  6725. if (
  6726. !("button" in $event) &&
  6727. _vm._k($event.keyCode, "esc", 27, $event.key, [
  6728. "Esc",
  6729. "Escape"
  6730. ])
  6731. ) {
  6732. return null
  6733. }
  6734. $event.stopPropagation()
  6735. $event.preventDefault()
  6736. _vm.visible = false
  6737. },
  6738. function($event) {
  6739. if (
  6740. !("button" in $event) &&
  6741. _vm._k(
  6742. $event.keyCode,
  6743. "delete",
  6744. [8, 46],
  6745. $event.key,
  6746. ["Backspace", "Delete", "Del"]
  6747. )
  6748. ) {
  6749. return null
  6750. }
  6751. return _vm.deletePrevTag($event)
  6752. },
  6753. function($event) {
  6754. if (
  6755. !("button" in $event) &&
  6756. _vm._k($event.keyCode, "tab", 9, $event.key, "Tab")
  6757. ) {
  6758. return null
  6759. }
  6760. _vm.visible = false
  6761. }
  6762. ],
  6763. compositionstart: _vm.handleComposition,
  6764. compositionupdate: _vm.handleComposition,
  6765. compositionend: _vm.handleComposition,
  6766. input: [
  6767. function($event) {
  6768. if ($event.target.composing) {
  6769. return
  6770. }
  6771. _vm.query = $event.target.value
  6772. },
  6773. _vm.debouncedQueryChange
  6774. ]
  6775. }
  6776. })
  6777. : _vm._e()
  6778. ],
  6779. 1
  6780. )
  6781. : _vm._e(),
  6782. _c(
  6783. "el-input",
  6784. {
  6785. ref: "reference",
  6786. class: { "is-focus": _vm.visible },
  6787. attrs: {
  6788. type: "text",
  6789. placeholder: _vm.currentPlaceholder,
  6790. name: _vm.name,
  6791. id: _vm.id,
  6792. autocomplete: _vm.autoComplete || _vm.autocomplete,
  6793. size: _vm.selectSize,
  6794. disabled: _vm.selectDisabled,
  6795. readonly: _vm.readonly,
  6796. "validate-event": false,
  6797. tabindex: _vm.multiple && _vm.filterable ? "-1" : null
  6798. },
  6799. on: {
  6800. focus: _vm.handleFocus,
  6801. blur: _vm.handleBlur,
  6802. input: _vm.debouncedOnInputChange,
  6803. compositionstart: _vm.handleComposition,
  6804. compositionupdate: _vm.handleComposition,
  6805. compositionend: _vm.handleComposition
  6806. },
  6807. nativeOn: {
  6808. keydown: [
  6809. function($event) {
  6810. if (
  6811. !("button" in $event) &&
  6812. _vm._k($event.keyCode, "down", 40, $event.key, [
  6813. "Down",
  6814. "ArrowDown"
  6815. ])
  6816. ) {
  6817. return null
  6818. }
  6819. $event.stopPropagation()
  6820. $event.preventDefault()
  6821. _vm.handleNavigate("next")
  6822. },
  6823. function($event) {
  6824. if (
  6825. !("button" in $event) &&
  6826. _vm._k($event.keyCode, "up", 38, $event.key, [
  6827. "Up",
  6828. "ArrowUp"
  6829. ])
  6830. ) {
  6831. return null
  6832. }
  6833. $event.stopPropagation()
  6834. $event.preventDefault()
  6835. _vm.handleNavigate("prev")
  6836. },
  6837. function($event) {
  6838. if (
  6839. !("button" in $event) &&
  6840. _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")
  6841. ) {
  6842. return null
  6843. }
  6844. $event.preventDefault()
  6845. return _vm.selectOption($event)
  6846. },
  6847. function($event) {
  6848. if (
  6849. !("button" in $event) &&
  6850. _vm._k($event.keyCode, "esc", 27, $event.key, [
  6851. "Esc",
  6852. "Escape"
  6853. ])
  6854. ) {
  6855. return null
  6856. }
  6857. $event.stopPropagation()
  6858. $event.preventDefault()
  6859. _vm.visible = false
  6860. },
  6861. function($event) {
  6862. if (
  6863. !("button" in $event) &&
  6864. _vm._k($event.keyCode, "tab", 9, $event.key, "Tab")
  6865. ) {
  6866. return null
  6867. }
  6868. _vm.visible = false
  6869. }
  6870. ],
  6871. mouseenter: function($event) {
  6872. _vm.inputHovering = true
  6873. },
  6874. mouseleave: function($event) {
  6875. _vm.inputHovering = false
  6876. }
  6877. },
  6878. model: {
  6879. value: _vm.selectedLabel,
  6880. callback: function($$v) {
  6881. _vm.selectedLabel = $$v
  6882. },
  6883. expression: "selectedLabel"
  6884. }
  6885. },
  6886. [
  6887. _vm.$slots.prefix
  6888. ? _c("template", { slot: "prefix" }, [_vm._t("prefix")], 2)
  6889. : _vm._e(),
  6890. _c("template", { slot: "suffix" }, [
  6891. _c("i", {
  6892. directives: [
  6893. {
  6894. name: "show",
  6895. rawName: "v-show",
  6896. value: !_vm.showClose,
  6897. expression: "!showClose"
  6898. }
  6899. ],
  6900. class: [
  6901. "el-select__caret",
  6902. "el-input__icon",
  6903. "el-icon-" + _vm.iconClass
  6904. ]
  6905. }),
  6906. _vm.showClose
  6907. ? _c("i", {
  6908. staticClass:
  6909. "el-select__caret el-input__icon el-icon-circle-close",
  6910. on: { click: _vm.handleClearClick }
  6911. })
  6912. : _vm._e()
  6913. ])
  6914. ],
  6915. 2
  6916. ),
  6917. _c(
  6918. "transition",
  6919. {
  6920. attrs: { name: "el-zoom-in-top" },
  6921. on: {
  6922. "before-enter": _vm.handleMenuEnter,
  6923. "after-leave": _vm.doDestroy
  6924. }
  6925. },
  6926. [
  6927. _c(
  6928. "el-select-menu",
  6929. {
  6930. directives: [
  6931. {
  6932. name: "show",
  6933. rawName: "v-show",
  6934. value: _vm.visible && _vm.emptyText !== false,
  6935. expression: "visible && emptyText !== false"
  6936. }
  6937. ],
  6938. ref: "popper",
  6939. attrs: { "append-to-body": _vm.popperAppendToBody }
  6940. },
  6941. [
  6942. _c(
  6943. "el-scrollbar",
  6944. {
  6945. directives: [
  6946. {
  6947. name: "show",
  6948. rawName: "v-show",
  6949. value: _vm.options.length > 0 && !_vm.loading,
  6950. expression: "options.length > 0 && !loading"
  6951. }
  6952. ],
  6953. ref: "scrollbar",
  6954. class: {
  6955. "is-empty":
  6956. !_vm.allowCreate &&
  6957. _vm.query &&
  6958. _vm.filteredOptionsCount === 0
  6959. },
  6960. attrs: {
  6961. tag: "ul",
  6962. "wrap-class": "el-select-dropdown__wrap",
  6963. "view-class": "el-select-dropdown__list"
  6964. }
  6965. },
  6966. [
  6967. _vm.showNewOption
  6968. ? _c("el-option", {
  6969. attrs: { value: _vm.query, created: "" }
  6970. })
  6971. : _vm._e(),
  6972. _vm._t("default")
  6973. ],
  6974. 2
  6975. ),
  6976. _vm.emptyText &&
  6977. (!_vm.allowCreate ||
  6978. _vm.loading ||
  6979. (_vm.allowCreate && _vm.options.length === 0))
  6980. ? [
  6981. _vm.$slots.empty
  6982. ? _vm._t("empty")
  6983. : _c("p", { staticClass: "el-select-dropdown__empty" }, [
  6984. _vm._v(
  6985. "\n " +
  6986. _vm._s(_vm.emptyText) +
  6987. "\n "
  6988. )
  6989. ])
  6990. ]
  6991. : _vm._e()
  6992. ],
  6993. 2
  6994. )
  6995. ],
  6996. 1
  6997. )
  6998. ],
  6999. 1
  7000. )
  7001. }
  7002. var selectvue_type_template_id_0e4aade6_staticRenderFns = []
  7003. selectvue_type_template_id_0e4aade6_render._withStripped = true
  7004. // CONCATENATED MODULE: ./packages/select/src/select.vue?vue&type=template&id=0e4aade6&
  7005. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/select/src/select-dropdown.vue?vue&type=template&id=06828748&
  7006. var select_dropdownvue_type_template_id_06828748_render = function() {
  7007. var _vm = this
  7008. var _h = _vm.$createElement
  7009. var _c = _vm._self._c || _h
  7010. return _c(
  7011. "div",
  7012. {
  7013. staticClass: "el-select-dropdown el-popper",
  7014. class: [{ "is-multiple": _vm.$parent.multiple }, _vm.popperClass],
  7015. style: { minWidth: _vm.minWidth }
  7016. },
  7017. [_vm._t("default")],
  7018. 2
  7019. )
  7020. }
  7021. var select_dropdownvue_type_template_id_06828748_staticRenderFns = []
  7022. select_dropdownvue_type_template_id_06828748_render._withStripped = true
  7023. // CONCATENATED MODULE: ./packages/select/src/select-dropdown.vue?vue&type=template&id=06828748&
  7024. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/select/src/select-dropdown.vue?vue&type=script&lang=js&
  7025. //
  7026. //
  7027. //
  7028. //
  7029. //
  7030. //
  7031. //
  7032. //
  7033. //
  7034. /* harmony default export */ var select_dropdownvue_type_script_lang_js_ = ({
  7035. name: 'ElSelectDropdown',
  7036. componentName: 'ElSelectDropdown',
  7037. mixins: [vue_popper_default.a],
  7038. props: {
  7039. placement: {
  7040. default: 'bottom-start'
  7041. },
  7042. boundariesPadding: {
  7043. default: 0
  7044. },
  7045. popperOptions: {
  7046. default: function _default() {
  7047. return {
  7048. gpuAcceleration: false
  7049. };
  7050. }
  7051. },
  7052. visibleArrow: {
  7053. default: true
  7054. },
  7055. appendToBody: {
  7056. type: Boolean,
  7057. default: true
  7058. }
  7059. },
  7060. data: function data() {
  7061. return {
  7062. minWidth: ''
  7063. };
  7064. },
  7065. computed: {
  7066. popperClass: function popperClass() {
  7067. return this.$parent.popperClass;
  7068. }
  7069. },
  7070. watch: {
  7071. '$parent.inputWidth': function $parentInputWidth() {
  7072. this.minWidth = this.$parent.$el.getBoundingClientRect().width + 'px';
  7073. }
  7074. },
  7075. mounted: function mounted() {
  7076. var _this = this;
  7077. this.referenceElm = this.$parent.$refs.reference.$el;
  7078. this.$parent.popperElm = this.popperElm = this.$el;
  7079. this.$on('updatePopper', function () {
  7080. if (_this.$parent.visible) _this.updatePopper();
  7081. });
  7082. this.$on('destroyPopper', this.destroyPopper);
  7083. }
  7084. });
  7085. // CONCATENATED MODULE: ./packages/select/src/select-dropdown.vue?vue&type=script&lang=js&
  7086. /* harmony default export */ var src_select_dropdownvue_type_script_lang_js_ = (select_dropdownvue_type_script_lang_js_);
  7087. // CONCATENATED MODULE: ./packages/select/src/select-dropdown.vue
  7088. /* normalize component */
  7089. var select_dropdown_component = normalizeComponent(
  7090. src_select_dropdownvue_type_script_lang_js_,
  7091. select_dropdownvue_type_template_id_06828748_render,
  7092. select_dropdownvue_type_template_id_06828748_staticRenderFns,
  7093. false,
  7094. null,
  7095. null,
  7096. null
  7097. )
  7098. /* hot reload */
  7099. if (false) { var select_dropdown_api; }
  7100. select_dropdown_component.options.__file = "packages/select/src/select-dropdown.vue"
  7101. /* harmony default export */ var select_dropdown = (select_dropdown_component.exports);
  7102. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/select/src/option.vue?vue&type=template&id=7a44c642&
  7103. var optionvue_type_template_id_7a44c642_render = function() {
  7104. var _vm = this
  7105. var _h = _vm.$createElement
  7106. var _c = _vm._self._c || _h
  7107. return _c(
  7108. "li",
  7109. {
  7110. directives: [
  7111. {
  7112. name: "show",
  7113. rawName: "v-show",
  7114. value: _vm.visible,
  7115. expression: "visible"
  7116. }
  7117. ],
  7118. staticClass: "el-select-dropdown__item",
  7119. class: {
  7120. selected: _vm.itemSelected,
  7121. "is-disabled": _vm.disabled || _vm.groupDisabled || _vm.limitReached,
  7122. hover: _vm.hover
  7123. },
  7124. on: {
  7125. mouseenter: _vm.hoverItem,
  7126. click: function($event) {
  7127. $event.stopPropagation()
  7128. return _vm.selectOptionClick($event)
  7129. }
  7130. }
  7131. },
  7132. [_vm._t("default", [_c("span", [_vm._v(_vm._s(_vm.currentLabel))])])],
  7133. 2
  7134. )
  7135. }
  7136. var optionvue_type_template_id_7a44c642_staticRenderFns = []
  7137. optionvue_type_template_id_7a44c642_render._withStripped = true
  7138. // CONCATENATED MODULE: ./packages/select/src/option.vue?vue&type=template&id=7a44c642&
  7139. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/select/src/option.vue?vue&type=script&lang=js&
  7140. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  7141. //
  7142. //
  7143. //
  7144. //
  7145. //
  7146. //
  7147. //
  7148. //
  7149. //
  7150. //
  7151. //
  7152. //
  7153. //
  7154. //
  7155. //
  7156. //
  7157. //
  7158. /* harmony default export */ var optionvue_type_script_lang_js_ = ({
  7159. mixins: [emitter_default.a],
  7160. name: 'ElOption',
  7161. componentName: 'ElOption',
  7162. inject: ['select'],
  7163. props: {
  7164. value: {
  7165. required: true
  7166. },
  7167. label: [String, Number],
  7168. created: Boolean,
  7169. disabled: {
  7170. type: Boolean,
  7171. default: false
  7172. }
  7173. },
  7174. data: function data() {
  7175. return {
  7176. index: -1,
  7177. groupDisabled: false,
  7178. visible: true,
  7179. hitState: false,
  7180. hover: false
  7181. };
  7182. },
  7183. computed: {
  7184. isObject: function isObject() {
  7185. return Object.prototype.toString.call(this.value).toLowerCase() === '[object object]';
  7186. },
  7187. currentLabel: function currentLabel() {
  7188. return this.label || (this.isObject ? '' : this.value);
  7189. },
  7190. currentValue: function currentValue() {
  7191. return this.value || this.label || '';
  7192. },
  7193. itemSelected: function itemSelected() {
  7194. if (!this.select.multiple) {
  7195. return this.isEqual(this.value, this.select.value);
  7196. } else {
  7197. return this.contains(this.select.value, this.value);
  7198. }
  7199. },
  7200. limitReached: function limitReached() {
  7201. if (this.select.multiple) {
  7202. return !this.itemSelected && (this.select.value || []).length >= this.select.multipleLimit && this.select.multipleLimit > 0;
  7203. } else {
  7204. return false;
  7205. }
  7206. }
  7207. },
  7208. watch: {
  7209. currentLabel: function currentLabel() {
  7210. if (!this.created && !this.select.remote) this.dispatch('ElSelect', 'setSelected');
  7211. },
  7212. value: function value(val, oldVal) {
  7213. var _select = this.select,
  7214. remote = _select.remote,
  7215. valueKey = _select.valueKey;
  7216. if (!this.created && !remote) {
  7217. if (valueKey && (typeof val === 'undefined' ? 'undefined' : _typeof(val)) === 'object' && (typeof oldVal === 'undefined' ? 'undefined' : _typeof(oldVal)) === 'object' && val[valueKey] === oldVal[valueKey]) {
  7218. return;
  7219. }
  7220. this.dispatch('ElSelect', 'setSelected');
  7221. }
  7222. }
  7223. },
  7224. methods: {
  7225. isEqual: function isEqual(a, b) {
  7226. if (!this.isObject) {
  7227. return a === b;
  7228. } else {
  7229. var valueKey = this.select.valueKey;
  7230. return Object(util_["getValueByPath"])(a, valueKey) === Object(util_["getValueByPath"])(b, valueKey);
  7231. }
  7232. },
  7233. contains: function contains() {
  7234. var arr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  7235. var target = arguments[1];
  7236. if (!this.isObject) {
  7237. return arr && arr.indexOf(target) > -1;
  7238. } else {
  7239. var valueKey = this.select.valueKey;
  7240. return arr && arr.some(function (item) {
  7241. return Object(util_["getValueByPath"])(item, valueKey) === Object(util_["getValueByPath"])(target, valueKey);
  7242. });
  7243. }
  7244. },
  7245. handleGroupDisabled: function handleGroupDisabled(val) {
  7246. this.groupDisabled = val;
  7247. },
  7248. hoverItem: function hoverItem() {
  7249. if (!this.disabled && !this.groupDisabled) {
  7250. this.select.hoverIndex = this.select.options.indexOf(this);
  7251. }
  7252. },
  7253. selectOptionClick: function selectOptionClick() {
  7254. if (this.disabled !== true && this.groupDisabled !== true) {
  7255. this.dispatch('ElSelect', 'handleOptionClick', [this, true]);
  7256. }
  7257. },
  7258. queryChange: function queryChange(query) {
  7259. this.visible = new RegExp(Object(util_["escapeRegexpString"])(query), 'i').test(this.currentLabel) || this.created;
  7260. if (!this.visible) {
  7261. this.select.filteredOptionsCount--;
  7262. }
  7263. }
  7264. },
  7265. created: function created() {
  7266. this.select.options.push(this);
  7267. this.select.cachedOptions.push(this);
  7268. this.select.optionsCount++;
  7269. this.select.filteredOptionsCount++;
  7270. this.$on('queryChange', this.queryChange);
  7271. this.$on('handleGroupDisabled', this.handleGroupDisabled);
  7272. },
  7273. beforeDestroy: function beforeDestroy() {
  7274. var _select2 = this.select,
  7275. selected = _select2.selected,
  7276. multiple = _select2.multiple;
  7277. var selectedOptions = multiple ? selected : [selected];
  7278. var index = this.select.cachedOptions.indexOf(this);
  7279. var selectedIndex = selectedOptions.indexOf(this);
  7280. // if option is not selected, remove it from cache
  7281. if (index > -1 && selectedIndex < 0) {
  7282. this.select.cachedOptions.splice(index, 1);
  7283. }
  7284. this.select.onOptionDestroy(this.select.options.indexOf(this));
  7285. }
  7286. });
  7287. // CONCATENATED MODULE: ./packages/select/src/option.vue?vue&type=script&lang=js&
  7288. /* harmony default export */ var src_optionvue_type_script_lang_js_ = (optionvue_type_script_lang_js_);
  7289. // CONCATENATED MODULE: ./packages/select/src/option.vue
  7290. /* normalize component */
  7291. var option_component = normalizeComponent(
  7292. src_optionvue_type_script_lang_js_,
  7293. optionvue_type_template_id_7a44c642_render,
  7294. optionvue_type_template_id_7a44c642_staticRenderFns,
  7295. false,
  7296. null,
  7297. null,
  7298. null
  7299. )
  7300. /* hot reload */
  7301. if (false) { var option_api; }
  7302. option_component.options.__file = "packages/select/src/option.vue"
  7303. /* harmony default export */ var src_option = (option_component.exports);
  7304. // EXTERNAL MODULE: external "element-ui/lib/tag"
  7305. var tag_ = __webpack_require__(30);
  7306. var tag_default = /*#__PURE__*/__webpack_require__.n(tag_);
  7307. // EXTERNAL MODULE: external "element-ui/lib/utils/resize-event"
  7308. var resize_event_ = __webpack_require__(15);
  7309. // EXTERNAL MODULE: external "element-ui/lib/utils/scroll-into-view"
  7310. var scroll_into_view_ = __webpack_require__(27);
  7311. var scroll_into_view_default = /*#__PURE__*/__webpack_require__.n(scroll_into_view_);
  7312. // CONCATENATED MODULE: ./packages/select/src/navigation-mixin.js
  7313. /* harmony default export */ var navigation_mixin = ({
  7314. data: function data() {
  7315. return {
  7316. hoverOption: -1
  7317. };
  7318. },
  7319. computed: {
  7320. optionsAllDisabled: function optionsAllDisabled() {
  7321. return this.options.filter(function (option) {
  7322. return option.visible;
  7323. }).every(function (option) {
  7324. return option.disabled;
  7325. });
  7326. }
  7327. },
  7328. watch: {
  7329. hoverIndex: function hoverIndex(val) {
  7330. var _this = this;
  7331. if (typeof val === 'number' && val > -1) {
  7332. this.hoverOption = this.options[val] || {};
  7333. }
  7334. this.options.forEach(function (option) {
  7335. option.hover = _this.hoverOption === option;
  7336. });
  7337. }
  7338. },
  7339. methods: {
  7340. navigateOptions: function navigateOptions(direction) {
  7341. var _this2 = this;
  7342. if (!this.visible) {
  7343. this.visible = true;
  7344. return;
  7345. }
  7346. if (this.options.length === 0 || this.filteredOptionsCount === 0) return;
  7347. if (!this.optionsAllDisabled) {
  7348. if (direction === 'next') {
  7349. this.hoverIndex++;
  7350. if (this.hoverIndex === this.options.length) {
  7351. this.hoverIndex = 0;
  7352. }
  7353. } else if (direction === 'prev') {
  7354. this.hoverIndex--;
  7355. if (this.hoverIndex < 0) {
  7356. this.hoverIndex = this.options.length - 1;
  7357. }
  7358. }
  7359. var option = this.options[this.hoverIndex];
  7360. if (option.disabled === true || option.groupDisabled === true || !option.visible) {
  7361. this.navigateOptions(direction);
  7362. }
  7363. this.$nextTick(function () {
  7364. return _this2.scrollToOption(_this2.hoverOption);
  7365. });
  7366. }
  7367. }
  7368. }
  7369. });
  7370. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/select/src/select.vue?vue&type=script&lang=js&
  7371. //
  7372. //
  7373. //
  7374. //
  7375. //
  7376. //
  7377. //
  7378. //
  7379. //
  7380. //
  7381. //
  7382. //
  7383. //
  7384. //
  7385. //
  7386. //
  7387. //
  7388. //
  7389. //
  7390. //
  7391. //
  7392. //
  7393. //
  7394. //
  7395. //
  7396. //
  7397. //
  7398. //
  7399. //
  7400. //
  7401. //
  7402. //
  7403. //
  7404. //
  7405. //
  7406. //
  7407. //
  7408. //
  7409. //
  7410. //
  7411. //
  7412. //
  7413. //
  7414. //
  7415. //
  7416. //
  7417. //
  7418. //
  7419. //
  7420. //
  7421. //
  7422. //
  7423. //
  7424. //
  7425. //
  7426. //
  7427. //
  7428. //
  7429. //
  7430. //
  7431. //
  7432. //
  7433. //
  7434. //
  7435. //
  7436. //
  7437. //
  7438. //
  7439. //
  7440. //
  7441. //
  7442. //
  7443. //
  7444. //
  7445. //
  7446. //
  7447. //
  7448. //
  7449. //
  7450. //
  7451. //
  7452. //
  7453. //
  7454. //
  7455. //
  7456. //
  7457. //
  7458. //
  7459. //
  7460. //
  7461. //
  7462. //
  7463. //
  7464. //
  7465. //
  7466. //
  7467. //
  7468. //
  7469. //
  7470. //
  7471. //
  7472. //
  7473. //
  7474. //
  7475. //
  7476. //
  7477. //
  7478. //
  7479. //
  7480. //
  7481. //
  7482. //
  7483. //
  7484. //
  7485. //
  7486. //
  7487. //
  7488. //
  7489. //
  7490. //
  7491. //
  7492. //
  7493. //
  7494. //
  7495. //
  7496. //
  7497. //
  7498. //
  7499. //
  7500. //
  7501. //
  7502. //
  7503. //
  7504. //
  7505. //
  7506. //
  7507. //
  7508. /* harmony default export */ var selectvue_type_script_lang_js_ = ({
  7509. mixins: [emitter_default.a, locale_default.a, focus_default()('reference'), navigation_mixin],
  7510. name: 'ElSelect',
  7511. componentName: 'ElSelect',
  7512. inject: {
  7513. elForm: {
  7514. default: ''
  7515. },
  7516. elFormItem: {
  7517. default: ''
  7518. }
  7519. },
  7520. provide: function provide() {
  7521. return {
  7522. 'select': this
  7523. };
  7524. },
  7525. computed: {
  7526. _elFormItemSize: function _elFormItemSize() {
  7527. return (this.elFormItem || {}).elFormItemSize;
  7528. },
  7529. readonly: function readonly() {
  7530. return !this.filterable || this.multiple || !Object(util_["isIE"])() && !Object(util_["isEdge"])() && !this.visible;
  7531. },
  7532. showClose: function showClose() {
  7533. var hasValue = this.multiple ? Array.isArray(this.value) && this.value.length > 0 : this.value !== undefined && this.value !== null && this.value !== '';
  7534. var criteria = this.clearable && !this.selectDisabled && this.inputHovering && hasValue;
  7535. return criteria;
  7536. },
  7537. iconClass: function iconClass() {
  7538. return this.remote && this.filterable ? '' : this.visible ? 'arrow-up is-reverse' : 'arrow-up';
  7539. },
  7540. debounce: function debounce() {
  7541. return this.remote ? 300 : 0;
  7542. },
  7543. emptyText: function emptyText() {
  7544. if (this.loading) {
  7545. return this.loadingText || this.t('el.select.loading');
  7546. } else {
  7547. if (this.remote && this.query === '' && this.options.length === 0) return false;
  7548. if (this.filterable && this.query && this.options.length > 0 && this.filteredOptionsCount === 0) {
  7549. return this.noMatchText || this.t('el.select.noMatch');
  7550. }
  7551. if (this.options.length === 0) {
  7552. return this.noDataText || this.t('el.select.noData');
  7553. }
  7554. }
  7555. return null;
  7556. },
  7557. showNewOption: function showNewOption() {
  7558. var _this = this;
  7559. var hasExistingOption = this.options.filter(function (option) {
  7560. return !option.created;
  7561. }).some(function (option) {
  7562. return option.currentLabel === _this.query;
  7563. });
  7564. return this.filterable && this.allowCreate && this.query !== '' && !hasExistingOption;
  7565. },
  7566. selectSize: function selectSize() {
  7567. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  7568. },
  7569. selectDisabled: function selectDisabled() {
  7570. return this.disabled || (this.elForm || {}).disabled;
  7571. },
  7572. collapseTagSize: function collapseTagSize() {
  7573. return ['small', 'mini'].indexOf(this.selectSize) > -1 ? 'mini' : 'small';
  7574. },
  7575. propPlaceholder: function propPlaceholder() {
  7576. return typeof this.placeholder !== 'undefined' ? this.placeholder : this.t('el.select.placeholder');
  7577. }
  7578. },
  7579. components: {
  7580. ElInput: input_default.a,
  7581. ElSelectMenu: select_dropdown,
  7582. ElOption: src_option,
  7583. ElTag: tag_default.a,
  7584. ElScrollbar: scrollbar_default.a
  7585. },
  7586. directives: { Clickoutside: clickoutside_default.a },
  7587. props: {
  7588. name: String,
  7589. id: String,
  7590. value: {
  7591. required: true
  7592. },
  7593. autocomplete: {
  7594. type: String,
  7595. default: 'off'
  7596. },
  7597. /** @Deprecated in next major version */
  7598. autoComplete: {
  7599. type: String,
  7600. validator: function validator(val) {
  7601. false && false;
  7602. return true;
  7603. }
  7604. },
  7605. automaticDropdown: Boolean,
  7606. size: String,
  7607. disabled: Boolean,
  7608. clearable: Boolean,
  7609. filterable: Boolean,
  7610. allowCreate: Boolean,
  7611. loading: Boolean,
  7612. popperClass: String,
  7613. remote: Boolean,
  7614. loadingText: String,
  7615. noMatchText: String,
  7616. noDataText: String,
  7617. remoteMethod: Function,
  7618. filterMethod: Function,
  7619. multiple: Boolean,
  7620. multipleLimit: {
  7621. type: Number,
  7622. default: 0
  7623. },
  7624. placeholder: {
  7625. type: String,
  7626. required: false
  7627. },
  7628. defaultFirstOption: Boolean,
  7629. reserveKeyword: Boolean,
  7630. valueKey: {
  7631. type: String,
  7632. default: 'value'
  7633. },
  7634. collapseTags: Boolean,
  7635. popperAppendToBody: {
  7636. type: Boolean,
  7637. default: true
  7638. }
  7639. },
  7640. data: function data() {
  7641. return {
  7642. options: [],
  7643. cachedOptions: [],
  7644. createdLabel: null,
  7645. createdSelected: false,
  7646. selected: this.multiple ? [] : {},
  7647. inputLength: 20,
  7648. inputWidth: 0,
  7649. initialInputHeight: 0,
  7650. cachedPlaceHolder: '',
  7651. optionsCount: 0,
  7652. filteredOptionsCount: 0,
  7653. visible: false,
  7654. softFocus: false,
  7655. selectedLabel: '',
  7656. hoverIndex: -1,
  7657. query: '',
  7658. previousQuery: null,
  7659. inputHovering: false,
  7660. currentPlaceholder: '',
  7661. menuVisibleOnFocus: false,
  7662. isOnComposition: false,
  7663. isSilentBlur: false
  7664. };
  7665. },
  7666. watch: {
  7667. selectDisabled: function selectDisabled() {
  7668. var _this2 = this;
  7669. this.$nextTick(function () {
  7670. _this2.resetInputHeight();
  7671. });
  7672. },
  7673. propPlaceholder: function propPlaceholder(val) {
  7674. this.cachedPlaceHolder = this.currentPlaceholder = val;
  7675. },
  7676. value: function value(val, oldVal) {
  7677. if (this.multiple) {
  7678. this.resetInputHeight();
  7679. if (val && val.length > 0 || this.$refs.input && this.query !== '') {
  7680. this.currentPlaceholder = '';
  7681. } else {
  7682. this.currentPlaceholder = this.cachedPlaceHolder;
  7683. }
  7684. if (this.filterable && !this.reserveKeyword) {
  7685. this.query = '';
  7686. this.handleQueryChange(this.query);
  7687. }
  7688. }
  7689. this.setSelected();
  7690. if (this.filterable && !this.multiple) {
  7691. this.inputLength = 20;
  7692. }
  7693. if (!Object(util_["valueEquals"])(val, oldVal)) {
  7694. this.dispatch('ElFormItem', 'el.form.change', val);
  7695. }
  7696. },
  7697. visible: function visible(val) {
  7698. var _this3 = this;
  7699. if (!val) {
  7700. this.broadcast('ElSelectDropdown', 'destroyPopper');
  7701. if (this.$refs.input) {
  7702. this.$refs.input.blur();
  7703. }
  7704. this.query = '';
  7705. this.previousQuery = null;
  7706. this.selectedLabel = '';
  7707. this.inputLength = 20;
  7708. this.menuVisibleOnFocus = false;
  7709. this.resetHoverIndex();
  7710. this.$nextTick(function () {
  7711. if (_this3.$refs.input && _this3.$refs.input.value === '' && _this3.selected.length === 0) {
  7712. _this3.currentPlaceholder = _this3.cachedPlaceHolder;
  7713. }
  7714. });
  7715. if (!this.multiple) {
  7716. if (this.selected) {
  7717. if (this.filterable && this.allowCreate && this.createdSelected && this.createdLabel) {
  7718. this.selectedLabel = this.createdLabel;
  7719. } else {
  7720. this.selectedLabel = this.selected.currentLabel;
  7721. }
  7722. if (this.filterable) this.query = this.selectedLabel;
  7723. }
  7724. if (this.filterable) {
  7725. this.currentPlaceholder = this.cachedPlaceHolder;
  7726. }
  7727. }
  7728. } else {
  7729. this.broadcast('ElSelectDropdown', 'updatePopper');
  7730. if (this.filterable) {
  7731. this.query = this.remote ? '' : this.selectedLabel;
  7732. this.handleQueryChange(this.query);
  7733. if (this.multiple) {
  7734. this.$refs.input.focus();
  7735. } else {
  7736. if (!this.remote) {
  7737. this.broadcast('ElOption', 'queryChange', '');
  7738. this.broadcast('ElOptionGroup', 'queryChange');
  7739. }
  7740. if (this.selectedLabel) {
  7741. this.currentPlaceholder = this.selectedLabel;
  7742. this.selectedLabel = '';
  7743. }
  7744. }
  7745. }
  7746. }
  7747. this.$emit('visible-change', val);
  7748. },
  7749. options: function options() {
  7750. var _this4 = this;
  7751. if (this.$isServer) return;
  7752. this.$nextTick(function () {
  7753. _this4.broadcast('ElSelectDropdown', 'updatePopper');
  7754. });
  7755. if (this.multiple) {
  7756. this.resetInputHeight();
  7757. }
  7758. var inputs = this.$el.querySelectorAll('input');
  7759. if ([].indexOf.call(inputs, document.activeElement) === -1) {
  7760. this.setSelected();
  7761. }
  7762. if (this.defaultFirstOption && (this.filterable || this.remote) && this.filteredOptionsCount) {
  7763. this.checkDefaultFirstOption();
  7764. }
  7765. }
  7766. },
  7767. methods: {
  7768. handleNavigate: function handleNavigate(direction) {
  7769. if (this.isOnComposition) return;
  7770. this.navigateOptions(direction);
  7771. },
  7772. handleComposition: function handleComposition(event) {
  7773. var _this5 = this;
  7774. var text = event.target.value;
  7775. if (event.type === 'compositionend') {
  7776. this.isOnComposition = false;
  7777. this.$nextTick(function (_) {
  7778. return _this5.handleQueryChange(text);
  7779. });
  7780. } else {
  7781. var lastCharacter = text[text.length - 1] || '';
  7782. this.isOnComposition = !Object(shared_["isKorean"])(lastCharacter);
  7783. }
  7784. },
  7785. handleQueryChange: function handleQueryChange(val) {
  7786. var _this6 = this;
  7787. if (this.previousQuery === val || this.isOnComposition) return;
  7788. if (this.previousQuery === null && (typeof this.filterMethod === 'function' || typeof this.remoteMethod === 'function')) {
  7789. this.previousQuery = val;
  7790. return;
  7791. }
  7792. this.previousQuery = val;
  7793. this.$nextTick(function () {
  7794. if (_this6.visible) _this6.broadcast('ElSelectDropdown', 'updatePopper');
  7795. });
  7796. this.hoverIndex = -1;
  7797. if (this.multiple && this.filterable) {
  7798. this.$nextTick(function () {
  7799. var length = _this6.$refs.input.value.length * 15 + 20;
  7800. _this6.inputLength = _this6.collapseTags ? Math.min(50, length) : length;
  7801. _this6.managePlaceholder();
  7802. _this6.resetInputHeight();
  7803. });
  7804. }
  7805. if (this.remote && typeof this.remoteMethod === 'function') {
  7806. this.hoverIndex = -1;
  7807. this.remoteMethod(val);
  7808. } else if (typeof this.filterMethod === 'function') {
  7809. this.filterMethod(val);
  7810. this.broadcast('ElOptionGroup', 'queryChange');
  7811. } else {
  7812. this.filteredOptionsCount = this.optionsCount;
  7813. this.broadcast('ElOption', 'queryChange', val);
  7814. this.broadcast('ElOptionGroup', 'queryChange');
  7815. }
  7816. if (this.defaultFirstOption && (this.filterable || this.remote) && this.filteredOptionsCount) {
  7817. this.checkDefaultFirstOption();
  7818. }
  7819. },
  7820. scrollToOption: function scrollToOption(option) {
  7821. var target = Array.isArray(option) && option[0] ? option[0].$el : option.$el;
  7822. if (this.$refs.popper && target) {
  7823. var menu = this.$refs.popper.$el.querySelector('.el-select-dropdown__wrap');
  7824. scroll_into_view_default()(menu, target);
  7825. }
  7826. this.$refs.scrollbar && this.$refs.scrollbar.handleScroll();
  7827. },
  7828. handleMenuEnter: function handleMenuEnter() {
  7829. var _this7 = this;
  7830. this.$nextTick(function () {
  7831. return _this7.scrollToOption(_this7.selected);
  7832. });
  7833. },
  7834. emitChange: function emitChange(val) {
  7835. if (!Object(util_["valueEquals"])(this.value, val)) {
  7836. this.$emit('change', val);
  7837. }
  7838. },
  7839. getOption: function getOption(value) {
  7840. var option = void 0;
  7841. var isObject = Object.prototype.toString.call(value).toLowerCase() === '[object object]';
  7842. var isNull = Object.prototype.toString.call(value).toLowerCase() === '[object null]';
  7843. var isUndefined = Object.prototype.toString.call(value).toLowerCase() === '[object undefined]';
  7844. for (var i = this.cachedOptions.length - 1; i >= 0; i--) {
  7845. var cachedOption = this.cachedOptions[i];
  7846. var isEqual = isObject ? Object(util_["getValueByPath"])(cachedOption.value, this.valueKey) === Object(util_["getValueByPath"])(value, this.valueKey) : cachedOption.value === value;
  7847. if (isEqual) {
  7848. option = cachedOption;
  7849. break;
  7850. }
  7851. }
  7852. if (option) return option;
  7853. var label = !isObject && !isNull && !isUndefined ? String(value) : '';
  7854. var newOption = {
  7855. value: value,
  7856. currentLabel: label
  7857. };
  7858. if (this.multiple) {
  7859. newOption.hitState = false;
  7860. }
  7861. return newOption;
  7862. },
  7863. setSelected: function setSelected() {
  7864. var _this8 = this;
  7865. if (!this.multiple) {
  7866. var option = this.getOption(this.value);
  7867. if (option.created) {
  7868. this.createdLabel = option.currentLabel;
  7869. this.createdSelected = true;
  7870. } else {
  7871. this.createdSelected = false;
  7872. }
  7873. this.selectedLabel = option.currentLabel;
  7874. this.selected = option;
  7875. if (this.filterable) this.query = this.selectedLabel;
  7876. return;
  7877. }
  7878. var result = [];
  7879. if (Array.isArray(this.value)) {
  7880. this.value.forEach(function (value) {
  7881. result.push(_this8.getOption(value));
  7882. });
  7883. }
  7884. this.selected = result;
  7885. this.$nextTick(function () {
  7886. _this8.resetInputHeight();
  7887. });
  7888. },
  7889. handleFocus: function handleFocus(event) {
  7890. if (!this.softFocus) {
  7891. if (this.automaticDropdown || this.filterable) {
  7892. if (this.filterable && !this.visible) {
  7893. this.menuVisibleOnFocus = true;
  7894. }
  7895. this.visible = true;
  7896. }
  7897. this.$emit('focus', event);
  7898. } else {
  7899. this.softFocus = false;
  7900. }
  7901. },
  7902. blur: function blur() {
  7903. this.visible = false;
  7904. this.$refs.reference.blur();
  7905. },
  7906. handleBlur: function handleBlur(event) {
  7907. var _this9 = this;
  7908. setTimeout(function () {
  7909. if (_this9.isSilentBlur) {
  7910. _this9.isSilentBlur = false;
  7911. } else {
  7912. _this9.$emit('blur', event);
  7913. }
  7914. }, 50);
  7915. this.softFocus = false;
  7916. },
  7917. handleClearClick: function handleClearClick(event) {
  7918. this.deleteSelected(event);
  7919. },
  7920. doDestroy: function doDestroy() {
  7921. this.$refs.popper && this.$refs.popper.doDestroy();
  7922. },
  7923. handleClose: function handleClose() {
  7924. this.visible = false;
  7925. },
  7926. toggleLastOptionHitState: function toggleLastOptionHitState(hit) {
  7927. if (!Array.isArray(this.selected)) return;
  7928. var option = this.selected[this.selected.length - 1];
  7929. if (!option) return;
  7930. if (hit === true || hit === false) {
  7931. option.hitState = hit;
  7932. return hit;
  7933. }
  7934. option.hitState = !option.hitState;
  7935. return option.hitState;
  7936. },
  7937. deletePrevTag: function deletePrevTag(e) {
  7938. if (e.target.value.length <= 0 && !this.toggleLastOptionHitState()) {
  7939. var value = this.value.slice();
  7940. value.pop();
  7941. this.$emit('input', value);
  7942. this.emitChange(value);
  7943. }
  7944. },
  7945. managePlaceholder: function managePlaceholder() {
  7946. if (this.currentPlaceholder !== '') {
  7947. this.currentPlaceholder = this.$refs.input.value ? '' : this.cachedPlaceHolder;
  7948. }
  7949. },
  7950. resetInputState: function resetInputState(e) {
  7951. if (e.keyCode !== 8) this.toggleLastOptionHitState(false);
  7952. this.inputLength = this.$refs.input.value.length * 15 + 20;
  7953. this.resetInputHeight();
  7954. },
  7955. resetInputHeight: function resetInputHeight() {
  7956. var _this10 = this;
  7957. if (this.collapseTags && !this.filterable) return;
  7958. this.$nextTick(function () {
  7959. if (!_this10.$refs.reference) return;
  7960. var inputChildNodes = _this10.$refs.reference.$el.childNodes;
  7961. var input = [].filter.call(inputChildNodes, function (item) {
  7962. return item.tagName === 'INPUT';
  7963. })[0];
  7964. var tags = _this10.$refs.tags;
  7965. var tagsHeight = tags ? Math.round(tags.getBoundingClientRect().height) : 0;
  7966. var sizeInMap = _this10.initialInputHeight || 40;
  7967. input.style.height = _this10.selected.length === 0 ? sizeInMap + 'px' : Math.max(tags ? tagsHeight + (tagsHeight > sizeInMap ? 6 : 0) : 0, sizeInMap) + 'px';
  7968. if (_this10.visible && _this10.emptyText !== false) {
  7969. _this10.broadcast('ElSelectDropdown', 'updatePopper');
  7970. }
  7971. });
  7972. },
  7973. resetHoverIndex: function resetHoverIndex() {
  7974. var _this11 = this;
  7975. setTimeout(function () {
  7976. if (!_this11.multiple) {
  7977. _this11.hoverIndex = _this11.options.indexOf(_this11.selected);
  7978. } else {
  7979. if (_this11.selected.length > 0) {
  7980. _this11.hoverIndex = Math.min.apply(null, _this11.selected.map(function (item) {
  7981. return _this11.options.indexOf(item);
  7982. }));
  7983. } else {
  7984. _this11.hoverIndex = -1;
  7985. }
  7986. }
  7987. }, 300);
  7988. },
  7989. handleOptionSelect: function handleOptionSelect(option, byClick) {
  7990. var _this12 = this;
  7991. if (this.multiple) {
  7992. var value = (this.value || []).slice();
  7993. var optionIndex = this.getValueIndex(value, option.value);
  7994. if (optionIndex > -1) {
  7995. value.splice(optionIndex, 1);
  7996. } else if (this.multipleLimit <= 0 || value.length < this.multipleLimit) {
  7997. value.push(option.value);
  7998. }
  7999. this.$emit('input', value);
  8000. this.emitChange(value);
  8001. if (option.created) {
  8002. this.query = '';
  8003. this.handleQueryChange('');
  8004. this.inputLength = 20;
  8005. }
  8006. if (this.filterable) this.$refs.input.focus();
  8007. } else {
  8008. this.$emit('input', option.value);
  8009. this.emitChange(option.value);
  8010. this.visible = false;
  8011. }
  8012. this.isSilentBlur = byClick;
  8013. this.setSoftFocus();
  8014. if (this.visible) return;
  8015. this.$nextTick(function () {
  8016. _this12.scrollToOption(option);
  8017. });
  8018. },
  8019. setSoftFocus: function setSoftFocus() {
  8020. this.softFocus = true;
  8021. var input = this.$refs.input || this.$refs.reference;
  8022. if (input) {
  8023. input.focus();
  8024. }
  8025. },
  8026. getValueIndex: function getValueIndex() {
  8027. var arr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  8028. var value = arguments[1];
  8029. var isObject = Object.prototype.toString.call(value).toLowerCase() === '[object object]';
  8030. if (!isObject) {
  8031. return arr.indexOf(value);
  8032. } else {
  8033. var valueKey = this.valueKey;
  8034. var index = -1;
  8035. arr.some(function (item, i) {
  8036. if (Object(util_["getValueByPath"])(item, valueKey) === Object(util_["getValueByPath"])(value, valueKey)) {
  8037. index = i;
  8038. return true;
  8039. }
  8040. return false;
  8041. });
  8042. return index;
  8043. }
  8044. },
  8045. toggleMenu: function toggleMenu() {
  8046. if (!this.selectDisabled) {
  8047. if (this.menuVisibleOnFocus) {
  8048. this.menuVisibleOnFocus = false;
  8049. } else {
  8050. this.visible = !this.visible;
  8051. }
  8052. if (this.visible) {
  8053. (this.$refs.input || this.$refs.reference).focus();
  8054. }
  8055. }
  8056. },
  8057. selectOption: function selectOption() {
  8058. if (!this.visible) {
  8059. this.toggleMenu();
  8060. } else {
  8061. if (this.options[this.hoverIndex]) {
  8062. this.handleOptionSelect(this.options[this.hoverIndex]);
  8063. }
  8064. }
  8065. },
  8066. deleteSelected: function deleteSelected(event) {
  8067. event.stopPropagation();
  8068. var value = this.multiple ? [] : '';
  8069. this.$emit('input', value);
  8070. this.emitChange(value);
  8071. this.visible = false;
  8072. this.$emit('clear');
  8073. },
  8074. deleteTag: function deleteTag(event, tag) {
  8075. var index = this.selected.indexOf(tag);
  8076. if (index > -1 && !this.selectDisabled) {
  8077. var value = this.value.slice();
  8078. value.splice(index, 1);
  8079. this.$emit('input', value);
  8080. this.emitChange(value);
  8081. this.$emit('remove-tag', tag.value);
  8082. }
  8083. event.stopPropagation();
  8084. },
  8085. onInputChange: function onInputChange() {
  8086. if (this.filterable && this.query !== this.selectedLabel) {
  8087. this.query = this.selectedLabel;
  8088. this.handleQueryChange(this.query);
  8089. }
  8090. },
  8091. onOptionDestroy: function onOptionDestroy(index) {
  8092. if (index > -1) {
  8093. this.optionsCount--;
  8094. this.filteredOptionsCount--;
  8095. this.options.splice(index, 1);
  8096. }
  8097. },
  8098. resetInputWidth: function resetInputWidth() {
  8099. this.inputWidth = this.$refs.reference.$el.getBoundingClientRect().width;
  8100. },
  8101. handleResize: function handleResize() {
  8102. this.resetInputWidth();
  8103. if (this.multiple) this.resetInputHeight();
  8104. },
  8105. checkDefaultFirstOption: function checkDefaultFirstOption() {
  8106. this.hoverIndex = -1;
  8107. // highlight the created option
  8108. var hasCreated = false;
  8109. for (var i = this.options.length - 1; i >= 0; i--) {
  8110. if (this.options[i].created) {
  8111. hasCreated = true;
  8112. this.hoverIndex = i;
  8113. break;
  8114. }
  8115. }
  8116. if (hasCreated) return;
  8117. for (var _i = 0; _i !== this.options.length; ++_i) {
  8118. var option = this.options[_i];
  8119. if (this.query) {
  8120. // highlight first options that passes the filter
  8121. if (!option.disabled && !option.groupDisabled && option.visible) {
  8122. this.hoverIndex = _i;
  8123. break;
  8124. }
  8125. } else {
  8126. // highlight currently selected option
  8127. if (option.itemSelected) {
  8128. this.hoverIndex = _i;
  8129. break;
  8130. }
  8131. }
  8132. }
  8133. },
  8134. getValueKey: function getValueKey(item) {
  8135. if (Object.prototype.toString.call(item.value).toLowerCase() !== '[object object]') {
  8136. return item.value;
  8137. } else {
  8138. return Object(util_["getValueByPath"])(item.value, this.valueKey);
  8139. }
  8140. }
  8141. },
  8142. created: function created() {
  8143. var _this13 = this;
  8144. this.cachedPlaceHolder = this.currentPlaceholder = this.propPlaceholder;
  8145. if (this.multiple && !Array.isArray(this.value)) {
  8146. this.$emit('input', []);
  8147. }
  8148. if (!this.multiple && Array.isArray(this.value)) {
  8149. this.$emit('input', '');
  8150. }
  8151. this.debouncedOnInputChange = debounce_default()(this.debounce, function () {
  8152. _this13.onInputChange();
  8153. });
  8154. this.debouncedQueryChange = debounce_default()(this.debounce, function (e) {
  8155. _this13.handleQueryChange(e.target.value);
  8156. });
  8157. this.$on('handleOptionClick', this.handleOptionSelect);
  8158. this.$on('setSelected', this.setSelected);
  8159. },
  8160. mounted: function mounted() {
  8161. var _this14 = this;
  8162. if (this.multiple && Array.isArray(this.value) && this.value.length > 0) {
  8163. this.currentPlaceholder = '';
  8164. }
  8165. Object(resize_event_["addResizeListener"])(this.$el, this.handleResize);
  8166. var reference = this.$refs.reference;
  8167. if (reference && reference.$el) {
  8168. var sizeMap = {
  8169. medium: 36,
  8170. small: 32,
  8171. mini: 28
  8172. };
  8173. var input = reference.$el.querySelector('input');
  8174. this.initialInputHeight = input.getBoundingClientRect().height || sizeMap[this.selectSize];
  8175. }
  8176. if (this.remote && this.multiple) {
  8177. this.resetInputHeight();
  8178. }
  8179. this.$nextTick(function () {
  8180. if (reference && reference.$el) {
  8181. _this14.inputWidth = reference.$el.getBoundingClientRect().width;
  8182. }
  8183. });
  8184. this.setSelected();
  8185. },
  8186. beforeDestroy: function beforeDestroy() {
  8187. if (this.$el && this.handleResize) Object(resize_event_["removeResizeListener"])(this.$el, this.handleResize);
  8188. }
  8189. });
  8190. // CONCATENATED MODULE: ./packages/select/src/select.vue?vue&type=script&lang=js&
  8191. /* harmony default export */ var src_selectvue_type_script_lang_js_ = (selectvue_type_script_lang_js_);
  8192. // CONCATENATED MODULE: ./packages/select/src/select.vue
  8193. /* normalize component */
  8194. var select_component = normalizeComponent(
  8195. src_selectvue_type_script_lang_js_,
  8196. selectvue_type_template_id_0e4aade6_render,
  8197. selectvue_type_template_id_0e4aade6_staticRenderFns,
  8198. false,
  8199. null,
  8200. null,
  8201. null
  8202. )
  8203. /* hot reload */
  8204. if (false) { var select_api; }
  8205. select_component.options.__file = "packages/select/src/select.vue"
  8206. /* harmony default export */ var src_select = (select_component.exports);
  8207. // CONCATENATED MODULE: ./packages/select/index.js
  8208. /* istanbul ignore next */
  8209. src_select.install = function (Vue) {
  8210. Vue.component(src_select.name, src_select);
  8211. };
  8212. /* harmony default export */ var packages_select = (src_select);
  8213. // CONCATENATED MODULE: ./packages/option/index.js
  8214. /* istanbul ignore next */
  8215. src_option.install = function (Vue) {
  8216. Vue.component(src_option.name, src_option);
  8217. };
  8218. /* harmony default export */ var packages_option = (src_option);
  8219. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/select/src/option-group.vue?vue&type=template&id=6685e5de&
  8220. var option_groupvue_type_template_id_6685e5de_render = function() {
  8221. var _vm = this
  8222. var _h = _vm.$createElement
  8223. var _c = _vm._self._c || _h
  8224. return _c(
  8225. "ul",
  8226. {
  8227. directives: [
  8228. {
  8229. name: "show",
  8230. rawName: "v-show",
  8231. value: _vm.visible,
  8232. expression: "visible"
  8233. }
  8234. ],
  8235. staticClass: "el-select-group__wrap"
  8236. },
  8237. [
  8238. _c("li", { staticClass: "el-select-group__title" }, [
  8239. _vm._v(_vm._s(_vm.label))
  8240. ]),
  8241. _c("li", [
  8242. _c("ul", { staticClass: "el-select-group" }, [_vm._t("default")], 2)
  8243. ])
  8244. ]
  8245. )
  8246. }
  8247. var option_groupvue_type_template_id_6685e5de_staticRenderFns = []
  8248. option_groupvue_type_template_id_6685e5de_render._withStripped = true
  8249. // CONCATENATED MODULE: ./packages/select/src/option-group.vue?vue&type=template&id=6685e5de&
  8250. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/select/src/option-group.vue?vue&type=script&lang=js&
  8251. //
  8252. //
  8253. //
  8254. //
  8255. //
  8256. //
  8257. //
  8258. //
  8259. //
  8260. //
  8261. //
  8262. /* harmony default export */ var option_groupvue_type_script_lang_js_ = ({
  8263. mixins: [emitter_default.a],
  8264. name: 'ElOptionGroup',
  8265. componentName: 'ElOptionGroup',
  8266. props: {
  8267. label: String,
  8268. disabled: {
  8269. type: Boolean,
  8270. default: false
  8271. }
  8272. },
  8273. data: function data() {
  8274. return {
  8275. visible: true
  8276. };
  8277. },
  8278. watch: {
  8279. disabled: function disabled(val) {
  8280. this.broadcast('ElOption', 'handleGroupDisabled', val);
  8281. }
  8282. },
  8283. methods: {
  8284. queryChange: function queryChange() {
  8285. this.visible = this.$children && Array.isArray(this.$children) && this.$children.some(function (option) {
  8286. return option.visible === true;
  8287. });
  8288. }
  8289. },
  8290. created: function created() {
  8291. this.$on('queryChange', this.queryChange);
  8292. },
  8293. mounted: function mounted() {
  8294. if (this.disabled) {
  8295. this.broadcast('ElOption', 'handleGroupDisabled', this.disabled);
  8296. }
  8297. }
  8298. });
  8299. // CONCATENATED MODULE: ./packages/select/src/option-group.vue?vue&type=script&lang=js&
  8300. /* harmony default export */ var src_option_groupvue_type_script_lang_js_ = (option_groupvue_type_script_lang_js_);
  8301. // CONCATENATED MODULE: ./packages/select/src/option-group.vue
  8302. /* normalize component */
  8303. var option_group_component = normalizeComponent(
  8304. src_option_groupvue_type_script_lang_js_,
  8305. option_groupvue_type_template_id_6685e5de_render,
  8306. option_groupvue_type_template_id_6685e5de_staticRenderFns,
  8307. false,
  8308. null,
  8309. null,
  8310. null
  8311. )
  8312. /* hot reload */
  8313. if (false) { var option_group_api; }
  8314. option_group_component.options.__file = "packages/select/src/option-group.vue"
  8315. /* harmony default export */ var option_group = (option_group_component.exports);
  8316. // CONCATENATED MODULE: ./packages/option-group/index.js
  8317. /* istanbul ignore next */
  8318. option_group.install = function (Vue) {
  8319. Vue.component(option_group.name, option_group);
  8320. };
  8321. /* harmony default export */ var packages_option_group = (option_group);
  8322. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/button/src/button.vue?vue&type=template&id=ca859fb4&
  8323. var buttonvue_type_template_id_ca859fb4_render = function() {
  8324. var _vm = this
  8325. var _h = _vm.$createElement
  8326. var _c = _vm._self._c || _h
  8327. return _c(
  8328. "button",
  8329. {
  8330. staticClass: "el-button",
  8331. class: [
  8332. _vm.type ? "el-button--" + _vm.type : "",
  8333. _vm.buttonSize ? "el-button--" + _vm.buttonSize : "",
  8334. {
  8335. "is-disabled": _vm.buttonDisabled,
  8336. "is-loading": _vm.loading,
  8337. "is-plain": _vm.plain,
  8338. "is-round": _vm.round,
  8339. "is-circle": _vm.circle
  8340. }
  8341. ],
  8342. attrs: {
  8343. disabled: _vm.buttonDisabled || _vm.loading,
  8344. autofocus: _vm.autofocus,
  8345. type: _vm.nativeType
  8346. },
  8347. on: { click: _vm.handleClick }
  8348. },
  8349. [
  8350. _vm.loading ? _c("i", { staticClass: "el-icon-loading" }) : _vm._e(),
  8351. _vm.icon && !_vm.loading ? _c("i", { class: _vm.icon }) : _vm._e(),
  8352. _vm.$slots.default ? _c("span", [_vm._t("default")], 2) : _vm._e()
  8353. ]
  8354. )
  8355. }
  8356. var buttonvue_type_template_id_ca859fb4_staticRenderFns = []
  8357. buttonvue_type_template_id_ca859fb4_render._withStripped = true
  8358. // CONCATENATED MODULE: ./packages/button/src/button.vue?vue&type=template&id=ca859fb4&
  8359. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/button/src/button.vue?vue&type=script&lang=js&
  8360. //
  8361. //
  8362. //
  8363. //
  8364. //
  8365. //
  8366. //
  8367. //
  8368. //
  8369. //
  8370. //
  8371. //
  8372. //
  8373. //
  8374. //
  8375. //
  8376. //
  8377. //
  8378. //
  8379. //
  8380. //
  8381. //
  8382. //
  8383. //
  8384. /* harmony default export */ var buttonvue_type_script_lang_js_ = ({
  8385. name: 'ElButton',
  8386. inject: {
  8387. elForm: {
  8388. default: ''
  8389. },
  8390. elFormItem: {
  8391. default: ''
  8392. }
  8393. },
  8394. props: {
  8395. type: {
  8396. type: String,
  8397. default: 'default'
  8398. },
  8399. size: String,
  8400. icon: {
  8401. type: String,
  8402. default: ''
  8403. },
  8404. nativeType: {
  8405. type: String,
  8406. default: 'button'
  8407. },
  8408. loading: Boolean,
  8409. disabled: Boolean,
  8410. plain: Boolean,
  8411. autofocus: Boolean,
  8412. round: Boolean,
  8413. circle: Boolean
  8414. },
  8415. computed: {
  8416. _elFormItemSize: function _elFormItemSize() {
  8417. return (this.elFormItem || {}).elFormItemSize;
  8418. },
  8419. buttonSize: function buttonSize() {
  8420. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  8421. },
  8422. buttonDisabled: function buttonDisabled() {
  8423. return this.$options.propsData.hasOwnProperty('disabled') ? this.disabled : (this.elForm || {}).disabled;
  8424. }
  8425. },
  8426. methods: {
  8427. handleClick: function handleClick(evt) {
  8428. this.$emit('click', evt);
  8429. }
  8430. }
  8431. });
  8432. // CONCATENATED MODULE: ./packages/button/src/button.vue?vue&type=script&lang=js&
  8433. /* harmony default export */ var src_buttonvue_type_script_lang_js_ = (buttonvue_type_script_lang_js_);
  8434. // CONCATENATED MODULE: ./packages/button/src/button.vue
  8435. /* normalize component */
  8436. var button_component = normalizeComponent(
  8437. src_buttonvue_type_script_lang_js_,
  8438. buttonvue_type_template_id_ca859fb4_render,
  8439. buttonvue_type_template_id_ca859fb4_staticRenderFns,
  8440. false,
  8441. null,
  8442. null,
  8443. null
  8444. )
  8445. /* hot reload */
  8446. if (false) { var button_api; }
  8447. button_component.options.__file = "packages/button/src/button.vue"
  8448. /* harmony default export */ var src_button = (button_component.exports);
  8449. // CONCATENATED MODULE: ./packages/button/index.js
  8450. /* istanbul ignore next */
  8451. src_button.install = function (Vue) {
  8452. Vue.component(src_button.name, src_button);
  8453. };
  8454. /* harmony default export */ var packages_button = (src_button);
  8455. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/button/src/button-group.vue?vue&type=template&id=3d8661d0&
  8456. var button_groupvue_type_template_id_3d8661d0_render = function() {
  8457. var _vm = this
  8458. var _h = _vm.$createElement
  8459. var _c = _vm._self._c || _h
  8460. return _c("div", { staticClass: "el-button-group" }, [_vm._t("default")], 2)
  8461. }
  8462. var button_groupvue_type_template_id_3d8661d0_staticRenderFns = []
  8463. button_groupvue_type_template_id_3d8661d0_render._withStripped = true
  8464. // CONCATENATED MODULE: ./packages/button/src/button-group.vue?vue&type=template&id=3d8661d0&
  8465. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/button/src/button-group.vue?vue&type=script&lang=js&
  8466. //
  8467. //
  8468. //
  8469. //
  8470. //
  8471. /* harmony default export */ var button_groupvue_type_script_lang_js_ = ({
  8472. name: 'ElButtonGroup'
  8473. });
  8474. // CONCATENATED MODULE: ./packages/button/src/button-group.vue?vue&type=script&lang=js&
  8475. /* harmony default export */ var src_button_groupvue_type_script_lang_js_ = (button_groupvue_type_script_lang_js_);
  8476. // CONCATENATED MODULE: ./packages/button/src/button-group.vue
  8477. /* normalize component */
  8478. var button_group_component = normalizeComponent(
  8479. src_button_groupvue_type_script_lang_js_,
  8480. button_groupvue_type_template_id_3d8661d0_render,
  8481. button_groupvue_type_template_id_3d8661d0_staticRenderFns,
  8482. false,
  8483. null,
  8484. null,
  8485. null
  8486. )
  8487. /* hot reload */
  8488. if (false) { var button_group_api; }
  8489. button_group_component.options.__file = "packages/button/src/button-group.vue"
  8490. /* harmony default export */ var button_group = (button_group_component.exports);
  8491. // CONCATENATED MODULE: ./packages/button-group/index.js
  8492. /* istanbul ignore next */
  8493. button_group.install = function (Vue) {
  8494. Vue.component(button_group.name, button_group);
  8495. };
  8496. /* harmony default export */ var packages_button_group = (button_group);
  8497. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/table/src/table.vue?vue&type=template&id=493fe34e&
  8498. var tablevue_type_template_id_493fe34e_render = function() {
  8499. var _vm = this
  8500. var _h = _vm.$createElement
  8501. var _c = _vm._self._c || _h
  8502. return _c(
  8503. "div",
  8504. {
  8505. staticClass: "el-table",
  8506. class: [
  8507. {
  8508. "el-table--fit": _vm.fit,
  8509. "el-table--striped": _vm.stripe,
  8510. "el-table--border": _vm.border || _vm.isGroup,
  8511. "el-table--hidden": _vm.isHidden,
  8512. "el-table--group": _vm.isGroup,
  8513. "el-table--fluid-height": _vm.maxHeight,
  8514. "el-table--scrollable-x": _vm.layout.scrollX,
  8515. "el-table--scrollable-y": _vm.layout.scrollY,
  8516. "el-table--enable-row-hover": !_vm.store.states.isComplex,
  8517. "el-table--enable-row-transition":
  8518. (_vm.store.states.data || []).length !== 0 &&
  8519. (_vm.store.states.data || []).length < 100
  8520. },
  8521. _vm.tableSize ? "el-table--" + _vm.tableSize : ""
  8522. ],
  8523. on: {
  8524. mouseleave: function($event) {
  8525. _vm.handleMouseLeave($event)
  8526. }
  8527. }
  8528. },
  8529. [
  8530. _c(
  8531. "div",
  8532. { ref: "hiddenColumns", staticClass: "hidden-columns" },
  8533. [_vm._t("default")],
  8534. 2
  8535. ),
  8536. _vm.showHeader
  8537. ? _c(
  8538. "div",
  8539. {
  8540. directives: [
  8541. {
  8542. name: "mousewheel",
  8543. rawName: "v-mousewheel",
  8544. value: _vm.handleHeaderFooterMousewheel,
  8545. expression: "handleHeaderFooterMousewheel"
  8546. }
  8547. ],
  8548. ref: "headerWrapper",
  8549. staticClass: "el-table__header-wrapper"
  8550. },
  8551. [
  8552. _c("table-header", {
  8553. ref: "tableHeader",
  8554. style: {
  8555. width: _vm.layout.bodyWidth ? _vm.layout.bodyWidth + "px" : ""
  8556. },
  8557. attrs: {
  8558. store: _vm.store,
  8559. border: _vm.border,
  8560. "default-sort": _vm.defaultSort
  8561. }
  8562. })
  8563. ],
  8564. 1
  8565. )
  8566. : _vm._e(),
  8567. _c(
  8568. "div",
  8569. {
  8570. ref: "bodyWrapper",
  8571. staticClass: "el-table__body-wrapper",
  8572. class: [
  8573. _vm.layout.scrollX
  8574. ? "is-scrolling-" + _vm.scrollPosition
  8575. : "is-scrolling-none"
  8576. ],
  8577. style: [_vm.bodyHeight]
  8578. },
  8579. [
  8580. _c("table-body", {
  8581. style: {
  8582. width: _vm.bodyWidth
  8583. },
  8584. attrs: {
  8585. context: _vm.context,
  8586. store: _vm.store,
  8587. stripe: _vm.stripe,
  8588. "row-class-name": _vm.rowClassName,
  8589. "row-style": _vm.rowStyle,
  8590. highlight: _vm.highlightCurrentRow
  8591. }
  8592. }),
  8593. !_vm.data || _vm.data.length === 0
  8594. ? _c(
  8595. "div",
  8596. {
  8597. ref: "emptyBlock",
  8598. staticClass: "el-table__empty-block",
  8599. style: _vm.emptyBlockStyle
  8600. },
  8601. [
  8602. _c(
  8603. "span",
  8604. { staticClass: "el-table__empty-text" },
  8605. [
  8606. _vm._t("empty", [
  8607. _vm._v(
  8608. _vm._s(_vm.emptyText || _vm.t("el.table.emptyText"))
  8609. )
  8610. ])
  8611. ],
  8612. 2
  8613. )
  8614. ]
  8615. )
  8616. : _vm._e(),
  8617. _vm.$slots.append
  8618. ? _c(
  8619. "div",
  8620. {
  8621. ref: "appendWrapper",
  8622. staticClass: "el-table__append-wrapper"
  8623. },
  8624. [_vm._t("append")],
  8625. 2
  8626. )
  8627. : _vm._e()
  8628. ],
  8629. 1
  8630. ),
  8631. _vm.showSummary
  8632. ? _c(
  8633. "div",
  8634. {
  8635. directives: [
  8636. {
  8637. name: "show",
  8638. rawName: "v-show",
  8639. value: _vm.data && _vm.data.length > 0,
  8640. expression: "data && data.length > 0"
  8641. },
  8642. {
  8643. name: "mousewheel",
  8644. rawName: "v-mousewheel",
  8645. value: _vm.handleHeaderFooterMousewheel,
  8646. expression: "handleHeaderFooterMousewheel"
  8647. }
  8648. ],
  8649. ref: "footerWrapper",
  8650. staticClass: "el-table__footer-wrapper"
  8651. },
  8652. [
  8653. _c("table-footer", {
  8654. style: {
  8655. width: _vm.layout.bodyWidth ? _vm.layout.bodyWidth + "px" : ""
  8656. },
  8657. attrs: {
  8658. store: _vm.store,
  8659. border: _vm.border,
  8660. "sum-text": _vm.sumText || _vm.t("el.table.sumText"),
  8661. "summary-method": _vm.summaryMethod,
  8662. "default-sort": _vm.defaultSort
  8663. }
  8664. })
  8665. ],
  8666. 1
  8667. )
  8668. : _vm._e(),
  8669. _vm.fixedColumns.length > 0
  8670. ? _c(
  8671. "div",
  8672. {
  8673. directives: [
  8674. {
  8675. name: "mousewheel",
  8676. rawName: "v-mousewheel",
  8677. value: _vm.handleFixedMousewheel,
  8678. expression: "handleFixedMousewheel"
  8679. }
  8680. ],
  8681. ref: "fixedWrapper",
  8682. staticClass: "el-table__fixed",
  8683. style: [
  8684. {
  8685. width: _vm.layout.fixedWidth
  8686. ? _vm.layout.fixedWidth + "px"
  8687. : ""
  8688. },
  8689. _vm.fixedHeight
  8690. ]
  8691. },
  8692. [
  8693. _vm.showHeader
  8694. ? _c(
  8695. "div",
  8696. {
  8697. ref: "fixedHeaderWrapper",
  8698. staticClass: "el-table__fixed-header-wrapper"
  8699. },
  8700. [
  8701. _c("table-header", {
  8702. ref: "fixedTableHeader",
  8703. style: {
  8704. width: _vm.bodyWidth
  8705. },
  8706. attrs: {
  8707. fixed: "left",
  8708. border: _vm.border,
  8709. store: _vm.store
  8710. }
  8711. })
  8712. ],
  8713. 1
  8714. )
  8715. : _vm._e(),
  8716. _c(
  8717. "div",
  8718. {
  8719. ref: "fixedBodyWrapper",
  8720. staticClass: "el-table__fixed-body-wrapper",
  8721. style: [
  8722. {
  8723. top: _vm.layout.headerHeight + "px"
  8724. },
  8725. _vm.fixedBodyHeight
  8726. ]
  8727. },
  8728. [
  8729. _c("table-body", {
  8730. style: {
  8731. width: _vm.bodyWidth
  8732. },
  8733. attrs: {
  8734. fixed: "left",
  8735. store: _vm.store,
  8736. stripe: _vm.stripe,
  8737. highlight: _vm.highlightCurrentRow,
  8738. "row-class-name": _vm.rowClassName,
  8739. "row-style": _vm.rowStyle
  8740. }
  8741. }),
  8742. _vm.$slots.append
  8743. ? _c("div", {
  8744. staticClass: "el-table__append-gutter",
  8745. style: { height: _vm.layout.appendHeight + "px" }
  8746. })
  8747. : _vm._e()
  8748. ],
  8749. 1
  8750. ),
  8751. _vm.showSummary
  8752. ? _c(
  8753. "div",
  8754. {
  8755. directives: [
  8756. {
  8757. name: "show",
  8758. rawName: "v-show",
  8759. value: _vm.data && _vm.data.length > 0,
  8760. expression: "data && data.length > 0"
  8761. }
  8762. ],
  8763. ref: "fixedFooterWrapper",
  8764. staticClass: "el-table__fixed-footer-wrapper"
  8765. },
  8766. [
  8767. _c("table-footer", {
  8768. style: {
  8769. width: _vm.bodyWidth
  8770. },
  8771. attrs: {
  8772. fixed: "left",
  8773. border: _vm.border,
  8774. "sum-text": _vm.sumText || _vm.t("el.table.sumText"),
  8775. "summary-method": _vm.summaryMethod,
  8776. store: _vm.store
  8777. }
  8778. })
  8779. ],
  8780. 1
  8781. )
  8782. : _vm._e()
  8783. ]
  8784. )
  8785. : _vm._e(),
  8786. _vm.rightFixedColumns.length > 0
  8787. ? _c(
  8788. "div",
  8789. {
  8790. directives: [
  8791. {
  8792. name: "mousewheel",
  8793. rawName: "v-mousewheel",
  8794. value: _vm.handleFixedMousewheel,
  8795. expression: "handleFixedMousewheel"
  8796. }
  8797. ],
  8798. ref: "rightFixedWrapper",
  8799. staticClass: "el-table__fixed-right",
  8800. style: [
  8801. {
  8802. width: _vm.layout.rightFixedWidth
  8803. ? _vm.layout.rightFixedWidth + "px"
  8804. : "",
  8805. right: _vm.layout.scrollY
  8806. ? (_vm.border
  8807. ? _vm.layout.gutterWidth
  8808. : _vm.layout.gutterWidth || 0) + "px"
  8809. : ""
  8810. },
  8811. _vm.fixedHeight
  8812. ]
  8813. },
  8814. [
  8815. _vm.showHeader
  8816. ? _c(
  8817. "div",
  8818. {
  8819. ref: "rightFixedHeaderWrapper",
  8820. staticClass: "el-table__fixed-header-wrapper"
  8821. },
  8822. [
  8823. _c("table-header", {
  8824. ref: "rightFixedTableHeader",
  8825. style: {
  8826. width: _vm.bodyWidth
  8827. },
  8828. attrs: {
  8829. fixed: "right",
  8830. border: _vm.border,
  8831. store: _vm.store
  8832. }
  8833. })
  8834. ],
  8835. 1
  8836. )
  8837. : _vm._e(),
  8838. _c(
  8839. "div",
  8840. {
  8841. ref: "rightFixedBodyWrapper",
  8842. staticClass: "el-table__fixed-body-wrapper",
  8843. style: [
  8844. {
  8845. top: _vm.layout.headerHeight + "px"
  8846. },
  8847. _vm.fixedBodyHeight
  8848. ]
  8849. },
  8850. [
  8851. _c("table-body", {
  8852. style: {
  8853. width: _vm.bodyWidth
  8854. },
  8855. attrs: {
  8856. fixed: "right",
  8857. store: _vm.store,
  8858. stripe: _vm.stripe,
  8859. "row-class-name": _vm.rowClassName,
  8860. "row-style": _vm.rowStyle,
  8861. highlight: _vm.highlightCurrentRow
  8862. }
  8863. }),
  8864. _vm.$slots.append
  8865. ? _c("div", {
  8866. staticClass: "el-table__append-gutter",
  8867. style: { height: _vm.layout.appendHeight + "px" }
  8868. })
  8869. : _vm._e()
  8870. ],
  8871. 1
  8872. ),
  8873. _vm.showSummary
  8874. ? _c(
  8875. "div",
  8876. {
  8877. directives: [
  8878. {
  8879. name: "show",
  8880. rawName: "v-show",
  8881. value: _vm.data && _vm.data.length > 0,
  8882. expression: "data && data.length > 0"
  8883. }
  8884. ],
  8885. ref: "rightFixedFooterWrapper",
  8886. staticClass: "el-table__fixed-footer-wrapper"
  8887. },
  8888. [
  8889. _c("table-footer", {
  8890. style: {
  8891. width: _vm.bodyWidth
  8892. },
  8893. attrs: {
  8894. fixed: "right",
  8895. border: _vm.border,
  8896. "sum-text": _vm.sumText || _vm.t("el.table.sumText"),
  8897. "summary-method": _vm.summaryMethod,
  8898. store: _vm.store
  8899. }
  8900. })
  8901. ],
  8902. 1
  8903. )
  8904. : _vm._e()
  8905. ]
  8906. )
  8907. : _vm._e(),
  8908. _vm.rightFixedColumns.length > 0
  8909. ? _c("div", {
  8910. ref: "rightFixedPatch",
  8911. staticClass: "el-table__fixed-right-patch",
  8912. style: {
  8913. width: _vm.layout.scrollY ? _vm.layout.gutterWidth + "px" : "0",
  8914. height: _vm.layout.headerHeight + "px"
  8915. }
  8916. })
  8917. : _vm._e(),
  8918. _c("div", {
  8919. directives: [
  8920. {
  8921. name: "show",
  8922. rawName: "v-show",
  8923. value: _vm.resizeProxyVisible,
  8924. expression: "resizeProxyVisible"
  8925. }
  8926. ],
  8927. ref: "resizeProxy",
  8928. staticClass: "el-table__column-resize-proxy"
  8929. })
  8930. ]
  8931. )
  8932. }
  8933. var tablevue_type_template_id_493fe34e_staticRenderFns = []
  8934. tablevue_type_template_id_493fe34e_render._withStripped = true
  8935. // CONCATENATED MODULE: ./packages/table/src/table.vue?vue&type=template&id=493fe34e&
  8936. // EXTERNAL MODULE: external "element-ui/lib/checkbox"
  8937. var checkbox_ = __webpack_require__(14);
  8938. var checkbox_default = /*#__PURE__*/__webpack_require__.n(checkbox_);
  8939. // EXTERNAL MODULE: external "throttle-debounce"
  8940. var external_throttle_debounce_ = __webpack_require__(36);
  8941. // EXTERNAL MODULE: external "normalize-wheel"
  8942. var external_normalize_wheel_ = __webpack_require__(39);
  8943. var external_normalize_wheel_default = /*#__PURE__*/__webpack_require__.n(external_normalize_wheel_);
  8944. // CONCATENATED MODULE: ./src/directives/mousewheel.js
  8945. var isFirefox = typeof navigator !== 'undefined' && navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
  8946. var mousewheel_mousewheel = function mousewheel(element, callback) {
  8947. if (element && element.addEventListener) {
  8948. element.addEventListener(isFirefox ? 'DOMMouseScroll' : 'mousewheel', function (event) {
  8949. var normalized = external_normalize_wheel_default()(event);
  8950. callback && callback.apply(this, [event, normalized]);
  8951. });
  8952. }
  8953. };
  8954. /* harmony default export */ var directives_mousewheel = ({
  8955. bind: function bind(el, binding) {
  8956. mousewheel_mousewheel(el, binding.value);
  8957. }
  8958. });
  8959. // EXTERNAL MODULE: external "vue"
  8960. var external_vue_ = __webpack_require__(6);
  8961. var external_vue_default = /*#__PURE__*/__webpack_require__.n(external_vue_);
  8962. // CONCATENATED MODULE: ./packages/table/src/util.js
  8963. var util_typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  8964. var getCell = function getCell(event) {
  8965. var cell = event.target;
  8966. while (cell && cell.tagName.toUpperCase() !== 'HTML') {
  8967. if (cell.tagName.toUpperCase() === 'TD') {
  8968. return cell;
  8969. }
  8970. cell = cell.parentNode;
  8971. }
  8972. return null;
  8973. };
  8974. var util_isObject = function isObject(obj) {
  8975. return obj !== null && (typeof obj === 'undefined' ? 'undefined' : util_typeof(obj)) === 'object';
  8976. };
  8977. var util_orderBy = function orderBy(array, sortKey, reverse, sortMethod, sortBy) {
  8978. if (!sortKey && !sortMethod && (!sortBy || Array.isArray(sortBy) && !sortBy.length)) {
  8979. return array;
  8980. }
  8981. if (typeof reverse === 'string') {
  8982. reverse = reverse === 'descending' ? -1 : 1;
  8983. } else {
  8984. reverse = reverse && reverse < 0 ? -1 : 1;
  8985. }
  8986. var getKey = sortMethod ? null : function (value, index) {
  8987. if (sortBy) {
  8988. if (!Array.isArray(sortBy)) {
  8989. sortBy = [sortBy];
  8990. }
  8991. return sortBy.map(function (by) {
  8992. if (typeof by === 'string') {
  8993. return Object(util_["getValueByPath"])(value, by);
  8994. } else {
  8995. return by(value, index, array);
  8996. }
  8997. });
  8998. }
  8999. if (sortKey !== '$key') {
  9000. if (util_isObject(value) && '$value' in value) value = value.$value;
  9001. }
  9002. return [util_isObject(value) ? Object(util_["getValueByPath"])(value, sortKey) : value];
  9003. };
  9004. var compare = function compare(a, b) {
  9005. if (sortMethod) {
  9006. return sortMethod(a.value, b.value);
  9007. }
  9008. for (var i = 0, len = a.key.length; i < len; i++) {
  9009. if (a.key[i] < b.key[i]) {
  9010. return -1;
  9011. }
  9012. if (a.key[i] > b.key[i]) {
  9013. return 1;
  9014. }
  9015. }
  9016. return 0;
  9017. };
  9018. return array.map(function (value, index) {
  9019. return {
  9020. value: value,
  9021. index: index,
  9022. key: getKey ? getKey(value, index) : null
  9023. };
  9024. }).sort(function (a, b) {
  9025. var order = compare(a, b);
  9026. if (!order) {
  9027. // make stable https://en.wikipedia.org/wiki/Sorting_algorithm#Stability
  9028. order = a.index - b.index;
  9029. }
  9030. return order * reverse;
  9031. }).map(function (item) {
  9032. return item.value;
  9033. });
  9034. };
  9035. var getColumnById = function getColumnById(table, columnId) {
  9036. var column = null;
  9037. table.columns.forEach(function (item) {
  9038. if (item.id === columnId) {
  9039. column = item;
  9040. }
  9041. });
  9042. return column;
  9043. };
  9044. var getColumnByKey = function getColumnByKey(table, columnKey) {
  9045. var column = null;
  9046. for (var i = 0; i < table.columns.length; i++) {
  9047. var item = table.columns[i];
  9048. if (item.columnKey === columnKey) {
  9049. column = item;
  9050. break;
  9051. }
  9052. }
  9053. return column;
  9054. };
  9055. var getColumnByCell = function getColumnByCell(table, cell) {
  9056. var matches = (cell.className || '').match(/el-table_[^\s]+/gm);
  9057. if (matches) {
  9058. return getColumnById(table, matches[0]);
  9059. }
  9060. return null;
  9061. };
  9062. var getRowIdentity = function getRowIdentity(row, rowKey) {
  9063. if (!row) throw new Error('row is required when get row identity');
  9064. if (typeof rowKey === 'string') {
  9065. if (rowKey.indexOf('.') < 0) {
  9066. return row[rowKey];
  9067. }
  9068. var key = rowKey.split('.');
  9069. var current = row;
  9070. for (var i = 0; i < key.length; i++) {
  9071. current = current[key[i]];
  9072. }
  9073. return current;
  9074. } else if (typeof rowKey === 'function') {
  9075. return rowKey.call(null, row);
  9076. }
  9077. };
  9078. var getKeysMap = function getKeysMap(array, rowKey) {
  9079. var arrayMap = {};
  9080. (array || []).forEach(function (row, index) {
  9081. arrayMap[getRowIdentity(row, rowKey)] = { row: row, index: index };
  9082. });
  9083. return arrayMap;
  9084. };
  9085. function hasOwn(obj, key) {
  9086. return Object.prototype.hasOwnProperty.call(obj, key);
  9087. }
  9088. function mergeOptions(defaults, config) {
  9089. var options = {};
  9090. var key = void 0;
  9091. for (key in defaults) {
  9092. options[key] = defaults[key];
  9093. }
  9094. for (key in config) {
  9095. if (hasOwn(config, key)) {
  9096. var value = config[key];
  9097. if (typeof value !== 'undefined') {
  9098. options[key] = value;
  9099. }
  9100. }
  9101. }
  9102. return options;
  9103. }
  9104. function parseWidth(width) {
  9105. if (width !== undefined) {
  9106. width = parseInt(width, 10);
  9107. if (isNaN(width)) {
  9108. width = null;
  9109. }
  9110. }
  9111. return width;
  9112. }
  9113. function parseMinWidth(minWidth) {
  9114. if (typeof minWidth !== 'undefined') {
  9115. minWidth = parseWidth(minWidth);
  9116. if (isNaN(minWidth)) {
  9117. minWidth = 80;
  9118. }
  9119. }
  9120. return minWidth;
  9121. };
  9122. function parseHeight(height) {
  9123. if (typeof height === 'number') {
  9124. return height;
  9125. }
  9126. if (typeof height === 'string') {
  9127. if (/^\d+(?:px)?$/.test(height)) {
  9128. return parseInt(height, 10);
  9129. } else {
  9130. return height;
  9131. }
  9132. }
  9133. return null;
  9134. }
  9135. // https://github.com/reduxjs/redux/blob/master/src/compose.js
  9136. function compose() {
  9137. for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) {
  9138. funcs[_key] = arguments[_key];
  9139. }
  9140. if (funcs.length === 0) {
  9141. return function (arg) {
  9142. return arg;
  9143. };
  9144. }
  9145. if (funcs.length === 1) {
  9146. return funcs[0];
  9147. }
  9148. return funcs.reduce(function (a, b) {
  9149. return function () {
  9150. return a(b.apply(undefined, arguments));
  9151. };
  9152. });
  9153. }
  9154. function toggleRowStatus(statusArr, row, newVal) {
  9155. var changed = false;
  9156. var index = statusArr.indexOf(row);
  9157. var included = index !== -1;
  9158. var addRow = function addRow() {
  9159. statusArr.push(row);
  9160. changed = true;
  9161. };
  9162. var removeRow = function removeRow() {
  9163. statusArr.splice(index, 1);
  9164. changed = true;
  9165. };
  9166. if (typeof newVal === 'boolean') {
  9167. if (newVal && !included) {
  9168. addRow();
  9169. } else if (!newVal && included) {
  9170. removeRow();
  9171. }
  9172. } else {
  9173. if (included) {
  9174. removeRow();
  9175. } else {
  9176. addRow();
  9177. }
  9178. }
  9179. return changed;
  9180. }
  9181. function walkTreeNode(root, cb) {
  9182. var childrenKey = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'children';
  9183. var lazyKey = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'hasChildren';
  9184. var isNil = function isNil(array) {
  9185. return !(Array.isArray(array) && array.length);
  9186. };
  9187. function _walker(parent, children, level) {
  9188. cb(parent, children, level);
  9189. children.forEach(function (item) {
  9190. if (item[lazyKey]) {
  9191. cb(item, null, level + 1);
  9192. return;
  9193. }
  9194. var children = item[childrenKey];
  9195. if (!isNil(children)) {
  9196. _walker(item, children, level + 1);
  9197. }
  9198. });
  9199. }
  9200. root.forEach(function (item) {
  9201. if (item[lazyKey]) {
  9202. cb(item, null, 0);
  9203. return;
  9204. }
  9205. var children = item[childrenKey];
  9206. if (!isNil(children)) {
  9207. _walker(item, children, 0);
  9208. }
  9209. });
  9210. }
  9211. var objectEquals = function objectEquals(objectA, objectB) {
  9212. // 取对象a和b的属性名
  9213. var aProps = Object.getOwnPropertyNames(objectA);
  9214. var bProps = Object.getOwnPropertyNames(objectB);
  9215. // 判断属性名的length是否一致
  9216. if (aProps.length !== bProps.length) {
  9217. return false;
  9218. }
  9219. // 循环取出属性名,再判断属性值是否一致
  9220. for (var i = 0; i < aProps.length; i++) {
  9221. var propName = aProps[i];
  9222. if (objectA[propName] !== objectB[propName]) {
  9223. return false;
  9224. }
  9225. }
  9226. return true;
  9227. };
  9228. // CONCATENATED MODULE: ./packages/table/src/store/expand.js
  9229. /* harmony default export */ var expand = ({
  9230. data: function data() {
  9231. return {
  9232. states: {
  9233. defaultExpandAll: false,
  9234. expandRows: []
  9235. }
  9236. };
  9237. },
  9238. methods: {
  9239. updateExpandRows: function updateExpandRows() {
  9240. var _states = this.states,
  9241. _states$data = _states.data,
  9242. data = _states$data === undefined ? [] : _states$data,
  9243. rowKey = _states.rowKey,
  9244. defaultExpandAll = _states.defaultExpandAll,
  9245. expandRows = _states.expandRows;
  9246. if (defaultExpandAll) {
  9247. this.states.expandRows = data.slice();
  9248. } else if (rowKey) {
  9249. // TODO:这里的代码可以优化
  9250. var expandRowsMap = getKeysMap(expandRows, rowKey);
  9251. this.states.expandRows = data.reduce(function (prev, row) {
  9252. var rowId = getRowIdentity(row, rowKey);
  9253. var rowInfo = expandRowsMap[rowId];
  9254. if (rowInfo) {
  9255. prev.push(row);
  9256. }
  9257. return prev;
  9258. }, []);
  9259. } else {
  9260. this.states.expandRows = [];
  9261. }
  9262. },
  9263. toggleRowExpansion: function toggleRowExpansion(row, expanded) {
  9264. var changed = toggleRowStatus(this.states.expandRows, row, expanded);
  9265. if (changed) {
  9266. this.table.$emit('expand-change', row, this.states.expandRows.slice());
  9267. this.scheduleLayout();
  9268. }
  9269. },
  9270. setExpandRowKeys: function setExpandRowKeys(rowKeys) {
  9271. this.assertRowKey();
  9272. // TODO:这里的代码可以优化
  9273. var _states2 = this.states,
  9274. data = _states2.data,
  9275. rowKey = _states2.rowKey;
  9276. var keysMap = getKeysMap(data, rowKey);
  9277. this.states.expandRows = rowKeys.reduce(function (prev, cur) {
  9278. var info = keysMap[cur];
  9279. if (info) {
  9280. prev.push(info.row);
  9281. }
  9282. return prev;
  9283. }, []);
  9284. },
  9285. isRowExpanded: function isRowExpanded(row) {
  9286. var _states3 = this.states,
  9287. _states3$expandRows = _states3.expandRows,
  9288. expandRows = _states3$expandRows === undefined ? [] : _states3$expandRows,
  9289. rowKey = _states3.rowKey;
  9290. if (rowKey) {
  9291. var expandMap = getKeysMap(expandRows, rowKey);
  9292. return !!expandMap[getRowIdentity(row, rowKey)];
  9293. }
  9294. return expandRows.indexOf(row) !== -1;
  9295. }
  9296. }
  9297. });
  9298. // CONCATENATED MODULE: ./packages/table/src/store/current.js
  9299. /* harmony default export */ var store_current = ({
  9300. data: function data() {
  9301. return {
  9302. states: {
  9303. // 不可响应的,设置 currentRowKey 时,data 不一定存在,也许无法算出正确的 currentRow
  9304. // 把该值缓存一下,当用户点击修改 currentRow 时,把该值重置为 null
  9305. _currentRowKey: null,
  9306. currentRow: null
  9307. }
  9308. };
  9309. },
  9310. methods: {
  9311. setCurrentRowKey: function setCurrentRowKey(key) {
  9312. this.assertRowKey();
  9313. this.states._currentRowKey = key;
  9314. this.setCurrentRowByKey(key);
  9315. },
  9316. restoreCurrentRowKey: function restoreCurrentRowKey() {
  9317. this.states._currentRowKey = null;
  9318. },
  9319. setCurrentRowByKey: function setCurrentRowByKey(key) {
  9320. var states = this.states;
  9321. var _states$data = states.data,
  9322. data = _states$data === undefined ? [] : _states$data,
  9323. rowKey = states.rowKey;
  9324. var currentRow = null;
  9325. if (rowKey) {
  9326. currentRow = Object(util_["arrayFind"])(data, function (item) {
  9327. return getRowIdentity(item, rowKey) === key;
  9328. });
  9329. }
  9330. states.currentRow = currentRow;
  9331. },
  9332. updateCurrentRow: function updateCurrentRow(currentRow) {
  9333. var states = this.states,
  9334. table = this.table;
  9335. var oldCurrentRow = states.currentRow;
  9336. if (currentRow && currentRow !== oldCurrentRow) {
  9337. states.currentRow = currentRow;
  9338. table.$emit('current-change', currentRow, oldCurrentRow);
  9339. return;
  9340. }
  9341. if (!currentRow && oldCurrentRow) {
  9342. states.currentRow = null;
  9343. table.$emit('current-change', null, oldCurrentRow);
  9344. }
  9345. },
  9346. updateCurrentRowData: function updateCurrentRowData() {
  9347. var states = this.states,
  9348. table = this.table;
  9349. var rowKey = states.rowKey,
  9350. _currentRowKey = states._currentRowKey;
  9351. // data 为 null 时,解构时的默认值会被忽略
  9352. var data = states.data || [];
  9353. var oldCurrentRow = states.currentRow;
  9354. // 当 currentRow 不在 data 中时尝试更新数据
  9355. if (data.indexOf(oldCurrentRow) === -1 && oldCurrentRow) {
  9356. if (rowKey) {
  9357. var currentRowKey = getRowIdentity(oldCurrentRow, rowKey);
  9358. this.setCurrentRowByKey(currentRowKey);
  9359. } else {
  9360. states.currentRow = null;
  9361. }
  9362. if (states.currentRow === null) {
  9363. table.$emit('current-change', null, oldCurrentRow);
  9364. }
  9365. } else if (_currentRowKey) {
  9366. // 把初始时下设置的 rowKey 转化成 rowData
  9367. this.setCurrentRowByKey(_currentRowKey);
  9368. this.restoreCurrentRowKey();
  9369. }
  9370. }
  9371. }
  9372. });
  9373. // CONCATENATED MODULE: ./packages/table/src/store/tree.js
  9374. 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; };
  9375. /* harmony default export */ var tree = ({
  9376. data: function data() {
  9377. return {
  9378. states: {
  9379. // defaultExpandAll 存在于 expand.js 中,这里不重复添加
  9380. // 在展开行中,expandRowKeys 会被转化成 expandRows,expandRowKeys 这个属性只是记录了 TreeTable 行的展开
  9381. // TODO: 拆分为独立的 TreeTable,统一用法
  9382. expandRowKeys: [],
  9383. treeData: {},
  9384. indent: 16,
  9385. lazy: false,
  9386. lazyTreeNodeMap: {},
  9387. lazyColumnIdentifier: 'hasChildren',
  9388. childrenColumnName: 'children'
  9389. }
  9390. };
  9391. },
  9392. computed: {
  9393. // 嵌入型的数据,watch 无法是检测到变化 https://github.com/ElemeFE/element/issues/14998
  9394. // TODO: 使用 computed 解决该问题,是否会造成性能问题?
  9395. // @return { id: { level, children } }
  9396. normalizedData: function normalizedData() {
  9397. if (!this.states.rowKey) return {};
  9398. var data = this.states.data || [];
  9399. return this.normalize(data);
  9400. },
  9401. // @return { id: { children } }
  9402. // 针对懒加载的情形,不处理嵌套数据
  9403. normalizedLazyNode: function normalizedLazyNode() {
  9404. var _states = this.states,
  9405. rowKey = _states.rowKey,
  9406. lazyTreeNodeMap = _states.lazyTreeNodeMap,
  9407. lazyColumnIdentifier = _states.lazyColumnIdentifier;
  9408. var keys = Object.keys(lazyTreeNodeMap);
  9409. var res = {};
  9410. if (!keys.length) return res;
  9411. keys.forEach(function (key) {
  9412. if (lazyTreeNodeMap[key].length) {
  9413. var item = { children: [] };
  9414. lazyTreeNodeMap[key].forEach(function (row) {
  9415. var currentRowKey = getRowIdentity(row, rowKey);
  9416. item.children.push(currentRowKey);
  9417. if (row[lazyColumnIdentifier] && !res[currentRowKey]) {
  9418. res[currentRowKey] = { children: [] };
  9419. }
  9420. });
  9421. res[key] = item;
  9422. }
  9423. });
  9424. return res;
  9425. }
  9426. },
  9427. watch: {
  9428. normalizedData: 'updateTreeData',
  9429. normalizedLazyNode: 'updateTreeData'
  9430. },
  9431. methods: {
  9432. normalize: function normalize(data) {
  9433. var _states2 = this.states,
  9434. childrenColumnName = _states2.childrenColumnName,
  9435. lazyColumnIdentifier = _states2.lazyColumnIdentifier,
  9436. rowKey = _states2.rowKey,
  9437. lazy = _states2.lazy;
  9438. var res = {};
  9439. walkTreeNode(data, function (parent, children, level) {
  9440. var parentId = getRowIdentity(parent, rowKey);
  9441. if (Array.isArray(children)) {
  9442. res[parentId] = {
  9443. children: children.map(function (row) {
  9444. return getRowIdentity(row, rowKey);
  9445. }),
  9446. level: level
  9447. };
  9448. } else if (lazy) {
  9449. // 当 children 不存在且 lazy 为 true,该节点即为懒加载的节点
  9450. res[parentId] = {
  9451. children: [],
  9452. lazy: true,
  9453. level: level
  9454. };
  9455. }
  9456. }, childrenColumnName, lazyColumnIdentifier);
  9457. return res;
  9458. },
  9459. updateTreeData: function updateTreeData() {
  9460. var nested = this.normalizedData;
  9461. var normalizedLazyNode = this.normalizedLazyNode;
  9462. var keys = Object.keys(nested);
  9463. var newTreeData = {};
  9464. if (keys.length) {
  9465. var _states3 = this.states,
  9466. oldTreeData = _states3.treeData,
  9467. defaultExpandAll = _states3.defaultExpandAll,
  9468. expandRowKeys = _states3.expandRowKeys,
  9469. lazy = _states3.lazy;
  9470. var rootLazyRowKeys = [];
  9471. var getExpanded = function getExpanded(oldValue, key) {
  9472. var included = defaultExpandAll || expandRowKeys && expandRowKeys.indexOf(key) !== -1;
  9473. return !!(oldValue && oldValue.expanded || included);
  9474. };
  9475. // 合并 expanded 与 display,确保数据刷新后,状态不变
  9476. keys.forEach(function (key) {
  9477. var oldValue = oldTreeData[key];
  9478. var newValue = _extends({}, nested[key]);
  9479. newValue.expanded = getExpanded(oldValue, key);
  9480. if (newValue.lazy) {
  9481. var _ref = oldValue || {},
  9482. _ref$loaded = _ref.loaded,
  9483. loaded = _ref$loaded === undefined ? false : _ref$loaded,
  9484. _ref$loading = _ref.loading,
  9485. loading = _ref$loading === undefined ? false : _ref$loading;
  9486. newValue.loaded = !!loaded;
  9487. newValue.loading = !!loading;
  9488. rootLazyRowKeys.push(key);
  9489. }
  9490. newTreeData[key] = newValue;
  9491. });
  9492. // 根据懒加载数据更新 treeData
  9493. var lazyKeys = Object.keys(normalizedLazyNode);
  9494. if (lazy && lazyKeys.length && rootLazyRowKeys.length) {
  9495. lazyKeys.forEach(function (key) {
  9496. var oldValue = oldTreeData[key];
  9497. var lazyNodeChildren = normalizedLazyNode[key].children;
  9498. if (rootLazyRowKeys.indexOf(key) !== -1) {
  9499. // 懒加载的 root 节点,更新一下原有的数据,原来的 children 一定是空数组
  9500. if (newTreeData[key].children.length !== 0) {
  9501. throw new Error('[ElTable]children must be an empty array.');
  9502. }
  9503. newTreeData[key].children = lazyNodeChildren;
  9504. } else {
  9505. var _ref2 = oldValue || {},
  9506. _ref2$loaded = _ref2.loaded,
  9507. loaded = _ref2$loaded === undefined ? false : _ref2$loaded,
  9508. _ref2$loading = _ref2.loading,
  9509. loading = _ref2$loading === undefined ? false : _ref2$loading;
  9510. newTreeData[key] = {
  9511. lazy: true,
  9512. loaded: !!loaded,
  9513. loading: !!loading,
  9514. expanded: getExpanded(oldValue, key),
  9515. children: lazyNodeChildren,
  9516. level: ''
  9517. };
  9518. }
  9519. });
  9520. }
  9521. }
  9522. this.states.treeData = newTreeData;
  9523. this.updateTableScrollY();
  9524. },
  9525. updateTreeExpandKeys: function updateTreeExpandKeys(value) {
  9526. this.states.expandRowKeys = value;
  9527. this.updateTreeData();
  9528. },
  9529. toggleTreeExpansion: function toggleTreeExpansion(row, expanded) {
  9530. this.assertRowKey();
  9531. var _states4 = this.states,
  9532. rowKey = _states4.rowKey,
  9533. treeData = _states4.treeData;
  9534. var id = getRowIdentity(row, rowKey);
  9535. var data = id && treeData[id];
  9536. if (id && data && 'expanded' in data) {
  9537. var oldExpanded = data.expanded;
  9538. expanded = typeof expanded === 'undefined' ? !data.expanded : expanded;
  9539. treeData[id].expanded = expanded;
  9540. if (oldExpanded !== expanded) {
  9541. this.table.$emit('expand-change', row, expanded);
  9542. }
  9543. this.updateTableScrollY();
  9544. }
  9545. },
  9546. loadOrToggle: function loadOrToggle(row) {
  9547. this.assertRowKey();
  9548. var _states5 = this.states,
  9549. lazy = _states5.lazy,
  9550. treeData = _states5.treeData,
  9551. rowKey = _states5.rowKey;
  9552. var id = getRowIdentity(row, rowKey);
  9553. var data = treeData[id];
  9554. if (lazy && data && 'loaded' in data && !data.loaded) {
  9555. this.loadData(row, id, data);
  9556. } else {
  9557. this.toggleTreeExpansion(row);
  9558. }
  9559. },
  9560. loadData: function loadData(row, key, treeNode) {
  9561. var _this = this;
  9562. var load = this.table.load;
  9563. var rawTreeData = this.states.treeData;
  9564. if (load && !rawTreeData[key].loaded) {
  9565. rawTreeData[key].loading = true;
  9566. load(row, treeNode, function (data) {
  9567. if (!Array.isArray(data)) {
  9568. throw new Error('[ElTable] data must be an array');
  9569. }
  9570. var _states6 = _this.states,
  9571. lazyTreeNodeMap = _states6.lazyTreeNodeMap,
  9572. treeData = _states6.treeData;
  9573. treeData[key].loading = false;
  9574. treeData[key].loaded = true;
  9575. treeData[key].expanded = true;
  9576. if (data.length) {
  9577. _this.$set(lazyTreeNodeMap, key, data);
  9578. }
  9579. _this.table.$emit('expand-change', row, true);
  9580. });
  9581. }
  9582. }
  9583. }
  9584. });
  9585. // CONCATENATED MODULE: ./packages/table/src/store/watcher.js
  9586. var watcher_sortData = function sortData(data, states) {
  9587. var sortingColumn = states.sortingColumn;
  9588. if (!sortingColumn || typeof sortingColumn.sortable === 'string') {
  9589. return data;
  9590. }
  9591. return util_orderBy(data, states.sortProp, states.sortOrder, sortingColumn.sortMethod, sortingColumn.sortBy);
  9592. };
  9593. var doFlattenColumns = function doFlattenColumns(columns) {
  9594. var result = [];
  9595. columns.forEach(function (column) {
  9596. if (column.children) {
  9597. result.push.apply(result, doFlattenColumns(column.children));
  9598. } else {
  9599. result.push(column);
  9600. }
  9601. });
  9602. return result;
  9603. };
  9604. /* harmony default export */ var watcher = (external_vue_default.a.extend({
  9605. data: function data() {
  9606. return {
  9607. states: {
  9608. // 3.0 版本后要求必须设置该属性
  9609. rowKey: null,
  9610. // 渲染的数据来源,是对 table 中的 data 过滤排序后的结果
  9611. data: [],
  9612. // 是否包含固定列
  9613. isComplex: false,
  9614. // 列
  9615. _columns: [], // 不可响应的
  9616. originColumns: [],
  9617. columns: [],
  9618. fixedColumns: [],
  9619. rightFixedColumns: [],
  9620. leafColumns: [],
  9621. fixedLeafColumns: [],
  9622. rightFixedLeafColumns: [],
  9623. leafColumnsLength: 0,
  9624. fixedLeafColumnsLength: 0,
  9625. rightFixedLeafColumnsLength: 0,
  9626. // 选择
  9627. isAllSelected: false,
  9628. selection: [],
  9629. reserveSelection: false,
  9630. selectOnIndeterminate: false,
  9631. selectable: null,
  9632. // 过滤
  9633. filters: {}, // 不可响应的
  9634. filteredData: null,
  9635. // 排序
  9636. sortingColumn: null,
  9637. sortProp: null,
  9638. sortOrder: null,
  9639. hoverRow: null
  9640. }
  9641. };
  9642. },
  9643. mixins: [expand, store_current, tree],
  9644. methods: {
  9645. // 检查 rowKey 是否存在
  9646. assertRowKey: function assertRowKey() {
  9647. var rowKey = this.states.rowKey;
  9648. if (!rowKey) throw new Error('[ElTable] prop row-key is required');
  9649. },
  9650. // 更新列
  9651. updateColumns: function updateColumns() {
  9652. var states = this.states;
  9653. var _columns = states._columns || [];
  9654. states.fixedColumns = _columns.filter(function (column) {
  9655. return column.fixed === true || column.fixed === 'left';
  9656. });
  9657. states.rightFixedColumns = _columns.filter(function (column) {
  9658. return column.fixed === 'right';
  9659. });
  9660. if (states.fixedColumns.length > 0 && _columns[0] && _columns[0].type === 'selection' && !_columns[0].fixed) {
  9661. _columns[0].fixed = true;
  9662. states.fixedColumns.unshift(_columns[0]);
  9663. }
  9664. var notFixedColumns = _columns.filter(function (column) {
  9665. return !column.fixed;
  9666. });
  9667. states.originColumns = [].concat(states.fixedColumns).concat(notFixedColumns).concat(states.rightFixedColumns);
  9668. var leafColumns = doFlattenColumns(notFixedColumns);
  9669. var fixedLeafColumns = doFlattenColumns(states.fixedColumns);
  9670. var rightFixedLeafColumns = doFlattenColumns(states.rightFixedColumns);
  9671. states.leafColumnsLength = leafColumns.length;
  9672. states.fixedLeafColumnsLength = fixedLeafColumns.length;
  9673. states.rightFixedLeafColumnsLength = rightFixedLeafColumns.length;
  9674. states.columns = [].concat(fixedLeafColumns).concat(leafColumns).concat(rightFixedLeafColumns);
  9675. states.isComplex = states.fixedColumns.length > 0 || states.rightFixedColumns.length > 0;
  9676. },
  9677. // 更新 DOM
  9678. scheduleLayout: function scheduleLayout(needUpdateColumns) {
  9679. if (needUpdateColumns) {
  9680. this.updateColumns();
  9681. }
  9682. this.table.debouncedUpdateLayout();
  9683. },
  9684. // 选择
  9685. isSelected: function isSelected(row) {
  9686. var _states$selection = this.states.selection,
  9687. selection = _states$selection === undefined ? [] : _states$selection;
  9688. return selection.indexOf(row) > -1;
  9689. },
  9690. clearSelection: function clearSelection() {
  9691. var states = this.states;
  9692. states.isAllSelected = false;
  9693. var oldSelection = states.selection;
  9694. if (oldSelection.length) {
  9695. states.selection = [];
  9696. this.table.$emit('selection-change', []);
  9697. }
  9698. },
  9699. cleanSelection: function cleanSelection() {
  9700. var states = this.states;
  9701. var data = states.data,
  9702. rowKey = states.rowKey,
  9703. selection = states.selection;
  9704. var deleted = void 0;
  9705. if (rowKey) {
  9706. deleted = [];
  9707. var selectedMap = getKeysMap(selection, rowKey);
  9708. var dataMap = getKeysMap(data, rowKey);
  9709. for (var key in selectedMap) {
  9710. if (selectedMap.hasOwnProperty(key) && !dataMap[key]) {
  9711. deleted.push(selectedMap[key].row);
  9712. }
  9713. }
  9714. } else {
  9715. deleted = selection.filter(function (item) {
  9716. return data.indexOf(item) === -1;
  9717. });
  9718. }
  9719. if (deleted.length) {
  9720. var newSelection = selection.filter(function (item) {
  9721. return deleted.indexOf(item) === -1;
  9722. });
  9723. states.selection = newSelection;
  9724. this.table.$emit('selection-change', newSelection.slice());
  9725. }
  9726. },
  9727. toggleRowSelection: function toggleRowSelection(row, selected) {
  9728. var emitChange = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  9729. var changed = toggleRowStatus(this.states.selection, row, selected);
  9730. if (changed) {
  9731. var newSelection = (this.states.selection || []).slice();
  9732. // 调用 API 修改选中值,不触发 select 事件
  9733. if (emitChange) {
  9734. this.table.$emit('select', newSelection, row);
  9735. }
  9736. this.table.$emit('selection-change', newSelection);
  9737. }
  9738. },
  9739. _toggleAllSelection: function _toggleAllSelection() {
  9740. var states = this.states;
  9741. var _states$data = states.data,
  9742. data = _states$data === undefined ? [] : _states$data,
  9743. selection = states.selection;
  9744. // when only some rows are selected (but not all), select or deselect all of them
  9745. // depending on the value of selectOnIndeterminate
  9746. var value = states.selectOnIndeterminate ? !states.isAllSelected : !(states.isAllSelected || selection.length);
  9747. states.isAllSelected = value;
  9748. var selectionChanged = false;
  9749. data.forEach(function (row, index) {
  9750. if (states.selectable) {
  9751. if (states.selectable.call(null, row, index) && toggleRowStatus(selection, row, value)) {
  9752. selectionChanged = true;
  9753. }
  9754. } else {
  9755. if (toggleRowStatus(selection, row, value)) {
  9756. selectionChanged = true;
  9757. }
  9758. }
  9759. });
  9760. if (selectionChanged) {
  9761. this.table.$emit('selection-change', selection ? selection.slice() : []);
  9762. }
  9763. this.table.$emit('select-all', selection);
  9764. },
  9765. updateSelectionByRowKey: function updateSelectionByRowKey() {
  9766. var states = this.states;
  9767. var selection = states.selection,
  9768. rowKey = states.rowKey,
  9769. data = states.data;
  9770. var selectedMap = getKeysMap(selection, rowKey);
  9771. data.forEach(function (row) {
  9772. var rowId = getRowIdentity(row, rowKey);
  9773. var rowInfo = selectedMap[rowId];
  9774. if (rowInfo) {
  9775. selection[rowInfo.index] = row;
  9776. }
  9777. });
  9778. },
  9779. updateAllSelected: function updateAllSelected() {
  9780. var states = this.states;
  9781. var selection = states.selection,
  9782. rowKey = states.rowKey,
  9783. selectable = states.selectable;
  9784. // data 为 null 时,解构时的默认值会被忽略
  9785. var data = states.data || [];
  9786. if (data.length === 0) {
  9787. states.isAllSelected = false;
  9788. return;
  9789. }
  9790. var selectedMap = void 0;
  9791. if (rowKey) {
  9792. selectedMap = getKeysMap(selection, rowKey);
  9793. }
  9794. var isSelected = function isSelected(row) {
  9795. if (selectedMap) {
  9796. return !!selectedMap[getRowIdentity(row, rowKey)];
  9797. } else {
  9798. return selection.indexOf(row) !== -1;
  9799. }
  9800. };
  9801. var isAllSelected = true;
  9802. var selectedCount = 0;
  9803. for (var i = 0, j = data.length; i < j; i++) {
  9804. var item = data[i];
  9805. var isRowSelectable = selectable && selectable.call(null, item, i);
  9806. if (!isSelected(item)) {
  9807. if (!selectable || isRowSelectable) {
  9808. isAllSelected = false;
  9809. break;
  9810. }
  9811. } else {
  9812. selectedCount++;
  9813. }
  9814. }
  9815. if (selectedCount === 0) isAllSelected = false;
  9816. states.isAllSelected = isAllSelected;
  9817. },
  9818. // 过滤与排序
  9819. updateFilters: function updateFilters(columns, values) {
  9820. if (!Array.isArray(columns)) {
  9821. columns = [columns];
  9822. }
  9823. var states = this.states;
  9824. var filters = {};
  9825. columns.forEach(function (col) {
  9826. states.filters[col.id] = values;
  9827. filters[col.columnKey || col.id] = values;
  9828. });
  9829. return filters;
  9830. },
  9831. updateSort: function updateSort(column, prop, order) {
  9832. if (this.states.sortingColumn && this.states.sortingColumn !== column) {
  9833. this.states.sortingColumn.order = null;
  9834. }
  9835. this.states.sortingColumn = column;
  9836. this.states.sortProp = prop;
  9837. this.states.sortOrder = order;
  9838. },
  9839. execFilter: function execFilter() {
  9840. var _this = this;
  9841. var states = this.states;
  9842. var _data = states._data,
  9843. filters = states.filters;
  9844. var data = _data;
  9845. Object.keys(filters).forEach(function (columnId) {
  9846. var values = states.filters[columnId];
  9847. if (!values || values.length === 0) return;
  9848. var column = getColumnById(_this.states, columnId);
  9849. if (column && column.filterMethod) {
  9850. data = data.filter(function (row) {
  9851. return values.some(function (value) {
  9852. return column.filterMethod.call(null, value, row, column);
  9853. });
  9854. });
  9855. }
  9856. });
  9857. states.filteredData = data;
  9858. },
  9859. execSort: function execSort() {
  9860. var states = this.states;
  9861. states.data = watcher_sortData(states.filteredData, states);
  9862. },
  9863. // 根据 filters 与 sort 去过滤 data
  9864. execQuery: function execQuery(ignore) {
  9865. if (!(ignore && ignore.filter)) {
  9866. this.execFilter();
  9867. }
  9868. this.execSort();
  9869. },
  9870. clearFilter: function clearFilter(columnKeys) {
  9871. var states = this.states;
  9872. var _table$$refs = this.table.$refs,
  9873. tableHeader = _table$$refs.tableHeader,
  9874. fixedTableHeader = _table$$refs.fixedTableHeader,
  9875. rightFixedTableHeader = _table$$refs.rightFixedTableHeader;
  9876. var panels = {};
  9877. if (tableHeader) panels = merge_default()(panels, tableHeader.filterPanels);
  9878. if (fixedTableHeader) panels = merge_default()(panels, fixedTableHeader.filterPanels);
  9879. if (rightFixedTableHeader) panels = merge_default()(panels, rightFixedTableHeader.filterPanels);
  9880. var keys = Object.keys(panels);
  9881. if (!keys.length) return;
  9882. if (typeof columnKeys === 'string') {
  9883. columnKeys = [columnKeys];
  9884. }
  9885. if (Array.isArray(columnKeys)) {
  9886. var columns = columnKeys.map(function (key) {
  9887. return getColumnByKey(states, key);
  9888. });
  9889. keys.forEach(function (key) {
  9890. var column = columns.find(function (col) {
  9891. return col.id === key;
  9892. });
  9893. if (column) {
  9894. // TODO: 优化这里的代码
  9895. panels[key].filteredValue = [];
  9896. }
  9897. });
  9898. this.commit('filterChange', {
  9899. column: columns,
  9900. values: [],
  9901. silent: true,
  9902. multi: true
  9903. });
  9904. } else {
  9905. keys.forEach(function (key) {
  9906. // TODO: 优化这里的代码
  9907. panels[key].filteredValue = [];
  9908. });
  9909. states.filters = {};
  9910. this.commit('filterChange', {
  9911. column: {},
  9912. values: [],
  9913. silent: true
  9914. });
  9915. }
  9916. },
  9917. clearSort: function clearSort() {
  9918. var states = this.states;
  9919. if (!states.sortingColumn) return;
  9920. this.updateSort(null, null, null);
  9921. this.commit('changeSortCondition', {
  9922. silent: true
  9923. });
  9924. },
  9925. // 适配层,expand-row-keys 在 Expand 与 TreeTable 中都有使用
  9926. setExpandRowKeysAdapter: function setExpandRowKeysAdapter(val) {
  9927. // 这里会触发额外的计算,但为了兼容性,暂时这么做
  9928. this.setExpandRowKeys(val);
  9929. this.updateTreeExpandKeys(val);
  9930. },
  9931. // 展开行与 TreeTable 都要使用
  9932. toggleRowExpansionAdapter: function toggleRowExpansionAdapter(row, expanded) {
  9933. var hasExpandColumn = this.states.columns.some(function (_ref) {
  9934. var type = _ref.type;
  9935. return type === 'expand';
  9936. });
  9937. if (hasExpandColumn) {
  9938. this.toggleRowExpansion(row, expanded);
  9939. } else {
  9940. this.toggleTreeExpansion(row, expanded);
  9941. }
  9942. }
  9943. }
  9944. }));
  9945. // CONCATENATED MODULE: ./packages/table/src/store/index.js
  9946. watcher.prototype.mutations = {
  9947. setData: function setData(states, data) {
  9948. var dataInstanceChanged = states._data !== data;
  9949. states._data = data;
  9950. this.execQuery();
  9951. // 数据变化,更新部分数据。
  9952. // 没有使用 computed,而是手动更新部分数据 https://github.com/vuejs/vue/issues/6660#issuecomment-331417140
  9953. this.updateCurrentRowData();
  9954. this.updateExpandRows();
  9955. if (states.reserveSelection) {
  9956. this.assertRowKey();
  9957. this.updateSelectionByRowKey();
  9958. } else {
  9959. if (dataInstanceChanged) {
  9960. this.clearSelection();
  9961. } else {
  9962. this.cleanSelection();
  9963. }
  9964. }
  9965. this.updateAllSelected();
  9966. this.updateTableScrollY();
  9967. },
  9968. insertColumn: function insertColumn(states, column, index, parent) {
  9969. var array = states._columns;
  9970. if (parent) {
  9971. array = parent.children;
  9972. if (!array) array = parent.children = [];
  9973. }
  9974. if (typeof index !== 'undefined') {
  9975. array.splice(index, 0, column);
  9976. } else {
  9977. array.push(column);
  9978. }
  9979. if (column.type === 'selection') {
  9980. states.selectable = column.selectable;
  9981. states.reserveSelection = column.reserveSelection;
  9982. }
  9983. if (this.table.$ready) {
  9984. this.updateColumns(); // hack for dynamics insert column
  9985. this.scheduleLayout();
  9986. }
  9987. },
  9988. removeColumn: function removeColumn(states, column, parent) {
  9989. var array = states._columns;
  9990. if (parent) {
  9991. array = parent.children;
  9992. if (!array) array = parent.children = [];
  9993. }
  9994. if (array) {
  9995. array.splice(array.indexOf(column), 1);
  9996. }
  9997. if (this.table.$ready) {
  9998. this.updateColumns(); // hack for dynamics remove column
  9999. this.scheduleLayout();
  10000. }
  10001. },
  10002. sort: function sort(states, options) {
  10003. var prop = options.prop,
  10004. order = options.order,
  10005. init = options.init;
  10006. if (prop) {
  10007. var column = Object(util_["arrayFind"])(states.columns, function (column) {
  10008. return column.property === prop;
  10009. });
  10010. if (column) {
  10011. column.order = order;
  10012. this.updateSort(column, prop, order);
  10013. this.commit('changeSortCondition', { init: init });
  10014. }
  10015. }
  10016. },
  10017. changeSortCondition: function changeSortCondition(states, options) {
  10018. // 修复 pr https://github.com/ElemeFE/element/pull/15012 导致的 bug
  10019. var column = states.sortingColumn,
  10020. prop = states.sortProp,
  10021. order = states.sortOrder;
  10022. if (order === null) {
  10023. states.sortingColumn = null;
  10024. states.sortProp = null;
  10025. }
  10026. var ingore = { filter: true };
  10027. this.execQuery(ingore);
  10028. if (!options || !(options.silent || options.init)) {
  10029. this.table.$emit('sort-change', {
  10030. column: column,
  10031. prop: prop,
  10032. order: order
  10033. });
  10034. }
  10035. this.updateTableScrollY();
  10036. },
  10037. filterChange: function filterChange(states, options) {
  10038. var column = options.column,
  10039. values = options.values,
  10040. silent = options.silent;
  10041. var newFilters = this.updateFilters(column, values);
  10042. this.execQuery();
  10043. if (!silent) {
  10044. this.table.$emit('filter-change', newFilters);
  10045. }
  10046. this.updateTableScrollY();
  10047. },
  10048. toggleAllSelection: function toggleAllSelection() {
  10049. this.toggleAllSelection();
  10050. },
  10051. rowSelectedChanged: function rowSelectedChanged(states, row) {
  10052. this.toggleRowSelection(row);
  10053. this.updateAllSelected();
  10054. },
  10055. setHoverRow: function setHoverRow(states, row) {
  10056. states.hoverRow = row;
  10057. },
  10058. setCurrentRow: function setCurrentRow(states, row) {
  10059. this.updateCurrentRow(row);
  10060. }
  10061. };
  10062. watcher.prototype.commit = function (name) {
  10063. var mutations = this.mutations;
  10064. if (mutations[name]) {
  10065. for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  10066. args[_key - 1] = arguments[_key];
  10067. }
  10068. mutations[name].apply(this, [this.states].concat(args));
  10069. } else {
  10070. throw new Error('Action not found: ' + name);
  10071. }
  10072. };
  10073. watcher.prototype.updateTableScrollY = function () {
  10074. external_vue_default.a.nextTick(this.table.updateScrollY);
  10075. };
  10076. /* harmony default export */ var src_store = (watcher);
  10077. // CONCATENATED MODULE: ./packages/table/src/store/helper.js
  10078. function createStore(table) {
  10079. var initialState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10080. if (!table) {
  10081. throw new Error('Table is required.');
  10082. }
  10083. var store = new src_store();
  10084. store.table = table;
  10085. // fix https://github.com/ElemeFE/element/issues/14075
  10086. // related pr https://github.com/ElemeFE/element/pull/14146
  10087. store.toggleAllSelection = debounce_default()(10, store._toggleAllSelection);
  10088. Object.keys(initialState).forEach(function (key) {
  10089. store.states[key] = initialState[key];
  10090. });
  10091. return store;
  10092. }
  10093. function mapStates(mapper) {
  10094. var res = {};
  10095. Object.keys(mapper).forEach(function (key) {
  10096. var value = mapper[key];
  10097. var fn = void 0;
  10098. if (typeof value === 'string') {
  10099. fn = function fn() {
  10100. return this.store.states[value];
  10101. };
  10102. } else if (typeof value === 'function') {
  10103. fn = function fn() {
  10104. return value.call(this, this.store.states);
  10105. };
  10106. } else {
  10107. console.error('invalid value type');
  10108. }
  10109. if (fn) {
  10110. res[key] = fn;
  10111. }
  10112. });
  10113. return res;
  10114. };
  10115. // EXTERNAL MODULE: external "element-ui/lib/utils/scrollbar-width"
  10116. var scrollbar_width_ = __webpack_require__(31);
  10117. var scrollbar_width_default = /*#__PURE__*/__webpack_require__.n(scrollbar_width_);
  10118. // CONCATENATED MODULE: ./packages/table/src/table-layout.js
  10119. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10120. var table_layout_TableLayout = function () {
  10121. function TableLayout(options) {
  10122. _classCallCheck(this, TableLayout);
  10123. this.observers = [];
  10124. this.table = null;
  10125. this.store = null;
  10126. this.columns = null;
  10127. this.fit = true;
  10128. this.showHeader = true;
  10129. this.height = null;
  10130. this.scrollX = false;
  10131. this.scrollY = false;
  10132. this.bodyWidth = null;
  10133. this.fixedWidth = null;
  10134. this.rightFixedWidth = null;
  10135. this.tableHeight = null;
  10136. this.headerHeight = 44; // Table Header Height
  10137. this.appendHeight = 0; // Append Slot Height
  10138. this.footerHeight = 44; // Table Footer Height
  10139. this.viewportHeight = null; // Table Height - Scroll Bar Height
  10140. this.bodyHeight = null; // Table Height - Table Header Height
  10141. this.fixedBodyHeight = null; // Table Height - Table Header Height - Scroll Bar Height
  10142. this.gutterWidth = scrollbar_width_default()();
  10143. for (var name in options) {
  10144. if (options.hasOwnProperty(name)) {
  10145. this[name] = options[name];
  10146. }
  10147. }
  10148. if (!this.table) {
  10149. throw new Error('table is required for Table Layout');
  10150. }
  10151. if (!this.store) {
  10152. throw new Error('store is required for Table Layout');
  10153. }
  10154. }
  10155. TableLayout.prototype.updateScrollY = function updateScrollY() {
  10156. var height = this.height;
  10157. if (height === null) return false;
  10158. var bodyWrapper = this.table.bodyWrapper;
  10159. if (this.table.$el && bodyWrapper) {
  10160. var body = bodyWrapper.querySelector('.el-table__body');
  10161. var prevScrollY = this.scrollY;
  10162. var scrollY = body.offsetHeight > this.bodyHeight;
  10163. this.scrollY = scrollY;
  10164. return prevScrollY !== scrollY;
  10165. }
  10166. return false;
  10167. };
  10168. TableLayout.prototype.setHeight = function setHeight(value) {
  10169. var _this = this;
  10170. var prop = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'height';
  10171. if (external_vue_default.a.prototype.$isServer) return;
  10172. var el = this.table.$el;
  10173. value = parseHeight(value);
  10174. this.height = value;
  10175. if (!el && (value || value === 0)) return external_vue_default.a.nextTick(function () {
  10176. return _this.setHeight(value, prop);
  10177. });
  10178. if (typeof value === 'number') {
  10179. el.style[prop] = value + 'px';
  10180. this.updateElsHeight();
  10181. } else if (typeof value === 'string') {
  10182. el.style[prop] = value;
  10183. this.updateElsHeight();
  10184. }
  10185. };
  10186. TableLayout.prototype.setMaxHeight = function setMaxHeight(value) {
  10187. this.setHeight(value, 'max-height');
  10188. };
  10189. TableLayout.prototype.getFlattenColumns = function getFlattenColumns() {
  10190. var flattenColumns = [];
  10191. var columns = this.table.columns;
  10192. columns.forEach(function (column) {
  10193. if (column.isColumnGroup) {
  10194. flattenColumns.push.apply(flattenColumns, column.columns);
  10195. } else {
  10196. flattenColumns.push(column);
  10197. }
  10198. });
  10199. return flattenColumns;
  10200. };
  10201. TableLayout.prototype.updateElsHeight = function updateElsHeight() {
  10202. var _this2 = this;
  10203. if (!this.table.$ready) return external_vue_default.a.nextTick(function () {
  10204. return _this2.updateElsHeight();
  10205. });
  10206. var _table$$refs = this.table.$refs,
  10207. headerWrapper = _table$$refs.headerWrapper,
  10208. appendWrapper = _table$$refs.appendWrapper,
  10209. footerWrapper = _table$$refs.footerWrapper;
  10210. this.appendHeight = appendWrapper ? appendWrapper.offsetHeight : 0;
  10211. if (this.showHeader && !headerWrapper) return;
  10212. // fix issue (https://github.com/ElemeFE/element/pull/16956)
  10213. var headerTrElm = headerWrapper ? headerWrapper.querySelector('.el-table__header tr') : null;
  10214. var noneHeader = this.headerDisplayNone(headerTrElm);
  10215. var headerHeight = this.headerHeight = !this.showHeader ? 0 : headerWrapper.offsetHeight;
  10216. if (this.showHeader && !noneHeader && headerWrapper.offsetWidth > 0 && (this.table.columns || []).length > 0 && headerHeight < 2) {
  10217. return external_vue_default.a.nextTick(function () {
  10218. return _this2.updateElsHeight();
  10219. });
  10220. }
  10221. var tableHeight = this.tableHeight = this.table.$el.clientHeight;
  10222. var footerHeight = this.footerHeight = footerWrapper ? footerWrapper.offsetHeight : 0;
  10223. if (this.height !== null) {
  10224. this.bodyHeight = tableHeight - headerHeight - footerHeight + (footerWrapper ? 1 : 0);
  10225. }
  10226. this.fixedBodyHeight = this.scrollX ? this.bodyHeight - this.gutterWidth : this.bodyHeight;
  10227. var noData = !(this.store.states.data && this.store.states.data.length);
  10228. this.viewportHeight = this.scrollX ? tableHeight - (noData ? 0 : this.gutterWidth) : tableHeight;
  10229. this.updateScrollY();
  10230. this.notifyObservers('scrollable');
  10231. };
  10232. TableLayout.prototype.headerDisplayNone = function headerDisplayNone(elm) {
  10233. if (!elm) return true;
  10234. var headerChild = elm;
  10235. while (headerChild.tagName !== 'DIV') {
  10236. if (getComputedStyle(headerChild).display === 'none') {
  10237. return true;
  10238. }
  10239. headerChild = headerChild.parentElement;
  10240. }
  10241. return false;
  10242. };
  10243. TableLayout.prototype.updateColumnsWidth = function updateColumnsWidth() {
  10244. if (external_vue_default.a.prototype.$isServer) return;
  10245. var fit = this.fit;
  10246. var bodyWidth = this.table.$el.clientWidth;
  10247. var bodyMinWidth = 0;
  10248. var flattenColumns = this.getFlattenColumns();
  10249. var flexColumns = flattenColumns.filter(function (column) {
  10250. return typeof column.width !== 'number';
  10251. });
  10252. flattenColumns.forEach(function (column) {
  10253. // Clean those columns whose width changed from flex to unflex
  10254. if (typeof column.width === 'number' && column.realWidth) column.realWidth = null;
  10255. });
  10256. if (flexColumns.length > 0 && fit) {
  10257. flattenColumns.forEach(function (column) {
  10258. bodyMinWidth += column.width || column.minWidth || 80;
  10259. });
  10260. var scrollYWidth = this.scrollY ? this.gutterWidth : 0;
  10261. if (bodyMinWidth <= bodyWidth - scrollYWidth) {
  10262. // DON'T HAVE SCROLL BAR
  10263. this.scrollX = false;
  10264. var totalFlexWidth = bodyWidth - scrollYWidth - bodyMinWidth;
  10265. if (flexColumns.length === 1) {
  10266. flexColumns[0].realWidth = (flexColumns[0].minWidth || 80) + totalFlexWidth;
  10267. } else {
  10268. var allColumnsWidth = flexColumns.reduce(function (prev, column) {
  10269. return prev + (column.minWidth || 80);
  10270. }, 0);
  10271. var flexWidthPerPixel = totalFlexWidth / allColumnsWidth;
  10272. var noneFirstWidth = 0;
  10273. flexColumns.forEach(function (column, index) {
  10274. if (index === 0) return;
  10275. var flexWidth = Math.floor((column.minWidth || 80) * flexWidthPerPixel);
  10276. noneFirstWidth += flexWidth;
  10277. column.realWidth = (column.minWidth || 80) + flexWidth;
  10278. });
  10279. flexColumns[0].realWidth = (flexColumns[0].minWidth || 80) + totalFlexWidth - noneFirstWidth;
  10280. }
  10281. } else {
  10282. // HAVE HORIZONTAL SCROLL BAR
  10283. this.scrollX = true;
  10284. flexColumns.forEach(function (column) {
  10285. column.realWidth = column.minWidth;
  10286. });
  10287. }
  10288. this.bodyWidth = Math.max(bodyMinWidth, bodyWidth);
  10289. this.table.resizeState.width = this.bodyWidth;
  10290. } else {
  10291. flattenColumns.forEach(function (column) {
  10292. if (!column.width && !column.minWidth) {
  10293. column.realWidth = 80;
  10294. } else {
  10295. column.realWidth = column.width || column.minWidth;
  10296. }
  10297. bodyMinWidth += column.realWidth;
  10298. });
  10299. this.scrollX = bodyMinWidth > bodyWidth;
  10300. this.bodyWidth = bodyMinWidth;
  10301. }
  10302. var fixedColumns = this.store.states.fixedColumns;
  10303. if (fixedColumns.length > 0) {
  10304. var fixedWidth = 0;
  10305. fixedColumns.forEach(function (column) {
  10306. fixedWidth += column.realWidth || column.width;
  10307. });
  10308. this.fixedWidth = fixedWidth;
  10309. }
  10310. var rightFixedColumns = this.store.states.rightFixedColumns;
  10311. if (rightFixedColumns.length > 0) {
  10312. var rightFixedWidth = 0;
  10313. rightFixedColumns.forEach(function (column) {
  10314. rightFixedWidth += column.realWidth || column.width;
  10315. });
  10316. this.rightFixedWidth = rightFixedWidth;
  10317. }
  10318. this.notifyObservers('columns');
  10319. };
  10320. TableLayout.prototype.addObserver = function addObserver(observer) {
  10321. this.observers.push(observer);
  10322. };
  10323. TableLayout.prototype.removeObserver = function removeObserver(observer) {
  10324. var index = this.observers.indexOf(observer);
  10325. if (index !== -1) {
  10326. this.observers.splice(index, 1);
  10327. }
  10328. };
  10329. TableLayout.prototype.notifyObservers = function notifyObservers(event) {
  10330. var _this3 = this;
  10331. var observers = this.observers;
  10332. observers.forEach(function (observer) {
  10333. switch (event) {
  10334. case 'columns':
  10335. observer.onColumnsChange(_this3);
  10336. break;
  10337. case 'scrollable':
  10338. observer.onScrollableChange(_this3);
  10339. break;
  10340. default:
  10341. throw new Error('Table Layout don\'t have event ' + event + '.');
  10342. }
  10343. });
  10344. };
  10345. return TableLayout;
  10346. }();
  10347. /* harmony default export */ var table_layout = (table_layout_TableLayout);
  10348. // CONCATENATED MODULE: ./packages/table/src/layout-observer.js
  10349. /* harmony default export */ var layout_observer = ({
  10350. created: function created() {
  10351. this.tableLayout.addObserver(this);
  10352. },
  10353. destroyed: function destroyed() {
  10354. this.tableLayout.removeObserver(this);
  10355. },
  10356. computed: {
  10357. tableLayout: function tableLayout() {
  10358. var layout = this.layout;
  10359. if (!layout && this.table) {
  10360. layout = this.table.layout;
  10361. }
  10362. if (!layout) {
  10363. throw new Error('Can not find table layout.');
  10364. }
  10365. return layout;
  10366. }
  10367. },
  10368. mounted: function mounted() {
  10369. this.onColumnsChange(this.tableLayout);
  10370. this.onScrollableChange(this.tableLayout);
  10371. },
  10372. updated: function updated() {
  10373. if (this.__updated__) return;
  10374. this.onColumnsChange(this.tableLayout);
  10375. this.onScrollableChange(this.tableLayout);
  10376. this.__updated__ = true;
  10377. },
  10378. methods: {
  10379. onColumnsChange: function onColumnsChange(layout) {
  10380. var cols = this.$el.querySelectorAll('colgroup > col');
  10381. if (!cols.length) return;
  10382. var flattenColumns = layout.getFlattenColumns();
  10383. var columnsMap = {};
  10384. flattenColumns.forEach(function (column) {
  10385. columnsMap[column.id] = column;
  10386. });
  10387. for (var i = 0, j = cols.length; i < j; i++) {
  10388. var col = cols[i];
  10389. var name = col.getAttribute('name');
  10390. var column = columnsMap[name];
  10391. if (column) {
  10392. col.setAttribute('width', column.realWidth || column.width);
  10393. }
  10394. }
  10395. },
  10396. onScrollableChange: function onScrollableChange(layout) {
  10397. var cols = this.$el.querySelectorAll('colgroup > col[name=gutter]');
  10398. for (var i = 0, j = cols.length; i < j; i++) {
  10399. var col = cols[i];
  10400. col.setAttribute('width', layout.scrollY ? layout.gutterWidth : '0');
  10401. }
  10402. var ths = this.$el.querySelectorAll('th.gutter');
  10403. for (var _i = 0, _j = ths.length; _i < _j; _i++) {
  10404. var th = ths[_i];
  10405. th.style.width = layout.scrollY ? layout.gutterWidth + 'px' : '0';
  10406. th.style.display = layout.scrollY ? '' : 'none';
  10407. }
  10408. }
  10409. }
  10410. });
  10411. // CONCATENATED MODULE: ./packages/table/src/table-row.js
  10412. var table_row_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; };
  10413. /* harmony default export */ var table_row = ({
  10414. name: 'ElTableRow',
  10415. props: ['columns', 'row', 'index', 'isSelected', 'isExpanded', 'store', 'context', 'firstDefaultColumnIndex', 'treeRowData', 'treeIndent', 'columnsHidden', 'getSpan', 'getColspanRealWidth', 'getCellStyle', 'getCellClass', 'handleCellMouseLeave', 'handleCellMouseEnter', 'fixed'],
  10416. components: {
  10417. ElCheckbox: checkbox_default.a
  10418. },
  10419. render: function render() {
  10420. var _this = this;
  10421. var h = arguments[0];
  10422. var columns = this.columns,
  10423. row = this.row,
  10424. $index = this.index,
  10425. store = this.store,
  10426. context = this.context,
  10427. firstDefaultColumnIndex = this.firstDefaultColumnIndex,
  10428. treeRowData = this.treeRowData,
  10429. treeIndent = this.treeIndent,
  10430. _columnsHidden = this.columnsHidden,
  10431. columnsHidden = _columnsHidden === undefined ? [] : _columnsHidden,
  10432. isSelected = this.isSelected,
  10433. isExpanded = this.isExpanded;
  10434. return h('tr', [columns.map(function (column, cellIndex) {
  10435. var _getSpan = _this.getSpan(row, column, $index, cellIndex),
  10436. rowspan = _getSpan.rowspan,
  10437. colspan = _getSpan.colspan;
  10438. if (!rowspan || !colspan) {
  10439. return null;
  10440. }
  10441. var columnData = table_row_extends({}, column);
  10442. columnData.realWidth = _this.getColspanRealWidth(columns, colspan, cellIndex);
  10443. var data = {
  10444. store: store,
  10445. isSelected: isSelected,
  10446. isExpanded: isExpanded,
  10447. _self: context,
  10448. column: columnData,
  10449. row: row,
  10450. $index: $index
  10451. };
  10452. if (cellIndex === firstDefaultColumnIndex && treeRowData) {
  10453. data.treeNode = {
  10454. indent: treeRowData.level * treeIndent,
  10455. level: treeRowData.level
  10456. };
  10457. if (typeof treeRowData.expanded === 'boolean') {
  10458. data.treeNode.expanded = treeRowData.expanded;
  10459. // 表明是懒加载
  10460. if ('loading' in treeRowData) {
  10461. data.treeNode.loading = treeRowData.loading;
  10462. }
  10463. if ('noLazyChildren' in treeRowData) {
  10464. data.treeNode.noLazyChildren = treeRowData.noLazyChildren;
  10465. }
  10466. }
  10467. }
  10468. return h(
  10469. 'td',
  10470. {
  10471. style: _this.getCellStyle($index, cellIndex, row, column),
  10472. 'class': _this.getCellClass($index, cellIndex, row, column),
  10473. attrs: { rowspan: rowspan,
  10474. colspan: colspan
  10475. },
  10476. on: {
  10477. 'mouseenter': function mouseenter($event) {
  10478. return _this.handleCellMouseEnter($event, row);
  10479. },
  10480. 'mouseleave': _this.handleCellMouseLeave
  10481. }
  10482. },
  10483. [column.renderCell.call(_this._renderProxy, _this.$createElement, data, columnsHidden[cellIndex])]
  10484. );
  10485. })]);
  10486. }
  10487. });
  10488. // CONCATENATED MODULE: ./packages/table/src/table-body.js
  10489. var table_body_typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  10490. var table_body_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; };
  10491. /* harmony default export */ var table_body = ({
  10492. name: 'ElTableBody',
  10493. mixins: [layout_observer],
  10494. components: {
  10495. ElCheckbox: checkbox_default.a,
  10496. ElTooltip: tooltip_default.a,
  10497. TableRow: table_row
  10498. },
  10499. props: {
  10500. store: {
  10501. required: true
  10502. },
  10503. stripe: Boolean,
  10504. context: {},
  10505. rowClassName: [String, Function],
  10506. rowStyle: [Object, Function],
  10507. fixed: String,
  10508. highlight: Boolean
  10509. },
  10510. render: function render(h) {
  10511. var _this = this;
  10512. var data = this.data || [];
  10513. return h(
  10514. 'table',
  10515. {
  10516. 'class': 'el-table__body',
  10517. attrs: { cellspacing: '0',
  10518. cellpadding: '0',
  10519. border: '0' }
  10520. },
  10521. [h('colgroup', [this.columns.map(function (column) {
  10522. return h('col', {
  10523. attrs: { name: column.id },
  10524. key: column.id });
  10525. })]), h('tbody', [data.reduce(function (acc, row) {
  10526. return acc.concat(_this.wrappedRowRender(row, acc.length));
  10527. }, []), h('el-tooltip', {
  10528. attrs: { effect: this.table.tooltipEffect, placement: 'top', content: this.tooltipContent },
  10529. ref: 'tooltip' })])]
  10530. );
  10531. },
  10532. computed: table_body_extends({
  10533. table: function table() {
  10534. return this.$parent;
  10535. }
  10536. }, mapStates({
  10537. data: 'data',
  10538. columns: 'columns',
  10539. treeIndent: 'indent',
  10540. leftFixedLeafCount: 'fixedLeafColumnsLength',
  10541. rightFixedLeafCount: 'rightFixedLeafColumnsLength',
  10542. columnsCount: function columnsCount(states) {
  10543. return states.columns.length;
  10544. },
  10545. leftFixedCount: function leftFixedCount(states) {
  10546. return states.fixedColumns.length;
  10547. },
  10548. rightFixedCount: function rightFixedCount(states) {
  10549. return states.rightFixedColumns.length;
  10550. },
  10551. hasExpandColumn: function hasExpandColumn(states) {
  10552. return states.columns.some(function (_ref) {
  10553. var type = _ref.type;
  10554. return type === 'expand';
  10555. });
  10556. }
  10557. }), {
  10558. columnsHidden: function columnsHidden() {
  10559. var _this2 = this;
  10560. return this.columns.map(function (column, index) {
  10561. return _this2.isColumnHidden(index);
  10562. });
  10563. },
  10564. firstDefaultColumnIndex: function firstDefaultColumnIndex() {
  10565. return Object(util_["arrayFindIndex"])(this.columns, function (_ref2) {
  10566. var type = _ref2.type;
  10567. return type === 'default';
  10568. });
  10569. }
  10570. }),
  10571. watch: {
  10572. // don't trigger getter of currentRow in getCellClass. see https://jsfiddle.net/oe2b4hqt/
  10573. // update DOM manually. see https://github.com/ElemeFE/element/pull/13954/files#diff-9b450c00d0a9dec0ffad5a3176972e40
  10574. 'store.states.hoverRow': function storeStatesHoverRow(newVal, oldVal) {
  10575. var _this3 = this;
  10576. if (!this.store.states.isComplex || this.$isServer) return;
  10577. var raf = window.requestAnimationFrame;
  10578. if (!raf) {
  10579. raf = function raf(fn) {
  10580. return setTimeout(fn, 16);
  10581. };
  10582. }
  10583. raf(function () {
  10584. var rows = _this3.$el.querySelectorAll('.el-table__row');
  10585. var oldRow = rows[oldVal];
  10586. var newRow = rows[newVal];
  10587. if (oldRow) {
  10588. Object(dom_["removeClass"])(oldRow, 'hover-row');
  10589. }
  10590. if (newRow) {
  10591. Object(dom_["addClass"])(newRow, 'hover-row');
  10592. }
  10593. });
  10594. }
  10595. },
  10596. data: function data() {
  10597. return {
  10598. tooltipContent: ''
  10599. };
  10600. },
  10601. created: function created() {
  10602. this.activateTooltip = debounce_default()(50, function (tooltip) {
  10603. return tooltip.handleShowPopper();
  10604. });
  10605. },
  10606. methods: {
  10607. getKeyOfRow: function getKeyOfRow(row, index) {
  10608. var rowKey = this.table.rowKey;
  10609. if (rowKey) {
  10610. return getRowIdentity(row, rowKey);
  10611. }
  10612. return index;
  10613. },
  10614. isColumnHidden: function isColumnHidden(index) {
  10615. if (this.fixed === true || this.fixed === 'left') {
  10616. return index >= this.leftFixedLeafCount;
  10617. } else if (this.fixed === 'right') {
  10618. return index < this.columnsCount - this.rightFixedLeafCount;
  10619. } else {
  10620. return index < this.leftFixedLeafCount || index >= this.columnsCount - this.rightFixedLeafCount;
  10621. }
  10622. },
  10623. getSpan: function getSpan(row, column, rowIndex, columnIndex) {
  10624. var rowspan = 1;
  10625. var colspan = 1;
  10626. var fn = this.table.spanMethod;
  10627. if (typeof fn === 'function') {
  10628. var result = fn({
  10629. row: row,
  10630. column: column,
  10631. rowIndex: rowIndex,
  10632. columnIndex: columnIndex
  10633. });
  10634. if (Array.isArray(result)) {
  10635. rowspan = result[0];
  10636. colspan = result[1];
  10637. } else if ((typeof result === 'undefined' ? 'undefined' : table_body_typeof(result)) === 'object') {
  10638. rowspan = result.rowspan;
  10639. colspan = result.colspan;
  10640. }
  10641. }
  10642. return { rowspan: rowspan, colspan: colspan };
  10643. },
  10644. getRowStyle: function getRowStyle(row, rowIndex) {
  10645. var rowStyle = this.table.rowStyle;
  10646. if (typeof rowStyle === 'function') {
  10647. return rowStyle.call(null, {
  10648. row: row,
  10649. rowIndex: rowIndex
  10650. });
  10651. }
  10652. return rowStyle || null;
  10653. },
  10654. getRowClass: function getRowClass(row, rowIndex) {
  10655. var selection = this.store.states.selection;
  10656. var classes = ['el-table__row'];
  10657. if (this.table.highlightCurrentRow && row === this.store.states.currentRow) {
  10658. classes.push('current-row');
  10659. }
  10660. if (this.table.highlightSelectionRow) {
  10661. for (var i = 0; i < selection.length; i++) {
  10662. if (objectEquals(row, selection[i])) {
  10663. classes.push('selection-row');
  10664. }
  10665. };
  10666. }
  10667. if (this.stripe && rowIndex % 2 === 1) {
  10668. classes.push('el-table__row--striped');
  10669. }
  10670. var rowClassName = this.table.rowClassName;
  10671. if (typeof rowClassName === 'string') {
  10672. classes.push(rowClassName);
  10673. } else if (typeof rowClassName === 'function') {
  10674. classes.push(rowClassName.call(null, {
  10675. row: row,
  10676. rowIndex: rowIndex
  10677. }));
  10678. }
  10679. if (this.store.states.expandRows.indexOf(row) > -1) {
  10680. classes.push('expanded');
  10681. }
  10682. return classes;
  10683. },
  10684. getCellStyle: function getCellStyle(rowIndex, columnIndex, row, column) {
  10685. var cellStyle = this.table.cellStyle;
  10686. if (typeof cellStyle === 'function') {
  10687. return cellStyle.call(null, {
  10688. rowIndex: rowIndex,
  10689. columnIndex: columnIndex,
  10690. row: row,
  10691. column: column
  10692. });
  10693. }
  10694. return cellStyle;
  10695. },
  10696. getCellClass: function getCellClass(rowIndex, columnIndex, row, column) {
  10697. var classes = [column.id, column.align, column.className];
  10698. if (this.isColumnHidden(columnIndex)) {
  10699. classes.push('is-hidden');
  10700. }
  10701. var cellClassName = this.table.cellClassName;
  10702. if (typeof cellClassName === 'string') {
  10703. classes.push(cellClassName);
  10704. } else if (typeof cellClassName === 'function') {
  10705. classes.push(cellClassName.call(null, {
  10706. rowIndex: rowIndex,
  10707. columnIndex: columnIndex,
  10708. row: row,
  10709. column: column
  10710. }));
  10711. }
  10712. classes.push('el-table__cell');
  10713. return classes.join(' ');
  10714. },
  10715. getColspanRealWidth: function getColspanRealWidth(columns, colspan, index) {
  10716. if (colspan < 1) {
  10717. return columns[index].realWidth;
  10718. }
  10719. var widthArr = columns.map(function (_ref3) {
  10720. var realWidth = _ref3.realWidth;
  10721. return realWidth;
  10722. }).slice(index, index + colspan);
  10723. return widthArr.reduce(function (acc, width) {
  10724. return acc + width;
  10725. }, -1);
  10726. },
  10727. handleCellMouseEnter: function handleCellMouseEnter(event, row) {
  10728. var table = this.table;
  10729. var cell = getCell(event);
  10730. if (cell) {
  10731. var column = getColumnByCell(table, cell);
  10732. var hoverState = table.hoverState = { cell: cell, column: column, row: row };
  10733. table.$emit('cell-mouse-enter', hoverState.row, hoverState.column, hoverState.cell, event);
  10734. }
  10735. // 判断是否text-overflow, 如果是就显示tooltip
  10736. var cellChild = event.target.querySelector('.cell');
  10737. if (!(Object(dom_["hasClass"])(cellChild, 'el-tooltip') && cellChild.childNodes.length)) {
  10738. return;
  10739. }
  10740. // use range width instead of scrollWidth to determine whether the text is overflowing
  10741. // to address a potential FireFox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1074543#c3
  10742. var range = document.createRange();
  10743. range.setStart(cellChild, 0);
  10744. range.setEnd(cellChild, cellChild.childNodes.length);
  10745. var rangeWidth = range.getBoundingClientRect().width;
  10746. var padding = (parseInt(Object(dom_["getStyle"])(cellChild, 'paddingLeft'), 10) || 0) + (parseInt(Object(dom_["getStyle"])(cellChild, 'paddingRight'), 10) || 0);
  10747. if ((rangeWidth + padding > cellChild.offsetWidth || cellChild.scrollWidth > cellChild.offsetWidth) && this.$refs.tooltip) {
  10748. var tooltip = this.$refs.tooltip;
  10749. // TODO 会引起整个 Table 的重新渲染,需要优化
  10750. this.tooltipContent = cell.innerText || cell.textContent;
  10751. tooltip.referenceElm = cell;
  10752. tooltip.$refs.popper && (tooltip.$refs.popper.style.display = 'none');
  10753. tooltip.doDestroy();
  10754. tooltip.setExpectedState(true);
  10755. this.activateTooltip(tooltip);
  10756. }
  10757. },
  10758. handleCellMouseLeave: function handleCellMouseLeave(event) {
  10759. var tooltip = this.$refs.tooltip;
  10760. if (tooltip) {
  10761. tooltip.setExpectedState(false);
  10762. tooltip.handleClosePopper();
  10763. }
  10764. var cell = getCell(event);
  10765. if (!cell) return;
  10766. var oldHoverState = this.table.hoverState || {};
  10767. this.table.$emit('cell-mouse-leave', oldHoverState.row, oldHoverState.column, oldHoverState.cell, event);
  10768. },
  10769. handleMouseEnter: debounce_default()(30, function (index) {
  10770. this.store.commit('setHoverRow', index);
  10771. }),
  10772. handleMouseLeave: debounce_default()(30, function () {
  10773. this.store.commit('setHoverRow', null);
  10774. }),
  10775. handleContextMenu: function handleContextMenu(event, row) {
  10776. this.handleEvent(event, row, 'contextmenu');
  10777. },
  10778. handleDoubleClick: function handleDoubleClick(event, row) {
  10779. this.handleEvent(event, row, 'dblclick');
  10780. },
  10781. handleClick: function handleClick(event, row) {
  10782. this.store.commit('setCurrentRow', row);
  10783. this.handleEvent(event, row, 'click');
  10784. },
  10785. handleEvent: function handleEvent(event, row, name) {
  10786. var table = this.table;
  10787. var cell = getCell(event);
  10788. var column = void 0;
  10789. if (cell) {
  10790. column = getColumnByCell(table, cell);
  10791. if (column) {
  10792. table.$emit('cell-' + name, row, column, cell, event);
  10793. }
  10794. }
  10795. table.$emit('row-' + name, row, column, event);
  10796. },
  10797. rowRender: function rowRender(row, $index, treeRowData) {
  10798. var _this4 = this;
  10799. var h = this.$createElement;
  10800. var treeIndent = this.treeIndent,
  10801. columns = this.columns,
  10802. firstDefaultColumnIndex = this.firstDefaultColumnIndex;
  10803. var rowClasses = this.getRowClass(row, $index);
  10804. var display = true;
  10805. if (treeRowData) {
  10806. rowClasses.push('el-table__row--level-' + treeRowData.level);
  10807. display = treeRowData.display;
  10808. }
  10809. // 指令 v-show 会覆盖 row-style 中 display
  10810. // 使用 :style 代替 v-show https://github.com/ElemeFE/element/issues/16995
  10811. var displayStyle = display ? null : {
  10812. display: 'none'
  10813. };
  10814. return h(table_row, {
  10815. style: [displayStyle, this.getRowStyle(row, $index)],
  10816. 'class': rowClasses,
  10817. key: this.getKeyOfRow(row, $index),
  10818. nativeOn: {
  10819. 'dblclick': function dblclick($event) {
  10820. return _this4.handleDoubleClick($event, row);
  10821. },
  10822. 'click': function click($event) {
  10823. return _this4.handleClick($event, row);
  10824. },
  10825. 'contextmenu': function contextmenu($event) {
  10826. return _this4.handleContextMenu($event, row);
  10827. },
  10828. 'mouseenter': function mouseenter(_) {
  10829. return _this4.handleMouseEnter($index);
  10830. },
  10831. 'mouseleave': this.handleMouseLeave
  10832. },
  10833. attrs: {
  10834. columns: columns,
  10835. row: row,
  10836. index: $index,
  10837. store: this.store,
  10838. context: this.context || this.table.$vnode.context,
  10839. firstDefaultColumnIndex: firstDefaultColumnIndex,
  10840. treeRowData: treeRowData,
  10841. treeIndent: treeIndent,
  10842. columnsHidden: this.columnsHidden,
  10843. getSpan: this.getSpan,
  10844. getColspanRealWidth: this.getColspanRealWidth,
  10845. getCellStyle: this.getCellStyle,
  10846. getCellClass: this.getCellClass,
  10847. handleCellMouseEnter: this.handleCellMouseEnter,
  10848. handleCellMouseLeave: this.handleCellMouseLeave,
  10849. isSelected: this.store.isSelected(row),
  10850. isExpanded: this.store.states.expandRows.indexOf(row) > -1,
  10851. fixed: this.fixed
  10852. }
  10853. });
  10854. },
  10855. wrappedRowRender: function wrappedRowRender(row, $index) {
  10856. var _this5 = this;
  10857. var h = this.$createElement;
  10858. var store = this.store;
  10859. var isRowExpanded = store.isRowExpanded,
  10860. assertRowKey = store.assertRowKey;
  10861. var _store$states = store.states,
  10862. treeData = _store$states.treeData,
  10863. lazyTreeNodeMap = _store$states.lazyTreeNodeMap,
  10864. childrenColumnName = _store$states.childrenColumnName,
  10865. rowKey = _store$states.rowKey;
  10866. if (this.hasExpandColumn && isRowExpanded(row)) {
  10867. var renderExpanded = this.table.renderExpanded;
  10868. var tr = this.rowRender(row, $index);
  10869. if (!renderExpanded) {
  10870. console.error('[Element Error]renderExpanded is required.');
  10871. return tr;
  10872. }
  10873. // 使用二维数组,避免修改 $index
  10874. return [[tr, h(
  10875. 'tr',
  10876. { key: 'expanded-row__' + tr.key },
  10877. [h(
  10878. 'td',
  10879. {
  10880. attrs: { colspan: this.columnsCount },
  10881. 'class': 'el-table__cell el-table__expanded-cell' },
  10882. [renderExpanded(this.$createElement, { row: row, $index: $index, store: this.store })]
  10883. )]
  10884. )]];
  10885. } else if (Object.keys(treeData).length) {
  10886. assertRowKey();
  10887. // TreeTable 时,rowKey 必须由用户设定,不使用 getKeyOfRow 计算
  10888. // 在调用 rowRender 函数时,仍然会计算 rowKey,不太好的操作
  10889. var key = getRowIdentity(row, rowKey);
  10890. var cur = treeData[key];
  10891. var treeRowData = null;
  10892. if (cur) {
  10893. treeRowData = {
  10894. expanded: cur.expanded,
  10895. level: cur.level,
  10896. display: true
  10897. };
  10898. if (typeof cur.lazy === 'boolean') {
  10899. if (typeof cur.loaded === 'boolean' && cur.loaded) {
  10900. treeRowData.noLazyChildren = !(cur.children && cur.children.length);
  10901. }
  10902. treeRowData.loading = cur.loading;
  10903. }
  10904. }
  10905. var tmp = [this.rowRender(row, $index, treeRowData)];
  10906. // 渲染嵌套数据
  10907. if (cur) {
  10908. // currentRow 记录的是 index,所以还需主动增加 TreeTable 的 index
  10909. var i = 0;
  10910. var traverse = function traverse(children, parent) {
  10911. if (!(children && children.length && parent)) return;
  10912. children.forEach(function (node) {
  10913. // 父节点的 display 状态影响子节点的显示状态
  10914. var innerTreeRowData = {
  10915. display: parent.display && parent.expanded,
  10916. level: parent.level + 1
  10917. };
  10918. var childKey = getRowIdentity(node, rowKey);
  10919. if (childKey === undefined || childKey === null) {
  10920. throw new Error('for nested data item, row-key is required.');
  10921. }
  10922. cur = table_body_extends({}, treeData[childKey]);
  10923. // 对于当前节点,分成有无子节点两种情况。
  10924. // 如果包含子节点的,设置 expanded 属性。
  10925. // 对于它子节点的 display 属性由它本身的 expanded 与 display 共同决定。
  10926. if (cur) {
  10927. innerTreeRowData.expanded = cur.expanded;
  10928. // 懒加载的某些节点,level 未知
  10929. cur.level = cur.level || innerTreeRowData.level;
  10930. cur.display = !!(cur.expanded && innerTreeRowData.display);
  10931. if (typeof cur.lazy === 'boolean') {
  10932. if (typeof cur.loaded === 'boolean' && cur.loaded) {
  10933. innerTreeRowData.noLazyChildren = !(cur.children && cur.children.length);
  10934. }
  10935. innerTreeRowData.loading = cur.loading;
  10936. }
  10937. }
  10938. i++;
  10939. tmp.push(_this5.rowRender(node, $index + i, innerTreeRowData));
  10940. if (cur) {
  10941. var _nodes = lazyTreeNodeMap[childKey] || node[childrenColumnName];
  10942. traverse(_nodes, cur);
  10943. }
  10944. });
  10945. };
  10946. // 对于 root 节点,display 一定为 true
  10947. cur.display = true;
  10948. var nodes = lazyTreeNodeMap[key] || row[childrenColumnName];
  10949. traverse(nodes, cur);
  10950. }
  10951. return tmp;
  10952. } else {
  10953. return this.rowRender(row, $index);
  10954. }
  10955. }
  10956. }
  10957. });
  10958. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/table/src/filter-panel.vue?vue&type=template&id=7f2c919f&
  10959. var filter_panelvue_type_template_id_7f2c919f_render = function() {
  10960. var _vm = this
  10961. var _h = _vm.$createElement
  10962. var _c = _vm._self._c || _h
  10963. return _c("transition", { attrs: { name: "el-zoom-in-top" } }, [
  10964. _vm.multiple
  10965. ? _c(
  10966. "div",
  10967. {
  10968. directives: [
  10969. {
  10970. name: "clickoutside",
  10971. rawName: "v-clickoutside",
  10972. value: _vm.handleOutsideClick,
  10973. expression: "handleOutsideClick"
  10974. },
  10975. {
  10976. name: "show",
  10977. rawName: "v-show",
  10978. value: _vm.showPopper,
  10979. expression: "showPopper"
  10980. }
  10981. ],
  10982. staticClass: "el-table-filter"
  10983. },
  10984. [
  10985. _c(
  10986. "div",
  10987. { staticClass: "el-table-filter__content" },
  10988. [
  10989. _c(
  10990. "el-scrollbar",
  10991. { attrs: { "wrap-class": "el-table-filter__wrap" } },
  10992. [
  10993. _c(
  10994. "el-checkbox-group",
  10995. {
  10996. staticClass: "el-table-filter__checkbox-group",
  10997. model: {
  10998. value: _vm.filteredValue,
  10999. callback: function($$v) {
  11000. _vm.filteredValue = $$v
  11001. },
  11002. expression: "filteredValue"
  11003. }
  11004. },
  11005. _vm._l(_vm.filters, function(filter) {
  11006. return _c(
  11007. "el-checkbox",
  11008. { key: filter.value, attrs: { label: filter.value } },
  11009. [_vm._v(_vm._s(filter.text))]
  11010. )
  11011. }),
  11012. 1
  11013. )
  11014. ],
  11015. 1
  11016. )
  11017. ],
  11018. 1
  11019. ),
  11020. _c("div", { staticClass: "el-table-filter__bottom" }, [
  11021. _c(
  11022. "button",
  11023. {
  11024. class: { "is-disabled": _vm.filteredValue.length === 0 },
  11025. attrs: { disabled: _vm.filteredValue.length === 0 },
  11026. on: { click: _vm.handleConfirm }
  11027. },
  11028. [_vm._v(_vm._s(_vm.t("el.table.confirmFilter")))]
  11029. ),
  11030. _c("button", { on: { click: _vm.handleReset } }, [
  11031. _vm._v(_vm._s(_vm.t("el.table.resetFilter")))
  11032. ])
  11033. ])
  11034. ]
  11035. )
  11036. : _c(
  11037. "div",
  11038. {
  11039. directives: [
  11040. {
  11041. name: "clickoutside",
  11042. rawName: "v-clickoutside",
  11043. value: _vm.handleOutsideClick,
  11044. expression: "handleOutsideClick"
  11045. },
  11046. {
  11047. name: "show",
  11048. rawName: "v-show",
  11049. value: _vm.showPopper,
  11050. expression: "showPopper"
  11051. }
  11052. ],
  11053. staticClass: "el-table-filter"
  11054. },
  11055. [
  11056. _c(
  11057. "ul",
  11058. { staticClass: "el-table-filter__list" },
  11059. [
  11060. _c(
  11061. "li",
  11062. {
  11063. staticClass: "el-table-filter__list-item",
  11064. class: {
  11065. "is-active":
  11066. _vm.filterValue === undefined ||
  11067. _vm.filterValue === null
  11068. },
  11069. on: {
  11070. click: function($event) {
  11071. _vm.handleSelect(null)
  11072. }
  11073. }
  11074. },
  11075. [_vm._v(_vm._s(_vm.t("el.table.clearFilter")))]
  11076. ),
  11077. _vm._l(_vm.filters, function(filter) {
  11078. return _c(
  11079. "li",
  11080. {
  11081. key: filter.value,
  11082. staticClass: "el-table-filter__list-item",
  11083. class: { "is-active": _vm.isActive(filter) },
  11084. attrs: { label: filter.value },
  11085. on: {
  11086. click: function($event) {
  11087. _vm.handleSelect(filter.value)
  11088. }
  11089. }
  11090. },
  11091. [_vm._v(_vm._s(filter.text))]
  11092. )
  11093. })
  11094. ],
  11095. 2
  11096. )
  11097. ]
  11098. )
  11099. ])
  11100. }
  11101. var filter_panelvue_type_template_id_7f2c919f_staticRenderFns = []
  11102. filter_panelvue_type_template_id_7f2c919f_render._withStripped = true
  11103. // CONCATENATED MODULE: ./packages/table/src/filter-panel.vue?vue&type=template&id=7f2c919f&
  11104. // CONCATENATED MODULE: ./packages/table/src/dropdown.js
  11105. var dropdowns = [];
  11106. !external_vue_default.a.prototype.$isServer && document.addEventListener('click', function (event) {
  11107. dropdowns.forEach(function (dropdown) {
  11108. var target = event.target;
  11109. if (!dropdown || !dropdown.$el) return;
  11110. if (target === dropdown.$el || dropdown.$el.contains(target)) {
  11111. return;
  11112. }
  11113. dropdown.handleOutsideClick && dropdown.handleOutsideClick(event);
  11114. });
  11115. });
  11116. /* harmony default export */ var src_dropdown = ({
  11117. open: function open(instance) {
  11118. if (instance) {
  11119. dropdowns.push(instance);
  11120. }
  11121. },
  11122. close: function close(instance) {
  11123. var index = dropdowns.indexOf(instance);
  11124. if (index !== -1) {
  11125. dropdowns.splice(instance, 1);
  11126. }
  11127. }
  11128. });
  11129. // EXTERNAL MODULE: external "element-ui/lib/checkbox-group"
  11130. var checkbox_group_ = __webpack_require__(32);
  11131. var checkbox_group_default = /*#__PURE__*/__webpack_require__.n(checkbox_group_);
  11132. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/table/src/filter-panel.vue?vue&type=script&lang=js&
  11133. //
  11134. //
  11135. //
  11136. //
  11137. //
  11138. //
  11139. //
  11140. //
  11141. //
  11142. //
  11143. //
  11144. //
  11145. //
  11146. //
  11147. //
  11148. //
  11149. //
  11150. //
  11151. //
  11152. //
  11153. //
  11154. //
  11155. //
  11156. //
  11157. //
  11158. //
  11159. //
  11160. //
  11161. //
  11162. //
  11163. //
  11164. //
  11165. //
  11166. //
  11167. //
  11168. //
  11169. //
  11170. //
  11171. //
  11172. //
  11173. //
  11174. //
  11175. //
  11176. //
  11177. /* harmony default export */ var filter_panelvue_type_script_lang_js_ = ({
  11178. name: 'ElTableFilterPanel',
  11179. mixins: [vue_popper_default.a, locale_default.a],
  11180. directives: {
  11181. Clickoutside: clickoutside_default.a
  11182. },
  11183. components: {
  11184. ElCheckbox: checkbox_default.a,
  11185. ElCheckboxGroup: checkbox_group_default.a,
  11186. ElScrollbar: scrollbar_default.a
  11187. },
  11188. props: {
  11189. placement: {
  11190. type: String,
  11191. default: 'bottom-end'
  11192. }
  11193. },
  11194. methods: {
  11195. isActive: function isActive(filter) {
  11196. return filter.value === this.filterValue;
  11197. },
  11198. handleOutsideClick: function handleOutsideClick() {
  11199. var _this = this;
  11200. setTimeout(function () {
  11201. _this.showPopper = false;
  11202. }, 16);
  11203. },
  11204. handleConfirm: function handleConfirm() {
  11205. this.confirmFilter(this.filteredValue);
  11206. this.handleOutsideClick();
  11207. },
  11208. handleReset: function handleReset() {
  11209. this.filteredValue = [];
  11210. this.confirmFilter(this.filteredValue);
  11211. this.handleOutsideClick();
  11212. },
  11213. handleSelect: function handleSelect(filterValue) {
  11214. this.filterValue = filterValue;
  11215. if (typeof filterValue !== 'undefined' && filterValue !== null) {
  11216. this.confirmFilter(this.filteredValue);
  11217. } else {
  11218. this.confirmFilter([]);
  11219. }
  11220. this.handleOutsideClick();
  11221. },
  11222. confirmFilter: function confirmFilter(filteredValue) {
  11223. this.table.store.commit('filterChange', {
  11224. column: this.column,
  11225. values: filteredValue
  11226. });
  11227. this.table.store.updateAllSelected();
  11228. }
  11229. },
  11230. data: function data() {
  11231. return {
  11232. table: null,
  11233. cell: null,
  11234. column: null
  11235. };
  11236. },
  11237. computed: {
  11238. filters: function filters() {
  11239. return this.column && this.column.filters;
  11240. },
  11241. filterValue: {
  11242. get: function get() {
  11243. return (this.column.filteredValue || [])[0];
  11244. },
  11245. set: function set(value) {
  11246. if (this.filteredValue) {
  11247. if (typeof value !== 'undefined' && value !== null) {
  11248. this.filteredValue.splice(0, 1, value);
  11249. } else {
  11250. this.filteredValue.splice(0, 1);
  11251. }
  11252. }
  11253. }
  11254. },
  11255. filteredValue: {
  11256. get: function get() {
  11257. if (this.column) {
  11258. return this.column.filteredValue || [];
  11259. }
  11260. return [];
  11261. },
  11262. set: function set(value) {
  11263. if (this.column) {
  11264. this.column.filteredValue = value;
  11265. }
  11266. }
  11267. },
  11268. multiple: function multiple() {
  11269. if (this.column) {
  11270. return this.column.filterMultiple;
  11271. }
  11272. return true;
  11273. }
  11274. },
  11275. mounted: function mounted() {
  11276. var _this2 = this;
  11277. this.popperElm = this.$el;
  11278. this.referenceElm = this.cell;
  11279. this.table.bodyWrapper.addEventListener('scroll', function () {
  11280. _this2.updatePopper();
  11281. });
  11282. this.$watch('showPopper', function (value) {
  11283. if (_this2.column) _this2.column.filterOpened = value;
  11284. if (value) {
  11285. src_dropdown.open(_this2);
  11286. } else {
  11287. src_dropdown.close(_this2);
  11288. }
  11289. });
  11290. },
  11291. watch: {
  11292. showPopper: function showPopper(val) {
  11293. if (val === true && parseInt(this.popperJS._popper.style.zIndex, 10) < popup_["PopupManager"].zIndex) {
  11294. this.popperJS._popper.style.zIndex = popup_["PopupManager"].nextZIndex();
  11295. }
  11296. }
  11297. }
  11298. });
  11299. // CONCATENATED MODULE: ./packages/table/src/filter-panel.vue?vue&type=script&lang=js&
  11300. /* harmony default export */ var src_filter_panelvue_type_script_lang_js_ = (filter_panelvue_type_script_lang_js_);
  11301. // CONCATENATED MODULE: ./packages/table/src/filter-panel.vue
  11302. /* normalize component */
  11303. var filter_panel_component = normalizeComponent(
  11304. src_filter_panelvue_type_script_lang_js_,
  11305. filter_panelvue_type_template_id_7f2c919f_render,
  11306. filter_panelvue_type_template_id_7f2c919f_staticRenderFns,
  11307. false,
  11308. null,
  11309. null,
  11310. null
  11311. )
  11312. /* hot reload */
  11313. if (false) { var filter_panel_api; }
  11314. filter_panel_component.options.__file = "packages/table/src/filter-panel.vue"
  11315. /* harmony default export */ var filter_panel = (filter_panel_component.exports);
  11316. // CONCATENATED MODULE: ./packages/table/src/table-header.js
  11317. var table_header_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; };
  11318. var getAllColumns = function getAllColumns(columns) {
  11319. var result = [];
  11320. columns.forEach(function (column) {
  11321. if (column.children) {
  11322. result.push(column);
  11323. result.push.apply(result, getAllColumns(column.children));
  11324. } else {
  11325. result.push(column);
  11326. }
  11327. });
  11328. return result;
  11329. };
  11330. var convertToRows = function convertToRows(originColumns) {
  11331. var maxLevel = 1;
  11332. var traverse = function traverse(column, parent) {
  11333. if (parent) {
  11334. column.level = parent.level + 1;
  11335. if (maxLevel < column.level) {
  11336. maxLevel = column.level;
  11337. }
  11338. }
  11339. if (column.children) {
  11340. var colSpan = 0;
  11341. column.children.forEach(function (subColumn) {
  11342. traverse(subColumn, column);
  11343. colSpan += subColumn.colSpan;
  11344. });
  11345. column.colSpan = colSpan;
  11346. } else {
  11347. column.colSpan = 1;
  11348. }
  11349. };
  11350. originColumns.forEach(function (column) {
  11351. column.level = 1;
  11352. traverse(column);
  11353. });
  11354. var rows = [];
  11355. for (var i = 0; i < maxLevel; i++) {
  11356. rows.push([]);
  11357. }
  11358. var allColumns = getAllColumns(originColumns);
  11359. allColumns.forEach(function (column) {
  11360. if (!column.children) {
  11361. column.rowSpan = maxLevel - column.level + 1;
  11362. } else {
  11363. column.rowSpan = 1;
  11364. }
  11365. rows[column.level - 1].push(column);
  11366. });
  11367. return rows;
  11368. };
  11369. /* harmony default export */ var table_header = ({
  11370. name: 'ElTableHeader',
  11371. mixins: [layout_observer],
  11372. render: function render(h) {
  11373. var _this = this;
  11374. var originColumns = this.store.states.originColumns;
  11375. var columnRows = convertToRows(originColumns, this.columns);
  11376. // 是否拥有多级表头
  11377. var isGroup = columnRows.length > 1;
  11378. if (isGroup) this.$parent.isGroup = true;
  11379. return h(
  11380. 'table',
  11381. {
  11382. 'class': 'el-table__header',
  11383. attrs: { cellspacing: '0',
  11384. cellpadding: '0',
  11385. border: '0' }
  11386. },
  11387. [h('colgroup', [this.columns.map(function (column) {
  11388. return h('col', {
  11389. attrs: { name: column.id },
  11390. key: column.id });
  11391. }), this.hasGutter ? h('col', {
  11392. attrs: { name: 'gutter' }
  11393. }) : '']), h(
  11394. 'thead',
  11395. { 'class': [{ 'is-group': isGroup, 'has-gutter': this.hasGutter }] },
  11396. [this._l(columnRows, function (columns, rowIndex) {
  11397. return h(
  11398. 'tr',
  11399. {
  11400. style: _this.getHeaderRowStyle(rowIndex),
  11401. 'class': _this.getHeaderRowClass(rowIndex)
  11402. },
  11403. [columns.map(function (column, cellIndex) {
  11404. return h(
  11405. 'th',
  11406. {
  11407. attrs: {
  11408. colspan: column.colSpan,
  11409. rowspan: column.rowSpan
  11410. },
  11411. on: {
  11412. 'mousemove': function mousemove($event) {
  11413. return _this.handleMouseMove($event, column);
  11414. },
  11415. 'mouseout': _this.handleMouseOut,
  11416. 'mousedown': function mousedown($event) {
  11417. return _this.handleMouseDown($event, column);
  11418. },
  11419. 'click': function click($event) {
  11420. return _this.handleHeaderClick($event, column);
  11421. },
  11422. 'contextmenu': function contextmenu($event) {
  11423. return _this.handleHeaderContextMenu($event, column);
  11424. }
  11425. },
  11426. style: _this.getHeaderCellStyle(rowIndex, cellIndex, columns, column),
  11427. 'class': _this.getHeaderCellClass(rowIndex, cellIndex, columns, column),
  11428. key: column.id },
  11429. [h(
  11430. 'div',
  11431. { 'class': ['cell', column.filteredValue && column.filteredValue.length > 0 ? 'highlight' : '', column.labelClassName] },
  11432. [column.renderHeader ? column.renderHeader.call(_this._renderProxy, h, { column: column, $index: cellIndex, store: _this.store, _self: _this.$parent.$vnode.context }) : column.label, column.sortable ? h(
  11433. 'span',
  11434. {
  11435. 'class': 'caret-wrapper',
  11436. on: {
  11437. 'click': function click($event) {
  11438. return _this.handleSortClick($event, column);
  11439. }
  11440. }
  11441. },
  11442. [h('i', { 'class': 'sort-caret ascending',
  11443. on: {
  11444. 'click': function click($event) {
  11445. return _this.handleSortClick($event, column, 'ascending');
  11446. }
  11447. }
  11448. }), h('i', { 'class': 'sort-caret descending',
  11449. on: {
  11450. 'click': function click($event) {
  11451. return _this.handleSortClick($event, column, 'descending');
  11452. }
  11453. }
  11454. })]
  11455. ) : '', column.filterable ? h(
  11456. 'span',
  11457. {
  11458. 'class': 'el-table__column-filter-trigger',
  11459. on: {
  11460. 'click': function click($event) {
  11461. return _this.handleFilterClick($event, column);
  11462. }
  11463. }
  11464. },
  11465. [h('i', { 'class': ['el-icon-arrow-down', column.filterOpened ? 'el-icon-arrow-up' : ''] })]
  11466. ) : '']
  11467. )]
  11468. );
  11469. }), _this.hasGutter ? h('th', { 'class': 'el-table__cell gutter' }) : '']
  11470. );
  11471. })]
  11472. )]
  11473. );
  11474. },
  11475. props: {
  11476. fixed: String,
  11477. store: {
  11478. required: true
  11479. },
  11480. border: Boolean,
  11481. defaultSort: {
  11482. type: Object,
  11483. default: function _default() {
  11484. return {
  11485. prop: '',
  11486. order: ''
  11487. };
  11488. }
  11489. }
  11490. },
  11491. components: {
  11492. ElCheckbox: checkbox_default.a
  11493. },
  11494. computed: table_header_extends({
  11495. table: function table() {
  11496. return this.$parent;
  11497. },
  11498. hasGutter: function hasGutter() {
  11499. return !this.fixed && this.tableLayout.gutterWidth;
  11500. }
  11501. }, mapStates({
  11502. columns: 'columns',
  11503. isAllSelected: 'isAllSelected',
  11504. leftFixedLeafCount: 'fixedLeafColumnsLength',
  11505. rightFixedLeafCount: 'rightFixedLeafColumnsLength',
  11506. columnsCount: function columnsCount(states) {
  11507. return states.columns.length;
  11508. },
  11509. leftFixedCount: function leftFixedCount(states) {
  11510. return states.fixedColumns.length;
  11511. },
  11512. rightFixedCount: function rightFixedCount(states) {
  11513. return states.rightFixedColumns.length;
  11514. }
  11515. })),
  11516. created: function created() {
  11517. this.filterPanels = {};
  11518. },
  11519. mounted: function mounted() {
  11520. var _this2 = this;
  11521. // nextTick 是有必要的 https://github.com/ElemeFE/element/pull/11311
  11522. this.$nextTick(function () {
  11523. var _defaultSort = _this2.defaultSort,
  11524. prop = _defaultSort.prop,
  11525. order = _defaultSort.order;
  11526. var init = true;
  11527. _this2.store.commit('sort', { prop: prop, order: order, init: init });
  11528. });
  11529. },
  11530. beforeDestroy: function beforeDestroy() {
  11531. var panels = this.filterPanels;
  11532. for (var prop in panels) {
  11533. if (panels.hasOwnProperty(prop) && panels[prop]) {
  11534. panels[prop].$destroy(true);
  11535. }
  11536. }
  11537. },
  11538. methods: {
  11539. isCellHidden: function isCellHidden(index, columns) {
  11540. var start = 0;
  11541. for (var i = 0; i < index; i++) {
  11542. start += columns[i].colSpan;
  11543. }
  11544. var after = start + columns[index].colSpan - 1;
  11545. if (this.fixed === true || this.fixed === 'left') {
  11546. return after >= this.leftFixedLeafCount;
  11547. } else if (this.fixed === 'right') {
  11548. return start < this.columnsCount - this.rightFixedLeafCount;
  11549. } else {
  11550. return after < this.leftFixedLeafCount || start >= this.columnsCount - this.rightFixedLeafCount;
  11551. }
  11552. },
  11553. getHeaderRowStyle: function getHeaderRowStyle(rowIndex) {
  11554. var headerRowStyle = this.table.headerRowStyle;
  11555. if (typeof headerRowStyle === 'function') {
  11556. return headerRowStyle.call(null, { rowIndex: rowIndex });
  11557. }
  11558. return headerRowStyle;
  11559. },
  11560. getHeaderRowClass: function getHeaderRowClass(rowIndex) {
  11561. var classes = [];
  11562. var headerRowClassName = this.table.headerRowClassName;
  11563. if (typeof headerRowClassName === 'string') {
  11564. classes.push(headerRowClassName);
  11565. } else if (typeof headerRowClassName === 'function') {
  11566. classes.push(headerRowClassName.call(null, { rowIndex: rowIndex }));
  11567. }
  11568. return classes.join(' ');
  11569. },
  11570. getHeaderCellStyle: function getHeaderCellStyle(rowIndex, columnIndex, row, column) {
  11571. var headerCellStyle = this.table.headerCellStyle;
  11572. if (typeof headerCellStyle === 'function') {
  11573. return headerCellStyle.call(null, {
  11574. rowIndex: rowIndex,
  11575. columnIndex: columnIndex,
  11576. row: row,
  11577. column: column
  11578. });
  11579. }
  11580. return headerCellStyle;
  11581. },
  11582. getHeaderCellClass: function getHeaderCellClass(rowIndex, columnIndex, row, column) {
  11583. var classes = [column.id, column.order, column.headerAlign, column.className, column.labelClassName];
  11584. if (rowIndex === 0 && this.isCellHidden(columnIndex, row)) {
  11585. classes.push('is-hidden');
  11586. }
  11587. if (!column.children) {
  11588. classes.push('is-leaf');
  11589. }
  11590. if (column.sortable) {
  11591. classes.push('is-sortable');
  11592. }
  11593. var headerCellClassName = this.table.headerCellClassName;
  11594. if (typeof headerCellClassName === 'string') {
  11595. classes.push(headerCellClassName);
  11596. } else if (typeof headerCellClassName === 'function') {
  11597. classes.push(headerCellClassName.call(null, {
  11598. rowIndex: rowIndex,
  11599. columnIndex: columnIndex,
  11600. row: row,
  11601. column: column
  11602. }));
  11603. }
  11604. classes.push('el-table__cell');
  11605. return classes.join(' ');
  11606. },
  11607. toggleAllSelection: function toggleAllSelection() {
  11608. this.store.commit('toggleAllSelection');
  11609. },
  11610. handleFilterClick: function handleFilterClick(event, column) {
  11611. event.stopPropagation();
  11612. var target = event.target;
  11613. var cell = target.tagName === 'TH' ? target : target.parentNode;
  11614. if (Object(dom_["hasClass"])(cell, 'noclick')) return;
  11615. cell = cell.querySelector('.el-table__column-filter-trigger') || cell;
  11616. var table = this.$parent;
  11617. var filterPanel = this.filterPanels[column.id];
  11618. if (filterPanel && column.filterOpened) {
  11619. filterPanel.showPopper = false;
  11620. return;
  11621. }
  11622. if (!filterPanel) {
  11623. filterPanel = new external_vue_default.a(filter_panel);
  11624. this.filterPanels[column.id] = filterPanel;
  11625. if (column.filterPlacement) {
  11626. filterPanel.placement = column.filterPlacement;
  11627. }
  11628. filterPanel.table = table;
  11629. filterPanel.cell = cell;
  11630. filterPanel.column = column;
  11631. !this.$isServer && filterPanel.$mount(document.createElement('div'));
  11632. }
  11633. setTimeout(function () {
  11634. filterPanel.showPopper = true;
  11635. }, 16);
  11636. },
  11637. handleHeaderClick: function handleHeaderClick(event, column) {
  11638. if (!column.filters && column.sortable) {
  11639. this.handleSortClick(event, column);
  11640. } else if (column.filterable && !column.sortable) {
  11641. this.handleFilterClick(event, column);
  11642. }
  11643. this.$parent.$emit('header-click', column, event);
  11644. },
  11645. handleHeaderContextMenu: function handleHeaderContextMenu(event, column) {
  11646. this.$parent.$emit('header-contextmenu', column, event);
  11647. },
  11648. handleMouseDown: function handleMouseDown(event, column) {
  11649. var _this3 = this;
  11650. if (this.$isServer) return;
  11651. if (column.children && column.children.length > 0) return;
  11652. /* istanbul ignore if */
  11653. if (this.draggingColumn && this.border) {
  11654. this.dragging = true;
  11655. this.$parent.resizeProxyVisible = true;
  11656. var table = this.$parent;
  11657. var tableEl = table.$el;
  11658. var tableLeft = tableEl.getBoundingClientRect().left;
  11659. var columnEl = this.$el.querySelector('th.' + column.id);
  11660. var columnRect = columnEl.getBoundingClientRect();
  11661. var minLeft = columnRect.left - tableLeft + 30;
  11662. Object(dom_["addClass"])(columnEl, 'noclick');
  11663. this.dragState = {
  11664. startMouseLeft: event.clientX,
  11665. startLeft: columnRect.right - tableLeft,
  11666. startColumnLeft: columnRect.left - tableLeft,
  11667. tableLeft: tableLeft
  11668. };
  11669. var resizeProxy = table.$refs.resizeProxy;
  11670. resizeProxy.style.left = this.dragState.startLeft + 'px';
  11671. document.onselectstart = function () {
  11672. return false;
  11673. };
  11674. document.ondragstart = function () {
  11675. return false;
  11676. };
  11677. var handleMouseMove = function handleMouseMove(event) {
  11678. var deltaLeft = event.clientX - _this3.dragState.startMouseLeft;
  11679. var proxyLeft = _this3.dragState.startLeft + deltaLeft;
  11680. resizeProxy.style.left = Math.max(minLeft, proxyLeft) + 'px';
  11681. };
  11682. var handleMouseUp = function handleMouseUp() {
  11683. if (_this3.dragging) {
  11684. var _dragState = _this3.dragState,
  11685. startColumnLeft = _dragState.startColumnLeft,
  11686. startLeft = _dragState.startLeft;
  11687. var finalLeft = parseInt(resizeProxy.style.left, 10);
  11688. var columnWidth = finalLeft - startColumnLeft;
  11689. column.width = column.realWidth = columnWidth;
  11690. table.$emit('header-dragend', column.width, startLeft - startColumnLeft, column, event);
  11691. _this3.store.scheduleLayout();
  11692. document.body.style.cursor = '';
  11693. _this3.dragging = false;
  11694. _this3.draggingColumn = null;
  11695. _this3.dragState = {};
  11696. table.resizeProxyVisible = false;
  11697. }
  11698. document.removeEventListener('mousemove', handleMouseMove);
  11699. document.removeEventListener('mouseup', handleMouseUp);
  11700. document.onselectstart = null;
  11701. document.ondragstart = null;
  11702. setTimeout(function () {
  11703. Object(dom_["removeClass"])(columnEl, 'noclick');
  11704. }, 0);
  11705. };
  11706. document.addEventListener('mousemove', handleMouseMove);
  11707. document.addEventListener('mouseup', handleMouseUp);
  11708. }
  11709. },
  11710. handleMouseMove: function handleMouseMove(event, column) {
  11711. if (column.children && column.children.length > 0) return;
  11712. var target = event.target;
  11713. while (target && target.tagName !== 'TH') {
  11714. target = target.parentNode;
  11715. }
  11716. if (!column || !column.resizable) return;
  11717. if (!this.dragging && this.border) {
  11718. var rect = target.getBoundingClientRect();
  11719. var bodyStyle = document.body.style;
  11720. if (rect.width > 12 && rect.right - event.pageX < 8) {
  11721. bodyStyle.cursor = 'col-resize';
  11722. if (Object(dom_["hasClass"])(target, 'is-sortable')) {
  11723. target.style.cursor = 'col-resize';
  11724. }
  11725. this.draggingColumn = column;
  11726. } else if (!this.dragging) {
  11727. bodyStyle.cursor = '';
  11728. if (Object(dom_["hasClass"])(target, 'is-sortable')) {
  11729. target.style.cursor = 'pointer';
  11730. }
  11731. this.draggingColumn = null;
  11732. }
  11733. }
  11734. },
  11735. handleMouseOut: function handleMouseOut() {
  11736. if (this.$isServer) return;
  11737. document.body.style.cursor = '';
  11738. },
  11739. toggleOrder: function toggleOrder(_ref) {
  11740. var order = _ref.order,
  11741. sortOrders = _ref.sortOrders;
  11742. if (order === '') return sortOrders[0];
  11743. var index = sortOrders.indexOf(order || null);
  11744. return sortOrders[index > sortOrders.length - 2 ? 0 : index + 1];
  11745. },
  11746. handleSortClick: function handleSortClick(event, column, givenOrder) {
  11747. event.stopPropagation();
  11748. var order = column.order === givenOrder ? null : givenOrder || this.toggleOrder(column);
  11749. var target = event.target;
  11750. while (target && target.tagName !== 'TH') {
  11751. target = target.parentNode;
  11752. }
  11753. if (target && target.tagName === 'TH') {
  11754. if (Object(dom_["hasClass"])(target, 'noclick')) {
  11755. Object(dom_["removeClass"])(target, 'noclick');
  11756. return;
  11757. }
  11758. }
  11759. if (!column.sortable) return;
  11760. var states = this.store.states;
  11761. var sortProp = states.sortProp;
  11762. var sortOrder = void 0;
  11763. var sortingColumn = states.sortingColumn;
  11764. if (sortingColumn !== column || sortingColumn === column && sortingColumn.order === null) {
  11765. if (sortingColumn) {
  11766. sortingColumn.order = null;
  11767. }
  11768. states.sortingColumn = column;
  11769. sortProp = column.property;
  11770. }
  11771. if (!order) {
  11772. sortOrder = column.order = null;
  11773. } else {
  11774. sortOrder = column.order = order;
  11775. }
  11776. states.sortProp = sortProp;
  11777. states.sortOrder = sortOrder;
  11778. this.store.commit('changeSortCondition');
  11779. }
  11780. },
  11781. data: function data() {
  11782. return {
  11783. draggingColumn: null,
  11784. dragging: false,
  11785. dragState: {}
  11786. };
  11787. }
  11788. });
  11789. // CONCATENATED MODULE: ./packages/table/src/table-footer.js
  11790. var table_footer_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; };
  11791. /* harmony default export */ var table_footer = ({
  11792. name: 'ElTableFooter',
  11793. mixins: [layout_observer],
  11794. render: function render(h) {
  11795. var _this = this;
  11796. var sums = [];
  11797. if (this.summaryMethod) {
  11798. sums = this.summaryMethod({ columns: this.columns, data: this.store.states.data });
  11799. } else {
  11800. this.columns.forEach(function (column, index) {
  11801. if (index === 0) {
  11802. sums[index] = _this.sumText;
  11803. return;
  11804. }
  11805. var values = _this.store.states.data.map(function (item) {
  11806. return Number(item[column.property]);
  11807. });
  11808. var precisions = [];
  11809. var notNumber = true;
  11810. values.forEach(function (value) {
  11811. if (!isNaN(value)) {
  11812. notNumber = false;
  11813. var decimal = ('' + value).split('.')[1];
  11814. precisions.push(decimal ? decimal.length : 0);
  11815. }
  11816. });
  11817. var precision = Math.max.apply(null, precisions);
  11818. if (!notNumber) {
  11819. sums[index] = values.reduce(function (prev, curr) {
  11820. var value = Number(curr);
  11821. if (!isNaN(value)) {
  11822. return parseFloat((prev + curr).toFixed(Math.min(precision, 20)));
  11823. } else {
  11824. return prev;
  11825. }
  11826. }, 0);
  11827. } else {
  11828. sums[index] = '';
  11829. }
  11830. });
  11831. }
  11832. return h(
  11833. 'table',
  11834. {
  11835. 'class': 'el-table__footer',
  11836. attrs: { cellspacing: '0',
  11837. cellpadding: '0',
  11838. border: '0' }
  11839. },
  11840. [h('colgroup', [this.columns.map(function (column) {
  11841. return h('col', {
  11842. attrs: { name: column.id },
  11843. key: column.id });
  11844. }), this.hasGutter ? h('col', {
  11845. attrs: { name: 'gutter' }
  11846. }) : '']), h(
  11847. 'tbody',
  11848. { 'class': [{ 'has-gutter': this.hasGutter }] },
  11849. [h('tr', [this.columns.map(function (column, cellIndex) {
  11850. return h(
  11851. 'td',
  11852. {
  11853. key: cellIndex,
  11854. attrs: { colspan: column.colSpan,
  11855. rowspan: column.rowSpan
  11856. },
  11857. 'class': [].concat(_this.getRowClasses(column, cellIndex), ['el-table__cell']) },
  11858. [h(
  11859. 'div',
  11860. { 'class': ['cell', column.labelClassName] },
  11861. [sums[cellIndex]]
  11862. )]
  11863. );
  11864. }), this.hasGutter ? h('th', { 'class': 'el-table__cell gutter' }) : ''])]
  11865. )]
  11866. );
  11867. },
  11868. props: {
  11869. fixed: String,
  11870. store: {
  11871. required: true
  11872. },
  11873. summaryMethod: Function,
  11874. sumText: String,
  11875. border: Boolean,
  11876. defaultSort: {
  11877. type: Object,
  11878. default: function _default() {
  11879. return {
  11880. prop: '',
  11881. order: ''
  11882. };
  11883. }
  11884. }
  11885. },
  11886. computed: table_footer_extends({
  11887. table: function table() {
  11888. return this.$parent;
  11889. },
  11890. hasGutter: function hasGutter() {
  11891. return !this.fixed && this.tableLayout.gutterWidth;
  11892. }
  11893. }, mapStates({
  11894. columns: 'columns',
  11895. isAllSelected: 'isAllSelected',
  11896. leftFixedLeafCount: 'fixedLeafColumnsLength',
  11897. rightFixedLeafCount: 'rightFixedLeafColumnsLength',
  11898. columnsCount: function columnsCount(states) {
  11899. return states.columns.length;
  11900. },
  11901. leftFixedCount: function leftFixedCount(states) {
  11902. return states.fixedColumns.length;
  11903. },
  11904. rightFixedCount: function rightFixedCount(states) {
  11905. return states.rightFixedColumns.length;
  11906. }
  11907. })),
  11908. methods: {
  11909. isCellHidden: function isCellHidden(index, columns, column) {
  11910. if (this.fixed === true || this.fixed === 'left') {
  11911. return index >= this.leftFixedLeafCount;
  11912. } else if (this.fixed === 'right') {
  11913. var before = 0;
  11914. for (var i = 0; i < index; i++) {
  11915. before += columns[i].colSpan;
  11916. }
  11917. return before < this.columnsCount - this.rightFixedLeafCount;
  11918. } else if (!this.fixed && column.fixed) {
  11919. // hide cell when footer instance is not fixed and column is fixed
  11920. return true;
  11921. } else {
  11922. return index < this.leftFixedCount || index >= this.columnsCount - this.rightFixedCount;
  11923. }
  11924. },
  11925. getRowClasses: function getRowClasses(column, cellIndex) {
  11926. var classes = [column.id, column.align, column.labelClassName];
  11927. if (column.className) {
  11928. classes.push(column.className);
  11929. }
  11930. if (this.isCellHidden(cellIndex, this.columns, column)) {
  11931. classes.push('is-hidden');
  11932. }
  11933. if (!column.children) {
  11934. classes.push('is-leaf');
  11935. }
  11936. return classes;
  11937. }
  11938. }
  11939. });
  11940. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/table/src/table.vue?vue&type=script&lang=js&
  11941. var tablevue_type_script_lang_js_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; };
  11942. //
  11943. //
  11944. //
  11945. //
  11946. //
  11947. //
  11948. //
  11949. //
  11950. //
  11951. //
  11952. //
  11953. //
  11954. //
  11955. //
  11956. //
  11957. //
  11958. //
  11959. //
  11960. //
  11961. //
  11962. //
  11963. //
  11964. //
  11965. //
  11966. //
  11967. //
  11968. //
  11969. //
  11970. //
  11971. //
  11972. //
  11973. //
  11974. //
  11975. //
  11976. //
  11977. //
  11978. //
  11979. //
  11980. //
  11981. //
  11982. //
  11983. //
  11984. //
  11985. //
  11986. //
  11987. //
  11988. //
  11989. //
  11990. //
  11991. //
  11992. //
  11993. //
  11994. //
  11995. //
  11996. //
  11997. //
  11998. //
  11999. //
  12000. //
  12001. //
  12002. //
  12003. //
  12004. //
  12005. //
  12006. //
  12007. //
  12008. //
  12009. //
  12010. //
  12011. //
  12012. //
  12013. //
  12014. //
  12015. //
  12016. //
  12017. //
  12018. //
  12019. //
  12020. //
  12021. //
  12022. //
  12023. //
  12024. //
  12025. //
  12026. //
  12027. //
  12028. //
  12029. //
  12030. //
  12031. //
  12032. //
  12033. //
  12034. //
  12035. //
  12036. //
  12037. //
  12038. //
  12039. //
  12040. //
  12041. //
  12042. //
  12043. //
  12044. //
  12045. //
  12046. //
  12047. //
  12048. //
  12049. //
  12050. //
  12051. //
  12052. //
  12053. //
  12054. //
  12055. //
  12056. //
  12057. //
  12058. //
  12059. //
  12060. //
  12061. //
  12062. //
  12063. //
  12064. //
  12065. //
  12066. //
  12067. //
  12068. //
  12069. //
  12070. //
  12071. //
  12072. //
  12073. //
  12074. //
  12075. //
  12076. //
  12077. //
  12078. //
  12079. //
  12080. //
  12081. //
  12082. //
  12083. //
  12084. //
  12085. //
  12086. //
  12087. //
  12088. //
  12089. //
  12090. //
  12091. //
  12092. //
  12093. //
  12094. //
  12095. //
  12096. //
  12097. //
  12098. //
  12099. //
  12100. //
  12101. //
  12102. //
  12103. //
  12104. //
  12105. //
  12106. //
  12107. //
  12108. //
  12109. //
  12110. //
  12111. //
  12112. //
  12113. //
  12114. //
  12115. //
  12116. //
  12117. //
  12118. //
  12119. //
  12120. //
  12121. //
  12122. //
  12123. //
  12124. //
  12125. //
  12126. //
  12127. //
  12128. //
  12129. //
  12130. //
  12131. //
  12132. //
  12133. //
  12134. //
  12135. //
  12136. //
  12137. //
  12138. //
  12139. //
  12140. //
  12141. //
  12142. //
  12143. //
  12144. //
  12145. //
  12146. //
  12147. //
  12148. //
  12149. //
  12150. //
  12151. //
  12152. //
  12153. //
  12154. //
  12155. //
  12156. var tableIdSeed = 1;
  12157. /* harmony default export */ var tablevue_type_script_lang_js_ = ({
  12158. name: 'ElTable',
  12159. mixins: [locale_default.a, migrating_default.a],
  12160. directives: {
  12161. Mousewheel: directives_mousewheel
  12162. },
  12163. props: {
  12164. data: {
  12165. type: Array,
  12166. default: function _default() {
  12167. return [];
  12168. }
  12169. },
  12170. size: String,
  12171. width: [String, Number],
  12172. height: [String, Number],
  12173. maxHeight: [String, Number],
  12174. fit: {
  12175. type: Boolean,
  12176. default: true
  12177. },
  12178. stripe: Boolean,
  12179. border: Boolean,
  12180. rowKey: [String, Function],
  12181. context: {},
  12182. showHeader: {
  12183. type: Boolean,
  12184. default: true
  12185. },
  12186. showSummary: Boolean,
  12187. sumText: String,
  12188. summaryMethod: Function,
  12189. rowClassName: [String, Function],
  12190. rowStyle: [Object, Function],
  12191. cellClassName: [String, Function],
  12192. cellStyle: [Object, Function],
  12193. headerRowClassName: [String, Function],
  12194. headerRowStyle: [Object, Function],
  12195. headerCellClassName: [String, Function],
  12196. headerCellStyle: [Object, Function],
  12197. highlightCurrentRow: Boolean,
  12198. highlightSelectionRow: {
  12199. type: Boolean,
  12200. default: false
  12201. },
  12202. currentRowKey: [String, Number],
  12203. emptyText: String,
  12204. expandRowKeys: Array,
  12205. defaultExpandAll: Boolean,
  12206. defaultSort: Object,
  12207. tooltipEffect: String,
  12208. spanMethod: Function,
  12209. selectOnIndeterminate: {
  12210. type: Boolean,
  12211. default: true
  12212. },
  12213. indent: {
  12214. type: Number,
  12215. default: 16
  12216. },
  12217. treeProps: {
  12218. type: Object,
  12219. default: function _default() {
  12220. return {
  12221. hasChildren: 'hasChildren',
  12222. children: 'children'
  12223. };
  12224. }
  12225. },
  12226. lazy: Boolean,
  12227. load: Function
  12228. },
  12229. components: {
  12230. TableHeader: table_header,
  12231. TableFooter: table_footer,
  12232. TableBody: table_body,
  12233. ElCheckbox: checkbox_default.a
  12234. },
  12235. methods: {
  12236. getMigratingConfig: function getMigratingConfig() {
  12237. return {
  12238. events: {
  12239. expand: 'expand is renamed to expand-change'
  12240. }
  12241. };
  12242. },
  12243. setCurrentRow: function setCurrentRow(row) {
  12244. this.store.commit('setCurrentRow', row);
  12245. },
  12246. toggleRowSelection: function toggleRowSelection(row, selected) {
  12247. this.store.toggleRowSelection(row, selected, false);
  12248. this.store.updateAllSelected();
  12249. },
  12250. toggleRowExpansion: function toggleRowExpansion(row, expanded) {
  12251. this.store.toggleRowExpansionAdapter(row, expanded);
  12252. },
  12253. clearSelection: function clearSelection() {
  12254. this.store.clearSelection();
  12255. },
  12256. clearFilter: function clearFilter(columnKeys) {
  12257. this.store.clearFilter(columnKeys);
  12258. },
  12259. clearSort: function clearSort() {
  12260. this.store.clearSort();
  12261. },
  12262. handleMouseLeave: function handleMouseLeave() {
  12263. this.store.commit('setHoverRow', null);
  12264. if (this.hoverState) this.hoverState = null;
  12265. },
  12266. updateScrollY: function updateScrollY() {
  12267. var changed = this.layout.updateScrollY();
  12268. if (changed) {
  12269. this.layout.notifyObservers('scrollable');
  12270. this.layout.updateColumnsWidth();
  12271. }
  12272. },
  12273. handleFixedMousewheel: function handleFixedMousewheel(event, data) {
  12274. var bodyWrapper = this.bodyWrapper;
  12275. if (Math.abs(data.spinY) > 0) {
  12276. var currentScrollTop = bodyWrapper.scrollTop;
  12277. if (data.pixelY < 0 && currentScrollTop !== 0) {
  12278. event.preventDefault();
  12279. }
  12280. if (data.pixelY > 0 && bodyWrapper.scrollHeight - bodyWrapper.clientHeight > currentScrollTop) {
  12281. event.preventDefault();
  12282. }
  12283. bodyWrapper.scrollTop += Math.ceil(data.pixelY / 5);
  12284. } else {
  12285. bodyWrapper.scrollLeft += Math.ceil(data.pixelX / 5);
  12286. }
  12287. },
  12288. handleHeaderFooterMousewheel: function handleHeaderFooterMousewheel(event, data) {
  12289. var pixelX = data.pixelX,
  12290. pixelY = data.pixelY;
  12291. if (Math.abs(pixelX) >= Math.abs(pixelY)) {
  12292. this.bodyWrapper.scrollLeft += data.pixelX / 5;
  12293. }
  12294. },
  12295. // TODO 使用 CSS transform
  12296. syncPostion: function syncPostion() {
  12297. var _bodyWrapper = this.bodyWrapper,
  12298. scrollLeft = _bodyWrapper.scrollLeft,
  12299. scrollTop = _bodyWrapper.scrollTop,
  12300. offsetWidth = _bodyWrapper.offsetWidth,
  12301. scrollWidth = _bodyWrapper.scrollWidth;
  12302. var _$refs = this.$refs,
  12303. headerWrapper = _$refs.headerWrapper,
  12304. footerWrapper = _$refs.footerWrapper,
  12305. fixedBodyWrapper = _$refs.fixedBodyWrapper,
  12306. rightFixedBodyWrapper = _$refs.rightFixedBodyWrapper;
  12307. if (headerWrapper) headerWrapper.scrollLeft = scrollLeft;
  12308. if (footerWrapper) footerWrapper.scrollLeft = scrollLeft;
  12309. if (fixedBodyWrapper) fixedBodyWrapper.scrollTop = scrollTop;
  12310. if (rightFixedBodyWrapper) rightFixedBodyWrapper.scrollTop = scrollTop;
  12311. var maxScrollLeftPosition = scrollWidth - offsetWidth - 1;
  12312. if (scrollLeft >= maxScrollLeftPosition) {
  12313. this.scrollPosition = 'right';
  12314. } else if (scrollLeft === 0) {
  12315. this.scrollPosition = 'left';
  12316. } else {
  12317. this.scrollPosition = 'middle';
  12318. }
  12319. },
  12320. throttleSyncPostion: Object(external_throttle_debounce_["throttle"])(16, function () {
  12321. this.syncPostion();
  12322. }),
  12323. onScroll: function onScroll(evt) {
  12324. var raf = window.requestAnimationFrame;
  12325. if (!raf) {
  12326. this.throttleSyncPostion();
  12327. } else {
  12328. raf(this.syncPostion);
  12329. }
  12330. },
  12331. bindEvents: function bindEvents() {
  12332. this.bodyWrapper.addEventListener('scroll', this.onScroll, { passive: true });
  12333. if (this.fit) {
  12334. Object(resize_event_["addResizeListener"])(this.$el, this.resizeListener);
  12335. }
  12336. },
  12337. unbindEvents: function unbindEvents() {
  12338. this.bodyWrapper.removeEventListener('scroll', this.onScroll, { passive: true });
  12339. if (this.fit) {
  12340. Object(resize_event_["removeResizeListener"])(this.$el, this.resizeListener);
  12341. }
  12342. },
  12343. resizeListener: function resizeListener() {
  12344. if (!this.$ready) return;
  12345. var shouldUpdateLayout = false;
  12346. var el = this.$el;
  12347. var _resizeState = this.resizeState,
  12348. oldWidth = _resizeState.width,
  12349. oldHeight = _resizeState.height;
  12350. var width = el.offsetWidth;
  12351. if (oldWidth !== width) {
  12352. shouldUpdateLayout = true;
  12353. }
  12354. var height = el.offsetHeight;
  12355. if ((this.height || this.shouldUpdateHeight) && oldHeight !== height) {
  12356. shouldUpdateLayout = true;
  12357. }
  12358. if (shouldUpdateLayout) {
  12359. this.resizeState.width = width;
  12360. this.resizeState.height = height;
  12361. this.doLayout();
  12362. }
  12363. },
  12364. doLayout: function doLayout() {
  12365. if (this.shouldUpdateHeight) {
  12366. this.layout.updateElsHeight();
  12367. }
  12368. this.layout.updateColumnsWidth();
  12369. },
  12370. sort: function sort(prop, order) {
  12371. this.store.commit('sort', { prop: prop, order: order });
  12372. },
  12373. toggleAllSelection: function toggleAllSelection() {
  12374. this.store.commit('toggleAllSelection');
  12375. }
  12376. },
  12377. computed: tablevue_type_script_lang_js_extends({
  12378. tableSize: function tableSize() {
  12379. return this.size || (this.$ELEMENT || {}).size;
  12380. },
  12381. bodyWrapper: function bodyWrapper() {
  12382. return this.$refs.bodyWrapper;
  12383. },
  12384. shouldUpdateHeight: function shouldUpdateHeight() {
  12385. return this.height || this.maxHeight || this.fixedColumns.length > 0 || this.rightFixedColumns.length > 0;
  12386. },
  12387. bodyWidth: function bodyWidth() {
  12388. var _layout = this.layout,
  12389. bodyWidth = _layout.bodyWidth,
  12390. scrollY = _layout.scrollY,
  12391. gutterWidth = _layout.gutterWidth;
  12392. return bodyWidth ? bodyWidth - (scrollY ? gutterWidth : 0) + 'px' : '';
  12393. },
  12394. bodyHeight: function bodyHeight() {
  12395. var _layout2 = this.layout,
  12396. _layout2$headerHeight = _layout2.headerHeight,
  12397. headerHeight = _layout2$headerHeight === undefined ? 0 : _layout2$headerHeight,
  12398. bodyHeight = _layout2.bodyHeight,
  12399. _layout2$footerHeight = _layout2.footerHeight,
  12400. footerHeight = _layout2$footerHeight === undefined ? 0 : _layout2$footerHeight;
  12401. if (this.height) {
  12402. return {
  12403. height: bodyHeight ? bodyHeight + 'px' : ''
  12404. };
  12405. } else if (this.maxHeight) {
  12406. var maxHeight = parseHeight(this.maxHeight);
  12407. if (typeof maxHeight === 'number') {
  12408. return {
  12409. 'max-height': maxHeight - footerHeight - (this.showHeader ? headerHeight : 0) + 'px'
  12410. };
  12411. }
  12412. }
  12413. return {};
  12414. },
  12415. fixedBodyHeight: function fixedBodyHeight() {
  12416. if (this.height) {
  12417. return {
  12418. height: this.layout.fixedBodyHeight ? this.layout.fixedBodyHeight + 'px' : ''
  12419. };
  12420. } else if (this.maxHeight) {
  12421. var maxHeight = parseHeight(this.maxHeight);
  12422. if (typeof maxHeight === 'number') {
  12423. maxHeight = this.layout.scrollX ? maxHeight - this.layout.gutterWidth : maxHeight;
  12424. if (this.showHeader) {
  12425. maxHeight -= this.layout.headerHeight;
  12426. }
  12427. maxHeight -= this.layout.footerHeight;
  12428. return {
  12429. 'max-height': maxHeight + 'px'
  12430. };
  12431. }
  12432. }
  12433. return {};
  12434. },
  12435. fixedHeight: function fixedHeight() {
  12436. if (this.maxHeight) {
  12437. if (this.showSummary) {
  12438. return {
  12439. bottom: 0
  12440. };
  12441. }
  12442. return {
  12443. bottom: this.layout.scrollX && this.data.length ? this.layout.gutterWidth + 'px' : ''
  12444. };
  12445. } else {
  12446. if (this.showSummary) {
  12447. return {
  12448. height: this.layout.tableHeight ? this.layout.tableHeight + 'px' : ''
  12449. };
  12450. }
  12451. return {
  12452. height: this.layout.viewportHeight ? this.layout.viewportHeight + 'px' : ''
  12453. };
  12454. }
  12455. },
  12456. emptyBlockStyle: function emptyBlockStyle() {
  12457. if (this.data && this.data.length) return null;
  12458. var height = '100%';
  12459. if (this.layout.appendHeight) {
  12460. height = 'calc(100% - ' + this.layout.appendHeight + 'px)';
  12461. }
  12462. return {
  12463. width: this.bodyWidth,
  12464. height: height
  12465. };
  12466. }
  12467. }, mapStates({
  12468. selection: 'selection',
  12469. columns: 'columns',
  12470. tableData: 'data',
  12471. fixedColumns: 'fixedColumns',
  12472. rightFixedColumns: 'rightFixedColumns'
  12473. })),
  12474. watch: {
  12475. height: {
  12476. immediate: true,
  12477. handler: function handler(value) {
  12478. this.layout.setHeight(value);
  12479. }
  12480. },
  12481. maxHeight: {
  12482. immediate: true,
  12483. handler: function handler(value) {
  12484. this.layout.setMaxHeight(value);
  12485. }
  12486. },
  12487. currentRowKey: {
  12488. immediate: true,
  12489. handler: function handler(value) {
  12490. if (!this.rowKey) return;
  12491. this.store.setCurrentRowKey(value);
  12492. }
  12493. },
  12494. data: {
  12495. immediate: true,
  12496. handler: function handler(value) {
  12497. this.store.commit('setData', value);
  12498. }
  12499. },
  12500. expandRowKeys: {
  12501. immediate: true,
  12502. handler: function handler(newVal) {
  12503. if (newVal) {
  12504. this.store.setExpandRowKeysAdapter(newVal);
  12505. }
  12506. }
  12507. }
  12508. },
  12509. created: function created() {
  12510. var _this = this;
  12511. this.tableId = 'el-table_' + tableIdSeed++;
  12512. this.debouncedUpdateLayout = Object(external_throttle_debounce_["debounce"])(50, function () {
  12513. return _this.doLayout();
  12514. });
  12515. },
  12516. mounted: function mounted() {
  12517. var _this2 = this;
  12518. this.bindEvents();
  12519. this.store.updateColumns();
  12520. this.doLayout();
  12521. this.resizeState = {
  12522. width: this.$el.offsetWidth,
  12523. height: this.$el.offsetHeight
  12524. };
  12525. // init filters
  12526. this.store.states.columns.forEach(function (column) {
  12527. if (column.filteredValue && column.filteredValue.length) {
  12528. _this2.store.commit('filterChange', {
  12529. column: column,
  12530. values: column.filteredValue,
  12531. silent: true
  12532. });
  12533. }
  12534. });
  12535. this.$ready = true;
  12536. },
  12537. destroyed: function destroyed() {
  12538. this.unbindEvents();
  12539. },
  12540. data: function data() {
  12541. var _treeProps = this.treeProps,
  12542. _treeProps$hasChildre = _treeProps.hasChildren,
  12543. hasChildren = _treeProps$hasChildre === undefined ? 'hasChildren' : _treeProps$hasChildre,
  12544. _treeProps$children = _treeProps.children,
  12545. children = _treeProps$children === undefined ? 'children' : _treeProps$children;
  12546. this.store = createStore(this, {
  12547. rowKey: this.rowKey,
  12548. defaultExpandAll: this.defaultExpandAll,
  12549. selectOnIndeterminate: this.selectOnIndeterminate,
  12550. // TreeTable 的相关配置
  12551. indent: this.indent,
  12552. lazy: this.lazy,
  12553. lazyColumnIdentifier: hasChildren,
  12554. childrenColumnName: children
  12555. });
  12556. var layout = new table_layout({
  12557. store: this.store,
  12558. table: this,
  12559. fit: this.fit,
  12560. showHeader: this.showHeader
  12561. });
  12562. return {
  12563. layout: layout,
  12564. isHidden: false,
  12565. renderExpanded: null,
  12566. resizeProxyVisible: false,
  12567. resizeState: {
  12568. width: null,
  12569. height: null
  12570. },
  12571. // 是否拥有多级表头
  12572. isGroup: false,
  12573. scrollPosition: 'left'
  12574. };
  12575. }
  12576. });
  12577. // CONCATENATED MODULE: ./packages/table/src/table.vue?vue&type=script&lang=js&
  12578. /* harmony default export */ var src_tablevue_type_script_lang_js_ = (tablevue_type_script_lang_js_);
  12579. // CONCATENATED MODULE: ./packages/table/src/table.vue
  12580. /* normalize component */
  12581. var table_component = normalizeComponent(
  12582. src_tablevue_type_script_lang_js_,
  12583. tablevue_type_template_id_493fe34e_render,
  12584. tablevue_type_template_id_493fe34e_staticRenderFns,
  12585. false,
  12586. null,
  12587. null,
  12588. null
  12589. )
  12590. /* hot reload */
  12591. if (false) { var table_api; }
  12592. table_component.options.__file = "packages/table/src/table.vue"
  12593. /* harmony default export */ var src_table = (table_component.exports);
  12594. // CONCATENATED MODULE: ./packages/table/index.js
  12595. /* istanbul ignore next */
  12596. src_table.install = function (Vue) {
  12597. Vue.component(src_table.name, src_table);
  12598. };
  12599. /* harmony default export */ var packages_table = (src_table);
  12600. // CONCATENATED MODULE: ./packages/table/src/config.js
  12601. var cellStarts = {
  12602. default: {
  12603. order: ''
  12604. },
  12605. selection: {
  12606. width: 48,
  12607. minWidth: 48,
  12608. realWidth: 48,
  12609. order: '',
  12610. className: 'el-table-column--selection'
  12611. },
  12612. expand: {
  12613. width: 48,
  12614. minWidth: 48,
  12615. realWidth: 48,
  12616. order: ''
  12617. },
  12618. index: {
  12619. width: 48,
  12620. minWidth: 48,
  12621. realWidth: 48,
  12622. order: ''
  12623. }
  12624. };
  12625. // 这些选项不应该被覆盖
  12626. var cellForced = {
  12627. selection: {
  12628. renderHeader: function renderHeader(h, _ref) {
  12629. var store = _ref.store;
  12630. return h('el-checkbox', {
  12631. attrs: {
  12632. disabled: store.states.data && store.states.data.length === 0,
  12633. indeterminate: store.states.selection.length > 0 && !this.isAllSelected,
  12634. value: this.isAllSelected },
  12635. on: {
  12636. 'input': this.toggleAllSelection
  12637. }
  12638. });
  12639. },
  12640. renderCell: function renderCell(h, _ref2) {
  12641. var row = _ref2.row,
  12642. column = _ref2.column,
  12643. isSelected = _ref2.isSelected,
  12644. store = _ref2.store,
  12645. $index = _ref2.$index;
  12646. return h('el-checkbox', {
  12647. nativeOn: {
  12648. 'click': function click(event) {
  12649. return event.stopPropagation();
  12650. }
  12651. },
  12652. attrs: {
  12653. value: isSelected,
  12654. disabled: column.selectable ? !column.selectable.call(null, row, $index) : false
  12655. },
  12656. on: {
  12657. 'input': function input() {
  12658. store.commit('rowSelectedChanged', row);
  12659. }
  12660. }
  12661. });
  12662. },
  12663. sortable: false,
  12664. resizable: false
  12665. },
  12666. index: {
  12667. renderHeader: function renderHeader(h, _ref3) {
  12668. var column = _ref3.column;
  12669. return column.label || '#';
  12670. },
  12671. renderCell: function renderCell(h, _ref4) {
  12672. var $index = _ref4.$index,
  12673. column = _ref4.column;
  12674. var i = $index + 1;
  12675. var index = column.index;
  12676. if (typeof index === 'number') {
  12677. i = $index + index;
  12678. } else if (typeof index === 'function') {
  12679. i = index($index);
  12680. }
  12681. return h('div', [i]);
  12682. },
  12683. sortable: false
  12684. },
  12685. expand: {
  12686. renderHeader: function renderHeader(h, _ref5) {
  12687. var column = _ref5.column;
  12688. return column.label || '';
  12689. },
  12690. renderCell: function renderCell(h, _ref6) {
  12691. var row = _ref6.row,
  12692. store = _ref6.store,
  12693. isExpanded = _ref6.isExpanded;
  12694. var classes = ['el-table__expand-icon'];
  12695. if (isExpanded) {
  12696. classes.push('el-table__expand-icon--expanded');
  12697. }
  12698. var callback = function callback(e) {
  12699. e.stopPropagation();
  12700. store.toggleRowExpansion(row);
  12701. };
  12702. return h(
  12703. 'div',
  12704. { 'class': classes,
  12705. on: {
  12706. 'click': callback
  12707. }
  12708. },
  12709. [h('i', { 'class': 'el-icon el-icon-arrow-right' })]
  12710. );
  12711. },
  12712. sortable: false,
  12713. resizable: false,
  12714. className: 'el-table__expand-column'
  12715. }
  12716. };
  12717. function defaultRenderCell(h, _ref7) {
  12718. var row = _ref7.row,
  12719. column = _ref7.column,
  12720. $index = _ref7.$index;
  12721. var property = column.property;
  12722. var value = property && Object(util_["getPropByPath"])(row, property).v;
  12723. if (column && column.formatter) {
  12724. return column.formatter(row, column, value, $index);
  12725. }
  12726. return value;
  12727. }
  12728. function treeCellPrefix(h, _ref8) {
  12729. var row = _ref8.row,
  12730. treeNode = _ref8.treeNode,
  12731. store = _ref8.store;
  12732. if (!treeNode) return null;
  12733. var ele = [];
  12734. var callback = function callback(e) {
  12735. e.stopPropagation();
  12736. store.loadOrToggle(row);
  12737. };
  12738. if (treeNode.indent) {
  12739. ele.push(h('span', { 'class': 'el-table__indent', style: { 'padding-left': treeNode.indent + 'px' } }));
  12740. }
  12741. if (typeof treeNode.expanded === 'boolean' && !treeNode.noLazyChildren) {
  12742. var expandClasses = ['el-table__expand-icon', treeNode.expanded ? 'el-table__expand-icon--expanded' : ''];
  12743. var iconClasses = ['el-icon-arrow-right'];
  12744. if (treeNode.loading) {
  12745. iconClasses = ['el-icon-loading'];
  12746. }
  12747. ele.push(h(
  12748. 'div',
  12749. { 'class': expandClasses,
  12750. on: {
  12751. 'click': callback
  12752. }
  12753. },
  12754. [h('i', { 'class': iconClasses })]
  12755. ));
  12756. } else {
  12757. ele.push(h('span', { 'class': 'el-table__placeholder' }));
  12758. }
  12759. return ele;
  12760. }
  12761. // CONCATENATED MODULE: ./packages/table/src/table-column.js
  12762. var table_column_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; };
  12763. var columnIdSeed = 1;
  12764. /* harmony default export */ var table_column = ({
  12765. name: 'ElTableColumn',
  12766. props: {
  12767. type: {
  12768. type: String,
  12769. default: 'default'
  12770. },
  12771. label: String,
  12772. className: String,
  12773. labelClassName: String,
  12774. property: String,
  12775. prop: String,
  12776. width: {},
  12777. minWidth: {},
  12778. renderHeader: Function,
  12779. sortable: {
  12780. type: [Boolean, String],
  12781. default: false
  12782. },
  12783. sortMethod: Function,
  12784. sortBy: [String, Function, Array],
  12785. resizable: {
  12786. type: Boolean,
  12787. default: true
  12788. },
  12789. columnKey: String,
  12790. align: String,
  12791. headerAlign: String,
  12792. showTooltipWhenOverflow: Boolean,
  12793. showOverflowTooltip: Boolean,
  12794. fixed: [Boolean, String],
  12795. formatter: Function,
  12796. selectable: Function,
  12797. reserveSelection: Boolean,
  12798. filterMethod: Function,
  12799. filteredValue: Array,
  12800. filters: Array,
  12801. filterPlacement: String,
  12802. filterMultiple: {
  12803. type: Boolean,
  12804. default: true
  12805. },
  12806. index: [Number, Function],
  12807. sortOrders: {
  12808. type: Array,
  12809. default: function _default() {
  12810. return ['ascending', 'descending', null];
  12811. },
  12812. validator: function validator(val) {
  12813. return val.every(function (order) {
  12814. return ['ascending', 'descending', null].indexOf(order) > -1;
  12815. });
  12816. }
  12817. }
  12818. },
  12819. data: function data() {
  12820. return {
  12821. isSubColumn: false,
  12822. columns: []
  12823. };
  12824. },
  12825. computed: {
  12826. owner: function owner() {
  12827. var parent = this.$parent;
  12828. while (parent && !parent.tableId) {
  12829. parent = parent.$parent;
  12830. }
  12831. return parent;
  12832. },
  12833. columnOrTableParent: function columnOrTableParent() {
  12834. var parent = this.$parent;
  12835. while (parent && !parent.tableId && !parent.columnId) {
  12836. parent = parent.$parent;
  12837. }
  12838. return parent;
  12839. },
  12840. realWidth: function realWidth() {
  12841. return parseWidth(this.width);
  12842. },
  12843. realMinWidth: function realMinWidth() {
  12844. return parseMinWidth(this.minWidth);
  12845. },
  12846. realAlign: function realAlign() {
  12847. return this.align ? 'is-' + this.align : null;
  12848. },
  12849. realHeaderAlign: function realHeaderAlign() {
  12850. return this.headerAlign ? 'is-' + this.headerAlign : this.realAlign;
  12851. }
  12852. },
  12853. methods: {
  12854. getPropsData: function getPropsData() {
  12855. var _this = this;
  12856. for (var _len = arguments.length, props = Array(_len), _key = 0; _key < _len; _key++) {
  12857. props[_key] = arguments[_key];
  12858. }
  12859. return props.reduce(function (prev, cur) {
  12860. if (Array.isArray(cur)) {
  12861. cur.forEach(function (key) {
  12862. prev[key] = _this[key];
  12863. });
  12864. }
  12865. return prev;
  12866. }, {});
  12867. },
  12868. getColumnElIndex: function getColumnElIndex(children, child) {
  12869. return [].indexOf.call(children, child);
  12870. },
  12871. setColumnWidth: function setColumnWidth(column) {
  12872. if (this.realWidth) {
  12873. column.width = this.realWidth;
  12874. }
  12875. if (this.realMinWidth) {
  12876. column.minWidth = this.realMinWidth;
  12877. }
  12878. if (!column.minWidth) {
  12879. column.minWidth = 80;
  12880. }
  12881. column.realWidth = column.width === undefined ? column.minWidth : column.width;
  12882. return column;
  12883. },
  12884. setColumnForcedProps: function setColumnForcedProps(column) {
  12885. // 对于特定类型的 column,某些属性不允许设置
  12886. var type = column.type;
  12887. var source = cellForced[type] || {};
  12888. Object.keys(source).forEach(function (prop) {
  12889. var value = source[prop];
  12890. if (value !== undefined) {
  12891. column[prop] = prop === 'className' ? column[prop] + ' ' + value : value;
  12892. }
  12893. });
  12894. return column;
  12895. },
  12896. setColumnRenders: function setColumnRenders(column) {
  12897. var _this2 = this;
  12898. var h = this.$createElement;
  12899. // renderHeader 属性不推荐使用。
  12900. if (this.renderHeader) {
  12901. console.warn('[Element Warn][TableColumn]Comparing to render-header, scoped-slot header is easier to use. We recommend users to use scoped-slot header.');
  12902. } else if (column.type !== 'selection') {
  12903. column.renderHeader = function (h, scope) {
  12904. var renderHeader = _this2.$scopedSlots.header;
  12905. return renderHeader ? renderHeader(scope) : column.label;
  12906. };
  12907. }
  12908. var originRenderCell = column.renderCell;
  12909. // TODO: 这里的实现调整
  12910. if (column.type === 'expand') {
  12911. // 对于展开行,renderCell 不允许配置的。在上一步中已经设置过,这里需要简单封装一下。
  12912. column.renderCell = function (h, data) {
  12913. return h(
  12914. 'div',
  12915. { 'class': 'cell' },
  12916. [originRenderCell(h, data)]
  12917. );
  12918. };
  12919. this.owner.renderExpanded = function (h, data) {
  12920. return _this2.$scopedSlots.default ? _this2.$scopedSlots.default(data) : _this2.$slots.default;
  12921. };
  12922. } else {
  12923. originRenderCell = originRenderCell || defaultRenderCell;
  12924. // 对 renderCell 进行包装
  12925. column.renderCell = function (h, data) {
  12926. var children = null;
  12927. if (_this2.$scopedSlots.default) {
  12928. children = _this2.$scopedSlots.default(data);
  12929. } else {
  12930. children = originRenderCell(h, data);
  12931. }
  12932. var prefix = treeCellPrefix(h, data);
  12933. var props = {
  12934. class: 'cell',
  12935. style: {}
  12936. };
  12937. if (column.showOverflowTooltip) {
  12938. props.class += ' el-tooltip';
  12939. props.style = { width: (data.column.realWidth || data.column.width) - 1 + 'px' };
  12940. }
  12941. return h(
  12942. 'div',
  12943. props,
  12944. [prefix, children]
  12945. );
  12946. };
  12947. }
  12948. return column;
  12949. },
  12950. registerNormalWatchers: function registerNormalWatchers() {
  12951. var _this3 = this;
  12952. var props = ['label', 'property', 'filters', 'filterMultiple', 'sortable', 'index', 'formatter', 'className', 'labelClassName', 'showOverflowTooltip'];
  12953. // 一些属性具有别名
  12954. var aliases = {
  12955. prop: 'property',
  12956. realAlign: 'align',
  12957. realHeaderAlign: 'headerAlign',
  12958. realWidth: 'width'
  12959. };
  12960. var allAliases = props.reduce(function (prev, cur) {
  12961. prev[cur] = cur;
  12962. return prev;
  12963. }, aliases);
  12964. Object.keys(allAliases).forEach(function (key) {
  12965. var columnKey = aliases[key];
  12966. _this3.$watch(key, function (newVal) {
  12967. _this3.columnConfig[columnKey] = newVal;
  12968. });
  12969. });
  12970. },
  12971. registerComplexWatchers: function registerComplexWatchers() {
  12972. var _this4 = this;
  12973. var props = ['fixed'];
  12974. var aliases = {
  12975. realWidth: 'width',
  12976. realMinWidth: 'minWidth'
  12977. };
  12978. var allAliases = props.reduce(function (prev, cur) {
  12979. prev[cur] = cur;
  12980. return prev;
  12981. }, aliases);
  12982. Object.keys(allAliases).forEach(function (key) {
  12983. var columnKey = aliases[key];
  12984. _this4.$watch(key, function (newVal) {
  12985. _this4.columnConfig[columnKey] = newVal;
  12986. var updateColumns = columnKey === 'fixed';
  12987. _this4.owner.store.scheduleLayout(updateColumns);
  12988. });
  12989. });
  12990. }
  12991. },
  12992. components: {
  12993. ElCheckbox: checkbox_default.a
  12994. },
  12995. beforeCreate: function beforeCreate() {
  12996. this.row = {};
  12997. this.column = {};
  12998. this.$index = 0;
  12999. this.columnId = '';
  13000. },
  13001. created: function created() {
  13002. var parent = this.columnOrTableParent;
  13003. this.isSubColumn = this.owner !== parent;
  13004. this.columnId = (parent.tableId || parent.columnId) + '_column_' + columnIdSeed++;
  13005. var type = this.type || 'default';
  13006. var sortable = this.sortable === '' ? true : this.sortable;
  13007. var defaults = table_column_extends({}, cellStarts[type], {
  13008. id: this.columnId,
  13009. type: type,
  13010. property: this.prop || this.property,
  13011. align: this.realAlign,
  13012. headerAlign: this.realHeaderAlign,
  13013. showOverflowTooltip: this.showOverflowTooltip || this.showTooltipWhenOverflow,
  13014. // filter 相关属性
  13015. filterable: this.filters || this.filterMethod,
  13016. filteredValue: [],
  13017. filterPlacement: '',
  13018. isColumnGroup: false,
  13019. filterOpened: false,
  13020. // sort 相关属性
  13021. sortable: sortable,
  13022. // index 列
  13023. index: this.index
  13024. });
  13025. var basicProps = ['columnKey', 'label', 'className', 'labelClassName', 'type', 'renderHeader', 'formatter', 'fixed', 'resizable'];
  13026. var sortProps = ['sortMethod', 'sortBy', 'sortOrders'];
  13027. var selectProps = ['selectable', 'reserveSelection'];
  13028. var filterProps = ['filterMethod', 'filters', 'filterMultiple', 'filterOpened', 'filteredValue', 'filterPlacement'];
  13029. var column = this.getPropsData(basicProps, sortProps, selectProps, filterProps);
  13030. column = mergeOptions(defaults, column);
  13031. // 注意 compose 中函数执行的顺序是从右到左
  13032. var chains = compose(this.setColumnRenders, this.setColumnWidth, this.setColumnForcedProps);
  13033. column = chains(column);
  13034. this.columnConfig = column;
  13035. // 注册 watcher
  13036. this.registerNormalWatchers();
  13037. this.registerComplexWatchers();
  13038. },
  13039. mounted: function mounted() {
  13040. var owner = this.owner;
  13041. var parent = this.columnOrTableParent;
  13042. var children = this.isSubColumn ? parent.$el.children : parent.$refs.hiddenColumns.children;
  13043. var columnIndex = this.getColumnElIndex(children, this.$el);
  13044. owner.store.commit('insertColumn', this.columnConfig, columnIndex, this.isSubColumn ? parent.columnConfig : null);
  13045. },
  13046. destroyed: function destroyed() {
  13047. if (!this.$parent) return;
  13048. var parent = this.$parent;
  13049. this.owner.store.commit('removeColumn', this.columnConfig, this.isSubColumn ? parent.columnConfig : null);
  13050. },
  13051. render: function render(h) {
  13052. // slots 也要渲染,需要计算合并表头
  13053. return h('div', this.$slots.default);
  13054. }
  13055. });
  13056. // CONCATENATED MODULE: ./packages/table-column/index.js
  13057. /* istanbul ignore next */
  13058. table_column.install = function (Vue) {
  13059. Vue.component(table_column.name, table_column);
  13060. };
  13061. /* harmony default export */ var packages_table_column = (table_column);
  13062. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/picker.vue?vue&type=template&id=79ae069f&
  13063. var pickervue_type_template_id_79ae069f_render = function() {
  13064. var _vm = this
  13065. var _h = _vm.$createElement
  13066. var _c = _vm._self._c || _h
  13067. return !_vm.ranged
  13068. ? _c(
  13069. "el-input",
  13070. _vm._b(
  13071. {
  13072. directives: [
  13073. {
  13074. name: "clickoutside",
  13075. rawName: "v-clickoutside",
  13076. value: _vm.handleClose,
  13077. expression: "handleClose"
  13078. }
  13079. ],
  13080. ref: "reference",
  13081. staticClass: "el-date-editor",
  13082. class: "el-date-editor--" + _vm.type,
  13083. attrs: {
  13084. readonly:
  13085. !_vm.editable ||
  13086. _vm.readonly ||
  13087. _vm.type === "dates" ||
  13088. _vm.type === "week" ||
  13089. _vm.type === "years" ||
  13090. _vm.type === "months",
  13091. disabled: _vm.pickerDisabled,
  13092. size: _vm.pickerSize,
  13093. name: _vm.name,
  13094. placeholder: _vm.placeholder,
  13095. value: _vm.displayValue,
  13096. validateEvent: false
  13097. },
  13098. on: {
  13099. focus: _vm.handleFocus,
  13100. input: function(value) {
  13101. return (_vm.userInput = value)
  13102. },
  13103. change: _vm.handleChange
  13104. },
  13105. nativeOn: {
  13106. keydown: function($event) {
  13107. return _vm.handleKeydown($event)
  13108. },
  13109. mouseenter: function($event) {
  13110. return _vm.handleMouseEnter($event)
  13111. },
  13112. mouseleave: function($event) {
  13113. _vm.showClose = false
  13114. }
  13115. }
  13116. },
  13117. "el-input",
  13118. _vm.firstInputId,
  13119. false
  13120. ),
  13121. [
  13122. _c("i", {
  13123. staticClass: "el-input__icon",
  13124. class: _vm.triggerClass,
  13125. attrs: { slot: "prefix" },
  13126. on: { click: _vm.handleFocus },
  13127. slot: "prefix"
  13128. }),
  13129. _vm.haveTrigger
  13130. ? _c("i", {
  13131. staticClass: "el-input__icon",
  13132. class: [_vm.showClose ? "" + _vm.clearIcon : ""],
  13133. attrs: { slot: "suffix" },
  13134. on: { click: _vm.handleClickIcon },
  13135. slot: "suffix"
  13136. })
  13137. : _vm._e()
  13138. ]
  13139. )
  13140. : _c(
  13141. "div",
  13142. {
  13143. directives: [
  13144. {
  13145. name: "clickoutside",
  13146. rawName: "v-clickoutside",
  13147. value: _vm.handleClose,
  13148. expression: "handleClose"
  13149. }
  13150. ],
  13151. ref: "reference",
  13152. staticClass: "el-date-editor el-range-editor el-input__inner",
  13153. class: [
  13154. "el-date-editor--" + _vm.type,
  13155. _vm.pickerSize ? "el-range-editor--" + _vm.pickerSize : "",
  13156. _vm.pickerDisabled ? "is-disabled" : "",
  13157. _vm.pickerVisible ? "is-active" : ""
  13158. ],
  13159. on: {
  13160. click: _vm.handleRangeClick,
  13161. mouseenter: _vm.handleMouseEnter,
  13162. mouseleave: function($event) {
  13163. _vm.showClose = false
  13164. },
  13165. keydown: _vm.handleKeydown
  13166. }
  13167. },
  13168. [
  13169. _c("i", {
  13170. class: ["el-input__icon", "el-range__icon", _vm.triggerClass]
  13171. }),
  13172. _c(
  13173. "input",
  13174. _vm._b(
  13175. {
  13176. staticClass: "el-range-input",
  13177. attrs: {
  13178. autocomplete: "off",
  13179. placeholder: _vm.startPlaceholder,
  13180. disabled: _vm.pickerDisabled,
  13181. readonly: !_vm.editable || _vm.readonly,
  13182. name: _vm.name && _vm.name[0]
  13183. },
  13184. domProps: { value: _vm.displayValue && _vm.displayValue[0] },
  13185. on: {
  13186. input: _vm.handleStartInput,
  13187. change: _vm.handleStartChange,
  13188. focus: _vm.handleFocus
  13189. }
  13190. },
  13191. "input",
  13192. _vm.firstInputId,
  13193. false
  13194. )
  13195. ),
  13196. _vm._t("range-separator", [
  13197. _c("span", { staticClass: "el-range-separator" }, [
  13198. _vm._v(_vm._s(_vm.rangeSeparator))
  13199. ])
  13200. ]),
  13201. _c(
  13202. "input",
  13203. _vm._b(
  13204. {
  13205. staticClass: "el-range-input",
  13206. attrs: {
  13207. autocomplete: "off",
  13208. placeholder: _vm.endPlaceholder,
  13209. disabled: _vm.pickerDisabled,
  13210. readonly: !_vm.editable || _vm.readonly,
  13211. name: _vm.name && _vm.name[1]
  13212. },
  13213. domProps: { value: _vm.displayValue && _vm.displayValue[1] },
  13214. on: {
  13215. input: _vm.handleEndInput,
  13216. change: _vm.handleEndChange,
  13217. focus: _vm.handleFocus
  13218. }
  13219. },
  13220. "input",
  13221. _vm.secondInputId,
  13222. false
  13223. )
  13224. ),
  13225. _vm.haveTrigger
  13226. ? _c("i", {
  13227. staticClass: "el-input__icon el-range__close-icon",
  13228. class: [_vm.showClose ? "" + _vm.clearIcon : ""],
  13229. on: { click: _vm.handleClickIcon }
  13230. })
  13231. : _vm._e()
  13232. ],
  13233. 2
  13234. )
  13235. }
  13236. var pickervue_type_template_id_79ae069f_staticRenderFns = []
  13237. pickervue_type_template_id_79ae069f_render._withStripped = true
  13238. // CONCATENATED MODULE: ./packages/date-picker/src/picker.vue?vue&type=template&id=79ae069f&
  13239. // EXTERNAL MODULE: external "element-ui/lib/utils/date-util"
  13240. var date_util_ = __webpack_require__(0);
  13241. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/picker.vue?vue&type=script&lang=js&
  13242. //
  13243. //
  13244. //
  13245. //
  13246. //
  13247. //
  13248. //
  13249. //
  13250. //
  13251. //
  13252. //
  13253. //
  13254. //
  13255. //
  13256. //
  13257. //
  13258. //
  13259. //
  13260. //
  13261. //
  13262. //
  13263. //
  13264. //
  13265. //
  13266. //
  13267. //
  13268. //
  13269. //
  13270. //
  13271. //
  13272. //
  13273. //
  13274. //
  13275. //
  13276. //
  13277. //
  13278. //
  13279. //
  13280. //
  13281. //
  13282. //
  13283. //
  13284. //
  13285. //
  13286. //
  13287. //
  13288. //
  13289. //
  13290. //
  13291. //
  13292. //
  13293. //
  13294. //
  13295. //
  13296. //
  13297. //
  13298. //
  13299. //
  13300. //
  13301. //
  13302. //
  13303. //
  13304. //
  13305. //
  13306. //
  13307. //
  13308. //
  13309. //
  13310. //
  13311. //
  13312. //
  13313. //
  13314. //
  13315. //
  13316. //
  13317. //
  13318. //
  13319. //
  13320. //
  13321. //
  13322. //
  13323. //
  13324. //
  13325. //
  13326. //
  13327. var NewPopper = {
  13328. props: {
  13329. appendToBody: vue_popper_default.a.props.appendToBody,
  13330. offset: vue_popper_default.a.props.offset,
  13331. boundariesPadding: vue_popper_default.a.props.boundariesPadding,
  13332. arrowOffset: vue_popper_default.a.props.arrowOffset,
  13333. transformOrigin: vue_popper_default.a.props.transformOrigin
  13334. },
  13335. methods: vue_popper_default.a.methods,
  13336. data: function data() {
  13337. return merge_default()({ visibleArrow: true }, vue_popper_default.a.data);
  13338. },
  13339. beforeDestroy: vue_popper_default.a.beforeDestroy
  13340. };
  13341. var DEFAULT_FORMATS = {
  13342. date: 'yyyy-MM-dd',
  13343. month: 'yyyy-MM',
  13344. months: 'yyyy-MM',
  13345. datetime: 'yyyy-MM-dd HH:mm:ss',
  13346. time: 'HH:mm:ss',
  13347. week: 'yyyywWW',
  13348. timerange: 'HH:mm:ss',
  13349. daterange: 'yyyy-MM-dd',
  13350. monthrange: 'yyyy-MM',
  13351. datetimerange: 'yyyy-MM-dd HH:mm:ss',
  13352. year: 'yyyy',
  13353. years: 'yyyy'
  13354. };
  13355. var HAVE_TRIGGER_TYPES = ['date', 'datetime', 'time', 'time-select', 'week', 'month', 'year', 'daterange', 'monthrange', 'timerange', 'datetimerange', 'dates', 'months', 'years'];
  13356. var pickervue_type_script_lang_js_DATE_FORMATTER = function DATE_FORMATTER(value, format) {
  13357. if (format === 'timestamp') return value.getTime();
  13358. return Object(date_util_["formatDate"])(value, format);
  13359. };
  13360. var pickervue_type_script_lang_js_DATE_PARSER = function DATE_PARSER(text, format) {
  13361. if (format === 'timestamp') return new Date(Number(text));
  13362. return Object(date_util_["parseDate"])(text, format);
  13363. };
  13364. var RANGE_FORMATTER = function RANGE_FORMATTER(value, format) {
  13365. if (Array.isArray(value) && value.length === 2) {
  13366. var start = value[0];
  13367. var end = value[1];
  13368. if (start && end) {
  13369. return [pickervue_type_script_lang_js_DATE_FORMATTER(start, format), pickervue_type_script_lang_js_DATE_FORMATTER(end, format)];
  13370. }
  13371. }
  13372. return '';
  13373. };
  13374. var RANGE_PARSER = function RANGE_PARSER(array, format, separator) {
  13375. if (!Array.isArray(array)) {
  13376. array = array.split(separator);
  13377. }
  13378. if (array.length === 2) {
  13379. var range1 = array[0];
  13380. var range2 = array[1];
  13381. return [pickervue_type_script_lang_js_DATE_PARSER(range1, format), pickervue_type_script_lang_js_DATE_PARSER(range2, format)];
  13382. }
  13383. return [];
  13384. };
  13385. var TYPE_VALUE_RESOLVER_MAP = {
  13386. default: {
  13387. formatter: function formatter(value) {
  13388. if (!value) return '';
  13389. return '' + value;
  13390. },
  13391. parser: function parser(text) {
  13392. if (text === undefined || text === '') return null;
  13393. return text;
  13394. }
  13395. },
  13396. week: {
  13397. formatter: function formatter(value, format) {
  13398. var week = Object(date_util_["getWeekNumber"])(value);
  13399. var month = value.getMonth();
  13400. var trueDate = new Date(value);
  13401. if (week === 1 && month === 11) {
  13402. trueDate.setHours(0, 0, 0, 0);
  13403. trueDate.setDate(trueDate.getDate() + 3 - (trueDate.getDay() + 6) % 7);
  13404. }
  13405. var date = Object(date_util_["formatDate"])(trueDate, format);
  13406. date = /WW/.test(date) ? date.replace(/WW/, week < 10 ? '0' + week : week) : date.replace(/W/, week);
  13407. return date;
  13408. },
  13409. parser: function parser(text, format) {
  13410. // parse as if a normal date
  13411. return TYPE_VALUE_RESOLVER_MAP.date.parser(text, format);
  13412. }
  13413. },
  13414. date: {
  13415. formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
  13416. parser: pickervue_type_script_lang_js_DATE_PARSER
  13417. },
  13418. datetime: {
  13419. formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
  13420. parser: pickervue_type_script_lang_js_DATE_PARSER
  13421. },
  13422. daterange: {
  13423. formatter: RANGE_FORMATTER,
  13424. parser: RANGE_PARSER
  13425. },
  13426. monthrange: {
  13427. formatter: RANGE_FORMATTER,
  13428. parser: RANGE_PARSER
  13429. },
  13430. datetimerange: {
  13431. formatter: RANGE_FORMATTER,
  13432. parser: RANGE_PARSER
  13433. },
  13434. timerange: {
  13435. formatter: RANGE_FORMATTER,
  13436. parser: RANGE_PARSER
  13437. },
  13438. time: {
  13439. formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
  13440. parser: pickervue_type_script_lang_js_DATE_PARSER
  13441. },
  13442. month: {
  13443. formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
  13444. parser: pickervue_type_script_lang_js_DATE_PARSER
  13445. },
  13446. year: {
  13447. formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
  13448. parser: pickervue_type_script_lang_js_DATE_PARSER
  13449. },
  13450. number: {
  13451. formatter: function formatter(value) {
  13452. if (!value) return '';
  13453. return '' + value;
  13454. },
  13455. parser: function parser(text) {
  13456. var result = Number(text);
  13457. if (!isNaN(text)) {
  13458. return result;
  13459. } else {
  13460. return null;
  13461. }
  13462. }
  13463. },
  13464. dates: {
  13465. formatter: function formatter(value, format) {
  13466. return value.map(function (date) {
  13467. return pickervue_type_script_lang_js_DATE_FORMATTER(date, format);
  13468. });
  13469. },
  13470. parser: function parser(value, format) {
  13471. return (typeof value === 'string' ? value.split(', ') : value).map(function (date) {
  13472. return date instanceof Date ? date : pickervue_type_script_lang_js_DATE_PARSER(date, format);
  13473. });
  13474. }
  13475. },
  13476. months: {
  13477. formatter: function formatter(value, format) {
  13478. return value.map(function (date) {
  13479. return pickervue_type_script_lang_js_DATE_FORMATTER(date, format);
  13480. });
  13481. },
  13482. parser: function parser(value, format) {
  13483. return (typeof value === 'string' ? value.split(', ') : value).map(function (date) {
  13484. return date instanceof Date ? date : pickervue_type_script_lang_js_DATE_PARSER(date, format);
  13485. });
  13486. }
  13487. },
  13488. years: {
  13489. formatter: function formatter(value, format) {
  13490. return value.map(function (date) {
  13491. return pickervue_type_script_lang_js_DATE_FORMATTER(date, format);
  13492. });
  13493. },
  13494. parser: function parser(value, format) {
  13495. return (typeof value === 'string' ? value.split(', ') : value).map(function (date) {
  13496. return date instanceof Date ? date : pickervue_type_script_lang_js_DATE_PARSER(date, format);
  13497. });
  13498. }
  13499. }
  13500. };
  13501. var PLACEMENT_MAP = {
  13502. left: 'bottom-start',
  13503. center: 'bottom',
  13504. right: 'bottom-end'
  13505. };
  13506. var parseAsFormatAndType = function parseAsFormatAndType(value, customFormat, type) {
  13507. var rangeSeparator = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '-';
  13508. if (!value) return null;
  13509. var parser = (TYPE_VALUE_RESOLVER_MAP[type] || TYPE_VALUE_RESOLVER_MAP['default']).parser;
  13510. var format = customFormat || DEFAULT_FORMATS[type];
  13511. return parser(value, format, rangeSeparator);
  13512. };
  13513. var formatAsFormatAndType = function formatAsFormatAndType(value, customFormat, type) {
  13514. if (!value) return null;
  13515. var formatter = (TYPE_VALUE_RESOLVER_MAP[type] || TYPE_VALUE_RESOLVER_MAP['default']).formatter;
  13516. var format = customFormat || DEFAULT_FORMATS[type];
  13517. return formatter(value, format);
  13518. };
  13519. /*
  13520. * Considers:
  13521. * 1. Date object
  13522. * 2. date string
  13523. * 3. array of 1 or 2
  13524. */
  13525. var valueEquals = function valueEquals(a, b) {
  13526. // considers Date object and string
  13527. var dateEquals = function dateEquals(a, b) {
  13528. var aIsDate = a instanceof Date;
  13529. var bIsDate = b instanceof Date;
  13530. if (aIsDate && bIsDate) {
  13531. return a.getTime() === b.getTime();
  13532. }
  13533. if (!aIsDate && !bIsDate) {
  13534. return a === b;
  13535. }
  13536. return false;
  13537. };
  13538. var aIsArray = a instanceof Array;
  13539. var bIsArray = b instanceof Array;
  13540. if (aIsArray && bIsArray) {
  13541. if (a.length !== b.length) {
  13542. return false;
  13543. }
  13544. return a.every(function (item, index) {
  13545. return dateEquals(item, b[index]);
  13546. });
  13547. }
  13548. if (!aIsArray && !bIsArray) {
  13549. return dateEquals(a, b);
  13550. }
  13551. return false;
  13552. };
  13553. var isString = function isString(val) {
  13554. return typeof val === 'string' || val instanceof String;
  13555. };
  13556. var pickervue_type_script_lang_js_validator = function validator(val) {
  13557. // either: String, Array of String, null / undefined
  13558. return val === null || val === undefined || isString(val) || Array.isArray(val) && val.length === 2 && val.every(isString);
  13559. };
  13560. /* harmony default export */ var pickervue_type_script_lang_js_ = ({
  13561. mixins: [emitter_default.a, NewPopper],
  13562. inject: {
  13563. elForm: {
  13564. default: ''
  13565. },
  13566. elFormItem: {
  13567. default: ''
  13568. }
  13569. },
  13570. props: {
  13571. size: String,
  13572. format: String,
  13573. valueFormat: String,
  13574. readonly: Boolean,
  13575. placeholder: String,
  13576. startPlaceholder: String,
  13577. endPlaceholder: String,
  13578. prefixIcon: String,
  13579. clearIcon: {
  13580. type: String,
  13581. default: 'el-icon-circle-close'
  13582. },
  13583. name: {
  13584. default: '',
  13585. validator: pickervue_type_script_lang_js_validator
  13586. },
  13587. disabled: Boolean,
  13588. clearable: {
  13589. type: Boolean,
  13590. default: true
  13591. },
  13592. id: {
  13593. default: '',
  13594. validator: pickervue_type_script_lang_js_validator
  13595. },
  13596. popperClass: String,
  13597. editable: {
  13598. type: Boolean,
  13599. default: true
  13600. },
  13601. align: {
  13602. type: String,
  13603. default: 'left'
  13604. },
  13605. value: {},
  13606. defaultValue: {},
  13607. defaultTime: {},
  13608. rangeSeparator: {
  13609. default: '-'
  13610. },
  13611. pickerOptions: {},
  13612. unlinkPanels: Boolean,
  13613. validateEvent: {
  13614. type: Boolean,
  13615. default: true
  13616. }
  13617. },
  13618. components: { ElInput: input_default.a },
  13619. directives: { Clickoutside: clickoutside_default.a },
  13620. data: function data() {
  13621. return {
  13622. pickerVisible: false,
  13623. showClose: false,
  13624. userInput: null,
  13625. valueOnOpen: null, // value when picker opens, used to determine whether to emit change
  13626. unwatchPickerOptions: null
  13627. };
  13628. },
  13629. watch: {
  13630. pickerVisible: function pickerVisible(val) {
  13631. if (this.readonly || this.pickerDisabled) return;
  13632. if (val) {
  13633. this.showPicker();
  13634. this.valueOnOpen = Array.isArray(this.value) ? [].concat(this.value) : this.value;
  13635. } else {
  13636. this.hidePicker();
  13637. this.emitChange(this.value);
  13638. this.userInput = null;
  13639. if (this.validateEvent) {
  13640. this.dispatch('ElFormItem', 'el.form.blur');
  13641. }
  13642. this.$emit('blur', this);
  13643. this.blur();
  13644. }
  13645. },
  13646. parsedValue: {
  13647. immediate: true,
  13648. handler: function handler(val) {
  13649. if (this.picker) {
  13650. this.picker.value = val;
  13651. }
  13652. }
  13653. },
  13654. defaultValue: function defaultValue(val) {
  13655. // NOTE: should eventually move to jsx style picker + panel ?
  13656. if (this.picker) {
  13657. this.picker.defaultValue = val;
  13658. }
  13659. },
  13660. value: function value(val, oldVal) {
  13661. if (!valueEquals(val, oldVal) && !this.pickerVisible && this.validateEvent) {
  13662. this.dispatch('ElFormItem', 'el.form.change', val);
  13663. }
  13664. }
  13665. },
  13666. computed: {
  13667. ranged: function ranged() {
  13668. return this.type.indexOf('range') > -1;
  13669. },
  13670. reference: function reference() {
  13671. var reference = this.$refs.reference;
  13672. return reference.$el || reference;
  13673. },
  13674. refInput: function refInput() {
  13675. if (this.reference) {
  13676. return [].slice.call(this.reference.querySelectorAll('input'));
  13677. }
  13678. return [];
  13679. },
  13680. valueIsEmpty: function valueIsEmpty() {
  13681. var val = this.value;
  13682. if (Array.isArray(val)) {
  13683. for (var i = 0, len = val.length; i < len; i++) {
  13684. if (val[i]) {
  13685. return false;
  13686. }
  13687. }
  13688. } else {
  13689. if (val) {
  13690. return false;
  13691. }
  13692. }
  13693. return true;
  13694. },
  13695. triggerClass: function triggerClass() {
  13696. return this.prefixIcon || (this.type.indexOf('time') !== -1 ? 'el-icon-time' : 'el-icon-date');
  13697. },
  13698. selectionMode: function selectionMode() {
  13699. if (this.type === 'week') {
  13700. return 'week';
  13701. } else if (this.type === 'month') {
  13702. return 'month';
  13703. } else if (this.type === 'year') {
  13704. return 'year';
  13705. } else if (this.type === 'dates') {
  13706. return 'dates';
  13707. } else if (this.type === 'months') {
  13708. return 'months';
  13709. } else if (this.type === 'years') {
  13710. return 'years';
  13711. }
  13712. return 'day';
  13713. },
  13714. haveTrigger: function haveTrigger() {
  13715. if (typeof this.showTrigger !== 'undefined') {
  13716. return this.showTrigger;
  13717. }
  13718. return HAVE_TRIGGER_TYPES.indexOf(this.type) !== -1;
  13719. },
  13720. displayValue: function displayValue() {
  13721. var formattedValue = formatAsFormatAndType(this.parsedValue, this.format, this.type, this.rangeSeparator);
  13722. if (Array.isArray(this.userInput)) {
  13723. return [this.userInput[0] || formattedValue && formattedValue[0] || '', this.userInput[1] || formattedValue && formattedValue[1] || ''];
  13724. } else if (this.userInput !== null) {
  13725. return this.userInput;
  13726. } else if (formattedValue) {
  13727. return this.type === 'dates' || this.type === 'years' || this.type === 'months' ? formattedValue.join(', ') : formattedValue;
  13728. } else {
  13729. return '';
  13730. }
  13731. },
  13732. parsedValue: function parsedValue() {
  13733. if (!this.value) return this.value; // component value is not set
  13734. if (this.type === 'time-select') return this.value; // time-select does not require parsing, this might change in next major version
  13735. var valueIsDateObject = Object(date_util_["isDateObject"])(this.value) || Array.isArray(this.value) && this.value.every(date_util_["isDateObject"]);
  13736. if (valueIsDateObject) {
  13737. return this.value;
  13738. }
  13739. if (this.valueFormat) {
  13740. return parseAsFormatAndType(this.value, this.valueFormat, this.type, this.rangeSeparator) || this.value;
  13741. }
  13742. // NOTE: deal with common but incorrect usage, should remove in next major version
  13743. // user might provide string / timestamp without value-format, coerce them into date (or array of date)
  13744. return Array.isArray(this.value) ? this.value.map(function (val) {
  13745. return new Date(val);
  13746. }) : new Date(this.value);
  13747. },
  13748. _elFormItemSize: function _elFormItemSize() {
  13749. return (this.elFormItem || {}).elFormItemSize;
  13750. },
  13751. pickerSize: function pickerSize() {
  13752. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  13753. },
  13754. pickerDisabled: function pickerDisabled() {
  13755. return this.disabled || (this.elForm || {}).disabled;
  13756. },
  13757. firstInputId: function firstInputId() {
  13758. var obj = {};
  13759. var id = void 0;
  13760. if (this.ranged) {
  13761. id = this.id && this.id[0];
  13762. } else {
  13763. id = this.id;
  13764. }
  13765. if (id) obj.id = id;
  13766. return obj;
  13767. },
  13768. secondInputId: function secondInputId() {
  13769. var obj = {};
  13770. var id = void 0;
  13771. if (this.ranged) {
  13772. id = this.id && this.id[1];
  13773. }
  13774. if (id) obj.id = id;
  13775. return obj;
  13776. }
  13777. },
  13778. created: function created() {
  13779. // vue-popper
  13780. this.popperOptions = {
  13781. boundariesPadding: 0,
  13782. gpuAcceleration: false
  13783. };
  13784. this.placement = PLACEMENT_MAP[this.align] || PLACEMENT_MAP.left;
  13785. this.$on('fieldReset', this.handleFieldReset);
  13786. },
  13787. methods: {
  13788. focus: function focus() {
  13789. if (!this.ranged) {
  13790. this.$refs.reference.focus();
  13791. } else {
  13792. this.handleFocus();
  13793. }
  13794. },
  13795. blur: function blur() {
  13796. this.refInput.forEach(function (input) {
  13797. return input.blur();
  13798. });
  13799. },
  13800. // {parse, formatTo} Value deals maps component value with internal Date
  13801. parseValue: function parseValue(value) {
  13802. var isParsed = Object(date_util_["isDateObject"])(value) || Array.isArray(value) && value.every(date_util_["isDateObject"]);
  13803. if (this.valueFormat && !isParsed) {
  13804. return parseAsFormatAndType(value, this.valueFormat, this.type, this.rangeSeparator) || value;
  13805. } else {
  13806. return value;
  13807. }
  13808. },
  13809. formatToValue: function formatToValue(date) {
  13810. var isFormattable = Object(date_util_["isDateObject"])(date) || Array.isArray(date) && date.every(date_util_["isDateObject"]);
  13811. if (this.valueFormat && isFormattable) {
  13812. return formatAsFormatAndType(date, this.valueFormat, this.type, this.rangeSeparator);
  13813. } else {
  13814. return date;
  13815. }
  13816. },
  13817. // {parse, formatTo} String deals with user input
  13818. parseString: function parseString(value) {
  13819. var type = Array.isArray(value) ? this.type : this.type.replace('range', '');
  13820. return parseAsFormatAndType(value, this.format, type);
  13821. },
  13822. formatToString: function formatToString(value) {
  13823. var type = Array.isArray(value) ? this.type : this.type.replace('range', '');
  13824. return formatAsFormatAndType(value, this.format, type);
  13825. },
  13826. handleMouseEnter: function handleMouseEnter() {
  13827. if (this.readonly || this.pickerDisabled) return;
  13828. if (!this.valueIsEmpty && this.clearable) {
  13829. this.showClose = true;
  13830. }
  13831. },
  13832. handleChange: function handleChange() {
  13833. if (this.userInput) {
  13834. var value = this.parseString(this.displayValue);
  13835. if (value) {
  13836. this.picker.value = value;
  13837. if (this.isValidValue(value)) {
  13838. this.emitInput(value);
  13839. this.userInput = null;
  13840. }
  13841. }
  13842. }
  13843. if (this.userInput === '') {
  13844. this.emitInput(null);
  13845. this.emitChange(null);
  13846. this.userInput = null;
  13847. }
  13848. },
  13849. handleStartInput: function handleStartInput(event) {
  13850. if (this.userInput) {
  13851. this.userInput = [event.target.value, this.userInput[1]];
  13852. } else {
  13853. this.userInput = [event.target.value, null];
  13854. }
  13855. },
  13856. handleEndInput: function handleEndInput(event) {
  13857. if (this.userInput) {
  13858. this.userInput = [this.userInput[0], event.target.value];
  13859. } else {
  13860. this.userInput = [null, event.target.value];
  13861. }
  13862. },
  13863. handleStartChange: function handleStartChange(event) {
  13864. var value = this.parseString(this.userInput && this.userInput[0]);
  13865. if (value) {
  13866. this.userInput = [this.formatToString(value), this.displayValue[1]];
  13867. var newValue = [value, this.picker.value && this.picker.value[1]];
  13868. this.picker.value = newValue;
  13869. if (this.isValidValue(newValue)) {
  13870. this.emitInput(newValue);
  13871. this.userInput = null;
  13872. }
  13873. }
  13874. },
  13875. handleEndChange: function handleEndChange(event) {
  13876. var value = this.parseString(this.userInput && this.userInput[1]);
  13877. if (value) {
  13878. this.userInput = [this.displayValue[0], this.formatToString(value)];
  13879. var newValue = [this.picker.value && this.picker.value[0], value];
  13880. this.picker.value = newValue;
  13881. if (this.isValidValue(newValue)) {
  13882. this.emitInput(newValue);
  13883. this.userInput = null;
  13884. }
  13885. }
  13886. },
  13887. handleClickIcon: function handleClickIcon(event) {
  13888. if (this.readonly || this.pickerDisabled) return;
  13889. if (this.showClose) {
  13890. this.valueOnOpen = this.value;
  13891. event.stopPropagation();
  13892. this.emitInput(null);
  13893. this.emitChange(null);
  13894. this.showClose = false;
  13895. if (this.picker && typeof this.picker.handleClear === 'function') {
  13896. this.picker.handleClear();
  13897. }
  13898. } else {
  13899. this.pickerVisible = !this.pickerVisible;
  13900. }
  13901. },
  13902. handleClose: function handleClose() {
  13903. if (!this.pickerVisible) return;
  13904. this.pickerVisible = false;
  13905. if (this.type === 'dates' || this.type === 'years' || this.type === 'months') {
  13906. // restore to former value
  13907. var oldValue = parseAsFormatAndType(this.valueOnOpen, this.valueFormat, this.type, this.rangeSeparator) || this.valueOnOpen;
  13908. this.emitInput(oldValue);
  13909. }
  13910. },
  13911. handleFieldReset: function handleFieldReset(initialValue) {
  13912. this.userInput = initialValue === '' ? null : initialValue;
  13913. },
  13914. handleFocus: function handleFocus() {
  13915. var type = this.type;
  13916. if (HAVE_TRIGGER_TYPES.indexOf(type) !== -1 && !this.pickerVisible) {
  13917. this.pickerVisible = true;
  13918. }
  13919. this.$emit('focus', this);
  13920. },
  13921. handleKeydown: function handleKeydown(event) {
  13922. var _this = this;
  13923. var keyCode = event.keyCode;
  13924. // ESC
  13925. if (keyCode === 27) {
  13926. this.pickerVisible = false;
  13927. event.stopPropagation();
  13928. return;
  13929. }
  13930. // Tab
  13931. if (keyCode === 9) {
  13932. if (!this.ranged) {
  13933. this.handleChange();
  13934. this.pickerVisible = this.picker.visible = false;
  13935. this.blur();
  13936. event.stopPropagation();
  13937. } else {
  13938. // user may change focus between two input
  13939. setTimeout(function () {
  13940. if (_this.refInput.indexOf(document.activeElement) === -1) {
  13941. _this.pickerVisible = false;
  13942. _this.blur();
  13943. event.stopPropagation();
  13944. }
  13945. }, 0);
  13946. }
  13947. return;
  13948. }
  13949. // Enter
  13950. if (keyCode === 13) {
  13951. if (this.userInput === '' || this.isValidValue(this.parseString(this.displayValue))) {
  13952. this.handleChange();
  13953. this.pickerVisible = this.picker.visible = false;
  13954. this.blur();
  13955. }
  13956. event.stopPropagation();
  13957. return;
  13958. }
  13959. // if user is typing, do not let picker handle key input
  13960. if (this.userInput) {
  13961. event.stopPropagation();
  13962. return;
  13963. }
  13964. // delegate other keys to panel
  13965. if (this.picker && this.picker.handleKeydown) {
  13966. this.picker.handleKeydown(event);
  13967. }
  13968. },
  13969. handleRangeClick: function handleRangeClick() {
  13970. var type = this.type;
  13971. if (HAVE_TRIGGER_TYPES.indexOf(type) !== -1 && !this.pickerVisible) {
  13972. this.pickerVisible = true;
  13973. }
  13974. this.$emit('focus', this);
  13975. },
  13976. hidePicker: function hidePicker() {
  13977. if (this.picker) {
  13978. this.picker.resetView && this.picker.resetView();
  13979. this.pickerVisible = this.picker.visible = false;
  13980. this.destroyPopper();
  13981. }
  13982. },
  13983. showPicker: function showPicker() {
  13984. var _this2 = this;
  13985. if (this.$isServer) return;
  13986. if (!this.picker) {
  13987. this.mountPicker();
  13988. }
  13989. this.pickerVisible = this.picker.visible = true;
  13990. this.updatePopper();
  13991. this.picker.value = this.parsedValue;
  13992. this.picker.resetView && this.picker.resetView();
  13993. this.$nextTick(function () {
  13994. _this2.picker.adjustSpinners && _this2.picker.adjustSpinners();
  13995. });
  13996. },
  13997. mountPicker: function mountPicker() {
  13998. var _this3 = this;
  13999. this.picker = new external_vue_default.a(this.panel).$mount();
  14000. this.picker.defaultValue = this.defaultValue;
  14001. this.picker.defaultTime = this.defaultTime;
  14002. this.picker.popperClass = this.popperClass;
  14003. this.popperElm = this.picker.$el;
  14004. this.picker.width = this.reference.getBoundingClientRect().width;
  14005. this.picker.showTime = this.type === 'datetime' || this.type === 'datetimerange';
  14006. this.picker.selectionMode = this.selectionMode;
  14007. this.picker.unlinkPanels = this.unlinkPanels;
  14008. this.picker.arrowControl = this.arrowControl || this.timeArrowControl || false;
  14009. this.$watch('format', function (format) {
  14010. _this3.picker.format = format;
  14011. });
  14012. var updateOptions = function updateOptions() {
  14013. var options = _this3.pickerOptions;
  14014. if (options && options.selectableRange) {
  14015. var ranges = options.selectableRange;
  14016. var parser = TYPE_VALUE_RESOLVER_MAP.datetimerange.parser;
  14017. var format = DEFAULT_FORMATS.timerange;
  14018. ranges = Array.isArray(ranges) ? ranges : [ranges];
  14019. _this3.picker.selectableRange = ranges.map(function (range) {
  14020. return parser(range, format, _this3.rangeSeparator);
  14021. });
  14022. }
  14023. for (var option in options) {
  14024. if (options.hasOwnProperty(option) &&
  14025. // 忽略 time-picker 的该配置项
  14026. option !== 'selectableRange') {
  14027. _this3.picker[option] = options[option];
  14028. }
  14029. }
  14030. // main format must prevail over undocumented pickerOptions.format
  14031. if (_this3.format) {
  14032. _this3.picker.format = _this3.format;
  14033. }
  14034. };
  14035. updateOptions();
  14036. this.unwatchPickerOptions = this.$watch('pickerOptions', function () {
  14037. return updateOptions();
  14038. }, { deep: true });
  14039. this.$el.appendChild(this.picker.$el);
  14040. this.picker.resetView && this.picker.resetView();
  14041. this.picker.$on('dodestroy', this.doDestroy);
  14042. this.picker.$on('pick', function () {
  14043. var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  14044. var visible = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  14045. _this3.userInput = null;
  14046. _this3.pickerVisible = _this3.picker.visible = visible;
  14047. _this3.emitInput(date);
  14048. _this3.picker.resetView && _this3.picker.resetView();
  14049. });
  14050. this.picker.$on('select-range', function (start, end, pos) {
  14051. if (_this3.refInput.length === 0) return;
  14052. if (!pos || pos === 'min') {
  14053. _this3.refInput[0].setSelectionRange(start, end);
  14054. _this3.refInput[0].focus();
  14055. } else if (pos === 'max') {
  14056. _this3.refInput[1].setSelectionRange(start, end);
  14057. _this3.refInput[1].focus();
  14058. }
  14059. });
  14060. },
  14061. unmountPicker: function unmountPicker() {
  14062. if (this.picker) {
  14063. this.picker.$destroy();
  14064. this.picker.$off();
  14065. if (typeof this.unwatchPickerOptions === 'function') {
  14066. this.unwatchPickerOptions();
  14067. }
  14068. this.picker.$el.parentNode.removeChild(this.picker.$el);
  14069. }
  14070. },
  14071. emitChange: function emitChange(val) {
  14072. // determine user real change only
  14073. if (!valueEquals(val, this.valueOnOpen)) {
  14074. this.$emit('change', val);
  14075. this.valueOnOpen = val;
  14076. if (this.validateEvent) {
  14077. this.dispatch('ElFormItem', 'el.form.change', val);
  14078. }
  14079. }
  14080. },
  14081. emitInput: function emitInput(val) {
  14082. var formatted = this.formatToValue(val);
  14083. if (!valueEquals(this.value, formatted)) {
  14084. this.$emit('input', formatted);
  14085. }
  14086. },
  14087. isValidValue: function isValidValue(value) {
  14088. if (!this.picker) {
  14089. this.mountPicker();
  14090. }
  14091. if (this.picker.isValidValue) {
  14092. return value && this.picker.isValidValue(value);
  14093. } else {
  14094. return true;
  14095. }
  14096. }
  14097. }
  14098. });
  14099. // CONCATENATED MODULE: ./packages/date-picker/src/picker.vue?vue&type=script&lang=js&
  14100. /* harmony default export */ var src_pickervue_type_script_lang_js_ = (pickervue_type_script_lang_js_);
  14101. // CONCATENATED MODULE: ./packages/date-picker/src/picker.vue
  14102. /* normalize component */
  14103. var picker_component = normalizeComponent(
  14104. src_pickervue_type_script_lang_js_,
  14105. pickervue_type_template_id_79ae069f_render,
  14106. pickervue_type_template_id_79ae069f_staticRenderFns,
  14107. false,
  14108. null,
  14109. null,
  14110. null
  14111. )
  14112. /* hot reload */
  14113. if (false) { var picker_api; }
  14114. picker_component.options.__file = "packages/date-picker/src/picker.vue"
  14115. /* harmony default export */ var picker = (picker_component.exports);
  14116. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/panel/date.vue?vue&type=template&id=2440d4ea&
  14117. var datevue_type_template_id_2440d4ea_render = function() {
  14118. var _vm = this
  14119. var _h = _vm.$createElement
  14120. var _c = _vm._self._c || _h
  14121. return _c(
  14122. "transition",
  14123. {
  14124. attrs: { name: "el-zoom-in-top" },
  14125. on: { "after-enter": _vm.handleEnter, "after-leave": _vm.handleLeave }
  14126. },
  14127. [
  14128. _c(
  14129. "div",
  14130. {
  14131. directives: [
  14132. {
  14133. name: "show",
  14134. rawName: "v-show",
  14135. value: _vm.visible,
  14136. expression: "visible"
  14137. }
  14138. ],
  14139. staticClass: "el-picker-panel el-date-picker el-popper",
  14140. class: [
  14141. {
  14142. "has-sidebar": _vm.$slots.sidebar || _vm.shortcuts,
  14143. "has-time": _vm.showTime
  14144. },
  14145. _vm.popperClass
  14146. ]
  14147. },
  14148. [
  14149. _c(
  14150. "div",
  14151. { staticClass: "el-picker-panel__body-wrapper" },
  14152. [
  14153. _vm._t("sidebar"),
  14154. _vm.shortcuts
  14155. ? _c(
  14156. "div",
  14157. { staticClass: "el-picker-panel__sidebar" },
  14158. _vm._l(_vm.shortcuts, function(shortcut, key) {
  14159. return _c(
  14160. "button",
  14161. {
  14162. key: key,
  14163. staticClass: "el-picker-panel__shortcut",
  14164. attrs: { type: "button" },
  14165. on: {
  14166. click: function($event) {
  14167. _vm.handleShortcutClick(shortcut)
  14168. }
  14169. }
  14170. },
  14171. [_vm._v(_vm._s(shortcut.text))]
  14172. )
  14173. }),
  14174. 0
  14175. )
  14176. : _vm._e(),
  14177. _c("div", { staticClass: "el-picker-panel__body" }, [
  14178. _vm.showTime
  14179. ? _c("div", { staticClass: "el-date-picker__time-header" }, [
  14180. _c(
  14181. "span",
  14182. { staticClass: "el-date-picker__editor-wrap" },
  14183. [
  14184. _c("el-input", {
  14185. attrs: {
  14186. placeholder: _vm.t("el.datepicker.selectDate"),
  14187. value: _vm.visibleDate,
  14188. size: "small"
  14189. },
  14190. on: {
  14191. input: function(val) {
  14192. return (_vm.userInputDate = val)
  14193. },
  14194. change: _vm.handleVisibleDateChange
  14195. }
  14196. })
  14197. ],
  14198. 1
  14199. ),
  14200. _c(
  14201. "span",
  14202. {
  14203. directives: [
  14204. {
  14205. name: "clickoutside",
  14206. rawName: "v-clickoutside",
  14207. value: _vm.handleTimePickClose,
  14208. expression: "handleTimePickClose"
  14209. }
  14210. ],
  14211. staticClass: "el-date-picker__editor-wrap"
  14212. },
  14213. [
  14214. _c("el-input", {
  14215. ref: "input",
  14216. attrs: {
  14217. placeholder: _vm.t("el.datepicker.selectTime"),
  14218. value: _vm.visibleTime,
  14219. size: "small"
  14220. },
  14221. on: {
  14222. focus: function($event) {
  14223. _vm.timePickerVisible = true
  14224. },
  14225. input: function(val) {
  14226. return (_vm.userInputTime = val)
  14227. },
  14228. change: _vm.handleVisibleTimeChange
  14229. }
  14230. }),
  14231. _c("time-picker", {
  14232. ref: "timepicker",
  14233. attrs: {
  14234. "time-arrow-control": _vm.arrowControl,
  14235. visible: _vm.timePickerVisible
  14236. },
  14237. on: {
  14238. pick: _vm.handleTimePick,
  14239. mounted: _vm.proxyTimePickerDataProperties
  14240. }
  14241. })
  14242. ],
  14243. 1
  14244. )
  14245. ])
  14246. : _vm._e(),
  14247. _c(
  14248. "div",
  14249. {
  14250. directives: [
  14251. {
  14252. name: "show",
  14253. rawName: "v-show",
  14254. value: _vm.currentView !== "time",
  14255. expression: "currentView !== 'time'"
  14256. }
  14257. ],
  14258. staticClass: "el-date-picker__header",
  14259. class: {
  14260. "el-date-picker__header--bordered":
  14261. _vm.currentView === "year" ||
  14262. _vm.currentView === "month"
  14263. }
  14264. },
  14265. [
  14266. _c("button", {
  14267. staticClass:
  14268. "el-picker-panel__icon-btn el-date-picker__prev-btn el-icon-d-arrow-left",
  14269. attrs: {
  14270. type: "button",
  14271. "aria-label": _vm.t("el.datepicker.prevYear")
  14272. },
  14273. on: { click: _vm.prevYear }
  14274. }),
  14275. _c("button", {
  14276. directives: [
  14277. {
  14278. name: "show",
  14279. rawName: "v-show",
  14280. value: _vm.currentView === "date",
  14281. expression: "currentView === 'date'"
  14282. }
  14283. ],
  14284. staticClass:
  14285. "el-picker-panel__icon-btn el-date-picker__prev-btn el-icon-arrow-left",
  14286. attrs: {
  14287. type: "button",
  14288. "aria-label": _vm.t("el.datepicker.prevMonth")
  14289. },
  14290. on: { click: _vm.prevMonth }
  14291. }),
  14292. _c(
  14293. "span",
  14294. {
  14295. staticClass: "el-date-picker__header-label",
  14296. attrs: { role: "button" },
  14297. on: { click: _vm.showYearPicker }
  14298. },
  14299. [_vm._v(_vm._s(_vm.yearLabel))]
  14300. ),
  14301. _c(
  14302. "span",
  14303. {
  14304. directives: [
  14305. {
  14306. name: "show",
  14307. rawName: "v-show",
  14308. value: _vm.currentView === "date",
  14309. expression: "currentView === 'date'"
  14310. }
  14311. ],
  14312. staticClass: "el-date-picker__header-label",
  14313. class: { active: _vm.currentView === "month" },
  14314. attrs: { role: "button" },
  14315. on: { click: _vm.showMonthPicker }
  14316. },
  14317. [
  14318. _vm._v(
  14319. _vm._s(_vm.t("el.datepicker.month" + (_vm.month + 1)))
  14320. )
  14321. ]
  14322. ),
  14323. _c("button", {
  14324. staticClass:
  14325. "el-picker-panel__icon-btn el-date-picker__next-btn el-icon-d-arrow-right",
  14326. attrs: {
  14327. type: "button",
  14328. "aria-label": _vm.t("el.datepicker.nextYear")
  14329. },
  14330. on: { click: _vm.nextYear }
  14331. }),
  14332. _c("button", {
  14333. directives: [
  14334. {
  14335. name: "show",
  14336. rawName: "v-show",
  14337. value: _vm.currentView === "date",
  14338. expression: "currentView === 'date'"
  14339. }
  14340. ],
  14341. staticClass:
  14342. "el-picker-panel__icon-btn el-date-picker__next-btn el-icon-arrow-right",
  14343. attrs: {
  14344. type: "button",
  14345. "aria-label": _vm.t("el.datepicker.nextMonth")
  14346. },
  14347. on: { click: _vm.nextMonth }
  14348. })
  14349. ]
  14350. ),
  14351. _c(
  14352. "div",
  14353. { staticClass: "el-picker-panel__content" },
  14354. [
  14355. _c("date-table", {
  14356. directives: [
  14357. {
  14358. name: "show",
  14359. rawName: "v-show",
  14360. value: _vm.currentView === "date",
  14361. expression: "currentView === 'date'"
  14362. }
  14363. ],
  14364. attrs: {
  14365. "selection-mode": _vm.selectionMode,
  14366. "first-day-of-week": _vm.firstDayOfWeek,
  14367. value: _vm.value,
  14368. "default-value": _vm.defaultValue
  14369. ? new Date(_vm.defaultValue)
  14370. : null,
  14371. date: _vm.date,
  14372. "cell-class-name": _vm.cellClassName,
  14373. "disabled-date": _vm.disabledDate
  14374. },
  14375. on: { pick: _vm.handleDatePick }
  14376. }),
  14377. _c("year-table", {
  14378. directives: [
  14379. {
  14380. name: "show",
  14381. rawName: "v-show",
  14382. value: _vm.currentView === "year",
  14383. expression: "currentView === 'year'"
  14384. }
  14385. ],
  14386. attrs: {
  14387. "selection-mode": _vm.selectionMode,
  14388. value: _vm.value,
  14389. "default-value": _vm.defaultValue
  14390. ? new Date(_vm.defaultValue)
  14391. : null,
  14392. date: _vm.date,
  14393. "disabled-date": _vm.disabledDate
  14394. },
  14395. on: { pick: _vm.handleYearPick }
  14396. }),
  14397. _c("month-table", {
  14398. directives: [
  14399. {
  14400. name: "show",
  14401. rawName: "v-show",
  14402. value: _vm.currentView === "month",
  14403. expression: "currentView === 'month'"
  14404. }
  14405. ],
  14406. attrs: {
  14407. "selection-mode": _vm.selectionMode,
  14408. value: _vm.value,
  14409. "default-value": _vm.defaultValue
  14410. ? new Date(_vm.defaultValue)
  14411. : null,
  14412. date: _vm.date,
  14413. "disabled-date": _vm.disabledDate
  14414. },
  14415. on: { pick: _vm.handleMonthPick }
  14416. })
  14417. ],
  14418. 1
  14419. )
  14420. ])
  14421. ],
  14422. 2
  14423. ),
  14424. _c(
  14425. "div",
  14426. {
  14427. directives: [
  14428. {
  14429. name: "show",
  14430. rawName: "v-show",
  14431. value:
  14432. _vm.footerVisible &&
  14433. (_vm.currentView === "date" ||
  14434. _vm.currentView === "month" ||
  14435. _vm.currentView === "year"),
  14436. expression:
  14437. "footerVisible && (currentView === 'date' || currentView === 'month' || currentView === 'year')"
  14438. }
  14439. ],
  14440. staticClass: "el-picker-panel__footer"
  14441. },
  14442. [
  14443. _c(
  14444. "el-button",
  14445. {
  14446. directives: [
  14447. {
  14448. name: "show",
  14449. rawName: "v-show",
  14450. value:
  14451. _vm.selectionMode !== "dates" &&
  14452. _vm.selectionMode !== "months" &&
  14453. _vm.selectionMode !== "years",
  14454. expression:
  14455. "selectionMode !== 'dates' && selectionMode !== 'months' && selectionMode !== 'years'"
  14456. }
  14457. ],
  14458. staticClass: "el-picker-panel__link-btn",
  14459. attrs: { size: "mini", type: "text" },
  14460. on: { click: _vm.changeToNow }
  14461. },
  14462. [
  14463. _vm._v(
  14464. "\n " +
  14465. _vm._s(_vm.t("el.datepicker.now")) +
  14466. "\n "
  14467. )
  14468. ]
  14469. ),
  14470. _c(
  14471. "el-button",
  14472. {
  14473. staticClass: "el-picker-panel__link-btn",
  14474. attrs: { plain: "", size: "mini" },
  14475. on: { click: _vm.confirm }
  14476. },
  14477. [
  14478. _vm._v(
  14479. "\n " +
  14480. _vm._s(_vm.t("el.datepicker.confirm")) +
  14481. "\n "
  14482. )
  14483. ]
  14484. )
  14485. ],
  14486. 1
  14487. )
  14488. ]
  14489. )
  14490. ]
  14491. )
  14492. }
  14493. var datevue_type_template_id_2440d4ea_staticRenderFns = []
  14494. datevue_type_template_id_2440d4ea_render._withStripped = true
  14495. // CONCATENATED MODULE: ./packages/date-picker/src/panel/date.vue?vue&type=template&id=2440d4ea&
  14496. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/panel/time.vue?vue&type=template&id=3d939089&
  14497. var timevue_type_template_id_3d939089_render = function() {
  14498. var _vm = this
  14499. var _h = _vm.$createElement
  14500. var _c = _vm._self._c || _h
  14501. return _c(
  14502. "transition",
  14503. {
  14504. attrs: { name: "el-zoom-in-top" },
  14505. on: {
  14506. "after-leave": function($event) {
  14507. _vm.$emit("dodestroy")
  14508. }
  14509. }
  14510. },
  14511. [
  14512. _c(
  14513. "div",
  14514. {
  14515. directives: [
  14516. {
  14517. name: "show",
  14518. rawName: "v-show",
  14519. value: _vm.visible,
  14520. expression: "visible"
  14521. }
  14522. ],
  14523. staticClass: "el-time-panel el-popper",
  14524. class: _vm.popperClass
  14525. },
  14526. [
  14527. _c(
  14528. "div",
  14529. {
  14530. staticClass: "el-time-panel__content",
  14531. class: { "has-seconds": _vm.showSeconds }
  14532. },
  14533. [
  14534. _c("time-spinner", {
  14535. ref: "spinner",
  14536. attrs: {
  14537. "arrow-control": _vm.useArrow,
  14538. "show-seconds": _vm.showSeconds,
  14539. "am-pm-mode": _vm.amPmMode,
  14540. date: _vm.date
  14541. },
  14542. on: {
  14543. change: _vm.handleChange,
  14544. "select-range": _vm.setSelectionRange
  14545. }
  14546. })
  14547. ],
  14548. 1
  14549. ),
  14550. _c("div", { staticClass: "el-time-panel__footer" }, [
  14551. _c(
  14552. "button",
  14553. {
  14554. staticClass: "el-time-panel__btn cancel",
  14555. attrs: { type: "button" },
  14556. on: { click: _vm.handleCancel }
  14557. },
  14558. [_vm._v(_vm._s(_vm.t("el.datepicker.cancel")))]
  14559. ),
  14560. _c(
  14561. "button",
  14562. {
  14563. staticClass: "el-time-panel__btn",
  14564. class: { confirm: !_vm.disabled },
  14565. attrs: { type: "button" },
  14566. on: {
  14567. click: function($event) {
  14568. _vm.handleConfirm()
  14569. }
  14570. }
  14571. },
  14572. [_vm._v(_vm._s(_vm.t("el.datepicker.confirm")))]
  14573. )
  14574. ])
  14575. ]
  14576. )
  14577. ]
  14578. )
  14579. }
  14580. var timevue_type_template_id_3d939089_staticRenderFns = []
  14581. timevue_type_template_id_3d939089_render._withStripped = true
  14582. // CONCATENATED MODULE: ./packages/date-picker/src/panel/time.vue?vue&type=template&id=3d939089&
  14583. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/basic/time-spinner.vue?vue&type=template&id=1facadeb&
  14584. var time_spinnervue_type_template_id_1facadeb_render = function() {
  14585. var _vm = this
  14586. var _h = _vm.$createElement
  14587. var _c = _vm._self._c || _h
  14588. return _c(
  14589. "div",
  14590. {
  14591. staticClass: "el-time-spinner",
  14592. class: { "has-seconds": _vm.showSeconds }
  14593. },
  14594. [
  14595. !_vm.arrowControl
  14596. ? [
  14597. _c(
  14598. "el-scrollbar",
  14599. {
  14600. ref: "hours",
  14601. staticClass: "el-time-spinner__wrapper",
  14602. attrs: {
  14603. "wrap-style": "max-height: inherit;",
  14604. "view-class": "el-time-spinner__list",
  14605. noresize: "",
  14606. tag: "ul"
  14607. },
  14608. nativeOn: {
  14609. mouseenter: function($event) {
  14610. _vm.emitSelectRange("hours")
  14611. },
  14612. mousemove: function($event) {
  14613. _vm.adjustCurrentSpinner("hours")
  14614. }
  14615. }
  14616. },
  14617. _vm._l(_vm.hoursList, function(disabled, hour) {
  14618. return _c(
  14619. "li",
  14620. {
  14621. key: hour,
  14622. staticClass: "el-time-spinner__item",
  14623. class: { active: hour === _vm.hours, disabled: disabled },
  14624. on: {
  14625. click: function($event) {
  14626. _vm.handleClick("hours", {
  14627. value: hour,
  14628. disabled: disabled
  14629. })
  14630. }
  14631. }
  14632. },
  14633. [
  14634. _vm._v(
  14635. _vm._s(
  14636. ("0" + (_vm.amPmMode ? hour % 12 || 12 : hour)).slice(
  14637. -2
  14638. )
  14639. ) + _vm._s(_vm.amPm(hour))
  14640. )
  14641. ]
  14642. )
  14643. }),
  14644. 0
  14645. ),
  14646. _c(
  14647. "el-scrollbar",
  14648. {
  14649. ref: "minutes",
  14650. staticClass: "el-time-spinner__wrapper",
  14651. attrs: {
  14652. "wrap-style": "max-height: inherit;",
  14653. "view-class": "el-time-spinner__list",
  14654. noresize: "",
  14655. tag: "ul"
  14656. },
  14657. nativeOn: {
  14658. mouseenter: function($event) {
  14659. _vm.emitSelectRange("minutes")
  14660. },
  14661. mousemove: function($event) {
  14662. _vm.adjustCurrentSpinner("minutes")
  14663. }
  14664. }
  14665. },
  14666. _vm._l(_vm.minutesList, function(enabled, key) {
  14667. return _c(
  14668. "li",
  14669. {
  14670. key: key,
  14671. staticClass: "el-time-spinner__item",
  14672. class: { active: key === _vm.minutes, disabled: !enabled },
  14673. on: {
  14674. click: function($event) {
  14675. _vm.handleClick("minutes", {
  14676. value: key,
  14677. disabled: false
  14678. })
  14679. }
  14680. }
  14681. },
  14682. [_vm._v(_vm._s(("0" + key).slice(-2)))]
  14683. )
  14684. }),
  14685. 0
  14686. ),
  14687. _c(
  14688. "el-scrollbar",
  14689. {
  14690. directives: [
  14691. {
  14692. name: "show",
  14693. rawName: "v-show",
  14694. value: _vm.showSeconds,
  14695. expression: "showSeconds"
  14696. }
  14697. ],
  14698. ref: "seconds",
  14699. staticClass: "el-time-spinner__wrapper",
  14700. attrs: {
  14701. "wrap-style": "max-height: inherit;",
  14702. "view-class": "el-time-spinner__list",
  14703. noresize: "",
  14704. tag: "ul"
  14705. },
  14706. nativeOn: {
  14707. mouseenter: function($event) {
  14708. _vm.emitSelectRange("seconds")
  14709. },
  14710. mousemove: function($event) {
  14711. _vm.adjustCurrentSpinner("seconds")
  14712. }
  14713. }
  14714. },
  14715. _vm._l(60, function(second, key) {
  14716. return _c(
  14717. "li",
  14718. {
  14719. key: key,
  14720. staticClass: "el-time-spinner__item",
  14721. class: { active: key === _vm.seconds },
  14722. on: {
  14723. click: function($event) {
  14724. _vm.handleClick("seconds", {
  14725. value: key,
  14726. disabled: false
  14727. })
  14728. }
  14729. }
  14730. },
  14731. [_vm._v(_vm._s(("0" + key).slice(-2)))]
  14732. )
  14733. }),
  14734. 0
  14735. )
  14736. ]
  14737. : _vm._e(),
  14738. _vm.arrowControl
  14739. ? [
  14740. _c(
  14741. "div",
  14742. {
  14743. staticClass: "el-time-spinner__wrapper is-arrow",
  14744. on: {
  14745. mouseenter: function($event) {
  14746. _vm.emitSelectRange("hours")
  14747. }
  14748. }
  14749. },
  14750. [
  14751. _c("i", {
  14752. directives: [
  14753. {
  14754. name: "repeat-click",
  14755. rawName: "v-repeat-click",
  14756. value: _vm.decrease,
  14757. expression: "decrease"
  14758. }
  14759. ],
  14760. staticClass: "el-time-spinner__arrow el-icon-arrow-up"
  14761. }),
  14762. _c("i", {
  14763. directives: [
  14764. {
  14765. name: "repeat-click",
  14766. rawName: "v-repeat-click",
  14767. value: _vm.increase,
  14768. expression: "increase"
  14769. }
  14770. ],
  14771. staticClass: "el-time-spinner__arrow el-icon-arrow-down"
  14772. }),
  14773. _c(
  14774. "ul",
  14775. { ref: "hours", staticClass: "el-time-spinner__list" },
  14776. _vm._l(_vm.arrowHourList, function(hour, key) {
  14777. return _c(
  14778. "li",
  14779. {
  14780. key: key,
  14781. staticClass: "el-time-spinner__item",
  14782. class: {
  14783. active: hour === _vm.hours,
  14784. disabled: _vm.hoursList[hour]
  14785. }
  14786. },
  14787. [
  14788. _vm._v(
  14789. _vm._s(
  14790. hour === undefined
  14791. ? ""
  14792. : (
  14793. "0" + (_vm.amPmMode ? hour % 12 || 12 : hour)
  14794. ).slice(-2) + _vm.amPm(hour)
  14795. )
  14796. )
  14797. ]
  14798. )
  14799. }),
  14800. 0
  14801. )
  14802. ]
  14803. ),
  14804. _c(
  14805. "div",
  14806. {
  14807. staticClass: "el-time-spinner__wrapper is-arrow",
  14808. on: {
  14809. mouseenter: function($event) {
  14810. _vm.emitSelectRange("minutes")
  14811. }
  14812. }
  14813. },
  14814. [
  14815. _c("i", {
  14816. directives: [
  14817. {
  14818. name: "repeat-click",
  14819. rawName: "v-repeat-click",
  14820. value: _vm.decrease,
  14821. expression: "decrease"
  14822. }
  14823. ],
  14824. staticClass: "el-time-spinner__arrow el-icon-arrow-up"
  14825. }),
  14826. _c("i", {
  14827. directives: [
  14828. {
  14829. name: "repeat-click",
  14830. rawName: "v-repeat-click",
  14831. value: _vm.increase,
  14832. expression: "increase"
  14833. }
  14834. ],
  14835. staticClass: "el-time-spinner__arrow el-icon-arrow-down"
  14836. }),
  14837. _c(
  14838. "ul",
  14839. { ref: "minutes", staticClass: "el-time-spinner__list" },
  14840. _vm._l(_vm.arrowMinuteList, function(minute, key) {
  14841. return _c(
  14842. "li",
  14843. {
  14844. key: key,
  14845. staticClass: "el-time-spinner__item",
  14846. class: { active: minute === _vm.minutes }
  14847. },
  14848. [
  14849. _vm._v(
  14850. "\n " +
  14851. _vm._s(
  14852. minute === undefined
  14853. ? ""
  14854. : ("0" + minute).slice(-2)
  14855. ) +
  14856. "\n "
  14857. )
  14858. ]
  14859. )
  14860. }),
  14861. 0
  14862. )
  14863. ]
  14864. ),
  14865. _vm.showSeconds
  14866. ? _c(
  14867. "div",
  14868. {
  14869. staticClass: "el-time-spinner__wrapper is-arrow",
  14870. on: {
  14871. mouseenter: function($event) {
  14872. _vm.emitSelectRange("seconds")
  14873. }
  14874. }
  14875. },
  14876. [
  14877. _c("i", {
  14878. directives: [
  14879. {
  14880. name: "repeat-click",
  14881. rawName: "v-repeat-click",
  14882. value: _vm.decrease,
  14883. expression: "decrease"
  14884. }
  14885. ],
  14886. staticClass: "el-time-spinner__arrow el-icon-arrow-up"
  14887. }),
  14888. _c("i", {
  14889. directives: [
  14890. {
  14891. name: "repeat-click",
  14892. rawName: "v-repeat-click",
  14893. value: _vm.increase,
  14894. expression: "increase"
  14895. }
  14896. ],
  14897. staticClass: "el-time-spinner__arrow el-icon-arrow-down"
  14898. }),
  14899. _c(
  14900. "ul",
  14901. { ref: "seconds", staticClass: "el-time-spinner__list" },
  14902. _vm._l(_vm.arrowSecondList, function(second, key) {
  14903. return _c(
  14904. "li",
  14905. {
  14906. key: key,
  14907. staticClass: "el-time-spinner__item",
  14908. class: { active: second === _vm.seconds }
  14909. },
  14910. [
  14911. _vm._v(
  14912. "\n " +
  14913. _vm._s(
  14914. second === undefined
  14915. ? ""
  14916. : ("0" + second).slice(-2)
  14917. ) +
  14918. "\n "
  14919. )
  14920. ]
  14921. )
  14922. }),
  14923. 0
  14924. )
  14925. ]
  14926. )
  14927. : _vm._e()
  14928. ]
  14929. : _vm._e()
  14930. ],
  14931. 2
  14932. )
  14933. }
  14934. var time_spinnervue_type_template_id_1facadeb_staticRenderFns = []
  14935. time_spinnervue_type_template_id_1facadeb_render._withStripped = true
  14936. // CONCATENATED MODULE: ./packages/date-picker/src/basic/time-spinner.vue?vue&type=template&id=1facadeb&
  14937. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/basic/time-spinner.vue?vue&type=script&lang=js&
  14938. //
  14939. //
  14940. //
  14941. //
  14942. //
  14943. //
  14944. //
  14945. //
  14946. //
  14947. //
  14948. //
  14949. //
  14950. //
  14951. //
  14952. //
  14953. //
  14954. //
  14955. //
  14956. //
  14957. //
  14958. //
  14959. //
  14960. //
  14961. //
  14962. //
  14963. //
  14964. //
  14965. //
  14966. //
  14967. //
  14968. //
  14969. //
  14970. //
  14971. //
  14972. //
  14973. //
  14974. //
  14975. //
  14976. //
  14977. //
  14978. //
  14979. //
  14980. //
  14981. //
  14982. //
  14983. //
  14984. //
  14985. //
  14986. //
  14987. //
  14988. //
  14989. //
  14990. //
  14991. //
  14992. //
  14993. //
  14994. //
  14995. //
  14996. //
  14997. //
  14998. //
  14999. //
  15000. //
  15001. //
  15002. //
  15003. //
  15004. //
  15005. //
  15006. //
  15007. //
  15008. //
  15009. //
  15010. //
  15011. //
  15012. //
  15013. //
  15014. //
  15015. //
  15016. //
  15017. //
  15018. //
  15019. //
  15020. //
  15021. //
  15022. //
  15023. //
  15024. //
  15025. //
  15026. //
  15027. //
  15028. //
  15029. //
  15030. //
  15031. //
  15032. //
  15033. //
  15034. //
  15035. //
  15036. //
  15037. //
  15038. //
  15039. //
  15040. /* harmony default export */ var time_spinnervue_type_script_lang_js_ = ({
  15041. components: { ElScrollbar: scrollbar_default.a },
  15042. directives: {
  15043. repeatClick: repeat_click
  15044. },
  15045. props: {
  15046. date: {},
  15047. defaultValue: {}, // reserved for future use
  15048. showSeconds: {
  15049. type: Boolean,
  15050. default: true
  15051. },
  15052. arrowControl: Boolean,
  15053. amPmMode: {
  15054. type: String,
  15055. default: '' // 'a': am/pm; 'A': AM/PM
  15056. }
  15057. },
  15058. computed: {
  15059. hours: function hours() {
  15060. return this.date.getHours();
  15061. },
  15062. minutes: function minutes() {
  15063. return this.date.getMinutes();
  15064. },
  15065. seconds: function seconds() {
  15066. return this.date.getSeconds();
  15067. },
  15068. hoursList: function hoursList() {
  15069. return Object(date_util_["getRangeHours"])(this.selectableRange);
  15070. },
  15071. minutesList: function minutesList() {
  15072. return Object(date_util_["getRangeMinutes"])(this.selectableRange, this.hours);
  15073. },
  15074. arrowHourList: function arrowHourList() {
  15075. var hours = this.hours;
  15076. return [hours > 0 ? hours - 1 : undefined, hours, hours < 23 ? hours + 1 : undefined];
  15077. },
  15078. arrowMinuteList: function arrowMinuteList() {
  15079. var minutes = this.minutes;
  15080. return [minutes > 0 ? minutes - 1 : undefined, minutes, minutes < 59 ? minutes + 1 : undefined];
  15081. },
  15082. arrowSecondList: function arrowSecondList() {
  15083. var seconds = this.seconds;
  15084. return [seconds > 0 ? seconds - 1 : undefined, seconds, seconds < 59 ? seconds + 1 : undefined];
  15085. }
  15086. },
  15087. data: function data() {
  15088. return {
  15089. selectableRange: [],
  15090. currentScrollbar: null
  15091. };
  15092. },
  15093. mounted: function mounted() {
  15094. var _this = this;
  15095. this.$nextTick(function () {
  15096. !_this.arrowControl && _this.bindScrollEvent();
  15097. });
  15098. },
  15099. methods: {
  15100. increase: function increase() {
  15101. this.scrollDown(1);
  15102. },
  15103. decrease: function decrease() {
  15104. this.scrollDown(-1);
  15105. },
  15106. modifyDateField: function modifyDateField(type, value) {
  15107. switch (type) {
  15108. case 'hours':
  15109. this.$emit('change', Object(date_util_["modifyTime"])(this.date, value, this.minutes, this.seconds));break;
  15110. case 'minutes':
  15111. this.$emit('change', Object(date_util_["modifyTime"])(this.date, this.hours, value, this.seconds));break;
  15112. case 'seconds':
  15113. this.$emit('change', Object(date_util_["modifyTime"])(this.date, this.hours, this.minutes, value));break;
  15114. }
  15115. },
  15116. handleClick: function handleClick(type, _ref) {
  15117. var value = _ref.value,
  15118. disabled = _ref.disabled;
  15119. if (!disabled) {
  15120. this.modifyDateField(type, value);
  15121. this.emitSelectRange(type);
  15122. this.adjustSpinner(type, value);
  15123. }
  15124. },
  15125. emitSelectRange: function emitSelectRange(type) {
  15126. if (type === 'hours') {
  15127. this.$emit('select-range', 0, 2);
  15128. } else if (type === 'minutes') {
  15129. this.$emit('select-range', 3, 5);
  15130. } else if (type === 'seconds') {
  15131. this.$emit('select-range', 6, 8);
  15132. }
  15133. this.currentScrollbar = type;
  15134. },
  15135. bindScrollEvent: function bindScrollEvent() {
  15136. var _this2 = this;
  15137. var bindFunction = function bindFunction(type) {
  15138. _this2.$refs[type].wrap.onscroll = function (e) {
  15139. // TODO: scroll is emitted when set scrollTop programatically
  15140. // should find better solutions in the future!
  15141. _this2.handleScroll(type, e);
  15142. };
  15143. };
  15144. bindFunction('hours');
  15145. bindFunction('minutes');
  15146. bindFunction('seconds');
  15147. },
  15148. handleScroll: function handleScroll(type) {
  15149. var value = Math.min(Math.round((this.$refs[type].wrap.scrollTop - (this.scrollBarHeight(type) * 0.5 - 10) / this.typeItemHeight(type) + 3) / this.typeItemHeight(type)), type === 'hours' ? 23 : 59);
  15150. this.modifyDateField(type, value);
  15151. },
  15152. // NOTE: used by datetime / date-range panel
  15153. // renamed from adjustScrollTop
  15154. // should try to refactory it
  15155. adjustSpinners: function adjustSpinners() {
  15156. this.adjustSpinner('hours', this.hours);
  15157. this.adjustSpinner('minutes', this.minutes);
  15158. this.adjustSpinner('seconds', this.seconds);
  15159. },
  15160. adjustCurrentSpinner: function adjustCurrentSpinner(type) {
  15161. this.adjustSpinner(type, this[type]);
  15162. },
  15163. adjustSpinner: function adjustSpinner(type, value) {
  15164. if (this.arrowControl) return;
  15165. var el = this.$refs[type].wrap;
  15166. if (el) {
  15167. el.scrollTop = Math.max(0, value * this.typeItemHeight(type));
  15168. }
  15169. },
  15170. scrollDown: function scrollDown(step) {
  15171. var _this3 = this;
  15172. if (!this.currentScrollbar) {
  15173. this.emitSelectRange('hours');
  15174. }
  15175. var label = this.currentScrollbar;
  15176. var hoursList = this.hoursList;
  15177. var now = this[label];
  15178. if (this.currentScrollbar === 'hours') {
  15179. var total = Math.abs(step);
  15180. step = step > 0 ? 1 : -1;
  15181. var length = hoursList.length;
  15182. while (length-- && total) {
  15183. now = (now + step + hoursList.length) % hoursList.length;
  15184. if (hoursList[now]) {
  15185. continue;
  15186. }
  15187. total--;
  15188. }
  15189. if (hoursList[now]) return;
  15190. } else {
  15191. now = (now + step + 60) % 60;
  15192. }
  15193. this.modifyDateField(label, now);
  15194. this.adjustSpinner(label, now);
  15195. this.$nextTick(function () {
  15196. return _this3.emitSelectRange(_this3.currentScrollbar);
  15197. });
  15198. },
  15199. amPm: function amPm(hour) {
  15200. var shouldShowAmPm = this.amPmMode.toLowerCase() === 'a';
  15201. if (!shouldShowAmPm) return '';
  15202. var isCapital = this.amPmMode === 'A';
  15203. var content = hour < 12 ? ' am' : ' pm';
  15204. if (isCapital) content = content.toUpperCase();
  15205. return content;
  15206. },
  15207. typeItemHeight: function typeItemHeight(type) {
  15208. return this.$refs[type].$el.querySelector('li').offsetHeight;
  15209. },
  15210. scrollBarHeight: function scrollBarHeight(type) {
  15211. return this.$refs[type].$el.offsetHeight;
  15212. }
  15213. }
  15214. });
  15215. // CONCATENATED MODULE: ./packages/date-picker/src/basic/time-spinner.vue?vue&type=script&lang=js&
  15216. /* harmony default export */ var basic_time_spinnervue_type_script_lang_js_ = (time_spinnervue_type_script_lang_js_);
  15217. // CONCATENATED MODULE: ./packages/date-picker/src/basic/time-spinner.vue
  15218. /* normalize component */
  15219. var time_spinner_component = normalizeComponent(
  15220. basic_time_spinnervue_type_script_lang_js_,
  15221. time_spinnervue_type_template_id_1facadeb_render,
  15222. time_spinnervue_type_template_id_1facadeb_staticRenderFns,
  15223. false,
  15224. null,
  15225. null,
  15226. null
  15227. )
  15228. /* hot reload */
  15229. if (false) { var time_spinner_api; }
  15230. time_spinner_component.options.__file = "packages/date-picker/src/basic/time-spinner.vue"
  15231. /* harmony default export */ var time_spinner = (time_spinner_component.exports);
  15232. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/panel/time.vue?vue&type=script&lang=js&
  15233. //
  15234. //
  15235. //
  15236. //
  15237. //
  15238. //
  15239. //
  15240. //
  15241. //
  15242. //
  15243. //
  15244. //
  15245. //
  15246. //
  15247. //
  15248. //
  15249. //
  15250. //
  15251. //
  15252. //
  15253. //
  15254. //
  15255. //
  15256. //
  15257. //
  15258. //
  15259. //
  15260. //
  15261. //
  15262. //
  15263. //
  15264. //
  15265. /* harmony default export */ var timevue_type_script_lang_js_ = ({
  15266. mixins: [locale_default.a],
  15267. components: {
  15268. TimeSpinner: time_spinner
  15269. },
  15270. props: {
  15271. visible: Boolean,
  15272. timeArrowControl: Boolean
  15273. },
  15274. watch: {
  15275. visible: function visible(val) {
  15276. var _this = this;
  15277. if (val) {
  15278. this.oldValue = this.value;
  15279. this.$nextTick(function () {
  15280. return _this.$refs.spinner.emitSelectRange('hours');
  15281. });
  15282. } else {
  15283. this.needInitAdjust = true;
  15284. }
  15285. },
  15286. value: function value(newVal) {
  15287. var _this2 = this;
  15288. var date = void 0;
  15289. if (newVal instanceof Date) {
  15290. date = Object(date_util_["limitTimeRange"])(newVal, this.selectableRange, this.format);
  15291. } else if (!newVal) {
  15292. date = this.defaultValue ? new Date(this.defaultValue) : new Date();
  15293. }
  15294. this.date = date;
  15295. if (this.visible && this.needInitAdjust) {
  15296. this.$nextTick(function (_) {
  15297. return _this2.adjustSpinners();
  15298. });
  15299. this.needInitAdjust = false;
  15300. }
  15301. },
  15302. selectableRange: function selectableRange(val) {
  15303. this.$refs.spinner.selectableRange = val;
  15304. },
  15305. defaultValue: function defaultValue(val) {
  15306. if (!Object(date_util_["isDate"])(this.value)) {
  15307. this.date = val ? new Date(val) : new Date();
  15308. }
  15309. }
  15310. },
  15311. data: function data() {
  15312. return {
  15313. popperClass: '',
  15314. format: 'HH:mm:ss',
  15315. value: '',
  15316. defaultValue: null,
  15317. date: new Date(),
  15318. oldValue: new Date(),
  15319. selectableRange: [],
  15320. selectionRange: [0, 2],
  15321. disabled: false,
  15322. arrowControl: false,
  15323. needInitAdjust: true
  15324. };
  15325. },
  15326. computed: {
  15327. showSeconds: function showSeconds() {
  15328. return (this.format || '').indexOf('ss') !== -1;
  15329. },
  15330. useArrow: function useArrow() {
  15331. return this.arrowControl || this.timeArrowControl || false;
  15332. },
  15333. amPmMode: function amPmMode() {
  15334. if ((this.format || '').indexOf('A') !== -1) return 'A';
  15335. if ((this.format || '').indexOf('a') !== -1) return 'a';
  15336. return '';
  15337. }
  15338. },
  15339. methods: {
  15340. handleCancel: function handleCancel() {
  15341. this.$emit('pick', this.oldValue, false);
  15342. },
  15343. handleChange: function handleChange(date) {
  15344. // this.visible avoids edge cases, when use scrolls during panel closing animation
  15345. if (this.visible) {
  15346. this.date = Object(date_util_["clearMilliseconds"])(date);
  15347. // if date is out of range, do not emit
  15348. if (this.isValidValue(this.date)) {
  15349. this.$emit('pick', this.date, true);
  15350. }
  15351. }
  15352. },
  15353. setSelectionRange: function setSelectionRange(start, end) {
  15354. this.$emit('select-range', start, end);
  15355. this.selectionRange = [start, end];
  15356. },
  15357. handleConfirm: function handleConfirm() {
  15358. var visible = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  15359. var first = arguments[1];
  15360. if (first) return;
  15361. var date = Object(date_util_["clearMilliseconds"])(Object(date_util_["limitTimeRange"])(this.date, this.selectableRange, this.format));
  15362. this.$emit('pick', date, visible, first);
  15363. },
  15364. handleKeydown: function handleKeydown(event) {
  15365. var keyCode = event.keyCode;
  15366. var mapping = { 38: -1, 40: 1, 37: -1, 39: 1 };
  15367. // Left or Right
  15368. if (keyCode === 37 || keyCode === 39) {
  15369. var step = mapping[keyCode];
  15370. this.changeSelectionRange(step);
  15371. event.preventDefault();
  15372. return;
  15373. }
  15374. // Up or Down
  15375. if (keyCode === 38 || keyCode === 40) {
  15376. var _step = mapping[keyCode];
  15377. this.$refs.spinner.scrollDown(_step);
  15378. event.preventDefault();
  15379. return;
  15380. }
  15381. },
  15382. isValidValue: function isValidValue(date) {
  15383. return Object(date_util_["timeWithinRange"])(date, this.selectableRange, this.format);
  15384. },
  15385. adjustSpinners: function adjustSpinners() {
  15386. return this.$refs.spinner.adjustSpinners();
  15387. },
  15388. changeSelectionRange: function changeSelectionRange(step) {
  15389. var list = [0, 3].concat(this.showSeconds ? [6] : []);
  15390. var mapping = ['hours', 'minutes'].concat(this.showSeconds ? ['seconds'] : []);
  15391. var index = list.indexOf(this.selectionRange[0]);
  15392. var next = (index + step + list.length) % list.length;
  15393. this.$refs.spinner.emitSelectRange(mapping[next]);
  15394. }
  15395. },
  15396. mounted: function mounted() {
  15397. var _this3 = this;
  15398. this.$nextTick(function () {
  15399. return _this3.handleConfirm(true, true);
  15400. });
  15401. this.$emit('mounted');
  15402. }
  15403. });
  15404. // CONCATENATED MODULE: ./packages/date-picker/src/panel/time.vue?vue&type=script&lang=js&
  15405. /* harmony default export */ var panel_timevue_type_script_lang_js_ = (timevue_type_script_lang_js_);
  15406. // CONCATENATED MODULE: ./packages/date-picker/src/panel/time.vue
  15407. /* normalize component */
  15408. var time_component = normalizeComponent(
  15409. panel_timevue_type_script_lang_js_,
  15410. timevue_type_template_id_3d939089_render,
  15411. timevue_type_template_id_3d939089_staticRenderFns,
  15412. false,
  15413. null,
  15414. null,
  15415. null
  15416. )
  15417. /* hot reload */
  15418. if (false) { var time_api; }
  15419. time_component.options.__file = "packages/date-picker/src/panel/time.vue"
  15420. /* harmony default export */ var panel_time = (time_component.exports);
  15421. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/basic/year-table.vue?vue&type=template&id=c86ab5e0&
  15422. var year_tablevue_type_template_id_c86ab5e0_render = function() {
  15423. var _vm = this
  15424. var _h = _vm.$createElement
  15425. var _c = _vm._self._c || _h
  15426. return _c(
  15427. "table",
  15428. { staticClass: "el-year-table", on: { click: _vm.handleYearTableClick } },
  15429. [
  15430. _c("tbody", [
  15431. _c("tr", [
  15432. _c(
  15433. "td",
  15434. {
  15435. staticClass: "available",
  15436. class: _vm.getCellStyle(_vm.startYear + 0)
  15437. },
  15438. [_c("a", { staticClass: "cell" }, [_vm._v(_vm._s(_vm.startYear))])]
  15439. ),
  15440. _c(
  15441. "td",
  15442. {
  15443. staticClass: "available",
  15444. class: _vm.getCellStyle(_vm.startYear + 1)
  15445. },
  15446. [
  15447. _c("a", { staticClass: "cell" }, [
  15448. _vm._v(_vm._s(_vm.startYear + 1))
  15449. ])
  15450. ]
  15451. ),
  15452. _c(
  15453. "td",
  15454. {
  15455. staticClass: "available",
  15456. class: _vm.getCellStyle(_vm.startYear + 2)
  15457. },
  15458. [
  15459. _c("a", { staticClass: "cell" }, [
  15460. _vm._v(_vm._s(_vm.startYear + 2))
  15461. ])
  15462. ]
  15463. ),
  15464. _c(
  15465. "td",
  15466. {
  15467. staticClass: "available",
  15468. class: _vm.getCellStyle(_vm.startYear + 3)
  15469. },
  15470. [
  15471. _c("a", { staticClass: "cell" }, [
  15472. _vm._v(_vm._s(_vm.startYear + 3))
  15473. ])
  15474. ]
  15475. )
  15476. ]),
  15477. _c("tr", [
  15478. _c(
  15479. "td",
  15480. {
  15481. staticClass: "available",
  15482. class: _vm.getCellStyle(_vm.startYear + 4)
  15483. },
  15484. [
  15485. _c("a", { staticClass: "cell" }, [
  15486. _vm._v(_vm._s(_vm.startYear + 4))
  15487. ])
  15488. ]
  15489. ),
  15490. _c(
  15491. "td",
  15492. {
  15493. staticClass: "available",
  15494. class: _vm.getCellStyle(_vm.startYear + 5)
  15495. },
  15496. [
  15497. _c("a", { staticClass: "cell" }, [
  15498. _vm._v(_vm._s(_vm.startYear + 5))
  15499. ])
  15500. ]
  15501. ),
  15502. _c(
  15503. "td",
  15504. {
  15505. staticClass: "available",
  15506. class: _vm.getCellStyle(_vm.startYear + 6)
  15507. },
  15508. [
  15509. _c("a", { staticClass: "cell" }, [
  15510. _vm._v(_vm._s(_vm.startYear + 6))
  15511. ])
  15512. ]
  15513. ),
  15514. _c(
  15515. "td",
  15516. {
  15517. staticClass: "available",
  15518. class: _vm.getCellStyle(_vm.startYear + 7)
  15519. },
  15520. [
  15521. _c("a", { staticClass: "cell" }, [
  15522. _vm._v(_vm._s(_vm.startYear + 7))
  15523. ])
  15524. ]
  15525. )
  15526. ]),
  15527. _c("tr", [
  15528. _c(
  15529. "td",
  15530. {
  15531. staticClass: "available",
  15532. class: _vm.getCellStyle(_vm.startYear + 8)
  15533. },
  15534. [
  15535. _c("a", { staticClass: "cell" }, [
  15536. _vm._v(_vm._s(_vm.startYear + 8))
  15537. ])
  15538. ]
  15539. ),
  15540. _c(
  15541. "td",
  15542. {
  15543. staticClass: "available",
  15544. class: _vm.getCellStyle(_vm.startYear + 9)
  15545. },
  15546. [
  15547. _c("a", { staticClass: "cell" }, [
  15548. _vm._v(_vm._s(_vm.startYear + 9))
  15549. ])
  15550. ]
  15551. ),
  15552. _c("td"),
  15553. _c("td")
  15554. ])
  15555. ])
  15556. ]
  15557. )
  15558. }
  15559. var year_tablevue_type_template_id_c86ab5e0_staticRenderFns = []
  15560. year_tablevue_type_template_id_c86ab5e0_render._withStripped = true
  15561. // CONCATENATED MODULE: ./packages/date-picker/src/basic/year-table.vue?vue&type=template&id=c86ab5e0&
  15562. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/basic/year-table.vue?vue&type=script&lang=js&
  15563. //
  15564. //
  15565. //
  15566. //
  15567. //
  15568. //
  15569. //
  15570. //
  15571. //
  15572. //
  15573. //
  15574. //
  15575. //
  15576. //
  15577. //
  15578. //
  15579. //
  15580. //
  15581. //
  15582. //
  15583. //
  15584. //
  15585. //
  15586. //
  15587. //
  15588. //
  15589. //
  15590. //
  15591. //
  15592. //
  15593. //
  15594. //
  15595. //
  15596. //
  15597. //
  15598. //
  15599. //
  15600. //
  15601. //
  15602. //
  15603. //
  15604. //
  15605. //
  15606. //
  15607. //
  15608. var year_tablevue_type_script_lang_js_datesInYear = function datesInYear(year) {
  15609. var numOfDays = Object(date_util_["getDayCountOfYear"])(year);
  15610. var firstDay = new Date(year, 0, 1);
  15611. return Object(date_util_["range"])(numOfDays).map(function (n) {
  15612. return Object(date_util_["nextDate"])(firstDay, n);
  15613. });
  15614. };
  15615. /* harmony default export */ var year_tablevue_type_script_lang_js_ = ({
  15616. props: {
  15617. disabledDate: {},
  15618. value: {},
  15619. defaultValue: {
  15620. validator: function validator(val) {
  15621. // null or valid Date Object
  15622. return val === null || val instanceof Date && Object(date_util_["isDate"])(val);
  15623. }
  15624. },
  15625. date: {},
  15626. selectionMode: {}
  15627. },
  15628. computed: {
  15629. startYear: function startYear() {
  15630. return Math.floor(this.date.getFullYear() / 10) * 10;
  15631. }
  15632. },
  15633. methods: {
  15634. getCellStyle: function getCellStyle(year) {
  15635. var style = {};
  15636. var today = new Date();
  15637. style.disabled = typeof this.disabledDate === 'function' ? year_tablevue_type_script_lang_js_datesInYear(year).every(this.disabledDate) : false;
  15638. style.current = Object(util_["arrayFindIndex"])(Object(util_["coerceTruthyValueToArray"])(this.value), function (date) {
  15639. return date.getFullYear() === year;
  15640. }) >= 0;
  15641. style.today = today.getFullYear() === year;
  15642. style.default = this.defaultValue && this.defaultValue.getFullYear() === year;
  15643. return style;
  15644. },
  15645. handleYearTableClick: function handleYearTableClick(event) {
  15646. var target = event.target;
  15647. if (target.tagName === 'A') {
  15648. if (Object(dom_["hasClass"])(target.parentNode, 'disabled')) return;
  15649. var year = target.textContent || target.innerText;
  15650. if (this.selectionMode === 'years') {
  15651. var value = this.value || [];
  15652. var idx = Object(util_["arrayFindIndex"])(value, function (date) {
  15653. return date.getFullYear() === Number(year);
  15654. });
  15655. var newValue = idx > -1 ? [].concat(value.slice(0, idx), value.slice(idx + 1)) : [].concat(value, [new Date(year)]);
  15656. this.$emit('pick', newValue);
  15657. } else {
  15658. this.$emit('pick', Number(year));
  15659. }
  15660. }
  15661. }
  15662. }
  15663. });
  15664. // CONCATENATED MODULE: ./packages/date-picker/src/basic/year-table.vue?vue&type=script&lang=js&
  15665. /* harmony default export */ var basic_year_tablevue_type_script_lang_js_ = (year_tablevue_type_script_lang_js_);
  15666. // CONCATENATED MODULE: ./packages/date-picker/src/basic/year-table.vue
  15667. /* normalize component */
  15668. var year_table_component = normalizeComponent(
  15669. basic_year_tablevue_type_script_lang_js_,
  15670. year_tablevue_type_template_id_c86ab5e0_render,
  15671. year_tablevue_type_template_id_c86ab5e0_staticRenderFns,
  15672. false,
  15673. null,
  15674. null,
  15675. null
  15676. )
  15677. /* hot reload */
  15678. if (false) { var year_table_api; }
  15679. year_table_component.options.__file = "packages/date-picker/src/basic/year-table.vue"
  15680. /* harmony default export */ var year_table = (year_table_component.exports);
  15681. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/basic/month-table.vue?vue&type=template&id=654d4f42&
  15682. var month_tablevue_type_template_id_654d4f42_render = function() {
  15683. var _vm = this
  15684. var _h = _vm.$createElement
  15685. var _c = _vm._self._c || _h
  15686. return _c(
  15687. "table",
  15688. {
  15689. staticClass: "el-month-table",
  15690. on: { click: _vm.handleMonthTableClick, mousemove: _vm.handleMouseMove }
  15691. },
  15692. [
  15693. _c(
  15694. "tbody",
  15695. _vm._l(_vm.rows, function(row, key) {
  15696. return _c(
  15697. "tr",
  15698. { key: key },
  15699. _vm._l(row, function(cell, key) {
  15700. return _c("td", { key: key, class: _vm.getCellStyle(cell) }, [
  15701. _c("div", [
  15702. _c("a", { staticClass: "cell" }, [
  15703. _vm._v(
  15704. _vm._s(
  15705. _vm.t("el.datepicker.months." + _vm.months[cell.text])
  15706. )
  15707. )
  15708. ])
  15709. ])
  15710. ])
  15711. }),
  15712. 0
  15713. )
  15714. }),
  15715. 0
  15716. )
  15717. ]
  15718. )
  15719. }
  15720. var month_tablevue_type_template_id_654d4f42_staticRenderFns = []
  15721. month_tablevue_type_template_id_654d4f42_render._withStripped = true
  15722. // CONCATENATED MODULE: ./packages/date-picker/src/basic/month-table.vue?vue&type=template&id=654d4f42&
  15723. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/basic/month-table.vue?vue&type=script&lang=js&
  15724. //
  15725. //
  15726. //
  15727. //
  15728. //
  15729. //
  15730. //
  15731. //
  15732. //
  15733. //
  15734. //
  15735. //
  15736. //
  15737. //
  15738. var month_tablevue_type_script_lang_js_datesInMonth = function datesInMonth(year, month) {
  15739. var numOfDays = Object(date_util_["getDayCountOfMonth"])(year, month);
  15740. var firstDay = new Date(year, month, 1);
  15741. return Object(date_util_["range"])(numOfDays).map(function (n) {
  15742. return Object(date_util_["nextDate"])(firstDay, n);
  15743. });
  15744. };
  15745. var clearDate = function clearDate(date) {
  15746. return new Date(date.getFullYear(), date.getMonth());
  15747. };
  15748. var getMonthTimestamp = function getMonthTimestamp(time) {
  15749. if (typeof time === 'number' || typeof time === 'string') {
  15750. return clearDate(new Date(time)).getTime();
  15751. } else if (time instanceof Date) {
  15752. return clearDate(time).getTime();
  15753. } else {
  15754. return NaN;
  15755. }
  15756. };
  15757. // remove the first element that satisfies `pred` from arr
  15758. // return a new array if modification occurs
  15759. // return the original array otherwise
  15760. var month_tablevue_type_script_lang_js_removeFromArray = function removeFromArray(arr, pred) {
  15761. var idx = typeof pred === 'function' ? Object(util_["arrayFindIndex"])(arr, pred) : arr.indexOf(pred);
  15762. return idx >= 0 ? [].concat(arr.slice(0, idx), arr.slice(idx + 1)) : arr;
  15763. };
  15764. /* harmony default export */ var month_tablevue_type_script_lang_js_ = ({
  15765. props: {
  15766. disabledDate: {},
  15767. value: {},
  15768. selectionMode: {
  15769. default: 'month'
  15770. },
  15771. minDate: {},
  15772. maxDate: {},
  15773. defaultValue: {
  15774. validator: function validator(val) {
  15775. // null or valid Date Object
  15776. return val === null || Object(date_util_["isDate"])(val) || Array.isArray(val) && val.every(date_util_["isDate"]);
  15777. }
  15778. },
  15779. date: {},
  15780. rangeState: {
  15781. default: function _default() {
  15782. return {
  15783. endDate: null,
  15784. selecting: false
  15785. };
  15786. }
  15787. }
  15788. },
  15789. mixins: [locale_default.a],
  15790. watch: {
  15791. 'rangeState.endDate': function rangeStateEndDate(newVal) {
  15792. this.markRange(this.minDate, newVal);
  15793. },
  15794. minDate: function minDate(newVal, oldVal) {
  15795. if (getMonthTimestamp(newVal) !== getMonthTimestamp(oldVal)) {
  15796. this.markRange(this.minDate, this.maxDate);
  15797. }
  15798. },
  15799. maxDate: function maxDate(newVal, oldVal) {
  15800. if (getMonthTimestamp(newVal) !== getMonthTimestamp(oldVal)) {
  15801. this.markRange(this.minDate, this.maxDate);
  15802. }
  15803. }
  15804. },
  15805. data: function data() {
  15806. return {
  15807. months: ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'],
  15808. tableRows: [[], [], []],
  15809. lastRow: null,
  15810. lastColumn: null
  15811. };
  15812. },
  15813. methods: {
  15814. cellMatchesDate: function cellMatchesDate(cell, date) {
  15815. var value = new Date(date);
  15816. return this.date.getFullYear() === value.getFullYear() && Number(cell.text) === value.getMonth();
  15817. },
  15818. getCellStyle: function getCellStyle(cell) {
  15819. var _this = this;
  15820. var style = {};
  15821. var year = this.date.getFullYear();
  15822. var today = new Date();
  15823. var month = cell.text;
  15824. var defaultValue = this.defaultValue ? Array.isArray(this.defaultValue) ? this.defaultValue : [this.defaultValue] : [];
  15825. style.disabled = typeof this.disabledDate === 'function' ? month_tablevue_type_script_lang_js_datesInMonth(year, month).every(this.disabledDate) : false;
  15826. style.current = Object(util_["arrayFindIndex"])(Object(util_["coerceTruthyValueToArray"])(this.value), function (date) {
  15827. return date.getFullYear() === year && date.getMonth() === month;
  15828. }) >= 0;
  15829. style.today = today.getFullYear() === year && today.getMonth() === month;
  15830. style.default = defaultValue.some(function (date) {
  15831. return _this.cellMatchesDate(cell, date);
  15832. });
  15833. if (cell.inRange) {
  15834. style['in-range'] = true;
  15835. if (cell.start) {
  15836. style['start-date'] = true;
  15837. }
  15838. if (cell.end) {
  15839. style['end-date'] = true;
  15840. }
  15841. }
  15842. return style;
  15843. },
  15844. getMonthOfCell: function getMonthOfCell(month) {
  15845. var year = this.date.getFullYear();
  15846. return new Date(year, month, 1);
  15847. },
  15848. markRange: function markRange(minDate, maxDate) {
  15849. minDate = getMonthTimestamp(minDate);
  15850. maxDate = getMonthTimestamp(maxDate) || minDate;
  15851. var _ref = [Math.min(minDate, maxDate), Math.max(minDate, maxDate)];
  15852. minDate = _ref[0];
  15853. maxDate = _ref[1];
  15854. var rows = this.rows;
  15855. for (var i = 0, k = rows.length; i < k; i++) {
  15856. var row = rows[i];
  15857. for (var j = 0, l = row.length; j < l; j++) {
  15858. var cell = row[j];
  15859. var index = i * 4 + j;
  15860. var time = new Date(this.date.getFullYear(), index).getTime();
  15861. cell.inRange = minDate && time >= minDate && time <= maxDate;
  15862. cell.start = minDate && time === minDate;
  15863. cell.end = maxDate && time === maxDate;
  15864. }
  15865. }
  15866. },
  15867. handleMouseMove: function handleMouseMove(event) {
  15868. if (!this.rangeState.selecting) return;
  15869. var target = event.target;
  15870. if (target.tagName === 'A') {
  15871. target = target.parentNode.parentNode;
  15872. }
  15873. if (target.tagName === 'DIV') {
  15874. target = target.parentNode;
  15875. }
  15876. if (target.tagName !== 'TD') return;
  15877. var row = target.parentNode.rowIndex;
  15878. var column = target.cellIndex;
  15879. // can not select disabled date
  15880. if (this.rows[row][column].disabled) return;
  15881. // only update rangeState when mouse moves to a new cell
  15882. // this avoids frequent Date object creation and improves performance
  15883. if (row !== this.lastRow || column !== this.lastColumn) {
  15884. this.lastRow = row;
  15885. this.lastColumn = column;
  15886. this.$emit('changerange', {
  15887. minDate: this.minDate,
  15888. maxDate: this.maxDate,
  15889. rangeState: {
  15890. selecting: true,
  15891. endDate: this.getMonthOfCell(row * 4 + column)
  15892. }
  15893. });
  15894. }
  15895. },
  15896. handleMonthTableClick: function handleMonthTableClick(event) {
  15897. var target = event.target;
  15898. if (target.tagName === 'A') {
  15899. target = target.parentNode.parentNode;
  15900. }
  15901. if (target.tagName === 'DIV') {
  15902. target = target.parentNode;
  15903. }
  15904. if (target.tagName !== 'TD') return;
  15905. if (Object(dom_["hasClass"])(target, 'disabled')) return;
  15906. var column = target.cellIndex;
  15907. var row = target.parentNode.rowIndex;
  15908. var month = row * 4 + column;
  15909. var newDate = this.getMonthOfCell(month);
  15910. if (this.selectionMode === 'range') {
  15911. if (!this.rangeState.selecting) {
  15912. this.$emit('pick', { minDate: newDate, maxDate: null });
  15913. this.rangeState.selecting = true;
  15914. } else {
  15915. if (newDate >= this.minDate) {
  15916. this.$emit('pick', { minDate: this.minDate, maxDate: newDate });
  15917. } else {
  15918. this.$emit('pick', { minDate: newDate, maxDate: this.minDate });
  15919. }
  15920. this.rangeState.selecting = false;
  15921. }
  15922. } else if (this.selectionMode === 'months') {
  15923. var value = this.value || [];
  15924. var year = this.date.getFullYear();
  15925. var newValue = Object(util_["arrayFindIndex"])(value, function (date) {
  15926. return date.getFullYear() === year && date.getMonth() === month;
  15927. }) >= 0 ? month_tablevue_type_script_lang_js_removeFromArray(value, function (date) {
  15928. return date.getTime() === newDate.getTime();
  15929. }) : [].concat(value, [newDate]);
  15930. this.$emit('pick', newValue);
  15931. } else {
  15932. this.$emit('pick', month);
  15933. }
  15934. }
  15935. },
  15936. computed: {
  15937. rows: function rows() {
  15938. var _this2 = this;
  15939. // TODO: refactory rows / getCellClasses
  15940. var rows = this.tableRows;
  15941. var disabledDate = this.disabledDate;
  15942. var selectedDate = [];
  15943. var now = getMonthTimestamp(new Date());
  15944. for (var i = 0; i < 3; i++) {
  15945. var row = rows[i];
  15946. var _loop = function _loop(j) {
  15947. var cell = row[j];
  15948. if (!cell) {
  15949. cell = { row: i, column: j, type: 'normal', inRange: false, start: false, end: false };
  15950. }
  15951. cell.type = 'normal';
  15952. var index = i * 4 + j;
  15953. var time = new Date(_this2.date.getFullYear(), index).getTime();
  15954. cell.inRange = time >= getMonthTimestamp(_this2.minDate) && time <= getMonthTimestamp(_this2.maxDate);
  15955. cell.start = _this2.minDate && time === getMonthTimestamp(_this2.minDate);
  15956. cell.end = _this2.maxDate && time === getMonthTimestamp(_this2.maxDate);
  15957. var isToday = time === now;
  15958. if (isToday) {
  15959. cell.type = 'today';
  15960. }
  15961. cell.text = index;
  15962. var cellDate = new Date(time);
  15963. cell.disabled = typeof disabledDate === 'function' && disabledDate(cellDate);
  15964. cell.selected = Object(util_["arrayFind"])(selectedDate, function (date) {
  15965. return date.getTime() === cellDate.getTime();
  15966. });
  15967. _this2.$set(row, j, cell);
  15968. };
  15969. for (var j = 0; j < 4; j++) {
  15970. _loop(j);
  15971. }
  15972. }
  15973. return rows;
  15974. }
  15975. }
  15976. });
  15977. // CONCATENATED MODULE: ./packages/date-picker/src/basic/month-table.vue?vue&type=script&lang=js&
  15978. /* harmony default export */ var basic_month_tablevue_type_script_lang_js_ = (month_tablevue_type_script_lang_js_);
  15979. // CONCATENATED MODULE: ./packages/date-picker/src/basic/month-table.vue
  15980. /* normalize component */
  15981. var month_table_component = normalizeComponent(
  15982. basic_month_tablevue_type_script_lang_js_,
  15983. month_tablevue_type_template_id_654d4f42_render,
  15984. month_tablevue_type_template_id_654d4f42_staticRenderFns,
  15985. false,
  15986. null,
  15987. null,
  15988. null
  15989. )
  15990. /* hot reload */
  15991. if (false) { var month_table_api; }
  15992. month_table_component.options.__file = "packages/date-picker/src/basic/month-table.vue"
  15993. /* harmony default export */ var month_table = (month_table_component.exports);
  15994. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/basic/date-table.vue?vue&type=template&id=5d1f3341&
  15995. var date_tablevue_type_template_id_5d1f3341_render = function() {
  15996. var _vm = this
  15997. var _h = _vm.$createElement
  15998. var _c = _vm._self._c || _h
  15999. return _c(
  16000. "table",
  16001. {
  16002. staticClass: "el-date-table",
  16003. class: { "is-week-mode": _vm.selectionMode === "week" },
  16004. attrs: { cellspacing: "0", cellpadding: "0" },
  16005. on: { click: _vm.handleClick, mousemove: _vm.handleMouseMove }
  16006. },
  16007. [
  16008. _c(
  16009. "tbody",
  16010. [
  16011. _c(
  16012. "tr",
  16013. [
  16014. _vm.showWeekNumber
  16015. ? _c("th", [_vm._v(_vm._s(_vm.t("el.datepicker.week")))])
  16016. : _vm._e(),
  16017. _vm._l(_vm.WEEKS, function(week, key) {
  16018. return _c("th", { key: key }, [
  16019. _vm._v(_vm._s(_vm.t("el.datepicker.weeks." + week)))
  16020. ])
  16021. })
  16022. ],
  16023. 2
  16024. ),
  16025. _vm._l(_vm.rows, function(row, key) {
  16026. return _c(
  16027. "tr",
  16028. {
  16029. key: key,
  16030. staticClass: "el-date-table__row",
  16031. class: { current: _vm.isWeekActive(row[1]) }
  16032. },
  16033. _vm._l(row, function(cell, key) {
  16034. return _c("td", { key: key, class: _vm.getCellClasses(cell) }, [
  16035. _c("div", [
  16036. _c("span", [
  16037. _vm._v("\n " + _vm._s(cell.text) + "\n ")
  16038. ])
  16039. ])
  16040. ])
  16041. }),
  16042. 0
  16043. )
  16044. })
  16045. ],
  16046. 2
  16047. )
  16048. ]
  16049. )
  16050. }
  16051. var date_tablevue_type_template_id_5d1f3341_staticRenderFns = []
  16052. date_tablevue_type_template_id_5d1f3341_render._withStripped = true
  16053. // CONCATENATED MODULE: ./packages/date-picker/src/basic/date-table.vue?vue&type=template&id=5d1f3341&
  16054. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/basic/date-table.vue?vue&type=script&lang=js&
  16055. //
  16056. //
  16057. //
  16058. //
  16059. //
  16060. //
  16061. //
  16062. //
  16063. //
  16064. //
  16065. //
  16066. //
  16067. //
  16068. //
  16069. //
  16070. //
  16071. //
  16072. //
  16073. //
  16074. //
  16075. //
  16076. //
  16077. //
  16078. //
  16079. //
  16080. //
  16081. //
  16082. //
  16083. //
  16084. //
  16085. //
  16086. //
  16087. //
  16088. var _WEEKS = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];
  16089. var date_tablevue_type_script_lang_js_getDateTimestamp = function getDateTimestamp(time) {
  16090. if (typeof time === 'number' || typeof time === 'string') {
  16091. return Object(date_util_["clearTime"])(new Date(time)).getTime();
  16092. } else if (time instanceof Date) {
  16093. return Object(date_util_["clearTime"])(time).getTime();
  16094. } else {
  16095. return NaN;
  16096. }
  16097. };
  16098. // remove the first element that satisfies `pred` from arr
  16099. // return a new array if modification occurs
  16100. // return the original array otherwise
  16101. var date_tablevue_type_script_lang_js_removeFromArray = function removeFromArray(arr, pred) {
  16102. var idx = typeof pred === 'function' ? Object(util_["arrayFindIndex"])(arr, pred) : arr.indexOf(pred);
  16103. return idx >= 0 ? [].concat(arr.slice(0, idx), arr.slice(idx + 1)) : arr;
  16104. };
  16105. /* harmony default export */ var date_tablevue_type_script_lang_js_ = ({
  16106. mixins: [locale_default.a],
  16107. props: {
  16108. firstDayOfWeek: {
  16109. default: 7,
  16110. type: Number,
  16111. validator: function validator(val) {
  16112. return val >= 1 && val <= 7;
  16113. }
  16114. },
  16115. value: {},
  16116. defaultValue: {
  16117. validator: function validator(val) {
  16118. // either: null, valid Date object, Array of valid Date objects
  16119. return val === null || Object(date_util_["isDate"])(val) || Array.isArray(val) && val.every(date_util_["isDate"]);
  16120. }
  16121. },
  16122. date: {},
  16123. selectionMode: {
  16124. default: 'day'
  16125. },
  16126. showWeekNumber: {
  16127. type: Boolean,
  16128. default: false
  16129. },
  16130. disabledDate: {},
  16131. cellClassName: {},
  16132. minDate: {},
  16133. maxDate: {},
  16134. rangeState: {
  16135. default: function _default() {
  16136. return {
  16137. endDate: null,
  16138. selecting: false
  16139. };
  16140. }
  16141. }
  16142. },
  16143. computed: {
  16144. offsetDay: function offsetDay() {
  16145. var week = this.firstDayOfWeek;
  16146. // 周日为界限,左右偏移的天数,3217654 例如周一就是 -1,目的是调整前两行日期的位置
  16147. return week > 3 ? 7 - week : -week;
  16148. },
  16149. WEEKS: function WEEKS() {
  16150. var week = this.firstDayOfWeek;
  16151. return _WEEKS.concat(_WEEKS).slice(week, week + 7);
  16152. },
  16153. year: function year() {
  16154. return this.date.getFullYear();
  16155. },
  16156. month: function month() {
  16157. return this.date.getMonth();
  16158. },
  16159. startDate: function startDate() {
  16160. return Object(date_util_["getStartDateOfMonth"])(this.year, this.month);
  16161. },
  16162. rows: function rows() {
  16163. var _this = this;
  16164. // TODO: refactory rows / getCellClasses
  16165. var date = new Date(this.year, this.month, 1);
  16166. var day = Object(date_util_["getFirstDayOfMonth"])(date); // day of first day
  16167. var dateCountOfMonth = Object(date_util_["getDayCountOfMonth"])(date.getFullYear(), date.getMonth());
  16168. var dateCountOfLastMonth = Object(date_util_["getDayCountOfMonth"])(date.getFullYear(), date.getMonth() === 0 ? 11 : date.getMonth() - 1);
  16169. day = day === 0 ? 7 : day;
  16170. var offset = this.offsetDay;
  16171. var rows = this.tableRows;
  16172. var count = 1;
  16173. var startDate = this.startDate;
  16174. var disabledDate = this.disabledDate;
  16175. var cellClassName = this.cellClassName;
  16176. var selectedDate = this.selectionMode === 'dates' ? Object(util_["coerceTruthyValueToArray"])(this.value) : [];
  16177. var now = date_tablevue_type_script_lang_js_getDateTimestamp(new Date());
  16178. for (var i = 0; i < 6; i++) {
  16179. var row = rows[i];
  16180. if (this.showWeekNumber) {
  16181. if (!row[0]) {
  16182. row[0] = { type: 'week', text: Object(date_util_["getWeekNumber"])(Object(date_util_["nextDate"])(startDate, i * 7 + 1)) };
  16183. }
  16184. }
  16185. var _loop = function _loop(j) {
  16186. var cell = row[_this.showWeekNumber ? j + 1 : j];
  16187. if (!cell) {
  16188. cell = { row: i, column: j, type: 'normal', inRange: false, start: false, end: false };
  16189. }
  16190. cell.type = 'normal';
  16191. var index = i * 7 + j;
  16192. var time = Object(date_util_["nextDate"])(startDate, index - offset).getTime();
  16193. cell.inRange = time >= date_tablevue_type_script_lang_js_getDateTimestamp(_this.minDate) && time <= date_tablevue_type_script_lang_js_getDateTimestamp(_this.maxDate);
  16194. cell.start = _this.minDate && time === date_tablevue_type_script_lang_js_getDateTimestamp(_this.minDate);
  16195. cell.end = _this.maxDate && time === date_tablevue_type_script_lang_js_getDateTimestamp(_this.maxDate);
  16196. var isToday = time === now;
  16197. if (isToday) {
  16198. cell.type = 'today';
  16199. }
  16200. if (i >= 0 && i <= 1) {
  16201. var numberOfDaysFromPreviousMonth = day + offset < 0 ? 7 + day + offset : day + offset;
  16202. if (j + i * 7 >= numberOfDaysFromPreviousMonth) {
  16203. cell.text = count++;
  16204. } else {
  16205. cell.text = dateCountOfLastMonth - (numberOfDaysFromPreviousMonth - j % 7) + 1 + i * 7;
  16206. cell.type = 'prev-month';
  16207. }
  16208. } else {
  16209. if (count <= dateCountOfMonth) {
  16210. cell.text = count++;
  16211. } else {
  16212. cell.text = count++ - dateCountOfMonth;
  16213. cell.type = 'next-month';
  16214. }
  16215. }
  16216. var cellDate = new Date(time);
  16217. cell.disabled = typeof disabledDate === 'function' && disabledDate(cellDate);
  16218. cell.selected = Object(util_["arrayFind"])(selectedDate, function (date) {
  16219. return date.getTime() === cellDate.getTime();
  16220. });
  16221. cell.customClass = typeof cellClassName === 'function' && cellClassName(cellDate);
  16222. _this.$set(row, _this.showWeekNumber ? j + 1 : j, cell);
  16223. };
  16224. for (var j = 0; j < 7; j++) {
  16225. _loop(j);
  16226. }
  16227. if (this.selectionMode === 'week') {
  16228. var start = this.showWeekNumber ? 1 : 0;
  16229. var end = this.showWeekNumber ? 7 : 6;
  16230. var isWeekActive = this.isWeekActive(row[start + 1]);
  16231. row[start].inRange = isWeekActive;
  16232. row[start].start = isWeekActive;
  16233. row[end].inRange = isWeekActive;
  16234. row[end].end = isWeekActive;
  16235. }
  16236. }
  16237. return rows;
  16238. }
  16239. },
  16240. watch: {
  16241. 'rangeState.endDate': function rangeStateEndDate(newVal) {
  16242. this.markRange(this.minDate, newVal);
  16243. },
  16244. minDate: function minDate(newVal, oldVal) {
  16245. if (date_tablevue_type_script_lang_js_getDateTimestamp(newVal) !== date_tablevue_type_script_lang_js_getDateTimestamp(oldVal)) {
  16246. this.markRange(this.minDate, this.maxDate);
  16247. }
  16248. },
  16249. maxDate: function maxDate(newVal, oldVal) {
  16250. if (date_tablevue_type_script_lang_js_getDateTimestamp(newVal) !== date_tablevue_type_script_lang_js_getDateTimestamp(oldVal)) {
  16251. this.markRange(this.minDate, this.maxDate);
  16252. }
  16253. }
  16254. },
  16255. data: function data() {
  16256. return {
  16257. tableRows: [[], [], [], [], [], []],
  16258. lastRow: null,
  16259. lastColumn: null
  16260. };
  16261. },
  16262. methods: {
  16263. cellMatchesDate: function cellMatchesDate(cell, date) {
  16264. var value = new Date(date);
  16265. return this.year === value.getFullYear() && this.month === value.getMonth() && Number(cell.text) === value.getDate();
  16266. },
  16267. getCellClasses: function getCellClasses(cell) {
  16268. var _this2 = this;
  16269. var selectionMode = this.selectionMode;
  16270. var defaultValue = this.defaultValue ? Array.isArray(this.defaultValue) ? this.defaultValue : [this.defaultValue] : [];
  16271. var classes = [];
  16272. if ((cell.type === 'normal' || cell.type === 'today') && !cell.disabled) {
  16273. classes.push('available');
  16274. if (cell.type === 'today') {
  16275. classes.push('today');
  16276. }
  16277. } else {
  16278. classes.push(cell.type);
  16279. }
  16280. if (cell.type === 'normal' && defaultValue.some(function (date) {
  16281. return _this2.cellMatchesDate(cell, date);
  16282. })) {
  16283. classes.push('default');
  16284. }
  16285. if (selectionMode === 'day' && (cell.type === 'normal' || cell.type === 'today') && this.cellMatchesDate(cell, this.value)) {
  16286. classes.push('current');
  16287. }
  16288. if (cell.inRange && (cell.type === 'normal' || cell.type === 'today' || this.selectionMode === 'week')) {
  16289. classes.push('in-range');
  16290. if (cell.start) {
  16291. classes.push('start-date');
  16292. }
  16293. if (cell.end) {
  16294. classes.push('end-date');
  16295. }
  16296. }
  16297. if (cell.disabled) {
  16298. classes.push('disabled');
  16299. }
  16300. if (cell.selected) {
  16301. classes.push('selected');
  16302. }
  16303. if (cell.customClass) {
  16304. classes.push(cell.customClass);
  16305. }
  16306. return classes.join(' ');
  16307. },
  16308. getDateOfCell: function getDateOfCell(row, column) {
  16309. var offsetFromStart = row * 7 + (column - (this.showWeekNumber ? 1 : 0)) - this.offsetDay;
  16310. return Object(date_util_["nextDate"])(this.startDate, offsetFromStart);
  16311. },
  16312. isWeekActive: function isWeekActive(cell) {
  16313. if (this.selectionMode !== 'week') return false;
  16314. var newDate = new Date(this.year, this.month, 1);
  16315. var year = newDate.getFullYear();
  16316. var month = newDate.getMonth();
  16317. if (cell.type === 'prev-month') {
  16318. newDate.setMonth(month === 0 ? 11 : month - 1);
  16319. newDate.setFullYear(month === 0 ? year - 1 : year);
  16320. }
  16321. if (cell.type === 'next-month') {
  16322. newDate.setMonth(month === 11 ? 0 : month + 1);
  16323. newDate.setFullYear(month === 11 ? year + 1 : year);
  16324. }
  16325. newDate.setDate(parseInt(cell.text, 10));
  16326. if (Object(date_util_["isDate"])(this.value)) {
  16327. var dayOffset = (this.value.getDay() - this.firstDayOfWeek + 7) % 7 - 1;
  16328. var weekDate = Object(date_util_["prevDate"])(this.value, dayOffset);
  16329. return weekDate.getTime() === newDate.getTime();
  16330. }
  16331. return false;
  16332. },
  16333. markRange: function markRange(minDate, maxDate) {
  16334. minDate = date_tablevue_type_script_lang_js_getDateTimestamp(minDate);
  16335. maxDate = date_tablevue_type_script_lang_js_getDateTimestamp(maxDate) || minDate;
  16336. var _ref = [Math.min(minDate, maxDate), Math.max(minDate, maxDate)];
  16337. minDate = _ref[0];
  16338. maxDate = _ref[1];
  16339. var startDate = this.startDate;
  16340. var rows = this.rows;
  16341. for (var i = 0, k = rows.length; i < k; i++) {
  16342. var row = rows[i];
  16343. for (var j = 0, l = row.length; j < l; j++) {
  16344. if (this.showWeekNumber && j === 0) continue;
  16345. var _cell = row[j];
  16346. var index = i * 7 + j + (this.showWeekNumber ? -1 : 0);
  16347. var time = Object(date_util_["nextDate"])(startDate, index - this.offsetDay).getTime();
  16348. _cell.inRange = minDate && time >= minDate && time <= maxDate;
  16349. _cell.start = minDate && time === minDate;
  16350. _cell.end = maxDate && time === maxDate;
  16351. }
  16352. }
  16353. },
  16354. handleMouseMove: function handleMouseMove(event) {
  16355. if (!this.rangeState.selecting) return;
  16356. var target = event.target;
  16357. if (target.tagName === 'SPAN') {
  16358. target = target.parentNode.parentNode;
  16359. }
  16360. if (target.tagName === 'DIV') {
  16361. target = target.parentNode;
  16362. }
  16363. if (target.tagName !== 'TD') return;
  16364. var row = target.parentNode.rowIndex - 1;
  16365. var column = target.cellIndex;
  16366. // can not select disabled date
  16367. if (this.rows[row][column].disabled) return;
  16368. // only update rangeState when mouse moves to a new cell
  16369. // this avoids frequent Date object creation and improves performance
  16370. if (row !== this.lastRow || column !== this.lastColumn) {
  16371. this.lastRow = row;
  16372. this.lastColumn = column;
  16373. this.$emit('changerange', {
  16374. minDate: this.minDate,
  16375. maxDate: this.maxDate,
  16376. rangeState: {
  16377. selecting: true,
  16378. endDate: this.getDateOfCell(row, column)
  16379. }
  16380. });
  16381. }
  16382. },
  16383. handleClick: function handleClick(event) {
  16384. var target = event.target;
  16385. if (target.tagName === 'SPAN') {
  16386. target = target.parentNode.parentNode;
  16387. }
  16388. if (target.tagName === 'DIV') {
  16389. target = target.parentNode;
  16390. }
  16391. if (target.tagName !== 'TD') return;
  16392. var row = target.parentNode.rowIndex - 1;
  16393. var column = this.selectionMode === 'week' ? 1 : target.cellIndex;
  16394. var cell = this.rows[row][column];
  16395. if (cell.disabled || cell.type === 'week') return;
  16396. var newDate = this.getDateOfCell(row, column);
  16397. if (this.selectionMode === 'range') {
  16398. if (!this.rangeState.selecting) {
  16399. this.$emit('pick', { minDate: newDate, maxDate: null });
  16400. this.rangeState.selecting = true;
  16401. } else {
  16402. if (newDate >= this.minDate) {
  16403. this.$emit('pick', { minDate: this.minDate, maxDate: newDate });
  16404. } else {
  16405. this.$emit('pick', { minDate: newDate, maxDate: this.minDate });
  16406. }
  16407. this.rangeState.selecting = false;
  16408. }
  16409. } else if (this.selectionMode === 'day') {
  16410. this.$emit('pick', newDate);
  16411. } else if (this.selectionMode === 'week') {
  16412. var weekNumber = Object(date_util_["getWeekNumber"])(newDate);
  16413. var value = newDate.getFullYear() + 'w' + weekNumber;
  16414. this.$emit('pick', {
  16415. year: newDate.getFullYear(),
  16416. week: weekNumber,
  16417. value: value,
  16418. date: newDate
  16419. });
  16420. } else if (this.selectionMode === 'dates') {
  16421. var _value = this.value || [];
  16422. var newValue = cell.selected ? date_tablevue_type_script_lang_js_removeFromArray(_value, function (date) {
  16423. return date.getTime() === newDate.getTime();
  16424. }) : [].concat(_value, [newDate]);
  16425. this.$emit('pick', newValue);
  16426. }
  16427. }
  16428. }
  16429. });
  16430. // CONCATENATED MODULE: ./packages/date-picker/src/basic/date-table.vue?vue&type=script&lang=js&
  16431. /* harmony default export */ var basic_date_tablevue_type_script_lang_js_ = (date_tablevue_type_script_lang_js_);
  16432. // CONCATENATED MODULE: ./packages/date-picker/src/basic/date-table.vue
  16433. /* normalize component */
  16434. var date_table_component = normalizeComponent(
  16435. basic_date_tablevue_type_script_lang_js_,
  16436. date_tablevue_type_template_id_5d1f3341_render,
  16437. date_tablevue_type_template_id_5d1f3341_staticRenderFns,
  16438. false,
  16439. null,
  16440. null,
  16441. null
  16442. )
  16443. /* hot reload */
  16444. if (false) { var date_table_api; }
  16445. date_table_component.options.__file = "packages/date-picker/src/basic/date-table.vue"
  16446. /* harmony default export */ var date_table = (date_table_component.exports);
  16447. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/panel/date.vue?vue&type=script&lang=js&
  16448. //
  16449. //
  16450. //
  16451. //
  16452. //
  16453. //
  16454. //
  16455. //
  16456. //
  16457. //
  16458. //
  16459. //
  16460. //
  16461. //
  16462. //
  16463. //
  16464. //
  16465. //
  16466. //
  16467. //
  16468. //
  16469. //
  16470. //
  16471. //
  16472. //
  16473. //
  16474. //
  16475. //
  16476. //
  16477. //
  16478. //
  16479. //
  16480. //
  16481. //
  16482. //
  16483. //
  16484. //
  16485. //
  16486. //
  16487. //
  16488. //
  16489. //
  16490. //
  16491. //
  16492. //
  16493. //
  16494. //
  16495. //
  16496. //
  16497. //
  16498. //
  16499. //
  16500. //
  16501. //
  16502. //
  16503. //
  16504. //
  16505. //
  16506. //
  16507. //
  16508. //
  16509. //
  16510. //
  16511. //
  16512. //
  16513. //
  16514. //
  16515. //
  16516. //
  16517. //
  16518. //
  16519. //
  16520. //
  16521. //
  16522. //
  16523. //
  16524. //
  16525. //
  16526. //
  16527. //
  16528. //
  16529. //
  16530. //
  16531. //
  16532. //
  16533. //
  16534. //
  16535. //
  16536. //
  16537. //
  16538. //
  16539. //
  16540. //
  16541. //
  16542. //
  16543. //
  16544. //
  16545. //
  16546. //
  16547. //
  16548. //
  16549. //
  16550. //
  16551. //
  16552. //
  16553. //
  16554. //
  16555. //
  16556. //
  16557. //
  16558. //
  16559. //
  16560. //
  16561. //
  16562. //
  16563. //
  16564. //
  16565. //
  16566. //
  16567. //
  16568. //
  16569. //
  16570. //
  16571. //
  16572. //
  16573. //
  16574. //
  16575. //
  16576. //
  16577. //
  16578. //
  16579. //
  16580. //
  16581. //
  16582. //
  16583. //
  16584. //
  16585. //
  16586. //
  16587. //
  16588. //
  16589. //
  16590. //
  16591. //
  16592. //
  16593. //
  16594. /* harmony default export */ var datevue_type_script_lang_js_ = ({
  16595. mixins: [locale_default.a],
  16596. directives: { Clickoutside: clickoutside_default.a },
  16597. watch: {
  16598. showTime: function showTime(val) {
  16599. var _this = this;
  16600. /* istanbul ignore if */
  16601. if (!val) return;
  16602. this.$nextTick(function (_) {
  16603. var inputElm = _this.$refs.input.$el;
  16604. if (inputElm) {
  16605. _this.pickerWidth = inputElm.getBoundingClientRect().width + 10;
  16606. }
  16607. });
  16608. },
  16609. value: function value(val) {
  16610. if (this.selectionMode === 'dates' && this.value) return;
  16611. if (this.selectionMode === 'months' && this.value) return;
  16612. if (this.selectionMode === 'years' && this.value) return;
  16613. if (Object(date_util_["isDate"])(val)) {
  16614. this.date = new Date(val);
  16615. } else {
  16616. this.date = this.getDefaultValue();
  16617. }
  16618. },
  16619. defaultValue: function defaultValue(val) {
  16620. if (!Object(date_util_["isDate"])(this.value)) {
  16621. this.date = val ? new Date(val) : new Date();
  16622. }
  16623. },
  16624. timePickerVisible: function timePickerVisible(val) {
  16625. var _this2 = this;
  16626. if (val) this.$nextTick(function () {
  16627. return _this2.$refs.timepicker.adjustSpinners();
  16628. });
  16629. },
  16630. selectionMode: function selectionMode(newVal) {
  16631. if (newVal === 'month') {
  16632. /* istanbul ignore next */
  16633. if (this.currentView !== 'year' || this.currentView !== 'month') {
  16634. this.currentView = 'month';
  16635. }
  16636. } else if (newVal === 'dates') {
  16637. this.currentView = 'date';
  16638. } else if (newVal === 'years') {
  16639. this.currentView = 'year';
  16640. } else if (newVal === 'months') {
  16641. this.currentView = 'month';
  16642. }
  16643. }
  16644. },
  16645. methods: {
  16646. proxyTimePickerDataProperties: function proxyTimePickerDataProperties() {
  16647. var _this3 = this;
  16648. var format = function format(timeFormat) {
  16649. _this3.$refs.timepicker.format = timeFormat;
  16650. };
  16651. var value = function value(_value) {
  16652. _this3.$refs.timepicker.value = _value;
  16653. };
  16654. var date = function date(_date) {
  16655. _this3.$refs.timepicker.date = _date;
  16656. };
  16657. var selectableRange = function selectableRange(_selectableRange) {
  16658. _this3.$refs.timepicker.selectableRange = _selectableRange;
  16659. };
  16660. this.$watch('value', value);
  16661. this.$watch('date', date);
  16662. this.$watch('selectableRange', selectableRange);
  16663. format(this.timeFormat);
  16664. value(this.value);
  16665. date(this.date);
  16666. selectableRange(this.selectableRange);
  16667. },
  16668. handleClear: function handleClear() {
  16669. this.date = this.getDefaultValue();
  16670. this.$emit('pick', null);
  16671. },
  16672. emit: function emit(value) {
  16673. var _this4 = this;
  16674. for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  16675. args[_key - 1] = arguments[_key];
  16676. }
  16677. if (!value) {
  16678. this.$emit.apply(this, ['pick', value].concat(args));
  16679. } else if (Array.isArray(value)) {
  16680. var dates = value.map(function (date) {
  16681. return _this4.showTime ? Object(date_util_["clearMilliseconds"])(date) : Object(date_util_["clearTime"])(date);
  16682. });
  16683. this.$emit.apply(this, ['pick', dates].concat(args));
  16684. } else {
  16685. this.$emit.apply(this, ['pick', this.showTime ? Object(date_util_["clearMilliseconds"])(value) : Object(date_util_["clearTime"])(value)].concat(args));
  16686. }
  16687. this.userInputDate = null;
  16688. this.userInputTime = null;
  16689. },
  16690. // resetDate() {
  16691. // this.date = new Date(this.date);
  16692. // },
  16693. showMonthPicker: function showMonthPicker() {
  16694. this.currentView = 'month';
  16695. },
  16696. showYearPicker: function showYearPicker() {
  16697. this.currentView = 'year';
  16698. },
  16699. // XXX: 没用到
  16700. // handleLabelClick() {
  16701. // if (this.currentView === 'date') {
  16702. // this.showMonthPicker();
  16703. // } else if (this.currentView === 'month') {
  16704. // this.showYearPicker();
  16705. // }
  16706. // },
  16707. prevMonth: function prevMonth() {
  16708. this.date = Object(date_util_["prevMonth"])(this.date);
  16709. },
  16710. nextMonth: function nextMonth() {
  16711. this.date = Object(date_util_["nextMonth"])(this.date);
  16712. },
  16713. prevYear: function prevYear() {
  16714. if (this.currentView === 'year') {
  16715. this.date = Object(date_util_["prevYear"])(this.date, 10);
  16716. } else {
  16717. this.date = Object(date_util_["prevYear"])(this.date);
  16718. }
  16719. },
  16720. nextYear: function nextYear() {
  16721. if (this.currentView === 'year') {
  16722. this.date = Object(date_util_["nextYear"])(this.date, 10);
  16723. } else {
  16724. this.date = Object(date_util_["nextYear"])(this.date);
  16725. }
  16726. },
  16727. handleShortcutClick: function handleShortcutClick(shortcut) {
  16728. if (shortcut.onClick) {
  16729. shortcut.onClick(this);
  16730. }
  16731. },
  16732. handleTimePick: function handleTimePick(value, visible, first) {
  16733. if (Object(date_util_["isDate"])(value)) {
  16734. var newDate = this.value ? Object(date_util_["modifyTime"])(this.value, value.getHours(), value.getMinutes(), value.getSeconds()) : Object(date_util_["modifyWithTimeString"])(this.getDefaultValue(), this.defaultTime);
  16735. this.date = newDate;
  16736. this.emit(this.date, true);
  16737. } else {
  16738. this.emit(value, true);
  16739. }
  16740. if (!first) {
  16741. this.timePickerVisible = visible;
  16742. }
  16743. },
  16744. handleTimePickClose: function handleTimePickClose() {
  16745. this.timePickerVisible = false;
  16746. },
  16747. handleMonthPick: function handleMonthPick(month) {
  16748. if (this.selectionMode === 'month') {
  16749. this.date = Object(date_util_["modifyDate"])(this.date, this.year, month, 1);
  16750. this.emit(this.date);
  16751. } else if (this.selectionMode === 'months') {
  16752. this.emit(month, true);
  16753. } else {
  16754. this.date = Object(date_util_["changeYearMonthAndClampDate"])(this.date, this.year, month);
  16755. // TODO: should emit intermediate value ??
  16756. // this.emit(this.date);
  16757. this.currentView = 'date';
  16758. }
  16759. },
  16760. handleDatePick: function handleDatePick(value) {
  16761. if (this.selectionMode === 'day') {
  16762. var newDate = this.value ? Object(date_util_["modifyDate"])(this.value, value.getFullYear(), value.getMonth(), value.getDate()) : Object(date_util_["modifyWithTimeString"])(value, this.defaultTime);
  16763. // change default time while out of selectableRange
  16764. if (!this.checkDateWithinRange(newDate)) {
  16765. newDate = Object(date_util_["modifyDate"])(this.selectableRange[0][0], value.getFullYear(), value.getMonth(), value.getDate());
  16766. }
  16767. this.date = newDate;
  16768. this.emit(this.date, this.showTime);
  16769. } else if (this.selectionMode === 'week') {
  16770. this.emit(value.date);
  16771. } else if (this.selectionMode === 'dates') {
  16772. this.emit(value, true); // set false to keep panel open
  16773. }
  16774. },
  16775. handleYearPick: function handleYearPick(year) {
  16776. if (this.selectionMode === 'year') {
  16777. this.date = Object(date_util_["modifyDate"])(this.date, year, 0, 1);
  16778. this.emit(this.date);
  16779. } else if (this.selectionMode === 'years') {
  16780. this.emit(year, true);
  16781. } else {
  16782. this.date = Object(date_util_["changeYearMonthAndClampDate"])(this.date, year, this.month);
  16783. // TODO: should emit intermediate value ??
  16784. // this.emit(this.date, true);
  16785. this.currentView = 'month';
  16786. }
  16787. },
  16788. changeToNow: function changeToNow() {
  16789. // NOTE: not a permanent solution
  16790. // consider disable "now" button in the future
  16791. if ((!this.disabledDate || !this.disabledDate(new Date())) && this.checkDateWithinRange(new Date())) {
  16792. this.date = new Date();
  16793. this.emit(this.date);
  16794. }
  16795. },
  16796. confirm: function confirm() {
  16797. if (this.selectionMode === 'dates' || this.selectionMode === 'months' || this.selectionMode === 'years') {
  16798. this.emit(this.value);
  16799. } else {
  16800. // value were emitted in handle{Date,Time}Pick, nothing to update here
  16801. // deal with the scenario where: user opens the picker, then confirm without doing anything
  16802. var value = this.value ? this.value : Object(date_util_["modifyWithTimeString"])(this.getDefaultValue(), this.defaultTime);
  16803. this.date = new Date(value); // refresh date
  16804. this.emit(value);
  16805. }
  16806. },
  16807. resetView: function resetView() {
  16808. if (this.selectionMode === 'month' || this.selectionMode === 'months') {
  16809. this.currentView = 'month';
  16810. } else if (this.selectionMode === 'year' || this.selectionMode === 'years') {
  16811. this.currentView = 'year';
  16812. } else {
  16813. this.currentView = 'date';
  16814. }
  16815. },
  16816. handleEnter: function handleEnter() {
  16817. document.body.addEventListener('keydown', this.handleKeydown);
  16818. },
  16819. handleLeave: function handleLeave() {
  16820. this.$emit('dodestroy');
  16821. document.body.removeEventListener('keydown', this.handleKeydown);
  16822. },
  16823. handleKeydown: function handleKeydown(event) {
  16824. var keyCode = event.keyCode;
  16825. var list = [38, 40, 37, 39];
  16826. if (this.visible && !this.timePickerVisible) {
  16827. if (list.indexOf(keyCode) !== -1) {
  16828. this.handleKeyControl(keyCode);
  16829. event.stopPropagation();
  16830. event.preventDefault();
  16831. }
  16832. if (keyCode === 13 && this.userInputDate === null && this.userInputTime === null) {
  16833. // Enter
  16834. this.emit(this.date, false);
  16835. }
  16836. }
  16837. },
  16838. handleKeyControl: function handleKeyControl(keyCode) {
  16839. var mapping = {
  16840. 'year': {
  16841. 38: -4, 40: 4, 37: -1, 39: 1, offset: function offset(date, step) {
  16842. return date.setFullYear(date.getFullYear() + step);
  16843. }
  16844. },
  16845. 'month': {
  16846. 38: -4, 40: 4, 37: -1, 39: 1, offset: function offset(date, step) {
  16847. return date.setMonth(date.getMonth() + step);
  16848. }
  16849. },
  16850. 'week': {
  16851. 38: -1, 40: 1, 37: -1, 39: 1, offset: function offset(date, step) {
  16852. return date.setDate(date.getDate() + step * 7);
  16853. }
  16854. },
  16855. 'day': {
  16856. 38: -7, 40: 7, 37: -1, 39: 1, offset: function offset(date, step) {
  16857. return date.setDate(date.getDate() + step);
  16858. }
  16859. }
  16860. };
  16861. var mode = this.selectionMode;
  16862. var year = 3.1536e10;
  16863. var now = this.date.getTime();
  16864. var newDate = new Date(this.date.getTime());
  16865. while (Math.abs(now - newDate.getTime()) <= year) {
  16866. var map = mapping[mode];
  16867. map.offset(newDate, map[keyCode]);
  16868. if (typeof this.disabledDate === 'function' && this.disabledDate(newDate)) {
  16869. continue;
  16870. }
  16871. this.date = newDate;
  16872. this.$emit('pick', newDate, true);
  16873. break;
  16874. }
  16875. },
  16876. handleVisibleTimeChange: function handleVisibleTimeChange(value) {
  16877. var time = Object(date_util_["parseDate"])(value, this.timeFormat);
  16878. if (time && this.checkDateWithinRange(time)) {
  16879. this.date = Object(date_util_["modifyDate"])(time, this.year, this.month, this.monthDate);
  16880. this.userInputTime = null;
  16881. this.$refs.timepicker.value = this.date;
  16882. this.timePickerVisible = false;
  16883. this.emit(this.date, true);
  16884. }
  16885. },
  16886. handleVisibleDateChange: function handleVisibleDateChange(value) {
  16887. var date = Object(date_util_["parseDate"])(value, this.dateFormat);
  16888. if (date) {
  16889. if (typeof this.disabledDate === 'function' && this.disabledDate(date)) {
  16890. return;
  16891. }
  16892. this.date = Object(date_util_["modifyTime"])(date, this.date.getHours(), this.date.getMinutes(), this.date.getSeconds());
  16893. this.userInputDate = null;
  16894. this.resetView();
  16895. this.emit(this.date, true);
  16896. }
  16897. },
  16898. isValidValue: function isValidValue(value) {
  16899. return value && !isNaN(value) && (typeof this.disabledDate === 'function' ? !this.disabledDate(value) : true) && this.checkDateWithinRange(value);
  16900. },
  16901. getDefaultValue: function getDefaultValue() {
  16902. // if default-value is set, return it
  16903. // otherwise, return now (the moment this method gets called)
  16904. return this.defaultValue ? new Date(this.defaultValue) : new Date();
  16905. },
  16906. checkDateWithinRange: function checkDateWithinRange(date) {
  16907. return this.selectableRange.length > 0 ? Object(date_util_["timeWithinRange"])(date, this.selectableRange, this.format || 'HH:mm:ss') : true;
  16908. }
  16909. },
  16910. components: {
  16911. TimePicker: panel_time, YearTable: year_table, MonthTable: month_table, DateTable: date_table, ElInput: input_default.a, ElButton: button_default.a
  16912. },
  16913. data: function data() {
  16914. return {
  16915. popperClass: '',
  16916. date: new Date(),
  16917. value: '',
  16918. defaultValue: null, // use getDefaultValue() for time computation
  16919. defaultTime: null,
  16920. showTime: false,
  16921. selectionMode: 'day',
  16922. shortcuts: '',
  16923. visible: false,
  16924. currentView: 'date',
  16925. disabledDate: '',
  16926. cellClassName: '',
  16927. selectableRange: [],
  16928. firstDayOfWeek: 7,
  16929. showWeekNumber: false,
  16930. timePickerVisible: false,
  16931. format: '',
  16932. arrowControl: false,
  16933. userInputDate: null,
  16934. userInputTime: null
  16935. };
  16936. },
  16937. computed: {
  16938. year: function year() {
  16939. return this.date.getFullYear();
  16940. },
  16941. month: function month() {
  16942. return this.date.getMonth();
  16943. },
  16944. week: function week() {
  16945. return Object(date_util_["getWeekNumber"])(this.date);
  16946. },
  16947. monthDate: function monthDate() {
  16948. return this.date.getDate();
  16949. },
  16950. footerVisible: function footerVisible() {
  16951. return this.showTime || this.selectionMode === 'dates' || this.selectionMode === 'months' || this.selectionMode === 'years';
  16952. },
  16953. visibleTime: function visibleTime() {
  16954. if (this.userInputTime !== null) {
  16955. return this.userInputTime;
  16956. } else {
  16957. return Object(date_util_["formatDate"])(this.value || this.defaultValue, this.timeFormat);
  16958. }
  16959. },
  16960. visibleDate: function visibleDate() {
  16961. if (this.userInputDate !== null) {
  16962. return this.userInputDate;
  16963. } else {
  16964. return Object(date_util_["formatDate"])(this.value || this.defaultValue, this.dateFormat);
  16965. }
  16966. },
  16967. yearLabel: function yearLabel() {
  16968. var yearTranslation = this.t('el.datepicker.year');
  16969. if (this.currentView === 'year') {
  16970. var startYear = Math.floor(this.year / 10) * 10;
  16971. if (yearTranslation) {
  16972. return startYear + ' ' + yearTranslation + ' - ' + (startYear + 9) + ' ' + yearTranslation;
  16973. }
  16974. return startYear + ' - ' + (startYear + 9);
  16975. }
  16976. return this.year + ' ' + yearTranslation;
  16977. },
  16978. timeFormat: function timeFormat() {
  16979. if (this.format) {
  16980. return Object(date_util_["extractTimeFormat"])(this.format);
  16981. } else {
  16982. return 'HH:mm:ss';
  16983. }
  16984. },
  16985. dateFormat: function dateFormat() {
  16986. if (this.format) {
  16987. return Object(date_util_["extractDateFormat"])(this.format);
  16988. } else {
  16989. return 'yyyy-MM-dd';
  16990. }
  16991. }
  16992. }
  16993. });
  16994. // CONCATENATED MODULE: ./packages/date-picker/src/panel/date.vue?vue&type=script&lang=js&
  16995. /* harmony default export */ var panel_datevue_type_script_lang_js_ = (datevue_type_script_lang_js_);
  16996. // CONCATENATED MODULE: ./packages/date-picker/src/panel/date.vue
  16997. /* normalize component */
  16998. var date_component = normalizeComponent(
  16999. panel_datevue_type_script_lang_js_,
  17000. datevue_type_template_id_2440d4ea_render,
  17001. datevue_type_template_id_2440d4ea_staticRenderFns,
  17002. false,
  17003. null,
  17004. null,
  17005. null
  17006. )
  17007. /* hot reload */
  17008. if (false) { var date_api; }
  17009. date_component.options.__file = "packages/date-picker/src/panel/date.vue"
  17010. /* harmony default export */ var panel_date = (date_component.exports);
  17011. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/panel/date-range.vue?vue&type=template&id=2652849a&
  17012. var date_rangevue_type_template_id_2652849a_render = function() {
  17013. var _vm = this
  17014. var _h = _vm.$createElement
  17015. var _c = _vm._self._c || _h
  17016. return _c(
  17017. "transition",
  17018. {
  17019. attrs: { name: "el-zoom-in-top" },
  17020. on: {
  17021. "after-leave": function($event) {
  17022. _vm.$emit("dodestroy")
  17023. }
  17024. }
  17025. },
  17026. [
  17027. _c(
  17028. "div",
  17029. {
  17030. directives: [
  17031. {
  17032. name: "show",
  17033. rawName: "v-show",
  17034. value: _vm.visible,
  17035. expression: "visible"
  17036. }
  17037. ],
  17038. staticClass: "el-picker-panel el-date-range-picker el-popper",
  17039. class: [
  17040. {
  17041. "has-sidebar": _vm.$slots.sidebar || _vm.shortcuts,
  17042. "has-time": _vm.showTime
  17043. },
  17044. _vm.popperClass
  17045. ]
  17046. },
  17047. [
  17048. _c(
  17049. "div",
  17050. { staticClass: "el-picker-panel__body-wrapper" },
  17051. [
  17052. _vm._t("sidebar"),
  17053. _vm.shortcuts
  17054. ? _c(
  17055. "div",
  17056. { staticClass: "el-picker-panel__sidebar" },
  17057. _vm._l(_vm.shortcuts, function(shortcut, key) {
  17058. return _c(
  17059. "button",
  17060. {
  17061. key: key,
  17062. staticClass: "el-picker-panel__shortcut",
  17063. attrs: { type: "button" },
  17064. on: {
  17065. click: function($event) {
  17066. _vm.handleShortcutClick(shortcut)
  17067. }
  17068. }
  17069. },
  17070. [_vm._v(_vm._s(shortcut.text))]
  17071. )
  17072. }),
  17073. 0
  17074. )
  17075. : _vm._e(),
  17076. _c("div", { staticClass: "el-picker-panel__body" }, [
  17077. _vm.showTime
  17078. ? _c(
  17079. "div",
  17080. { staticClass: "el-date-range-picker__time-header" },
  17081. [
  17082. _c(
  17083. "span",
  17084. { staticClass: "el-date-range-picker__editors-wrap" },
  17085. [
  17086. _c(
  17087. "span",
  17088. {
  17089. staticClass:
  17090. "el-date-range-picker__time-picker-wrap"
  17091. },
  17092. [
  17093. _c("el-input", {
  17094. ref: "minInput",
  17095. staticClass: "el-date-range-picker__editor",
  17096. attrs: {
  17097. size: "small",
  17098. disabled: _vm.rangeState.selecting,
  17099. placeholder: _vm.t(
  17100. "el.datepicker.startDate"
  17101. ),
  17102. value: _vm.minVisibleDate
  17103. },
  17104. on: {
  17105. input: function(val) {
  17106. return _vm.handleDateInput(val, "min")
  17107. },
  17108. change: function(val) {
  17109. return _vm.handleDateChange(val, "min")
  17110. }
  17111. }
  17112. })
  17113. ],
  17114. 1
  17115. ),
  17116. _c(
  17117. "span",
  17118. {
  17119. directives: [
  17120. {
  17121. name: "clickoutside",
  17122. rawName: "v-clickoutside",
  17123. value: _vm.handleMinTimeClose,
  17124. expression: "handleMinTimeClose"
  17125. }
  17126. ],
  17127. staticClass:
  17128. "el-date-range-picker__time-picker-wrap"
  17129. },
  17130. [
  17131. _c("el-input", {
  17132. staticClass: "el-date-range-picker__editor",
  17133. attrs: {
  17134. size: "small",
  17135. disabled: _vm.rangeState.selecting,
  17136. placeholder: _vm.t(
  17137. "el.datepicker.startTime"
  17138. ),
  17139. value: _vm.minVisibleTime
  17140. },
  17141. on: {
  17142. focus: function($event) {
  17143. _vm.minTimePickerVisible = true
  17144. },
  17145. input: function(val) {
  17146. return _vm.handleTimeInput(val, "min")
  17147. },
  17148. change: function(val) {
  17149. return _vm.handleTimeChange(val, "min")
  17150. }
  17151. }
  17152. }),
  17153. _c("time-picker", {
  17154. ref: "minTimePicker",
  17155. attrs: {
  17156. "time-arrow-control": _vm.arrowControl,
  17157. visible: _vm.minTimePickerVisible
  17158. },
  17159. on: {
  17160. pick: _vm.handleMinTimePick,
  17161. mounted: function($event) {
  17162. _vm.$refs.minTimePicker.format =
  17163. _vm.timeFormat
  17164. }
  17165. }
  17166. })
  17167. ],
  17168. 1
  17169. )
  17170. ]
  17171. ),
  17172. _c("span", { staticClass: "el-icon-arrow-right" }),
  17173. _c(
  17174. "span",
  17175. {
  17176. staticClass:
  17177. "el-date-range-picker__editors-wrap is-right"
  17178. },
  17179. [
  17180. _c(
  17181. "span",
  17182. {
  17183. staticClass:
  17184. "el-date-range-picker__time-picker-wrap"
  17185. },
  17186. [
  17187. _c("el-input", {
  17188. staticClass: "el-date-range-picker__editor",
  17189. attrs: {
  17190. size: "small",
  17191. disabled: _vm.rangeState.selecting,
  17192. placeholder: _vm.t("el.datepicker.endDate"),
  17193. value: _vm.maxVisibleDate,
  17194. readonly: !_vm.minDate
  17195. },
  17196. on: {
  17197. input: function(val) {
  17198. return _vm.handleDateInput(val, "max")
  17199. },
  17200. change: function(val) {
  17201. return _vm.handleDateChange(val, "max")
  17202. }
  17203. }
  17204. })
  17205. ],
  17206. 1
  17207. ),
  17208. _c(
  17209. "span",
  17210. {
  17211. directives: [
  17212. {
  17213. name: "clickoutside",
  17214. rawName: "v-clickoutside",
  17215. value: _vm.handleMaxTimeClose,
  17216. expression: "handleMaxTimeClose"
  17217. }
  17218. ],
  17219. staticClass:
  17220. "el-date-range-picker__time-picker-wrap"
  17221. },
  17222. [
  17223. _c("el-input", {
  17224. staticClass: "el-date-range-picker__editor",
  17225. attrs: {
  17226. size: "small",
  17227. disabled: _vm.rangeState.selecting,
  17228. placeholder: _vm.t("el.datepicker.endTime"),
  17229. value: _vm.maxVisibleTime,
  17230. readonly: !_vm.minDate
  17231. },
  17232. on: {
  17233. focus: function($event) {
  17234. _vm.minDate &&
  17235. (_vm.maxTimePickerVisible = true)
  17236. },
  17237. input: function(val) {
  17238. return _vm.handleTimeInput(val, "max")
  17239. },
  17240. change: function(val) {
  17241. return _vm.handleTimeChange(val, "max")
  17242. }
  17243. }
  17244. }),
  17245. _c("time-picker", {
  17246. ref: "maxTimePicker",
  17247. attrs: {
  17248. "time-arrow-control": _vm.arrowControl,
  17249. visible: _vm.maxTimePickerVisible
  17250. },
  17251. on: {
  17252. pick: _vm.handleMaxTimePick,
  17253. mounted: function($event) {
  17254. _vm.$refs.maxTimePicker.format =
  17255. _vm.timeFormat
  17256. }
  17257. }
  17258. })
  17259. ],
  17260. 1
  17261. )
  17262. ]
  17263. )
  17264. ]
  17265. )
  17266. : _vm._e(),
  17267. _c(
  17268. "div",
  17269. {
  17270. staticClass:
  17271. "el-picker-panel__content el-date-range-picker__content is-left"
  17272. },
  17273. [
  17274. _c("div", { staticClass: "el-date-range-picker__header" }, [
  17275. _c("button", {
  17276. staticClass:
  17277. "el-picker-panel__icon-btn el-icon-d-arrow-left",
  17278. attrs: { type: "button" },
  17279. on: { click: _vm.leftPrevYear }
  17280. }),
  17281. _c("button", {
  17282. staticClass:
  17283. "el-picker-panel__icon-btn el-icon-arrow-left",
  17284. attrs: { type: "button" },
  17285. on: { click: _vm.leftPrevMonth }
  17286. }),
  17287. _vm.unlinkPanels
  17288. ? _c("button", {
  17289. staticClass:
  17290. "el-picker-panel__icon-btn el-icon-d-arrow-right",
  17291. class: { "is-disabled": !_vm.enableYearArrow },
  17292. attrs: {
  17293. type: "button",
  17294. disabled: !_vm.enableYearArrow
  17295. },
  17296. on: { click: _vm.leftNextYear }
  17297. })
  17298. : _vm._e(),
  17299. _vm.unlinkPanels
  17300. ? _c("button", {
  17301. staticClass:
  17302. "el-picker-panel__icon-btn el-icon-arrow-right",
  17303. class: { "is-disabled": !_vm.enableMonthArrow },
  17304. attrs: {
  17305. type: "button",
  17306. disabled: !_vm.enableMonthArrow
  17307. },
  17308. on: { click: _vm.leftNextMonth }
  17309. })
  17310. : _vm._e(),
  17311. _c("div", [_vm._v(_vm._s(_vm.leftLabel))])
  17312. ]),
  17313. _c("date-table", {
  17314. attrs: {
  17315. "selection-mode": "range",
  17316. date: _vm.leftDate,
  17317. "default-value": _vm.defaultValue,
  17318. "min-date": _vm.minDate,
  17319. "max-date": _vm.maxDate,
  17320. "range-state": _vm.rangeState,
  17321. "disabled-date": _vm.disabledDate,
  17322. "cell-class-name": _vm.cellClassName,
  17323. "first-day-of-week": _vm.firstDayOfWeek
  17324. },
  17325. on: {
  17326. changerange: _vm.handleChangeRange,
  17327. pick: _vm.handleRangePick
  17328. }
  17329. })
  17330. ],
  17331. 1
  17332. ),
  17333. _c(
  17334. "div",
  17335. {
  17336. staticClass:
  17337. "el-picker-panel__content el-date-range-picker__content is-right"
  17338. },
  17339. [
  17340. _c("div", { staticClass: "el-date-range-picker__header" }, [
  17341. _vm.unlinkPanels
  17342. ? _c("button", {
  17343. staticClass:
  17344. "el-picker-panel__icon-btn el-icon-d-arrow-left",
  17345. class: { "is-disabled": !_vm.enableYearArrow },
  17346. attrs: {
  17347. type: "button",
  17348. disabled: !_vm.enableYearArrow
  17349. },
  17350. on: { click: _vm.rightPrevYear }
  17351. })
  17352. : _vm._e(),
  17353. _vm.unlinkPanels
  17354. ? _c("button", {
  17355. staticClass:
  17356. "el-picker-panel__icon-btn el-icon-arrow-left",
  17357. class: { "is-disabled": !_vm.enableMonthArrow },
  17358. attrs: {
  17359. type: "button",
  17360. disabled: !_vm.enableMonthArrow
  17361. },
  17362. on: { click: _vm.rightPrevMonth }
  17363. })
  17364. : _vm._e(),
  17365. _c("button", {
  17366. staticClass:
  17367. "el-picker-panel__icon-btn el-icon-d-arrow-right",
  17368. attrs: { type: "button" },
  17369. on: { click: _vm.rightNextYear }
  17370. }),
  17371. _c("button", {
  17372. staticClass:
  17373. "el-picker-panel__icon-btn el-icon-arrow-right",
  17374. attrs: { type: "button" },
  17375. on: { click: _vm.rightNextMonth }
  17376. }),
  17377. _c("div", [_vm._v(_vm._s(_vm.rightLabel))])
  17378. ]),
  17379. _c("date-table", {
  17380. attrs: {
  17381. "selection-mode": "range",
  17382. date: _vm.rightDate,
  17383. "default-value": _vm.defaultValue,
  17384. "min-date": _vm.minDate,
  17385. "max-date": _vm.maxDate,
  17386. "range-state": _vm.rangeState,
  17387. "disabled-date": _vm.disabledDate,
  17388. "cell-class-name": _vm.cellClassName,
  17389. "first-day-of-week": _vm.firstDayOfWeek
  17390. },
  17391. on: {
  17392. changerange: _vm.handleChangeRange,
  17393. pick: _vm.handleRangePick
  17394. }
  17395. })
  17396. ],
  17397. 1
  17398. )
  17399. ])
  17400. ],
  17401. 2
  17402. ),
  17403. _vm.showTime
  17404. ? _c(
  17405. "div",
  17406. { staticClass: "el-picker-panel__footer" },
  17407. [
  17408. _c(
  17409. "el-button",
  17410. {
  17411. staticClass: "el-picker-panel__link-btn",
  17412. attrs: { size: "mini", type: "text" },
  17413. on: { click: _vm.handleClear }
  17414. },
  17415. [
  17416. _vm._v(
  17417. "\n " +
  17418. _vm._s(_vm.t("el.datepicker.clear")) +
  17419. "\n "
  17420. )
  17421. ]
  17422. ),
  17423. _c(
  17424. "el-button",
  17425. {
  17426. staticClass: "el-picker-panel__link-btn",
  17427. attrs: {
  17428. plain: "",
  17429. size: "mini",
  17430. disabled: _vm.btnDisabled
  17431. },
  17432. on: {
  17433. click: function($event) {
  17434. _vm.handleConfirm(false)
  17435. }
  17436. }
  17437. },
  17438. [
  17439. _vm._v(
  17440. "\n " +
  17441. _vm._s(_vm.t("el.datepicker.confirm")) +
  17442. "\n "
  17443. )
  17444. ]
  17445. )
  17446. ],
  17447. 1
  17448. )
  17449. : _vm._e()
  17450. ]
  17451. )
  17452. ]
  17453. )
  17454. }
  17455. var date_rangevue_type_template_id_2652849a_staticRenderFns = []
  17456. date_rangevue_type_template_id_2652849a_render._withStripped = true
  17457. // CONCATENATED MODULE: ./packages/date-picker/src/panel/date-range.vue?vue&type=template&id=2652849a&
  17458. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/panel/date-range.vue?vue&type=script&lang=js&
  17459. //
  17460. //
  17461. //
  17462. //
  17463. //
  17464. //
  17465. //
  17466. //
  17467. //
  17468. //
  17469. //
  17470. //
  17471. //
  17472. //
  17473. //
  17474. //
  17475. //
  17476. //
  17477. //
  17478. //
  17479. //
  17480. //
  17481. //
  17482. //
  17483. //
  17484. //
  17485. //
  17486. //
  17487. //
  17488. //
  17489. //
  17490. //
  17491. //
  17492. //
  17493. //
  17494. //
  17495. //
  17496. //
  17497. //
  17498. //
  17499. //
  17500. //
  17501. //
  17502. //
  17503. //
  17504. //
  17505. //
  17506. //
  17507. //
  17508. //
  17509. //
  17510. //
  17511. //
  17512. //
  17513. //
  17514. //
  17515. //
  17516. //
  17517. //
  17518. //
  17519. //
  17520. //
  17521. //
  17522. //
  17523. //
  17524. //
  17525. //
  17526. //
  17527. //
  17528. //
  17529. //
  17530. //
  17531. //
  17532. //
  17533. //
  17534. //
  17535. //
  17536. //
  17537. //
  17538. //
  17539. //
  17540. //
  17541. //
  17542. //
  17543. //
  17544. //
  17545. //
  17546. //
  17547. //
  17548. //
  17549. //
  17550. //
  17551. //
  17552. //
  17553. //
  17554. //
  17555. //
  17556. //
  17557. //
  17558. //
  17559. //
  17560. //
  17561. //
  17562. //
  17563. //
  17564. //
  17565. //
  17566. //
  17567. //
  17568. //
  17569. //
  17570. //
  17571. //
  17572. //
  17573. //
  17574. //
  17575. //
  17576. //
  17577. //
  17578. //
  17579. //
  17580. //
  17581. //
  17582. //
  17583. //
  17584. //
  17585. //
  17586. //
  17587. //
  17588. //
  17589. //
  17590. //
  17591. //
  17592. //
  17593. //
  17594. //
  17595. //
  17596. //
  17597. //
  17598. //
  17599. //
  17600. //
  17601. //
  17602. //
  17603. //
  17604. //
  17605. //
  17606. //
  17607. //
  17608. //
  17609. //
  17610. //
  17611. //
  17612. //
  17613. //
  17614. //
  17615. //
  17616. //
  17617. //
  17618. //
  17619. //
  17620. //
  17621. //
  17622. //
  17623. //
  17624. //
  17625. //
  17626. //
  17627. //
  17628. //
  17629. //
  17630. //
  17631. //
  17632. //
  17633. //
  17634. //
  17635. //
  17636. //
  17637. //
  17638. //
  17639. //
  17640. //
  17641. //
  17642. //
  17643. //
  17644. //
  17645. //
  17646. //
  17647. //
  17648. var date_rangevue_type_script_lang_js_calcDefaultValue = function calcDefaultValue(defaultValue) {
  17649. if (Array.isArray(defaultValue)) {
  17650. return [new Date(defaultValue[0]), new Date(defaultValue[1])];
  17651. } else if (defaultValue) {
  17652. return [new Date(defaultValue), Object(date_util_["nextDate"])(new Date(defaultValue), 1)];
  17653. } else {
  17654. return [new Date(), Object(date_util_["nextDate"])(new Date(), 1)];
  17655. }
  17656. };
  17657. /* harmony default export */ var date_rangevue_type_script_lang_js_ = ({
  17658. mixins: [locale_default.a],
  17659. directives: { Clickoutside: clickoutside_default.a },
  17660. computed: {
  17661. btnDisabled: function btnDisabled() {
  17662. return !(this.minDate && this.maxDate && !this.selecting && this.isValidValue([this.minDate, this.maxDate]));
  17663. },
  17664. leftLabel: function leftLabel() {
  17665. return this.leftDate.getFullYear() + ' ' + this.t('el.datepicker.year') + ' ' + this.t('el.datepicker.month' + (this.leftDate.getMonth() + 1));
  17666. },
  17667. rightLabel: function rightLabel() {
  17668. return this.rightDate.getFullYear() + ' ' + this.t('el.datepicker.year') + ' ' + this.t('el.datepicker.month' + (this.rightDate.getMonth() + 1));
  17669. },
  17670. leftYear: function leftYear() {
  17671. return this.leftDate.getFullYear();
  17672. },
  17673. leftMonth: function leftMonth() {
  17674. return this.leftDate.getMonth();
  17675. },
  17676. leftMonthDate: function leftMonthDate() {
  17677. return this.leftDate.getDate();
  17678. },
  17679. rightYear: function rightYear() {
  17680. return this.rightDate.getFullYear();
  17681. },
  17682. rightMonth: function rightMonth() {
  17683. return this.rightDate.getMonth();
  17684. },
  17685. rightMonthDate: function rightMonthDate() {
  17686. return this.rightDate.getDate();
  17687. },
  17688. minVisibleDate: function minVisibleDate() {
  17689. if (this.dateUserInput.min !== null) return this.dateUserInput.min;
  17690. if (this.minDate) return Object(date_util_["formatDate"])(this.minDate, this.dateFormat);
  17691. return '';
  17692. },
  17693. maxVisibleDate: function maxVisibleDate() {
  17694. if (this.dateUserInput.max !== null) return this.dateUserInput.max;
  17695. if (this.maxDate || this.minDate) return Object(date_util_["formatDate"])(this.maxDate || this.minDate, this.dateFormat);
  17696. return '';
  17697. },
  17698. minVisibleTime: function minVisibleTime() {
  17699. if (this.timeUserInput.min !== null) return this.timeUserInput.min;
  17700. if (this.minDate) return Object(date_util_["formatDate"])(this.minDate, this.timeFormat);
  17701. return '';
  17702. },
  17703. maxVisibleTime: function maxVisibleTime() {
  17704. if (this.timeUserInput.max !== null) return this.timeUserInput.max;
  17705. if (this.maxDate || this.minDate) return Object(date_util_["formatDate"])(this.maxDate || this.minDate, this.timeFormat);
  17706. return '';
  17707. },
  17708. timeFormat: function timeFormat() {
  17709. if (this.format) {
  17710. return Object(date_util_["extractTimeFormat"])(this.format);
  17711. } else {
  17712. return 'HH:mm:ss';
  17713. }
  17714. },
  17715. dateFormat: function dateFormat() {
  17716. if (this.format) {
  17717. return Object(date_util_["extractDateFormat"])(this.format);
  17718. } else {
  17719. return 'yyyy-MM-dd';
  17720. }
  17721. },
  17722. enableMonthArrow: function enableMonthArrow() {
  17723. var nextMonth = (this.leftMonth + 1) % 12;
  17724. var yearOffset = this.leftMonth + 1 >= 12 ? 1 : 0;
  17725. return this.unlinkPanels && new Date(this.leftYear + yearOffset, nextMonth) < new Date(this.rightYear, this.rightMonth);
  17726. },
  17727. enableYearArrow: function enableYearArrow() {
  17728. return this.unlinkPanels && this.rightYear * 12 + this.rightMonth - (this.leftYear * 12 + this.leftMonth + 1) >= 12;
  17729. }
  17730. },
  17731. data: function data() {
  17732. return {
  17733. popperClass: '',
  17734. value: [],
  17735. defaultValue: null,
  17736. defaultTime: null,
  17737. minDate: '',
  17738. maxDate: '',
  17739. leftDate: new Date(),
  17740. rightDate: Object(date_util_["nextMonth"])(new Date()),
  17741. rangeState: {
  17742. endDate: null,
  17743. selecting: false,
  17744. row: null,
  17745. column: null
  17746. },
  17747. showTime: false,
  17748. shortcuts: '',
  17749. visible: '',
  17750. disabledDate: '',
  17751. cellClassName: '',
  17752. firstDayOfWeek: 7,
  17753. minTimePickerVisible: false,
  17754. maxTimePickerVisible: false,
  17755. format: '',
  17756. arrowControl: false,
  17757. unlinkPanels: false,
  17758. dateUserInput: {
  17759. min: null,
  17760. max: null
  17761. },
  17762. timeUserInput: {
  17763. min: null,
  17764. max: null
  17765. }
  17766. };
  17767. },
  17768. watch: {
  17769. minDate: function minDate(val) {
  17770. var _this = this;
  17771. this.dateUserInput.min = null;
  17772. this.timeUserInput.min = null;
  17773. this.$nextTick(function () {
  17774. if (_this.$refs.maxTimePicker && _this.maxDate && _this.maxDate < _this.minDate) {
  17775. var format = 'HH:mm:ss';
  17776. _this.$refs.maxTimePicker.selectableRange = [[Object(date_util_["parseDate"])(Object(date_util_["formatDate"])(_this.minDate, format), format), Object(date_util_["parseDate"])('23:59:59', format)]];
  17777. }
  17778. });
  17779. if (val && this.$refs.minTimePicker) {
  17780. this.$refs.minTimePicker.date = val;
  17781. this.$refs.minTimePicker.value = val;
  17782. }
  17783. },
  17784. maxDate: function maxDate(val) {
  17785. this.dateUserInput.max = null;
  17786. this.timeUserInput.max = null;
  17787. if (val && this.$refs.maxTimePicker) {
  17788. this.$refs.maxTimePicker.date = val;
  17789. this.$refs.maxTimePicker.value = val;
  17790. }
  17791. },
  17792. minTimePickerVisible: function minTimePickerVisible(val) {
  17793. var _this2 = this;
  17794. if (val) {
  17795. this.$nextTick(function () {
  17796. _this2.$refs.minTimePicker.date = _this2.minDate;
  17797. _this2.$refs.minTimePicker.value = _this2.minDate;
  17798. _this2.$refs.minTimePicker.adjustSpinners();
  17799. });
  17800. }
  17801. },
  17802. maxTimePickerVisible: function maxTimePickerVisible(val) {
  17803. var _this3 = this;
  17804. if (val) {
  17805. this.$nextTick(function () {
  17806. _this3.$refs.maxTimePicker.date = _this3.maxDate;
  17807. _this3.$refs.maxTimePicker.value = _this3.maxDate;
  17808. _this3.$refs.maxTimePicker.adjustSpinners();
  17809. });
  17810. }
  17811. },
  17812. value: function value(newVal) {
  17813. if (!newVal) {
  17814. this.minDate = null;
  17815. this.maxDate = null;
  17816. } else if (Array.isArray(newVal)) {
  17817. this.minDate = Object(date_util_["isDate"])(newVal[0]) ? new Date(newVal[0]) : null;
  17818. this.maxDate = Object(date_util_["isDate"])(newVal[1]) ? new Date(newVal[1]) : null;
  17819. if (this.minDate) {
  17820. this.leftDate = this.minDate;
  17821. if (this.unlinkPanels && this.maxDate) {
  17822. var minDateYear = this.minDate.getFullYear();
  17823. var minDateMonth = this.minDate.getMonth();
  17824. var maxDateYear = this.maxDate.getFullYear();
  17825. var maxDateMonth = this.maxDate.getMonth();
  17826. this.rightDate = minDateYear === maxDateYear && minDateMonth === maxDateMonth ? Object(date_util_["nextMonth"])(this.maxDate) : this.maxDate;
  17827. } else {
  17828. this.rightDate = Object(date_util_["nextMonth"])(this.leftDate);
  17829. }
  17830. } else {
  17831. this.leftDate = date_rangevue_type_script_lang_js_calcDefaultValue(this.defaultValue)[0];
  17832. this.rightDate = Object(date_util_["nextMonth"])(this.leftDate);
  17833. }
  17834. }
  17835. },
  17836. defaultValue: function defaultValue(val) {
  17837. if (!Array.isArray(this.value)) {
  17838. var _calcDefaultValue = date_rangevue_type_script_lang_js_calcDefaultValue(val),
  17839. left = _calcDefaultValue[0],
  17840. right = _calcDefaultValue[1];
  17841. this.leftDate = left;
  17842. this.rightDate = val && val[1] && this.unlinkPanels ? right : Object(date_util_["nextMonth"])(this.leftDate);
  17843. }
  17844. }
  17845. },
  17846. methods: {
  17847. handleClear: function handleClear() {
  17848. this.minDate = null;
  17849. this.maxDate = null;
  17850. this.leftDate = date_rangevue_type_script_lang_js_calcDefaultValue(this.defaultValue)[0];
  17851. this.rightDate = Object(date_util_["nextMonth"])(this.leftDate);
  17852. this.$emit('pick', null);
  17853. },
  17854. handleChangeRange: function handleChangeRange(val) {
  17855. this.minDate = val.minDate;
  17856. this.maxDate = val.maxDate;
  17857. this.rangeState = val.rangeState;
  17858. },
  17859. handleDateInput: function handleDateInput(value, type) {
  17860. this.dateUserInput[type] = value;
  17861. if (value.length !== this.dateFormat.length) return;
  17862. var parsedValue = Object(date_util_["parseDate"])(value, this.dateFormat);
  17863. if (parsedValue) {
  17864. if (typeof this.disabledDate === 'function' && this.disabledDate(new Date(parsedValue))) {
  17865. return;
  17866. }
  17867. if (type === 'min') {
  17868. this.minDate = Object(date_util_["modifyDate"])(this.minDate || new Date(), parsedValue.getFullYear(), parsedValue.getMonth(), parsedValue.getDate());
  17869. this.leftDate = new Date(parsedValue);
  17870. if (!this.unlinkPanels) {
  17871. this.rightDate = Object(date_util_["nextMonth"])(this.leftDate);
  17872. }
  17873. } else {
  17874. this.maxDate = Object(date_util_["modifyDate"])(this.maxDate || new Date(), parsedValue.getFullYear(), parsedValue.getMonth(), parsedValue.getDate());
  17875. this.rightDate = new Date(parsedValue);
  17876. if (!this.unlinkPanels) {
  17877. this.leftDate = Object(date_util_["prevMonth"])(parsedValue);
  17878. }
  17879. }
  17880. }
  17881. },
  17882. handleDateChange: function handleDateChange(value, type) {
  17883. var parsedValue = Object(date_util_["parseDate"])(value, this.dateFormat);
  17884. if (parsedValue) {
  17885. if (type === 'min') {
  17886. this.minDate = Object(date_util_["modifyDate"])(this.minDate, parsedValue.getFullYear(), parsedValue.getMonth(), parsedValue.getDate());
  17887. if (this.minDate > this.maxDate) {
  17888. this.maxDate = this.minDate;
  17889. }
  17890. } else {
  17891. this.maxDate = Object(date_util_["modifyDate"])(this.maxDate, parsedValue.getFullYear(), parsedValue.getMonth(), parsedValue.getDate());
  17892. if (this.maxDate < this.minDate) {
  17893. this.minDate = this.maxDate;
  17894. }
  17895. }
  17896. }
  17897. },
  17898. handleTimeInput: function handleTimeInput(value, type) {
  17899. var _this4 = this;
  17900. this.timeUserInput[type] = value;
  17901. if (value.length !== this.timeFormat.length) return;
  17902. var parsedValue = Object(date_util_["parseDate"])(value, this.timeFormat);
  17903. if (parsedValue) {
  17904. if (type === 'min') {
  17905. this.minDate = Object(date_util_["modifyTime"])(this.minDate, parsedValue.getHours(), parsedValue.getMinutes(), parsedValue.getSeconds());
  17906. this.$nextTick(function (_) {
  17907. return _this4.$refs.minTimePicker.adjustSpinners();
  17908. });
  17909. } else {
  17910. this.maxDate = Object(date_util_["modifyTime"])(this.maxDate, parsedValue.getHours(), parsedValue.getMinutes(), parsedValue.getSeconds());
  17911. this.$nextTick(function (_) {
  17912. return _this4.$refs.maxTimePicker.adjustSpinners();
  17913. });
  17914. }
  17915. }
  17916. },
  17917. handleTimeChange: function handleTimeChange(value, type) {
  17918. var parsedValue = Object(date_util_["parseDate"])(value, this.timeFormat);
  17919. if (parsedValue) {
  17920. if (type === 'min') {
  17921. this.minDate = Object(date_util_["modifyTime"])(this.minDate, parsedValue.getHours(), parsedValue.getMinutes(), parsedValue.getSeconds());
  17922. if (this.minDate > this.maxDate) {
  17923. this.maxDate = this.minDate;
  17924. }
  17925. this.$refs.minTimePicker.value = this.minDate;
  17926. this.minTimePickerVisible = false;
  17927. } else {
  17928. this.maxDate = Object(date_util_["modifyTime"])(this.maxDate, parsedValue.getHours(), parsedValue.getMinutes(), parsedValue.getSeconds());
  17929. if (this.maxDate < this.minDate) {
  17930. this.minDate = this.maxDate;
  17931. }
  17932. this.$refs.maxTimePicker.value = this.minDate;
  17933. this.maxTimePickerVisible = false;
  17934. }
  17935. }
  17936. },
  17937. handleRangePick: function handleRangePick(val) {
  17938. var _this5 = this;
  17939. var close = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  17940. var defaultTime = this.defaultTime || [];
  17941. var minDate = Object(date_util_["modifyWithTimeString"])(val.minDate, defaultTime[0]);
  17942. var maxDate = Object(date_util_["modifyWithTimeString"])(val.maxDate, defaultTime[1]);
  17943. if (this.maxDate === maxDate && this.minDate === minDate) {
  17944. return;
  17945. }
  17946. this.onPick && this.onPick(val);
  17947. this.maxDate = maxDate;
  17948. this.minDate = minDate;
  17949. // workaround for https://github.com/ElemeFE/element/issues/7539, should remove this block when we don't have to care about Chromium 55 - 57
  17950. setTimeout(function () {
  17951. _this5.maxDate = maxDate;
  17952. _this5.minDate = minDate;
  17953. }, 10);
  17954. if (!close || this.showTime) return;
  17955. this.handleConfirm();
  17956. },
  17957. handleShortcutClick: function handleShortcutClick(shortcut) {
  17958. if (shortcut.onClick) {
  17959. shortcut.onClick(this);
  17960. }
  17961. },
  17962. handleMinTimePick: function handleMinTimePick(value, visible, first) {
  17963. this.minDate = this.minDate || new Date();
  17964. if (value) {
  17965. this.minDate = Object(date_util_["modifyTime"])(this.minDate, value.getHours(), value.getMinutes(), value.getSeconds());
  17966. }
  17967. if (!first) {
  17968. this.minTimePickerVisible = visible;
  17969. }
  17970. if (!this.maxDate || this.maxDate && this.maxDate.getTime() < this.minDate.getTime()) {
  17971. this.maxDate = new Date(this.minDate);
  17972. }
  17973. },
  17974. handleMinTimeClose: function handleMinTimeClose() {
  17975. this.minTimePickerVisible = false;
  17976. },
  17977. handleMaxTimePick: function handleMaxTimePick(value, visible, first) {
  17978. if (this.maxDate && value) {
  17979. this.maxDate = Object(date_util_["modifyTime"])(this.maxDate, value.getHours(), value.getMinutes(), value.getSeconds());
  17980. }
  17981. if (!first) {
  17982. this.maxTimePickerVisible = visible;
  17983. }
  17984. if (this.maxDate && this.minDate && this.minDate.getTime() > this.maxDate.getTime()) {
  17985. this.minDate = new Date(this.maxDate);
  17986. }
  17987. },
  17988. handleMaxTimeClose: function handleMaxTimeClose() {
  17989. this.maxTimePickerVisible = false;
  17990. },
  17991. // leftPrev*, rightNext* need to take care of `unlinkPanels`
  17992. leftPrevYear: function leftPrevYear() {
  17993. this.leftDate = Object(date_util_["prevYear"])(this.leftDate);
  17994. if (!this.unlinkPanels) {
  17995. this.rightDate = Object(date_util_["nextMonth"])(this.leftDate);
  17996. }
  17997. },
  17998. leftPrevMonth: function leftPrevMonth() {
  17999. this.leftDate = Object(date_util_["prevMonth"])(this.leftDate);
  18000. if (!this.unlinkPanels) {
  18001. this.rightDate = Object(date_util_["nextMonth"])(this.leftDate);
  18002. }
  18003. },
  18004. rightNextYear: function rightNextYear() {
  18005. if (!this.unlinkPanels) {
  18006. this.leftDate = Object(date_util_["nextYear"])(this.leftDate);
  18007. this.rightDate = Object(date_util_["nextMonth"])(this.leftDate);
  18008. } else {
  18009. this.rightDate = Object(date_util_["nextYear"])(this.rightDate);
  18010. }
  18011. },
  18012. rightNextMonth: function rightNextMonth() {
  18013. if (!this.unlinkPanels) {
  18014. this.leftDate = Object(date_util_["nextMonth"])(this.leftDate);
  18015. this.rightDate = Object(date_util_["nextMonth"])(this.leftDate);
  18016. } else {
  18017. this.rightDate = Object(date_util_["nextMonth"])(this.rightDate);
  18018. }
  18019. },
  18020. // leftNext*, rightPrev* are called when `unlinkPanels` is true
  18021. leftNextYear: function leftNextYear() {
  18022. this.leftDate = Object(date_util_["nextYear"])(this.leftDate);
  18023. },
  18024. leftNextMonth: function leftNextMonth() {
  18025. this.leftDate = Object(date_util_["nextMonth"])(this.leftDate);
  18026. },
  18027. rightPrevYear: function rightPrevYear() {
  18028. this.rightDate = Object(date_util_["prevYear"])(this.rightDate);
  18029. },
  18030. rightPrevMonth: function rightPrevMonth() {
  18031. this.rightDate = Object(date_util_["prevMonth"])(this.rightDate);
  18032. },
  18033. handleConfirm: function handleConfirm() {
  18034. var visible = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  18035. if (this.isValidValue([this.minDate, this.maxDate])) {
  18036. this.$emit('pick', [this.minDate, this.maxDate], visible);
  18037. }
  18038. },
  18039. isValidValue: function isValidValue(value) {
  18040. return Array.isArray(value) && value && value[0] && value[1] && Object(date_util_["isDate"])(value[0]) && Object(date_util_["isDate"])(value[1]) && value[0].getTime() <= value[1].getTime() && (typeof this.disabledDate === 'function' ? !this.disabledDate(value[0]) && !this.disabledDate(value[1]) : true);
  18041. },
  18042. resetView: function resetView() {
  18043. // NOTE: this is a hack to reset {min, max}Date on picker open.
  18044. // TODO: correct way of doing so is to refactor {min, max}Date to be dependent on value and internal selection state
  18045. // an alternative would be resetView whenever picker becomes visible, should also investigate date-panel's resetView
  18046. if (this.minDate && this.maxDate == null) this.rangeState.selecting = false;
  18047. this.minDate = this.value && Object(date_util_["isDate"])(this.value[0]) ? new Date(this.value[0]) : null;
  18048. this.maxDate = this.value && Object(date_util_["isDate"])(this.value[0]) ? new Date(this.value[1]) : null;
  18049. }
  18050. },
  18051. components: { TimePicker: panel_time, DateTable: date_table, ElInput: input_default.a, ElButton: button_default.a }
  18052. });
  18053. // CONCATENATED MODULE: ./packages/date-picker/src/panel/date-range.vue?vue&type=script&lang=js&
  18054. /* harmony default export */ var panel_date_rangevue_type_script_lang_js_ = (date_rangevue_type_script_lang_js_);
  18055. // CONCATENATED MODULE: ./packages/date-picker/src/panel/date-range.vue
  18056. /* normalize component */
  18057. var date_range_component = normalizeComponent(
  18058. panel_date_rangevue_type_script_lang_js_,
  18059. date_rangevue_type_template_id_2652849a_render,
  18060. date_rangevue_type_template_id_2652849a_staticRenderFns,
  18061. false,
  18062. null,
  18063. null,
  18064. null
  18065. )
  18066. /* hot reload */
  18067. if (false) { var date_range_api; }
  18068. date_range_component.options.__file = "packages/date-picker/src/panel/date-range.vue"
  18069. /* harmony default export */ var date_range = (date_range_component.exports);
  18070. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/panel/month-range.vue?vue&type=template&id=f2645fb8&
  18071. var month_rangevue_type_template_id_f2645fb8_render = function() {
  18072. var _vm = this
  18073. var _h = _vm.$createElement
  18074. var _c = _vm._self._c || _h
  18075. return _c(
  18076. "transition",
  18077. {
  18078. attrs: { name: "el-zoom-in-top" },
  18079. on: {
  18080. "after-leave": function($event) {
  18081. _vm.$emit("dodestroy")
  18082. }
  18083. }
  18084. },
  18085. [
  18086. _c(
  18087. "div",
  18088. {
  18089. directives: [
  18090. {
  18091. name: "show",
  18092. rawName: "v-show",
  18093. value: _vm.visible,
  18094. expression: "visible"
  18095. }
  18096. ],
  18097. staticClass: "el-picker-panel el-date-range-picker el-popper",
  18098. class: [
  18099. {
  18100. "has-sidebar": _vm.$slots.sidebar || _vm.shortcuts
  18101. },
  18102. _vm.popperClass
  18103. ]
  18104. },
  18105. [
  18106. _c(
  18107. "div",
  18108. { staticClass: "el-picker-panel__body-wrapper" },
  18109. [
  18110. _vm._t("sidebar"),
  18111. _vm.shortcuts
  18112. ? _c(
  18113. "div",
  18114. { staticClass: "el-picker-panel__sidebar" },
  18115. _vm._l(_vm.shortcuts, function(shortcut, key) {
  18116. return _c(
  18117. "button",
  18118. {
  18119. key: key,
  18120. staticClass: "el-picker-panel__shortcut",
  18121. attrs: { type: "button" },
  18122. on: {
  18123. click: function($event) {
  18124. _vm.handleShortcutClick(shortcut)
  18125. }
  18126. }
  18127. },
  18128. [_vm._v(_vm._s(shortcut.text))]
  18129. )
  18130. }),
  18131. 0
  18132. )
  18133. : _vm._e(),
  18134. _c("div", { staticClass: "el-picker-panel__body" }, [
  18135. _c(
  18136. "div",
  18137. {
  18138. staticClass:
  18139. "el-picker-panel__content el-date-range-picker__content is-left"
  18140. },
  18141. [
  18142. _c("div", { staticClass: "el-date-range-picker__header" }, [
  18143. _c("button", {
  18144. staticClass:
  18145. "el-picker-panel__icon-btn el-icon-d-arrow-left",
  18146. attrs: { type: "button" },
  18147. on: { click: _vm.leftPrevYear }
  18148. }),
  18149. _vm.unlinkPanels
  18150. ? _c("button", {
  18151. staticClass:
  18152. "el-picker-panel__icon-btn el-icon-d-arrow-right",
  18153. class: { "is-disabled": !_vm.enableYearArrow },
  18154. attrs: {
  18155. type: "button",
  18156. disabled: !_vm.enableYearArrow
  18157. },
  18158. on: { click: _vm.leftNextYear }
  18159. })
  18160. : _vm._e(),
  18161. _c("div", [_vm._v(_vm._s(_vm.leftLabel))])
  18162. ]),
  18163. _c("month-table", {
  18164. attrs: {
  18165. "selection-mode": "range",
  18166. date: _vm.leftDate,
  18167. "default-value": _vm.defaultValue,
  18168. "min-date": _vm.minDate,
  18169. "max-date": _vm.maxDate,
  18170. "range-state": _vm.rangeState,
  18171. "disabled-date": _vm.disabledDate
  18172. },
  18173. on: {
  18174. changerange: _vm.handleChangeRange,
  18175. pick: _vm.handleRangePick
  18176. }
  18177. })
  18178. ],
  18179. 1
  18180. ),
  18181. _c(
  18182. "div",
  18183. {
  18184. staticClass:
  18185. "el-picker-panel__content el-date-range-picker__content is-right"
  18186. },
  18187. [
  18188. _c("div", { staticClass: "el-date-range-picker__header" }, [
  18189. _vm.unlinkPanels
  18190. ? _c("button", {
  18191. staticClass:
  18192. "el-picker-panel__icon-btn el-icon-d-arrow-left",
  18193. class: { "is-disabled": !_vm.enableYearArrow },
  18194. attrs: {
  18195. type: "button",
  18196. disabled: !_vm.enableYearArrow
  18197. },
  18198. on: { click: _vm.rightPrevYear }
  18199. })
  18200. : _vm._e(),
  18201. _c("button", {
  18202. staticClass:
  18203. "el-picker-panel__icon-btn el-icon-d-arrow-right",
  18204. attrs: { type: "button" },
  18205. on: { click: _vm.rightNextYear }
  18206. }),
  18207. _c("div", [_vm._v(_vm._s(_vm.rightLabel))])
  18208. ]),
  18209. _c("month-table", {
  18210. attrs: {
  18211. "selection-mode": "range",
  18212. date: _vm.rightDate,
  18213. "default-value": _vm.defaultValue,
  18214. "min-date": _vm.minDate,
  18215. "max-date": _vm.maxDate,
  18216. "range-state": _vm.rangeState,
  18217. "disabled-date": _vm.disabledDate
  18218. },
  18219. on: {
  18220. changerange: _vm.handleChangeRange,
  18221. pick: _vm.handleRangePick
  18222. }
  18223. })
  18224. ],
  18225. 1
  18226. )
  18227. ])
  18228. ],
  18229. 2
  18230. )
  18231. ]
  18232. )
  18233. ]
  18234. )
  18235. }
  18236. var month_rangevue_type_template_id_f2645fb8_staticRenderFns = []
  18237. month_rangevue_type_template_id_f2645fb8_render._withStripped = true
  18238. // CONCATENATED MODULE: ./packages/date-picker/src/panel/month-range.vue?vue&type=template&id=f2645fb8&
  18239. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/panel/month-range.vue?vue&type=script&lang=js&
  18240. //
  18241. //
  18242. //
  18243. //
  18244. //
  18245. //
  18246. //
  18247. //
  18248. //
  18249. //
  18250. //
  18251. //
  18252. //
  18253. //
  18254. //
  18255. //
  18256. //
  18257. //
  18258. //
  18259. //
  18260. //
  18261. //
  18262. //
  18263. //
  18264. //
  18265. //
  18266. //
  18267. //
  18268. //
  18269. //
  18270. //
  18271. //
  18272. //
  18273. //
  18274. //
  18275. //
  18276. //
  18277. //
  18278. //
  18279. //
  18280. //
  18281. //
  18282. //
  18283. //
  18284. //
  18285. //
  18286. //
  18287. //
  18288. //
  18289. //
  18290. //
  18291. //
  18292. //
  18293. //
  18294. //
  18295. //
  18296. //
  18297. //
  18298. //
  18299. //
  18300. //
  18301. //
  18302. //
  18303. //
  18304. //
  18305. //
  18306. //
  18307. //
  18308. //
  18309. //
  18310. //
  18311. //
  18312. //
  18313. //
  18314. //
  18315. //
  18316. //
  18317. //
  18318. //
  18319. var month_rangevue_type_script_lang_js_calcDefaultValue = function calcDefaultValue(defaultValue) {
  18320. if (Array.isArray(defaultValue)) {
  18321. return [new Date(defaultValue[0]), new Date(defaultValue[1])];
  18322. } else if (defaultValue) {
  18323. return [new Date(defaultValue), Object(date_util_["nextMonth"])(new Date(defaultValue))];
  18324. } else {
  18325. return [new Date(), Object(date_util_["nextMonth"])(new Date())];
  18326. }
  18327. };
  18328. /* harmony default export */ var month_rangevue_type_script_lang_js_ = ({
  18329. mixins: [locale_default.a],
  18330. directives: { Clickoutside: clickoutside_default.a },
  18331. computed: {
  18332. btnDisabled: function btnDisabled() {
  18333. return !(this.minDate && this.maxDate && !this.selecting && this.isValidValue([this.minDate, this.maxDate]));
  18334. },
  18335. leftLabel: function leftLabel() {
  18336. return this.leftDate.getFullYear() + ' ' + this.t('el.datepicker.year');
  18337. },
  18338. rightLabel: function rightLabel() {
  18339. return this.rightDate.getFullYear() + ' ' + this.t('el.datepicker.year');
  18340. },
  18341. leftYear: function leftYear() {
  18342. return this.leftDate.getFullYear();
  18343. },
  18344. rightYear: function rightYear() {
  18345. return this.rightDate.getFullYear() === this.leftDate.getFullYear() ? this.leftDate.getFullYear() + 1 : this.rightDate.getFullYear();
  18346. },
  18347. enableYearArrow: function enableYearArrow() {
  18348. return this.unlinkPanels && this.rightYear > this.leftYear + 1;
  18349. }
  18350. },
  18351. data: function data() {
  18352. return {
  18353. popperClass: '',
  18354. value: [],
  18355. defaultValue: null,
  18356. defaultTime: null,
  18357. minDate: '',
  18358. maxDate: '',
  18359. leftDate: new Date(),
  18360. rightDate: Object(date_util_["nextYear"])(new Date()),
  18361. rangeState: {
  18362. endDate: null,
  18363. selecting: false,
  18364. row: null,
  18365. column: null
  18366. },
  18367. shortcuts: '',
  18368. visible: '',
  18369. disabledDate: '',
  18370. format: '',
  18371. arrowControl: false,
  18372. unlinkPanels: false
  18373. };
  18374. },
  18375. watch: {
  18376. value: function value(newVal) {
  18377. if (!newVal) {
  18378. this.minDate = null;
  18379. this.maxDate = null;
  18380. } else if (Array.isArray(newVal)) {
  18381. this.minDate = Object(date_util_["isDate"])(newVal[0]) ? new Date(newVal[0]) : null;
  18382. this.maxDate = Object(date_util_["isDate"])(newVal[1]) ? new Date(newVal[1]) : null;
  18383. if (this.minDate) {
  18384. this.leftDate = this.minDate;
  18385. if (this.unlinkPanels && this.maxDate) {
  18386. var minDateYear = this.minDate.getFullYear();
  18387. var maxDateYear = this.maxDate.getFullYear();
  18388. this.rightDate = minDateYear === maxDateYear ? Object(date_util_["nextYear"])(this.maxDate) : this.maxDate;
  18389. } else {
  18390. this.rightDate = Object(date_util_["nextYear"])(this.leftDate);
  18391. }
  18392. } else {
  18393. this.leftDate = month_rangevue_type_script_lang_js_calcDefaultValue(this.defaultValue)[0];
  18394. this.rightDate = Object(date_util_["nextYear"])(this.leftDate);
  18395. }
  18396. }
  18397. },
  18398. defaultValue: function defaultValue(val) {
  18399. if (!Array.isArray(this.value)) {
  18400. var _calcDefaultValue = month_rangevue_type_script_lang_js_calcDefaultValue(val),
  18401. left = _calcDefaultValue[0],
  18402. right = _calcDefaultValue[1];
  18403. this.leftDate = left;
  18404. this.rightDate = val && val[1] && left.getFullYear() !== right.getFullYear() && this.unlinkPanels ? right : Object(date_util_["nextYear"])(this.leftDate);
  18405. }
  18406. }
  18407. },
  18408. methods: {
  18409. handleClear: function handleClear() {
  18410. this.minDate = null;
  18411. this.maxDate = null;
  18412. this.leftDate = month_rangevue_type_script_lang_js_calcDefaultValue(this.defaultValue)[0];
  18413. this.rightDate = Object(date_util_["nextYear"])(this.leftDate);
  18414. this.$emit('pick', null);
  18415. },
  18416. handleChangeRange: function handleChangeRange(val) {
  18417. this.minDate = val.minDate;
  18418. this.maxDate = val.maxDate;
  18419. this.rangeState = val.rangeState;
  18420. },
  18421. handleRangePick: function handleRangePick(val) {
  18422. var _this = this;
  18423. var close = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  18424. var defaultTime = this.defaultTime || [];
  18425. var minDate = Object(date_util_["modifyWithTimeString"])(val.minDate, defaultTime[0]);
  18426. var maxDate = Object(date_util_["modifyWithTimeString"])(val.maxDate, defaultTime[1]);
  18427. if (this.maxDate === maxDate && this.minDate === minDate) {
  18428. return;
  18429. }
  18430. this.onPick && this.onPick(val);
  18431. this.maxDate = maxDate;
  18432. this.minDate = minDate;
  18433. // workaround for https://github.com/ElemeFE/element/issues/7539, should remove this block when we don't have to care about Chromium 55 - 57
  18434. setTimeout(function () {
  18435. _this.maxDate = maxDate;
  18436. _this.minDate = minDate;
  18437. }, 10);
  18438. if (!close) return;
  18439. this.handleConfirm();
  18440. },
  18441. handleShortcutClick: function handleShortcutClick(shortcut) {
  18442. if (shortcut.onClick) {
  18443. shortcut.onClick(this);
  18444. }
  18445. },
  18446. // leftPrev*, rightNext* need to take care of `unlinkPanels`
  18447. leftPrevYear: function leftPrevYear() {
  18448. this.leftDate = Object(date_util_["prevYear"])(this.leftDate);
  18449. if (!this.unlinkPanels) {
  18450. this.rightDate = Object(date_util_["prevYear"])(this.rightDate);
  18451. }
  18452. },
  18453. rightNextYear: function rightNextYear() {
  18454. if (!this.unlinkPanels) {
  18455. this.leftDate = Object(date_util_["nextYear"])(this.leftDate);
  18456. }
  18457. this.rightDate = Object(date_util_["nextYear"])(this.rightDate);
  18458. },
  18459. // leftNext*, rightPrev* are called when `unlinkPanels` is true
  18460. leftNextYear: function leftNextYear() {
  18461. this.leftDate = Object(date_util_["nextYear"])(this.leftDate);
  18462. },
  18463. rightPrevYear: function rightPrevYear() {
  18464. this.rightDate = Object(date_util_["prevYear"])(this.rightDate);
  18465. },
  18466. handleConfirm: function handleConfirm() {
  18467. var visible = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  18468. if (this.isValidValue([this.minDate, this.maxDate])) {
  18469. this.$emit('pick', [this.minDate, this.maxDate], visible);
  18470. }
  18471. },
  18472. isValidValue: function isValidValue(value) {
  18473. return Array.isArray(value) && value && value[0] && value[1] && Object(date_util_["isDate"])(value[0]) && Object(date_util_["isDate"])(value[1]) && value[0].getTime() <= value[1].getTime() && (typeof this.disabledDate === 'function' ? !this.disabledDate(value[0]) && !this.disabledDate(value[1]) : true);
  18474. },
  18475. resetView: function resetView() {
  18476. // NOTE: this is a hack to reset {min, max}Date on picker open.
  18477. // TODO: correct way of doing so is to refactor {min, max}Date to be dependent on value and internal selection state
  18478. // an alternative would be resetView whenever picker becomes visible, should also investigate date-panel's resetView
  18479. this.minDate = this.value && Object(date_util_["isDate"])(this.value[0]) ? new Date(this.value[0]) : null;
  18480. this.maxDate = this.value && Object(date_util_["isDate"])(this.value[0]) ? new Date(this.value[1]) : null;
  18481. }
  18482. },
  18483. components: { MonthTable: month_table, ElInput: input_default.a, ElButton: button_default.a }
  18484. });
  18485. // CONCATENATED MODULE: ./packages/date-picker/src/panel/month-range.vue?vue&type=script&lang=js&
  18486. /* harmony default export */ var panel_month_rangevue_type_script_lang_js_ = (month_rangevue_type_script_lang_js_);
  18487. // CONCATENATED MODULE: ./packages/date-picker/src/panel/month-range.vue
  18488. /* normalize component */
  18489. var month_range_component = normalizeComponent(
  18490. panel_month_rangevue_type_script_lang_js_,
  18491. month_rangevue_type_template_id_f2645fb8_render,
  18492. month_rangevue_type_template_id_f2645fb8_staticRenderFns,
  18493. false,
  18494. null,
  18495. null,
  18496. null
  18497. )
  18498. /* hot reload */
  18499. if (false) { var month_range_api; }
  18500. month_range_component.options.__file = "packages/date-picker/src/panel/month-range.vue"
  18501. /* harmony default export */ var month_range = (month_range_component.exports);
  18502. // CONCATENATED MODULE: ./packages/date-picker/src/picker/date-picker.js
  18503. var date_picker_getPanel = function getPanel(type) {
  18504. if (type === 'daterange' || type === 'datetimerange') {
  18505. return date_range;
  18506. } else if (type === 'monthrange') {
  18507. return month_range;
  18508. }
  18509. return panel_date;
  18510. };
  18511. /* harmony default export */ var date_picker = ({
  18512. mixins: [picker],
  18513. name: 'ElDatePicker',
  18514. props: {
  18515. type: {
  18516. type: String,
  18517. default: 'date'
  18518. },
  18519. timeArrowControl: Boolean
  18520. },
  18521. watch: {
  18522. type: function type(_type) {
  18523. if (this.picker) {
  18524. this.unmountPicker();
  18525. this.panel = date_picker_getPanel(_type);
  18526. this.mountPicker();
  18527. } else {
  18528. this.panel = date_picker_getPanel(_type);
  18529. }
  18530. }
  18531. },
  18532. created: function created() {
  18533. this.panel = date_picker_getPanel(this.type);
  18534. }
  18535. });
  18536. // CONCATENATED MODULE: ./packages/date-picker/index.js
  18537. /* istanbul ignore next */
  18538. date_picker.install = function install(Vue) {
  18539. Vue.component(date_picker.name, date_picker);
  18540. };
  18541. /* harmony default export */ var packages_date_picker = (date_picker);
  18542. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/panel/time-select.vue?vue&type=template&id=51ab9320&
  18543. var time_selectvue_type_template_id_51ab9320_render = function() {
  18544. var _vm = this
  18545. var _h = _vm.$createElement
  18546. var _c = _vm._self._c || _h
  18547. return _c(
  18548. "transition",
  18549. {
  18550. attrs: { name: "el-zoom-in-top" },
  18551. on: {
  18552. "before-enter": _vm.handleMenuEnter,
  18553. "after-leave": function($event) {
  18554. _vm.$emit("dodestroy")
  18555. }
  18556. }
  18557. },
  18558. [
  18559. _c(
  18560. "div",
  18561. {
  18562. directives: [
  18563. {
  18564. name: "show",
  18565. rawName: "v-show",
  18566. value: _vm.visible,
  18567. expression: "visible"
  18568. }
  18569. ],
  18570. ref: "popper",
  18571. staticClass: "el-picker-panel time-select el-popper",
  18572. class: _vm.popperClass,
  18573. style: { width: _vm.width + "px" }
  18574. },
  18575. [
  18576. _c(
  18577. "el-scrollbar",
  18578. {
  18579. attrs: { noresize: "", "wrap-class": "el-picker-panel__content" }
  18580. },
  18581. _vm._l(_vm.items, function(item) {
  18582. return _c(
  18583. "div",
  18584. {
  18585. key: item.value,
  18586. staticClass: "time-select-item",
  18587. class: {
  18588. selected: _vm.value === item.value,
  18589. disabled: item.disabled,
  18590. default: item.value === _vm.defaultValue
  18591. },
  18592. attrs: { disabled: item.disabled },
  18593. on: {
  18594. click: function($event) {
  18595. _vm.handleClick(item)
  18596. }
  18597. }
  18598. },
  18599. [_vm._v(_vm._s(item.value))]
  18600. )
  18601. }),
  18602. 0
  18603. )
  18604. ],
  18605. 1
  18606. )
  18607. ]
  18608. )
  18609. }
  18610. var time_selectvue_type_template_id_51ab9320_staticRenderFns = []
  18611. time_selectvue_type_template_id_51ab9320_render._withStripped = true
  18612. // CONCATENATED MODULE: ./packages/date-picker/src/panel/time-select.vue?vue&type=template&id=51ab9320&
  18613. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/panel/time-select.vue?vue&type=script&lang=js&
  18614. //
  18615. //
  18616. //
  18617. //
  18618. //
  18619. //
  18620. //
  18621. //
  18622. //
  18623. //
  18624. //
  18625. //
  18626. //
  18627. //
  18628. //
  18629. //
  18630. //
  18631. //
  18632. //
  18633. //
  18634. var parseTime = function parseTime(time) {
  18635. var values = (time || '').split(':');
  18636. if (values.length >= 2) {
  18637. var hours = parseInt(values[0], 10);
  18638. var minutes = parseInt(values[1], 10);
  18639. return {
  18640. hours: hours,
  18641. minutes: minutes
  18642. };
  18643. }
  18644. /* istanbul ignore next */
  18645. return null;
  18646. };
  18647. var compareTime = function compareTime(time1, time2) {
  18648. var value1 = parseTime(time1);
  18649. var value2 = parseTime(time2);
  18650. var minutes1 = value1.minutes + value1.hours * 60;
  18651. var minutes2 = value2.minutes + value2.hours * 60;
  18652. if (minutes1 === minutes2) {
  18653. return 0;
  18654. }
  18655. return minutes1 > minutes2 ? 1 : -1;
  18656. };
  18657. var formatTime = function formatTime(time) {
  18658. return (time.hours < 10 ? '0' + time.hours : time.hours) + ':' + (time.minutes < 10 ? '0' + time.minutes : time.minutes);
  18659. };
  18660. var nextTime = function nextTime(time, step) {
  18661. var timeValue = parseTime(time);
  18662. var stepValue = parseTime(step);
  18663. var next = {
  18664. hours: timeValue.hours,
  18665. minutes: timeValue.minutes
  18666. };
  18667. next.minutes += stepValue.minutes;
  18668. next.hours += stepValue.hours;
  18669. next.hours += Math.floor(next.minutes / 60);
  18670. next.minutes = next.minutes % 60;
  18671. return formatTime(next);
  18672. };
  18673. /* harmony default export */ var time_selectvue_type_script_lang_js_ = ({
  18674. components: { ElScrollbar: scrollbar_default.a },
  18675. watch: {
  18676. value: function value(val) {
  18677. var _this = this;
  18678. if (!val) return;
  18679. this.$nextTick(function () {
  18680. return _this.scrollToOption();
  18681. });
  18682. }
  18683. },
  18684. methods: {
  18685. handleClick: function handleClick(item) {
  18686. if (!item.disabled) {
  18687. this.$emit('pick', item.value);
  18688. }
  18689. },
  18690. handleClear: function handleClear() {
  18691. this.$emit('pick', null);
  18692. },
  18693. scrollToOption: function scrollToOption() {
  18694. var selector = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '.selected';
  18695. var menu = this.$refs.popper.querySelector('.el-picker-panel__content');
  18696. scroll_into_view_default()(menu, menu.querySelector(selector));
  18697. },
  18698. handleMenuEnter: function handleMenuEnter() {
  18699. var _this2 = this;
  18700. var selected = this.items.map(function (item) {
  18701. return item.value;
  18702. }).indexOf(this.value) !== -1;
  18703. var hasDefault = this.items.map(function (item) {
  18704. return item.value;
  18705. }).indexOf(this.defaultValue) !== -1;
  18706. var option = selected && '.selected' || hasDefault && '.default' || '.time-select-item:not(.disabled)';
  18707. this.$nextTick(function () {
  18708. return _this2.scrollToOption(option);
  18709. });
  18710. },
  18711. scrollDown: function scrollDown(step) {
  18712. var items = this.items;
  18713. var length = items.length;
  18714. var total = items.length;
  18715. var index = items.map(function (item) {
  18716. return item.value;
  18717. }).indexOf(this.value);
  18718. while (total--) {
  18719. index = (index + step + length) % length;
  18720. if (!items[index].disabled) {
  18721. this.$emit('pick', items[index].value, true);
  18722. return;
  18723. }
  18724. }
  18725. },
  18726. isValidValue: function isValidValue(date) {
  18727. return this.items.filter(function (item) {
  18728. return !item.disabled;
  18729. }).map(function (item) {
  18730. return item.value;
  18731. }).indexOf(date) !== -1;
  18732. },
  18733. handleKeydown: function handleKeydown(event) {
  18734. var keyCode = event.keyCode;
  18735. if (keyCode === 38 || keyCode === 40) {
  18736. var mapping = { 40: 1, 38: -1 };
  18737. var offset = mapping[keyCode.toString()];
  18738. this.scrollDown(offset);
  18739. event.stopPropagation();
  18740. return;
  18741. }
  18742. }
  18743. },
  18744. data: function data() {
  18745. return {
  18746. popperClass: '',
  18747. start: '09:00',
  18748. end: '18:00',
  18749. step: '00:30',
  18750. value: '',
  18751. defaultValue: '',
  18752. visible: false,
  18753. minTime: '',
  18754. maxTime: '',
  18755. width: 0
  18756. };
  18757. },
  18758. computed: {
  18759. items: function items() {
  18760. var start = this.start;
  18761. var end = this.end;
  18762. var step = this.step;
  18763. var result = [];
  18764. if (start && end && step) {
  18765. var current = start;
  18766. while (compareTime(current, end) <= 0) {
  18767. result.push({
  18768. value: current,
  18769. disabled: compareTime(current, this.minTime || '-1:-1') <= 0 || compareTime(current, this.maxTime || '100:100') >= 0
  18770. });
  18771. current = nextTime(current, step);
  18772. }
  18773. }
  18774. return result;
  18775. }
  18776. }
  18777. });
  18778. // CONCATENATED MODULE: ./packages/date-picker/src/panel/time-select.vue?vue&type=script&lang=js&
  18779. /* harmony default export */ var panel_time_selectvue_type_script_lang_js_ = (time_selectvue_type_script_lang_js_);
  18780. // CONCATENATED MODULE: ./packages/date-picker/src/panel/time-select.vue
  18781. /* normalize component */
  18782. var time_select_component = normalizeComponent(
  18783. panel_time_selectvue_type_script_lang_js_,
  18784. time_selectvue_type_template_id_51ab9320_render,
  18785. time_selectvue_type_template_id_51ab9320_staticRenderFns,
  18786. false,
  18787. null,
  18788. null,
  18789. null
  18790. )
  18791. /* hot reload */
  18792. if (false) { var time_select_api; }
  18793. time_select_component.options.__file = "packages/date-picker/src/panel/time-select.vue"
  18794. /* harmony default export */ var time_select = (time_select_component.exports);
  18795. // CONCATENATED MODULE: ./packages/date-picker/src/picker/time-select.js
  18796. /* harmony default export */ var picker_time_select = ({
  18797. mixins: [picker],
  18798. name: 'ElTimeSelect',
  18799. componentName: 'ElTimeSelect',
  18800. props: {
  18801. type: {
  18802. type: String,
  18803. default: 'time-select'
  18804. }
  18805. },
  18806. beforeCreate: function beforeCreate() {
  18807. this.panel = time_select;
  18808. }
  18809. });
  18810. // CONCATENATED MODULE: ./packages/time-select/index.js
  18811. /* istanbul ignore next */
  18812. picker_time_select.install = function (Vue) {
  18813. Vue.component(picker_time_select.name, picker_time_select);
  18814. };
  18815. /* harmony default export */ var packages_time_select = (picker_time_select);
  18816. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/panel/time-range.vue?vue&type=template&id=fb28660e&
  18817. var time_rangevue_type_template_id_fb28660e_render = function() {
  18818. var _vm = this
  18819. var _h = _vm.$createElement
  18820. var _c = _vm._self._c || _h
  18821. return _c(
  18822. "transition",
  18823. {
  18824. attrs: { name: "el-zoom-in-top" },
  18825. on: {
  18826. "after-leave": function($event) {
  18827. _vm.$emit("dodestroy")
  18828. }
  18829. }
  18830. },
  18831. [
  18832. _c(
  18833. "div",
  18834. {
  18835. directives: [
  18836. {
  18837. name: "show",
  18838. rawName: "v-show",
  18839. value: _vm.visible,
  18840. expression: "visible"
  18841. }
  18842. ],
  18843. staticClass: "el-time-range-picker el-picker-panel el-popper",
  18844. class: _vm.popperClass
  18845. },
  18846. [
  18847. _c("div", { staticClass: "el-time-range-picker__content" }, [
  18848. _c("div", { staticClass: "el-time-range-picker__cell" }, [
  18849. _c("div", { staticClass: "el-time-range-picker__header" }, [
  18850. _vm._v(_vm._s(_vm.t("el.datepicker.startTime")))
  18851. ]),
  18852. _c(
  18853. "div",
  18854. {
  18855. staticClass:
  18856. "el-time-range-picker__body el-time-panel__content",
  18857. class: {
  18858. "has-seconds": _vm.showSeconds,
  18859. "is-arrow": _vm.arrowControl
  18860. }
  18861. },
  18862. [
  18863. _c("time-spinner", {
  18864. ref: "minSpinner",
  18865. attrs: {
  18866. "show-seconds": _vm.showSeconds,
  18867. "am-pm-mode": _vm.amPmMode,
  18868. "arrow-control": _vm.arrowControl,
  18869. date: _vm.minDate
  18870. },
  18871. on: {
  18872. change: _vm.handleMinChange,
  18873. "select-range": _vm.setMinSelectionRange
  18874. }
  18875. })
  18876. ],
  18877. 1
  18878. )
  18879. ]),
  18880. _c("div", { staticClass: "el-time-range-picker__cell" }, [
  18881. _c("div", { staticClass: "el-time-range-picker__header" }, [
  18882. _vm._v(_vm._s(_vm.t("el.datepicker.endTime")))
  18883. ]),
  18884. _c(
  18885. "div",
  18886. {
  18887. staticClass:
  18888. "el-time-range-picker__body el-time-panel__content",
  18889. class: {
  18890. "has-seconds": _vm.showSeconds,
  18891. "is-arrow": _vm.arrowControl
  18892. }
  18893. },
  18894. [
  18895. _c("time-spinner", {
  18896. ref: "maxSpinner",
  18897. attrs: {
  18898. "show-seconds": _vm.showSeconds,
  18899. "am-pm-mode": _vm.amPmMode,
  18900. "arrow-control": _vm.arrowControl,
  18901. date: _vm.maxDate
  18902. },
  18903. on: {
  18904. change: _vm.handleMaxChange,
  18905. "select-range": _vm.setMaxSelectionRange
  18906. }
  18907. })
  18908. ],
  18909. 1
  18910. )
  18911. ])
  18912. ]),
  18913. _c("div", { staticClass: "el-time-panel__footer" }, [
  18914. _c(
  18915. "button",
  18916. {
  18917. staticClass: "el-time-panel__btn cancel",
  18918. attrs: { type: "button" },
  18919. on: {
  18920. click: function($event) {
  18921. _vm.handleCancel()
  18922. }
  18923. }
  18924. },
  18925. [_vm._v(_vm._s(_vm.t("el.datepicker.cancel")))]
  18926. ),
  18927. _c(
  18928. "button",
  18929. {
  18930. staticClass: "el-time-panel__btn confirm",
  18931. attrs: { type: "button", disabled: _vm.btnDisabled },
  18932. on: {
  18933. click: function($event) {
  18934. _vm.handleConfirm()
  18935. }
  18936. }
  18937. },
  18938. [_vm._v(_vm._s(_vm.t("el.datepicker.confirm")))]
  18939. )
  18940. ])
  18941. ]
  18942. )
  18943. ]
  18944. )
  18945. }
  18946. var time_rangevue_type_template_id_fb28660e_staticRenderFns = []
  18947. time_rangevue_type_template_id_fb28660e_render._withStripped = true
  18948. // CONCATENATED MODULE: ./packages/date-picker/src/panel/time-range.vue?vue&type=template&id=fb28660e&
  18949. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/date-picker/src/panel/time-range.vue?vue&type=script&lang=js&
  18950. //
  18951. //
  18952. //
  18953. //
  18954. //
  18955. //
  18956. //
  18957. //
  18958. //
  18959. //
  18960. //
  18961. //
  18962. //
  18963. //
  18964. //
  18965. //
  18966. //
  18967. //
  18968. //
  18969. //
  18970. //
  18971. //
  18972. //
  18973. //
  18974. //
  18975. //
  18976. //
  18977. //
  18978. //
  18979. //
  18980. //
  18981. //
  18982. //
  18983. //
  18984. //
  18985. //
  18986. //
  18987. //
  18988. //
  18989. //
  18990. //
  18991. //
  18992. //
  18993. //
  18994. //
  18995. //
  18996. //
  18997. //
  18998. //
  18999. //
  19000. //
  19001. //
  19002. //
  19003. //
  19004. //
  19005. //
  19006. //
  19007. var MIN_TIME = Object(date_util_["parseDate"])('00:00:00', 'HH:mm:ss');
  19008. var MAX_TIME = Object(date_util_["parseDate"])('23:59:59', 'HH:mm:ss');
  19009. var time_rangevue_type_script_lang_js_minTimeOfDay = function minTimeOfDay(date) {
  19010. return Object(date_util_["modifyDate"])(MIN_TIME, date.getFullYear(), date.getMonth(), date.getDate());
  19011. };
  19012. var time_rangevue_type_script_lang_js_maxTimeOfDay = function maxTimeOfDay(date) {
  19013. return Object(date_util_["modifyDate"])(MAX_TIME, date.getFullYear(), date.getMonth(), date.getDate());
  19014. };
  19015. // increase time by amount of milliseconds, but within the range of day
  19016. var advanceTime = function advanceTime(date, amount) {
  19017. return new Date(Math.min(date.getTime() + amount, time_rangevue_type_script_lang_js_maxTimeOfDay(date).getTime()));
  19018. };
  19019. /* harmony default export */ var time_rangevue_type_script_lang_js_ = ({
  19020. mixins: [locale_default.a],
  19021. components: { TimeSpinner: time_spinner },
  19022. computed: {
  19023. showSeconds: function showSeconds() {
  19024. return (this.format || '').indexOf('ss') !== -1;
  19025. },
  19026. offset: function offset() {
  19027. return this.showSeconds ? 11 : 8;
  19028. },
  19029. spinner: function spinner() {
  19030. return this.selectionRange[0] < this.offset ? this.$refs.minSpinner : this.$refs.maxSpinner;
  19031. },
  19032. btnDisabled: function btnDisabled() {
  19033. return this.minDate.getTime() > this.maxDate.getTime();
  19034. },
  19035. amPmMode: function amPmMode() {
  19036. if ((this.format || '').indexOf('A') !== -1) return 'A';
  19037. if ((this.format || '').indexOf('a') !== -1) return 'a';
  19038. return '';
  19039. }
  19040. },
  19041. data: function data() {
  19042. return {
  19043. popperClass: '',
  19044. minDate: new Date(),
  19045. maxDate: new Date(),
  19046. value: [],
  19047. oldValue: [new Date(), new Date()],
  19048. defaultValue: null,
  19049. format: 'HH:mm:ss',
  19050. visible: false,
  19051. selectionRange: [0, 2],
  19052. arrowControl: false
  19053. };
  19054. },
  19055. watch: {
  19056. value: function value(_value) {
  19057. if (Array.isArray(_value)) {
  19058. this.minDate = new Date(_value[0]);
  19059. this.maxDate = new Date(_value[1]);
  19060. } else {
  19061. if (Array.isArray(this.defaultValue)) {
  19062. this.minDate = new Date(this.defaultValue[0]);
  19063. this.maxDate = new Date(this.defaultValue[1]);
  19064. } else if (this.defaultValue) {
  19065. this.minDate = new Date(this.defaultValue);
  19066. this.maxDate = advanceTime(new Date(this.defaultValue), 60 * 60 * 1000);
  19067. } else {
  19068. this.minDate = new Date();
  19069. this.maxDate = advanceTime(new Date(), 60 * 60 * 1000);
  19070. }
  19071. }
  19072. },
  19073. visible: function visible(val) {
  19074. var _this = this;
  19075. if (val) {
  19076. this.oldValue = this.value;
  19077. this.$nextTick(function () {
  19078. return _this.$refs.minSpinner.emitSelectRange('hours');
  19079. });
  19080. }
  19081. }
  19082. },
  19083. methods: {
  19084. handleClear: function handleClear() {
  19085. this.$emit('pick', null);
  19086. },
  19087. handleCancel: function handleCancel() {
  19088. this.$emit('pick', this.oldValue);
  19089. },
  19090. handleMinChange: function handleMinChange(date) {
  19091. this.minDate = Object(date_util_["clearMilliseconds"])(date);
  19092. this.handleChange();
  19093. },
  19094. handleMaxChange: function handleMaxChange(date) {
  19095. this.maxDate = Object(date_util_["clearMilliseconds"])(date);
  19096. this.handleChange();
  19097. },
  19098. handleChange: function handleChange() {
  19099. if (this.isValidValue([this.minDate, this.maxDate])) {
  19100. this.$refs.minSpinner.selectableRange = [[time_rangevue_type_script_lang_js_minTimeOfDay(this.minDate), this.maxDate]];
  19101. this.$refs.maxSpinner.selectableRange = [[this.minDate, time_rangevue_type_script_lang_js_maxTimeOfDay(this.maxDate)]];
  19102. this.$emit('pick', [this.minDate, this.maxDate], true);
  19103. }
  19104. },
  19105. setMinSelectionRange: function setMinSelectionRange(start, end) {
  19106. this.$emit('select-range', start, end, 'min');
  19107. this.selectionRange = [start, end];
  19108. },
  19109. setMaxSelectionRange: function setMaxSelectionRange(start, end) {
  19110. this.$emit('select-range', start, end, 'max');
  19111. this.selectionRange = [start + this.offset, end + this.offset];
  19112. },
  19113. handleConfirm: function handleConfirm() {
  19114. var visible = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  19115. var minSelectableRange = this.$refs.minSpinner.selectableRange;
  19116. var maxSelectableRange = this.$refs.maxSpinner.selectableRange;
  19117. this.minDate = Object(date_util_["limitTimeRange"])(this.minDate, minSelectableRange, this.format);
  19118. this.maxDate = Object(date_util_["limitTimeRange"])(this.maxDate, maxSelectableRange, this.format);
  19119. this.$emit('pick', [this.minDate, this.maxDate], visible);
  19120. },
  19121. adjustSpinners: function adjustSpinners() {
  19122. this.$refs.minSpinner.adjustSpinners();
  19123. this.$refs.maxSpinner.adjustSpinners();
  19124. },
  19125. changeSelectionRange: function changeSelectionRange(step) {
  19126. var list = this.showSeconds ? [0, 3, 6, 11, 14, 17] : [0, 3, 8, 11];
  19127. var mapping = ['hours', 'minutes'].concat(this.showSeconds ? ['seconds'] : []);
  19128. var index = list.indexOf(this.selectionRange[0]);
  19129. var next = (index + step + list.length) % list.length;
  19130. var half = list.length / 2;
  19131. if (next < half) {
  19132. this.$refs.minSpinner.emitSelectRange(mapping[next]);
  19133. } else {
  19134. this.$refs.maxSpinner.emitSelectRange(mapping[next - half]);
  19135. }
  19136. },
  19137. isValidValue: function isValidValue(date) {
  19138. return Array.isArray(date) && Object(date_util_["timeWithinRange"])(this.minDate, this.$refs.minSpinner.selectableRange) && Object(date_util_["timeWithinRange"])(this.maxDate, this.$refs.maxSpinner.selectableRange);
  19139. },
  19140. handleKeydown: function handleKeydown(event) {
  19141. var keyCode = event.keyCode;
  19142. var mapping = { 38: -1, 40: 1, 37: -1, 39: 1 };
  19143. // Left or Right
  19144. if (keyCode === 37 || keyCode === 39) {
  19145. var step = mapping[keyCode];
  19146. this.changeSelectionRange(step);
  19147. event.preventDefault();
  19148. return;
  19149. }
  19150. // Up or Down
  19151. if (keyCode === 38 || keyCode === 40) {
  19152. var _step = mapping[keyCode];
  19153. this.spinner.scrollDown(_step);
  19154. event.preventDefault();
  19155. return;
  19156. }
  19157. }
  19158. }
  19159. });
  19160. // CONCATENATED MODULE: ./packages/date-picker/src/panel/time-range.vue?vue&type=script&lang=js&
  19161. /* harmony default export */ var panel_time_rangevue_type_script_lang_js_ = (time_rangevue_type_script_lang_js_);
  19162. // CONCATENATED MODULE: ./packages/date-picker/src/panel/time-range.vue
  19163. /* normalize component */
  19164. var time_range_component = normalizeComponent(
  19165. panel_time_rangevue_type_script_lang_js_,
  19166. time_rangevue_type_template_id_fb28660e_render,
  19167. time_rangevue_type_template_id_fb28660e_staticRenderFns,
  19168. false,
  19169. null,
  19170. null,
  19171. null
  19172. )
  19173. /* hot reload */
  19174. if (false) { var time_range_api; }
  19175. time_range_component.options.__file = "packages/date-picker/src/panel/time-range.vue"
  19176. /* harmony default export */ var time_range = (time_range_component.exports);
  19177. // CONCATENATED MODULE: ./packages/date-picker/src/picker/time-picker.js
  19178. /* harmony default export */ var time_picker = ({
  19179. mixins: [picker],
  19180. name: 'ElTimePicker',
  19181. props: {
  19182. isRange: Boolean,
  19183. arrowControl: Boolean
  19184. },
  19185. data: function data() {
  19186. return {
  19187. type: ''
  19188. };
  19189. },
  19190. watch: {
  19191. isRange: function isRange(_isRange) {
  19192. if (this.picker) {
  19193. this.unmountPicker();
  19194. this.type = _isRange ? 'timerange' : 'time';
  19195. this.panel = _isRange ? time_range : panel_time;
  19196. this.mountPicker();
  19197. } else {
  19198. this.type = _isRange ? 'timerange' : 'time';
  19199. this.panel = _isRange ? time_range : panel_time;
  19200. }
  19201. }
  19202. },
  19203. created: function created() {
  19204. this.type = this.isRange ? 'timerange' : 'time';
  19205. this.panel = this.isRange ? time_range : panel_time;
  19206. }
  19207. });
  19208. // CONCATENATED MODULE: ./packages/time-picker/index.js
  19209. /* istanbul ignore next */
  19210. time_picker.install = function (Vue) {
  19211. Vue.component(time_picker.name, time_picker);
  19212. };
  19213. /* harmony default export */ var packages_time_picker = (time_picker);
  19214. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/popover/src/main.vue?vue&type=template&id=52060272&
  19215. var mainvue_type_template_id_52060272_render = function() {
  19216. var _vm = this
  19217. var _h = _vm.$createElement
  19218. var _c = _vm._self._c || _h
  19219. return _c(
  19220. "span",
  19221. [
  19222. _c(
  19223. "transition",
  19224. {
  19225. attrs: { name: _vm.transition },
  19226. on: {
  19227. "after-enter": _vm.handleAfterEnter,
  19228. "after-leave": _vm.handleAfterLeave
  19229. }
  19230. },
  19231. [
  19232. _c(
  19233. "div",
  19234. {
  19235. directives: [
  19236. {
  19237. name: "show",
  19238. rawName: "v-show",
  19239. value: !_vm.disabled && _vm.showPopper,
  19240. expression: "!disabled && showPopper"
  19241. }
  19242. ],
  19243. ref: "popper",
  19244. staticClass: "el-popover el-popper",
  19245. class: [_vm.popperClass, _vm.content && "el-popover--plain"],
  19246. style: { width: _vm.width + "px" },
  19247. attrs: {
  19248. role: "tooltip",
  19249. id: _vm.tooltipId,
  19250. "aria-hidden":
  19251. _vm.disabled || !_vm.showPopper ? "true" : "false"
  19252. }
  19253. },
  19254. [
  19255. _vm.title
  19256. ? _c("div", {
  19257. staticClass: "el-popover__title",
  19258. domProps: { textContent: _vm._s(_vm.title) }
  19259. })
  19260. : _vm._e(),
  19261. _vm._t("default", [_vm._v(_vm._s(_vm.content))])
  19262. ],
  19263. 2
  19264. )
  19265. ]
  19266. ),
  19267. _c(
  19268. "span",
  19269. { ref: "wrapper", staticClass: "el-popover__reference-wrapper" },
  19270. [_vm._t("reference")],
  19271. 2
  19272. )
  19273. ],
  19274. 1
  19275. )
  19276. }
  19277. var mainvue_type_template_id_52060272_staticRenderFns = []
  19278. mainvue_type_template_id_52060272_render._withStripped = true
  19279. // CONCATENATED MODULE: ./packages/popover/src/main.vue?vue&type=template&id=52060272&
  19280. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/popover/src/main.vue?vue&type=script&lang=js&
  19281. //
  19282. //
  19283. //
  19284. //
  19285. //
  19286. //
  19287. //
  19288. //
  19289. //
  19290. //
  19291. //
  19292. //
  19293. //
  19294. //
  19295. //
  19296. //
  19297. //
  19298. //
  19299. //
  19300. //
  19301. //
  19302. //
  19303. //
  19304. //
  19305. //
  19306. /* harmony default export */ var mainvue_type_script_lang_js_ = ({
  19307. name: 'ElPopover',
  19308. mixins: [vue_popper_default.a],
  19309. props: {
  19310. trigger: {
  19311. type: String,
  19312. default: 'click',
  19313. validator: function validator(value) {
  19314. return ['click', 'focus', 'hover', 'manual'].indexOf(value) > -1;
  19315. }
  19316. },
  19317. openDelay: {
  19318. type: Number,
  19319. default: 0
  19320. },
  19321. closeDelay: {
  19322. type: Number,
  19323. default: 200
  19324. },
  19325. title: String,
  19326. disabled: Boolean,
  19327. content: String,
  19328. reference: {},
  19329. popperClass: String,
  19330. width: {},
  19331. visibleArrow: {
  19332. default: true
  19333. },
  19334. arrowOffset: {
  19335. type: Number,
  19336. default: 0
  19337. },
  19338. transition: {
  19339. type: String,
  19340. default: 'fade-in-linear'
  19341. },
  19342. tabindex: {
  19343. type: Number,
  19344. default: 0
  19345. }
  19346. },
  19347. computed: {
  19348. tooltipId: function tooltipId() {
  19349. return 'el-popover-' + Object(util_["generateId"])();
  19350. }
  19351. },
  19352. watch: {
  19353. showPopper: function showPopper(val) {
  19354. if (this.disabled) {
  19355. return;
  19356. }
  19357. val ? this.$emit('show') : this.$emit('hide');
  19358. }
  19359. },
  19360. mounted: function mounted() {
  19361. var _this = this;
  19362. var reference = this.referenceElm = this.reference || this.$refs.reference;
  19363. var popper = this.popper || this.$refs.popper;
  19364. if (!reference && this.$refs.wrapper.children) {
  19365. reference = this.referenceElm = this.$refs.wrapper.children[0];
  19366. }
  19367. // 可访问性
  19368. if (reference) {
  19369. Object(dom_["addClass"])(reference, 'el-popover__reference');
  19370. reference.setAttribute('aria-describedby', this.tooltipId);
  19371. reference.setAttribute('tabindex', this.tabindex); // tab序列
  19372. popper.setAttribute('tabindex', 0);
  19373. if (this.trigger !== 'click') {
  19374. Object(dom_["on"])(reference, 'focusin', function () {
  19375. _this.handleFocus();
  19376. var instance = reference.__vue__;
  19377. if (instance && typeof instance.focus === 'function') {
  19378. instance.focus();
  19379. }
  19380. });
  19381. Object(dom_["on"])(popper, 'focusin', this.handleFocus);
  19382. Object(dom_["on"])(reference, 'focusout', this.handleBlur);
  19383. Object(dom_["on"])(popper, 'focusout', this.handleBlur);
  19384. }
  19385. Object(dom_["on"])(reference, 'keydown', this.handleKeydown);
  19386. Object(dom_["on"])(reference, 'click', this.handleClick);
  19387. }
  19388. if (this.trigger === 'click') {
  19389. Object(dom_["on"])(reference, 'click', this.doToggle);
  19390. Object(dom_["on"])(document, 'click', this.handleDocumentClick);
  19391. } else if (this.trigger === 'hover') {
  19392. Object(dom_["on"])(reference, 'mouseenter', this.handleMouseEnter);
  19393. Object(dom_["on"])(popper, 'mouseenter', this.handleMouseEnter);
  19394. Object(dom_["on"])(reference, 'mouseleave', this.handleMouseLeave);
  19395. Object(dom_["on"])(popper, 'mouseleave', this.handleMouseLeave);
  19396. } else if (this.trigger === 'focus') {
  19397. if (this.tabindex < 0) {
  19398. console.warn('[Element Warn][Popover]a negative taindex means that the element cannot be focused by tab key');
  19399. }
  19400. if (reference.querySelector('input, textarea')) {
  19401. Object(dom_["on"])(reference, 'focusin', this.doShow);
  19402. Object(dom_["on"])(reference, 'focusout', this.doClose);
  19403. } else {
  19404. Object(dom_["on"])(reference, 'mousedown', this.doShow);
  19405. Object(dom_["on"])(reference, 'mouseup', this.doClose);
  19406. }
  19407. }
  19408. },
  19409. beforeDestroy: function beforeDestroy() {
  19410. this.cleanup();
  19411. },
  19412. deactivated: function deactivated() {
  19413. this.cleanup();
  19414. },
  19415. methods: {
  19416. doToggle: function doToggle() {
  19417. this.showPopper = !this.showPopper;
  19418. },
  19419. doShow: function doShow() {
  19420. this.showPopper = true;
  19421. },
  19422. doClose: function doClose() {
  19423. this.showPopper = false;
  19424. },
  19425. handleFocus: function handleFocus() {
  19426. Object(dom_["addClass"])(this.referenceElm, 'focusing');
  19427. if (this.trigger === 'click' || this.trigger === 'focus') this.showPopper = true;
  19428. },
  19429. handleClick: function handleClick() {
  19430. Object(dom_["removeClass"])(this.referenceElm, 'focusing');
  19431. },
  19432. handleBlur: function handleBlur() {
  19433. Object(dom_["removeClass"])(this.referenceElm, 'focusing');
  19434. if (this.trigger === 'click' || this.trigger === 'focus') this.showPopper = false;
  19435. },
  19436. handleMouseEnter: function handleMouseEnter() {
  19437. var _this2 = this;
  19438. clearTimeout(this._timer);
  19439. if (this.openDelay) {
  19440. this._timer = setTimeout(function () {
  19441. _this2.showPopper = true;
  19442. }, this.openDelay);
  19443. } else {
  19444. this.showPopper = true;
  19445. }
  19446. },
  19447. handleKeydown: function handleKeydown(ev) {
  19448. if (ev.keyCode === 27 && this.trigger !== 'manual') {
  19449. // esc
  19450. this.doClose();
  19451. }
  19452. },
  19453. handleMouseLeave: function handleMouseLeave() {
  19454. var _this3 = this;
  19455. clearTimeout(this._timer);
  19456. if (this.closeDelay) {
  19457. this._timer = setTimeout(function () {
  19458. _this3.showPopper = false;
  19459. }, this.closeDelay);
  19460. } else {
  19461. this.showPopper = false;
  19462. }
  19463. },
  19464. handleDocumentClick: function handleDocumentClick(e) {
  19465. var reference = this.reference || this.$refs.reference;
  19466. var popper = this.popper || this.$refs.popper;
  19467. if (!reference && this.$refs.wrapper.children) {
  19468. reference = this.referenceElm = this.$refs.wrapper.children[0];
  19469. }
  19470. if (!this.$el || !reference || this.$el.contains(e.target) || reference.contains(e.target) || !popper || popper.contains(e.target)) return;
  19471. this.showPopper = false;
  19472. },
  19473. handleAfterEnter: function handleAfterEnter() {
  19474. this.$emit('after-enter');
  19475. },
  19476. handleAfterLeave: function handleAfterLeave() {
  19477. this.$emit('after-leave');
  19478. this.doDestroy();
  19479. },
  19480. cleanup: function cleanup() {
  19481. if (this.openDelay || this.closeDelay) {
  19482. clearTimeout(this._timer);
  19483. }
  19484. }
  19485. },
  19486. destroyed: function destroyed() {
  19487. var reference = this.reference;
  19488. Object(dom_["off"])(reference, 'click', this.doToggle);
  19489. Object(dom_["off"])(reference, 'mouseup', this.doClose);
  19490. Object(dom_["off"])(reference, 'mousedown', this.doShow);
  19491. Object(dom_["off"])(reference, 'focusin', this.doShow);
  19492. Object(dom_["off"])(reference, 'focusout', this.doClose);
  19493. Object(dom_["off"])(reference, 'mousedown', this.doShow);
  19494. Object(dom_["off"])(reference, 'mouseup', this.doClose);
  19495. Object(dom_["off"])(reference, 'mouseleave', this.handleMouseLeave);
  19496. Object(dom_["off"])(reference, 'mouseenter', this.handleMouseEnter);
  19497. Object(dom_["off"])(document, 'click', this.handleDocumentClick);
  19498. }
  19499. });
  19500. // CONCATENATED MODULE: ./packages/popover/src/main.vue?vue&type=script&lang=js&
  19501. /* harmony default export */ var src_mainvue_type_script_lang_js_ = (mainvue_type_script_lang_js_);
  19502. // CONCATENATED MODULE: ./packages/popover/src/main.vue
  19503. /* normalize component */
  19504. var main_component = normalizeComponent(
  19505. src_mainvue_type_script_lang_js_,
  19506. mainvue_type_template_id_52060272_render,
  19507. mainvue_type_template_id_52060272_staticRenderFns,
  19508. false,
  19509. null,
  19510. null,
  19511. null
  19512. )
  19513. /* hot reload */
  19514. if (false) { var main_api; }
  19515. main_component.options.__file = "packages/popover/src/main.vue"
  19516. /* harmony default export */ var main = (main_component.exports);
  19517. // CONCATENATED MODULE: ./packages/popover/src/directive.js
  19518. var getReference = function getReference(el, binding, vnode) {
  19519. var _ref = binding.expression ? binding.value : binding.arg;
  19520. var popper = vnode.context.$refs[_ref];
  19521. if (popper) {
  19522. if (Array.isArray(popper)) {
  19523. popper[0].$refs.reference = el;
  19524. } else {
  19525. popper.$refs.reference = el;
  19526. }
  19527. }
  19528. };
  19529. /* harmony default export */ var directive = ({
  19530. bind: function bind(el, binding, vnode) {
  19531. getReference(el, binding, vnode);
  19532. },
  19533. inserted: function inserted(el, binding, vnode) {
  19534. getReference(el, binding, vnode);
  19535. }
  19536. });
  19537. // CONCATENATED MODULE: ./packages/popover/index.js
  19538. external_vue_default.a.directive('popover', directive);
  19539. /* istanbul ignore next */
  19540. main.install = function (Vue) {
  19541. Vue.directive('popover', directive);
  19542. Vue.component(main.name, main);
  19543. };
  19544. main.directive = directive;
  19545. /* harmony default export */ var popover = (main);
  19546. // CONCATENATED MODULE: ./packages/tooltip/src/main.js
  19547. /* harmony default export */ var src_main = ({
  19548. name: 'ElTooltip',
  19549. mixins: [vue_popper_default.a],
  19550. props: {
  19551. openDelay: {
  19552. type: Number,
  19553. default: 0
  19554. },
  19555. disabled: Boolean,
  19556. manual: Boolean,
  19557. effect: {
  19558. type: String,
  19559. default: 'dark'
  19560. },
  19561. arrowOffset: {
  19562. type: Number,
  19563. default: 0
  19564. },
  19565. popperClass: String,
  19566. content: String,
  19567. visibleArrow: {
  19568. default: true
  19569. },
  19570. transition: {
  19571. type: String,
  19572. default: 'el-fade-in-linear'
  19573. },
  19574. popperOptions: {
  19575. default: function _default() {
  19576. return {
  19577. boundariesPadding: 10,
  19578. gpuAcceleration: false
  19579. };
  19580. }
  19581. },
  19582. enterable: {
  19583. type: Boolean,
  19584. default: true
  19585. },
  19586. hideAfter: {
  19587. type: Number,
  19588. default: 0
  19589. },
  19590. tabindex: {
  19591. type: Number,
  19592. default: 0
  19593. }
  19594. },
  19595. data: function data() {
  19596. return {
  19597. tooltipId: 'el-tooltip-' + Object(util_["generateId"])(),
  19598. timeoutPending: null,
  19599. focusing: false
  19600. };
  19601. },
  19602. beforeCreate: function beforeCreate() {
  19603. var _this = this;
  19604. if (this.$isServer) return;
  19605. this.popperVM = new external_vue_default.a({
  19606. data: { node: '' },
  19607. render: function render(h) {
  19608. return this.node;
  19609. }
  19610. }).$mount();
  19611. this.debounceClose = debounce_default()(200, function () {
  19612. return _this.handleClosePopper();
  19613. });
  19614. },
  19615. render: function render(h) {
  19616. var _this2 = this;
  19617. if (this.popperVM) {
  19618. this.popperVM.node = h(
  19619. 'transition',
  19620. {
  19621. attrs: {
  19622. name: this.transition
  19623. },
  19624. on: {
  19625. 'afterLeave': this.doDestroy
  19626. }
  19627. },
  19628. [h(
  19629. 'div',
  19630. {
  19631. on: {
  19632. 'mouseleave': function mouseleave() {
  19633. _this2.setExpectedState(false);_this2.debounceClose();
  19634. },
  19635. 'mouseenter': function mouseenter() {
  19636. _this2.setExpectedState(true);
  19637. }
  19638. },
  19639. ref: 'popper',
  19640. attrs: { role: 'tooltip',
  19641. id: this.tooltipId,
  19642. 'aria-hidden': this.disabled || !this.showPopper ? 'true' : 'false'
  19643. },
  19644. directives: [{
  19645. name: 'show',
  19646. value: !this.disabled && this.showPopper
  19647. }],
  19648. 'class': ['el-tooltip__popper', 'is-' + this.effect, this.popperClass] },
  19649. [this.$slots.content || this.content]
  19650. )]
  19651. );
  19652. }
  19653. var firstElement = this.getFirstElement();
  19654. if (!firstElement) return null;
  19655. var data = firstElement.data = firstElement.data || {};
  19656. data.staticClass = this.addTooltipClass(data.staticClass);
  19657. return firstElement;
  19658. },
  19659. mounted: function mounted() {
  19660. var _this3 = this;
  19661. this.referenceElm = this.$el;
  19662. if (this.$el.nodeType === 1) {
  19663. this.$el.setAttribute('aria-describedby', this.tooltipId);
  19664. this.$el.setAttribute('tabindex', this.tabindex);
  19665. Object(dom_["on"])(this.referenceElm, 'mouseenter', this.show);
  19666. Object(dom_["on"])(this.referenceElm, 'mouseleave', this.hide);
  19667. Object(dom_["on"])(this.referenceElm, 'focus', function () {
  19668. if (!_this3.$slots.default || !_this3.$slots.default.length) {
  19669. _this3.handleFocus();
  19670. return;
  19671. }
  19672. var instance = _this3.$slots.default[0].componentInstance;
  19673. if (instance && instance.focus) {
  19674. instance.focus();
  19675. } else {
  19676. _this3.handleFocus();
  19677. }
  19678. });
  19679. Object(dom_["on"])(this.referenceElm, 'blur', this.handleBlur);
  19680. Object(dom_["on"])(this.referenceElm, 'click', this.removeFocusing);
  19681. }
  19682. // fix issue https://github.com/ElemeFE/element/issues/14424
  19683. if (this.value && this.popperVM) {
  19684. this.popperVM.$nextTick(function () {
  19685. if (_this3.value) {
  19686. _this3.updatePopper();
  19687. }
  19688. });
  19689. }
  19690. },
  19691. watch: {
  19692. focusing: function focusing(val) {
  19693. if (val) {
  19694. Object(dom_["addClass"])(this.referenceElm, 'focusing');
  19695. } else {
  19696. Object(dom_["removeClass"])(this.referenceElm, 'focusing');
  19697. }
  19698. }
  19699. },
  19700. methods: {
  19701. show: function show() {
  19702. this.setExpectedState(true);
  19703. this.handleShowPopper();
  19704. },
  19705. hide: function hide() {
  19706. this.setExpectedState(false);
  19707. this.debounceClose();
  19708. },
  19709. handleFocus: function handleFocus() {
  19710. this.focusing = true;
  19711. this.show();
  19712. },
  19713. handleBlur: function handleBlur() {
  19714. this.focusing = false;
  19715. this.hide();
  19716. },
  19717. removeFocusing: function removeFocusing() {
  19718. this.focusing = false;
  19719. },
  19720. addTooltipClass: function addTooltipClass(prev) {
  19721. if (!prev) {
  19722. return 'el-tooltip';
  19723. } else {
  19724. return 'el-tooltip ' + prev.replace('el-tooltip', '');
  19725. }
  19726. },
  19727. handleShowPopper: function handleShowPopper() {
  19728. var _this4 = this;
  19729. if (!this.expectedState || this.manual) return;
  19730. clearTimeout(this.timeout);
  19731. this.timeout = setTimeout(function () {
  19732. _this4.showPopper = true;
  19733. }, this.openDelay);
  19734. if (this.hideAfter > 0) {
  19735. this.timeoutPending = setTimeout(function () {
  19736. _this4.showPopper = false;
  19737. }, this.hideAfter);
  19738. }
  19739. },
  19740. handleClosePopper: function handleClosePopper() {
  19741. if (this.enterable && this.expectedState || this.manual) return;
  19742. clearTimeout(this.timeout);
  19743. if (this.timeoutPending) {
  19744. clearTimeout(this.timeoutPending);
  19745. }
  19746. this.showPopper = false;
  19747. if (this.disabled) {
  19748. this.doDestroy();
  19749. }
  19750. },
  19751. setExpectedState: function setExpectedState(expectedState) {
  19752. if (expectedState === false) {
  19753. clearTimeout(this.timeoutPending);
  19754. }
  19755. this.expectedState = expectedState;
  19756. },
  19757. getFirstElement: function getFirstElement() {
  19758. var slots = this.$slots.default;
  19759. if (!Array.isArray(slots)) return null;
  19760. var element = null;
  19761. for (var index = 0; index < slots.length; index++) {
  19762. if (slots[index] && slots[index].tag) {
  19763. element = slots[index];
  19764. break;
  19765. };
  19766. }
  19767. return element;
  19768. }
  19769. },
  19770. beforeDestroy: function beforeDestroy() {
  19771. this.popperVM && this.popperVM.$destroy();
  19772. },
  19773. destroyed: function destroyed() {
  19774. var reference = this.referenceElm;
  19775. if (reference.nodeType === 1) {
  19776. Object(dom_["off"])(reference, 'mouseenter', this.show);
  19777. Object(dom_["off"])(reference, 'mouseleave', this.hide);
  19778. Object(dom_["off"])(reference, 'focus', this.handleFocus);
  19779. Object(dom_["off"])(reference, 'blur', this.handleBlur);
  19780. Object(dom_["off"])(reference, 'click', this.removeFocusing);
  19781. }
  19782. }
  19783. });
  19784. // CONCATENATED MODULE: ./packages/tooltip/index.js
  19785. /* istanbul ignore next */
  19786. src_main.install = function (Vue) {
  19787. Vue.component(src_main.name, src_main);
  19788. };
  19789. /* harmony default export */ var packages_tooltip = (src_main);
  19790. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/message-box/src/main.vue?vue&type=template&id=6b29b012&
  19791. var mainvue_type_template_id_6b29b012_render = function() {
  19792. var _vm = this
  19793. var _h = _vm.$createElement
  19794. var _c = _vm._self._c || _h
  19795. return _c("transition", { attrs: { name: "msgbox-fade" } }, [
  19796. _c(
  19797. "div",
  19798. {
  19799. directives: [
  19800. {
  19801. name: "show",
  19802. rawName: "v-show",
  19803. value: _vm.visible,
  19804. expression: "visible"
  19805. }
  19806. ],
  19807. staticClass: "el-message-box__wrapper",
  19808. attrs: {
  19809. tabindex: "-1",
  19810. role: "dialog",
  19811. "aria-modal": "true",
  19812. "aria-label": _vm.title || "dialog"
  19813. },
  19814. on: {
  19815. click: function($event) {
  19816. if ($event.target !== $event.currentTarget) {
  19817. return null
  19818. }
  19819. return _vm.handleWrapperClick($event)
  19820. }
  19821. }
  19822. },
  19823. [
  19824. _c(
  19825. "div",
  19826. {
  19827. staticClass: "el-message-box",
  19828. class: [_vm.customClass, _vm.center && "el-message-box--center"]
  19829. },
  19830. [
  19831. _vm.title !== null
  19832. ? _c("div", { staticClass: "el-message-box__header" }, [
  19833. _c("div", { staticClass: "el-message-box__title" }, [
  19834. _vm.icon && _vm.center
  19835. ? _c("div", {
  19836. class: ["el-message-box__status", _vm.icon]
  19837. })
  19838. : _vm._e(),
  19839. _c("span", [_vm._v(_vm._s(_vm.title))])
  19840. ]),
  19841. _vm.showClose
  19842. ? _c(
  19843. "button",
  19844. {
  19845. staticClass: "el-message-box__headerbtn",
  19846. attrs: { type: "button", "aria-label": "Close" },
  19847. on: {
  19848. click: function($event) {
  19849. _vm.handleAction(
  19850. _vm.distinguishCancelAndClose
  19851. ? "close"
  19852. : "cancel"
  19853. )
  19854. },
  19855. keydown: function($event) {
  19856. if (
  19857. !("button" in $event) &&
  19858. _vm._k(
  19859. $event.keyCode,
  19860. "enter",
  19861. 13,
  19862. $event.key,
  19863. "Enter"
  19864. )
  19865. ) {
  19866. return null
  19867. }
  19868. _vm.handleAction(
  19869. _vm.distinguishCancelAndClose
  19870. ? "close"
  19871. : "cancel"
  19872. )
  19873. }
  19874. }
  19875. },
  19876. [
  19877. _c("i", {
  19878. staticClass: "el-message-box__close el-icon-close"
  19879. })
  19880. ]
  19881. )
  19882. : _vm._e()
  19883. ])
  19884. : _vm._e(),
  19885. _c("div", { staticClass: "el-message-box__content" }, [
  19886. _c("div", { staticClass: "el-message-box__container" }, [
  19887. _vm.icon && !_vm.center && _vm.message !== ""
  19888. ? _c("div", { class: ["el-message-box__status", _vm.icon] })
  19889. : _vm._e(),
  19890. _vm.message !== ""
  19891. ? _c(
  19892. "div",
  19893. { staticClass: "el-message-box__message" },
  19894. [
  19895. _vm._t("default", [
  19896. !_vm.dangerouslyUseHTMLString
  19897. ? _c("p", [_vm._v(_vm._s(_vm.message))])
  19898. : _c("p", {
  19899. domProps: { innerHTML: _vm._s(_vm.message) }
  19900. })
  19901. ])
  19902. ],
  19903. 2
  19904. )
  19905. : _vm._e()
  19906. ]),
  19907. _c(
  19908. "div",
  19909. {
  19910. directives: [
  19911. {
  19912. name: "show",
  19913. rawName: "v-show",
  19914. value: _vm.showInput,
  19915. expression: "showInput"
  19916. }
  19917. ],
  19918. staticClass: "el-message-box__input"
  19919. },
  19920. [
  19921. _c("el-input", {
  19922. ref: "input",
  19923. attrs: {
  19924. type: _vm.inputType,
  19925. placeholder: _vm.inputPlaceholder
  19926. },
  19927. nativeOn: {
  19928. keydown: function($event) {
  19929. if (
  19930. !("button" in $event) &&
  19931. _vm._k(
  19932. $event.keyCode,
  19933. "enter",
  19934. 13,
  19935. $event.key,
  19936. "Enter"
  19937. )
  19938. ) {
  19939. return null
  19940. }
  19941. return _vm.handleInputEnter($event)
  19942. }
  19943. },
  19944. model: {
  19945. value: _vm.inputValue,
  19946. callback: function($$v) {
  19947. _vm.inputValue = $$v
  19948. },
  19949. expression: "inputValue"
  19950. }
  19951. }),
  19952. _c(
  19953. "div",
  19954. {
  19955. staticClass: "el-message-box__errormsg",
  19956. style: {
  19957. visibility: !!_vm.editorErrorMessage
  19958. ? "visible"
  19959. : "hidden"
  19960. }
  19961. },
  19962. [_vm._v(_vm._s(_vm.editorErrorMessage))]
  19963. )
  19964. ],
  19965. 1
  19966. )
  19967. ]),
  19968. _c(
  19969. "div",
  19970. { staticClass: "el-message-box__btns" },
  19971. [
  19972. _vm.showCancelButton
  19973. ? _c(
  19974. "el-button",
  19975. {
  19976. class: [_vm.cancelButtonClasses],
  19977. attrs: {
  19978. loading: _vm.cancelButtonLoading,
  19979. round: _vm.roundButton,
  19980. size: "small"
  19981. },
  19982. on: {
  19983. keydown: function($event) {
  19984. if (
  19985. !("button" in $event) &&
  19986. _vm._k(
  19987. $event.keyCode,
  19988. "enter",
  19989. 13,
  19990. $event.key,
  19991. "Enter"
  19992. )
  19993. ) {
  19994. return null
  19995. }
  19996. _vm.handleAction("cancel")
  19997. }
  19998. },
  19999. nativeOn: {
  20000. click: function($event) {
  20001. _vm.handleAction("cancel")
  20002. }
  20003. }
  20004. },
  20005. [
  20006. _vm._v(
  20007. "\n " +
  20008. _vm._s(
  20009. _vm.cancelButtonText ||
  20010. _vm.t("el.messagebox.cancel")
  20011. ) +
  20012. "\n "
  20013. )
  20014. ]
  20015. )
  20016. : _vm._e(),
  20017. _c(
  20018. "el-button",
  20019. {
  20020. directives: [
  20021. {
  20022. name: "show",
  20023. rawName: "v-show",
  20024. value: _vm.showConfirmButton,
  20025. expression: "showConfirmButton"
  20026. }
  20027. ],
  20028. ref: "confirm",
  20029. class: [_vm.confirmButtonClasses],
  20030. attrs: {
  20031. loading: _vm.confirmButtonLoading,
  20032. round: _vm.roundButton,
  20033. size: "small"
  20034. },
  20035. on: {
  20036. keydown: function($event) {
  20037. if (
  20038. !("button" in $event) &&
  20039. _vm._k(
  20040. $event.keyCode,
  20041. "enter",
  20042. 13,
  20043. $event.key,
  20044. "Enter"
  20045. )
  20046. ) {
  20047. return null
  20048. }
  20049. _vm.handleAction("confirm")
  20050. }
  20051. },
  20052. nativeOn: {
  20053. click: function($event) {
  20054. _vm.handleAction("confirm")
  20055. }
  20056. }
  20057. },
  20058. [
  20059. _vm._v(
  20060. "\n " +
  20061. _vm._s(
  20062. _vm.confirmButtonText ||
  20063. _vm.t("el.messagebox.confirm")
  20064. ) +
  20065. "\n "
  20066. )
  20067. ]
  20068. )
  20069. ],
  20070. 1
  20071. )
  20072. ]
  20073. )
  20074. ]
  20075. )
  20076. ])
  20077. }
  20078. var mainvue_type_template_id_6b29b012_staticRenderFns = []
  20079. mainvue_type_template_id_6b29b012_render._withStripped = true
  20080. // CONCATENATED MODULE: ./packages/message-box/src/main.vue?vue&type=template&id=6b29b012&
  20081. // EXTERNAL MODULE: external "element-ui/lib/locale"
  20082. var lib_locale_ = __webpack_require__(12);
  20083. var lib_locale_default = /*#__PURE__*/__webpack_require__.n(lib_locale_);
  20084. // EXTERNAL MODULE: external "element-ui/lib/utils/aria-dialog"
  20085. var aria_dialog_ = __webpack_require__(40);
  20086. var aria_dialog_default = /*#__PURE__*/__webpack_require__.n(aria_dialog_);
  20087. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/message-box/src/main.vue?vue&type=script&lang=js&
  20088. //
  20089. //
  20090. //
  20091. //
  20092. //
  20093. //
  20094. //
  20095. //
  20096. //
  20097. //
  20098. //
  20099. //
  20100. //
  20101. //
  20102. //
  20103. //
  20104. //
  20105. //
  20106. //
  20107. //
  20108. //
  20109. //
  20110. //
  20111. //
  20112. //
  20113. //
  20114. //
  20115. //
  20116. //
  20117. //
  20118. //
  20119. //
  20120. //
  20121. //
  20122. //
  20123. //
  20124. //
  20125. //
  20126. //
  20127. //
  20128. //
  20129. //
  20130. //
  20131. //
  20132. //
  20133. //
  20134. //
  20135. //
  20136. //
  20137. //
  20138. //
  20139. //
  20140. //
  20141. //
  20142. //
  20143. //
  20144. //
  20145. //
  20146. //
  20147. //
  20148. //
  20149. //
  20150. //
  20151. //
  20152. //
  20153. //
  20154. //
  20155. //
  20156. //
  20157. //
  20158. //
  20159. //
  20160. //
  20161. //
  20162. //
  20163. //
  20164. //
  20165. //
  20166. //
  20167. //
  20168. var messageBox = void 0;
  20169. var typeMap = {
  20170. success: 'success',
  20171. info: 'info',
  20172. warning: 'warning',
  20173. error: 'error'
  20174. };
  20175. /* harmony default export */ var message_box_src_mainvue_type_script_lang_js_ = ({
  20176. mixins: [popup_default.a, locale_default.a],
  20177. props: {
  20178. modal: {
  20179. default: true
  20180. },
  20181. lockScroll: {
  20182. default: true
  20183. },
  20184. showClose: {
  20185. type: Boolean,
  20186. default: true
  20187. },
  20188. closeOnClickModal: {
  20189. default: true
  20190. },
  20191. closeOnPressEscape: {
  20192. default: true
  20193. },
  20194. closeOnHashChange: {
  20195. default: true
  20196. },
  20197. center: {
  20198. default: false,
  20199. type: Boolean
  20200. },
  20201. roundButton: {
  20202. default: false,
  20203. type: Boolean
  20204. }
  20205. },
  20206. components: {
  20207. ElInput: input_default.a,
  20208. ElButton: button_default.a
  20209. },
  20210. computed: {
  20211. icon: function icon() {
  20212. var type = this.type,
  20213. iconClass = this.iconClass;
  20214. return iconClass || (type && typeMap[type] ? 'el-icon-' + typeMap[type] : '');
  20215. },
  20216. confirmButtonClasses: function confirmButtonClasses() {
  20217. return 'el-button--primary ' + this.confirmButtonClass;
  20218. },
  20219. cancelButtonClasses: function cancelButtonClasses() {
  20220. return '' + this.cancelButtonClass;
  20221. }
  20222. },
  20223. methods: {
  20224. getSafeClose: function getSafeClose() {
  20225. var _this = this;
  20226. var currentId = this.uid;
  20227. return function () {
  20228. _this.$nextTick(function () {
  20229. if (currentId === _this.uid) _this.doClose();
  20230. });
  20231. };
  20232. },
  20233. doClose: function doClose() {
  20234. var _this2 = this;
  20235. if (!this.visible) return;
  20236. this.visible = false;
  20237. this._closing = true;
  20238. this.onClose && this.onClose();
  20239. messageBox.closeDialog(); // 解绑
  20240. if (this.lockScroll) {
  20241. setTimeout(this.restoreBodyStyle, 200);
  20242. }
  20243. this.opened = false;
  20244. this.doAfterClose();
  20245. setTimeout(function () {
  20246. if (_this2.action) _this2.callback(_this2.action, _this2);
  20247. });
  20248. },
  20249. handleWrapperClick: function handleWrapperClick() {
  20250. if (this.closeOnClickModal) {
  20251. this.handleAction(this.distinguishCancelAndClose ? 'close' : 'cancel');
  20252. }
  20253. },
  20254. handleInputEnter: function handleInputEnter() {
  20255. if (this.inputType !== 'textarea') {
  20256. return this.handleAction('confirm');
  20257. }
  20258. },
  20259. handleAction: function handleAction(action) {
  20260. if (this.$type === 'prompt' && action === 'confirm' && !this.validate()) {
  20261. return;
  20262. }
  20263. this.action = action;
  20264. if (typeof this.beforeClose === 'function') {
  20265. this.close = this.getSafeClose();
  20266. this.beforeClose(action, this, this.close);
  20267. } else {
  20268. this.doClose();
  20269. }
  20270. },
  20271. validate: function validate() {
  20272. if (this.$type === 'prompt') {
  20273. var inputPattern = this.inputPattern;
  20274. if (inputPattern && !inputPattern.test(this.inputValue || '')) {
  20275. this.editorErrorMessage = this.inputErrorMessage || Object(lib_locale_["t"])('el.messagebox.error');
  20276. Object(dom_["addClass"])(this.getInputElement(), 'invalid');
  20277. return false;
  20278. }
  20279. var inputValidator = this.inputValidator;
  20280. if (typeof inputValidator === 'function') {
  20281. var validateResult = inputValidator(this.inputValue);
  20282. if (validateResult === false) {
  20283. this.editorErrorMessage = this.inputErrorMessage || Object(lib_locale_["t"])('el.messagebox.error');
  20284. Object(dom_["addClass"])(this.getInputElement(), 'invalid');
  20285. return false;
  20286. }
  20287. if (typeof validateResult === 'string') {
  20288. this.editorErrorMessage = validateResult;
  20289. Object(dom_["addClass"])(this.getInputElement(), 'invalid');
  20290. return false;
  20291. }
  20292. }
  20293. }
  20294. this.editorErrorMessage = '';
  20295. Object(dom_["removeClass"])(this.getInputElement(), 'invalid');
  20296. return true;
  20297. },
  20298. getFirstFocus: function getFirstFocus() {
  20299. var btn = this.$el.querySelector('.el-message-box__btns .el-button');
  20300. var title = this.$el.querySelector('.el-message-box__btns .el-message-box__title');
  20301. return btn || title;
  20302. },
  20303. getInputElement: function getInputElement() {
  20304. var inputRefs = this.$refs.input.$refs;
  20305. return inputRefs.input || inputRefs.textarea;
  20306. },
  20307. handleClose: function handleClose() {
  20308. this.handleAction('close');
  20309. }
  20310. },
  20311. watch: {
  20312. inputValue: {
  20313. immediate: true,
  20314. handler: function handler(val) {
  20315. var _this3 = this;
  20316. this.$nextTick(function (_) {
  20317. if (_this3.$type === 'prompt' && val !== null) {
  20318. _this3.validate();
  20319. }
  20320. });
  20321. }
  20322. },
  20323. visible: function visible(val) {
  20324. var _this4 = this;
  20325. if (val) {
  20326. this.uid++;
  20327. if (this.$type === 'alert' || this.$type === 'confirm') {
  20328. this.$nextTick(function () {
  20329. _this4.$refs.confirm.$el.focus();
  20330. });
  20331. }
  20332. this.focusAfterClosed = document.activeElement;
  20333. messageBox = new aria_dialog_default.a(this.$el, this.focusAfterClosed, this.getFirstFocus());
  20334. }
  20335. // prompt
  20336. if (this.$type !== 'prompt') return;
  20337. if (val) {
  20338. setTimeout(function () {
  20339. if (_this4.$refs.input && _this4.$refs.input.$el) {
  20340. _this4.getInputElement().focus();
  20341. }
  20342. }, 500);
  20343. } else {
  20344. this.editorErrorMessage = '';
  20345. Object(dom_["removeClass"])(this.getInputElement(), 'invalid');
  20346. }
  20347. }
  20348. },
  20349. mounted: function mounted() {
  20350. var _this5 = this;
  20351. this.$nextTick(function () {
  20352. if (_this5.closeOnHashChange) {
  20353. window.addEventListener('hashchange', _this5.close);
  20354. }
  20355. });
  20356. },
  20357. beforeDestroy: function beforeDestroy() {
  20358. if (this.closeOnHashChange) {
  20359. window.removeEventListener('hashchange', this.close);
  20360. }
  20361. setTimeout(function () {
  20362. messageBox.closeDialog();
  20363. });
  20364. },
  20365. data: function data() {
  20366. return {
  20367. uid: 1,
  20368. title: undefined,
  20369. message: '',
  20370. type: '',
  20371. iconClass: '',
  20372. customClass: '',
  20373. showInput: false,
  20374. inputValue: null,
  20375. inputPlaceholder: '',
  20376. inputType: 'text',
  20377. inputPattern: null,
  20378. inputValidator: null,
  20379. inputErrorMessage: '',
  20380. showConfirmButton: true,
  20381. showCancelButton: false,
  20382. action: '',
  20383. confirmButtonText: '',
  20384. cancelButtonText: '',
  20385. confirmButtonLoading: false,
  20386. cancelButtonLoading: false,
  20387. confirmButtonClass: '',
  20388. confirmButtonDisabled: false,
  20389. cancelButtonClass: '',
  20390. editorErrorMessage: null,
  20391. callback: null,
  20392. dangerouslyUseHTMLString: false,
  20393. focusAfterClosed: null,
  20394. isOnComposition: false,
  20395. distinguishCancelAndClose: false
  20396. };
  20397. }
  20398. });
  20399. // CONCATENATED MODULE: ./packages/message-box/src/main.vue?vue&type=script&lang=js&
  20400. /* harmony default export */ var packages_message_box_src_mainvue_type_script_lang_js_ = (message_box_src_mainvue_type_script_lang_js_);
  20401. // CONCATENATED MODULE: ./packages/message-box/src/main.vue
  20402. /* normalize component */
  20403. var src_main_component = normalizeComponent(
  20404. packages_message_box_src_mainvue_type_script_lang_js_,
  20405. mainvue_type_template_id_6b29b012_render,
  20406. mainvue_type_template_id_6b29b012_staticRenderFns,
  20407. false,
  20408. null,
  20409. null,
  20410. null
  20411. )
  20412. /* hot reload */
  20413. if (false) { var src_main_api; }
  20414. src_main_component.options.__file = "packages/message-box/src/main.vue"
  20415. /* harmony default export */ var message_box_src_main = (src_main_component.exports);
  20416. // EXTERNAL MODULE: external "element-ui/lib/utils/vdom"
  20417. var vdom_ = __webpack_require__(22);
  20418. // CONCATENATED MODULE: ./packages/message-box/src/main.js
  20419. var main_typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  20420. var main_defaults = {
  20421. title: null,
  20422. message: '',
  20423. type: '',
  20424. iconClass: '',
  20425. showInput: false,
  20426. showClose: true,
  20427. modalFade: true,
  20428. lockScroll: true,
  20429. closeOnClickModal: true,
  20430. closeOnPressEscape: true,
  20431. closeOnHashChange: true,
  20432. inputValue: null,
  20433. inputPlaceholder: '',
  20434. inputType: 'text',
  20435. inputPattern: null,
  20436. inputValidator: null,
  20437. inputErrorMessage: '',
  20438. showConfirmButton: true,
  20439. showCancelButton: false,
  20440. confirmButtonPosition: 'right',
  20441. confirmButtonHighlight: false,
  20442. cancelButtonHighlight: false,
  20443. confirmButtonText: '',
  20444. cancelButtonText: '',
  20445. confirmButtonClass: '',
  20446. cancelButtonClass: '',
  20447. customClass: '',
  20448. beforeClose: null,
  20449. dangerouslyUseHTMLString: false,
  20450. center: false,
  20451. roundButton: false,
  20452. distinguishCancelAndClose: false
  20453. };
  20454. var MessageBoxConstructor = external_vue_default.a.extend(message_box_src_main);
  20455. var currentMsg = void 0,
  20456. main_instance = void 0;
  20457. var msgQueue = [];
  20458. var defaultCallback = function defaultCallback(action) {
  20459. if (currentMsg) {
  20460. var callback = currentMsg.callback;
  20461. if (typeof callback === 'function') {
  20462. if (main_instance.showInput) {
  20463. callback(main_instance.inputValue, action);
  20464. } else {
  20465. callback(action);
  20466. }
  20467. }
  20468. if (currentMsg.resolve) {
  20469. if (action === 'confirm') {
  20470. if (main_instance.showInput) {
  20471. currentMsg.resolve({ value: main_instance.inputValue, action: action });
  20472. } else {
  20473. currentMsg.resolve(action);
  20474. }
  20475. } else if (currentMsg.reject && (action === 'cancel' || action === 'close')) {
  20476. currentMsg.reject(action);
  20477. }
  20478. }
  20479. }
  20480. };
  20481. var initInstance = function initInstance() {
  20482. main_instance = new MessageBoxConstructor({
  20483. el: document.createElement('div')
  20484. });
  20485. main_instance.callback = defaultCallback;
  20486. };
  20487. var main_showNextMsg = function showNextMsg() {
  20488. if (!main_instance) {
  20489. initInstance();
  20490. }
  20491. main_instance.action = '';
  20492. if (!main_instance.visible || main_instance.closeTimer) {
  20493. if (msgQueue.length > 0) {
  20494. currentMsg = msgQueue.shift();
  20495. var options = currentMsg.options;
  20496. for (var prop in options) {
  20497. if (options.hasOwnProperty(prop)) {
  20498. main_instance[prop] = options[prop];
  20499. }
  20500. }
  20501. if (options.callback === undefined) {
  20502. main_instance.callback = defaultCallback;
  20503. }
  20504. var oldCb = main_instance.callback;
  20505. main_instance.callback = function (action, instance) {
  20506. oldCb(action, instance);
  20507. showNextMsg();
  20508. };
  20509. if (Object(vdom_["isVNode"])(main_instance.message)) {
  20510. main_instance.$slots.default = [main_instance.message];
  20511. main_instance.message = null;
  20512. } else {
  20513. delete main_instance.$slots.default;
  20514. }
  20515. ['modal', 'showClose', 'closeOnClickModal', 'closeOnPressEscape', 'closeOnHashChange'].forEach(function (prop) {
  20516. if (main_instance[prop] === undefined) {
  20517. main_instance[prop] = true;
  20518. }
  20519. });
  20520. document.body.appendChild(main_instance.$el);
  20521. external_vue_default.a.nextTick(function () {
  20522. main_instance.visible = true;
  20523. });
  20524. }
  20525. }
  20526. };
  20527. var main_MessageBox = function MessageBox(options, callback) {
  20528. if (external_vue_default.a.prototype.$isServer) return;
  20529. if (typeof options === 'string' || Object(vdom_["isVNode"])(options)) {
  20530. options = {
  20531. message: options
  20532. };
  20533. if (typeof arguments[1] === 'string') {
  20534. options.title = arguments[1];
  20535. }
  20536. } else if (options.callback && !callback) {
  20537. callback = options.callback;
  20538. }
  20539. if (typeof Promise !== 'undefined') {
  20540. return new Promise(function (resolve, reject) {
  20541. // eslint-disable-line
  20542. msgQueue.push({
  20543. options: merge_default()({}, main_defaults, MessageBox.defaults, options),
  20544. callback: callback,
  20545. resolve: resolve,
  20546. reject: reject
  20547. });
  20548. main_showNextMsg();
  20549. });
  20550. } else {
  20551. msgQueue.push({
  20552. options: merge_default()({}, main_defaults, MessageBox.defaults, options),
  20553. callback: callback
  20554. });
  20555. main_showNextMsg();
  20556. }
  20557. };
  20558. main_MessageBox.setDefaults = function (defaults) {
  20559. main_MessageBox.defaults = defaults;
  20560. };
  20561. main_MessageBox.alert = function (message, title, options) {
  20562. if ((typeof title === 'undefined' ? 'undefined' : main_typeof(title)) === 'object') {
  20563. options = title;
  20564. title = '';
  20565. } else if (title === undefined) {
  20566. title = '';
  20567. }
  20568. return main_MessageBox(merge_default()({
  20569. title: title,
  20570. message: message,
  20571. $type: 'alert',
  20572. closeOnPressEscape: false,
  20573. closeOnClickModal: false
  20574. }, options));
  20575. };
  20576. main_MessageBox.confirm = function (message, title, options) {
  20577. if ((typeof title === 'undefined' ? 'undefined' : main_typeof(title)) === 'object') {
  20578. options = title;
  20579. title = '';
  20580. } else if (title === undefined) {
  20581. title = '';
  20582. }
  20583. return main_MessageBox(merge_default()({
  20584. title: title,
  20585. message: message,
  20586. $type: 'confirm',
  20587. showCancelButton: true
  20588. }, options));
  20589. };
  20590. main_MessageBox.prompt = function (message, title, options) {
  20591. if ((typeof title === 'undefined' ? 'undefined' : main_typeof(title)) === 'object') {
  20592. options = title;
  20593. title = '';
  20594. } else if (title === undefined) {
  20595. title = '';
  20596. }
  20597. return main_MessageBox(merge_default()({
  20598. title: title,
  20599. message: message,
  20600. showCancelButton: true,
  20601. showInput: true,
  20602. $type: 'prompt'
  20603. }, options));
  20604. };
  20605. main_MessageBox.close = function () {
  20606. main_instance.doClose();
  20607. main_instance.visible = false;
  20608. msgQueue = [];
  20609. currentMsg = null;
  20610. };
  20611. /* harmony default export */ var packages_message_box_src_main = (main_MessageBox);
  20612. // CONCATENATED MODULE: ./packages/message-box/index.js
  20613. /* harmony default export */ var message_box = (packages_message_box_src_main);
  20614. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/breadcrumb/src/breadcrumb.vue?vue&type=template&id=4b464c06&
  20615. var breadcrumbvue_type_template_id_4b464c06_render = function() {
  20616. var _vm = this
  20617. var _h = _vm.$createElement
  20618. var _c = _vm._self._c || _h
  20619. return _c(
  20620. "div",
  20621. {
  20622. staticClass: "el-breadcrumb",
  20623. attrs: { "aria-label": "Breadcrumb", role: "navigation" }
  20624. },
  20625. [_vm._t("default")],
  20626. 2
  20627. )
  20628. }
  20629. var breadcrumbvue_type_template_id_4b464c06_staticRenderFns = []
  20630. breadcrumbvue_type_template_id_4b464c06_render._withStripped = true
  20631. // CONCATENATED MODULE: ./packages/breadcrumb/src/breadcrumb.vue?vue&type=template&id=4b464c06&
  20632. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/breadcrumb/src/breadcrumb.vue?vue&type=script&lang=js&
  20633. //
  20634. //
  20635. //
  20636. //
  20637. //
  20638. /* harmony default export */ var breadcrumbvue_type_script_lang_js_ = ({
  20639. name: 'ElBreadcrumb',
  20640. props: {
  20641. separator: {
  20642. type: String,
  20643. default: '/'
  20644. },
  20645. separatorClass: {
  20646. type: String,
  20647. default: ''
  20648. }
  20649. },
  20650. provide: function provide() {
  20651. return {
  20652. elBreadcrumb: this
  20653. };
  20654. },
  20655. mounted: function mounted() {
  20656. var items = this.$el.querySelectorAll('.el-breadcrumb__item');
  20657. if (items.length) {
  20658. items[items.length - 1].setAttribute('aria-current', 'page');
  20659. }
  20660. }
  20661. });
  20662. // CONCATENATED MODULE: ./packages/breadcrumb/src/breadcrumb.vue?vue&type=script&lang=js&
  20663. /* harmony default export */ var src_breadcrumbvue_type_script_lang_js_ = (breadcrumbvue_type_script_lang_js_);
  20664. // CONCATENATED MODULE: ./packages/breadcrumb/src/breadcrumb.vue
  20665. /* normalize component */
  20666. var breadcrumb_component = normalizeComponent(
  20667. src_breadcrumbvue_type_script_lang_js_,
  20668. breadcrumbvue_type_template_id_4b464c06_render,
  20669. breadcrumbvue_type_template_id_4b464c06_staticRenderFns,
  20670. false,
  20671. null,
  20672. null,
  20673. null
  20674. )
  20675. /* hot reload */
  20676. if (false) { var breadcrumb_api; }
  20677. breadcrumb_component.options.__file = "packages/breadcrumb/src/breadcrumb.vue"
  20678. /* harmony default export */ var breadcrumb = (breadcrumb_component.exports);
  20679. // CONCATENATED MODULE: ./packages/breadcrumb/index.js
  20680. /* istanbul ignore next */
  20681. breadcrumb.install = function (Vue) {
  20682. Vue.component(breadcrumb.name, breadcrumb);
  20683. };
  20684. /* harmony default export */ var packages_breadcrumb = (breadcrumb);
  20685. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/breadcrumb/src/breadcrumb-item.vue?vue&type=template&id=fcf9eaac&
  20686. var breadcrumb_itemvue_type_template_id_fcf9eaac_render = function() {
  20687. var _vm = this
  20688. var _h = _vm.$createElement
  20689. var _c = _vm._self._c || _h
  20690. return _c("span", { staticClass: "el-breadcrumb__item" }, [
  20691. _c(
  20692. "span",
  20693. {
  20694. ref: "link",
  20695. class: ["el-breadcrumb__inner", _vm.to ? "is-link" : ""],
  20696. attrs: { role: "link" }
  20697. },
  20698. [_vm._t("default")],
  20699. 2
  20700. ),
  20701. _vm.separatorClass
  20702. ? _c("i", {
  20703. staticClass: "el-breadcrumb__separator",
  20704. class: _vm.separatorClass
  20705. })
  20706. : _c(
  20707. "span",
  20708. {
  20709. staticClass: "el-breadcrumb__separator",
  20710. attrs: { role: "presentation" }
  20711. },
  20712. [_vm._v(_vm._s(_vm.separator))]
  20713. )
  20714. ])
  20715. }
  20716. var breadcrumb_itemvue_type_template_id_fcf9eaac_staticRenderFns = []
  20717. breadcrumb_itemvue_type_template_id_fcf9eaac_render._withStripped = true
  20718. // CONCATENATED MODULE: ./packages/breadcrumb/src/breadcrumb-item.vue?vue&type=template&id=fcf9eaac&
  20719. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/breadcrumb/src/breadcrumb-item.vue?vue&type=script&lang=js&
  20720. //
  20721. //
  20722. //
  20723. //
  20724. //
  20725. //
  20726. //
  20727. //
  20728. //
  20729. //
  20730. //
  20731. //
  20732. /* harmony default export */ var breadcrumb_itemvue_type_script_lang_js_ = ({
  20733. name: 'ElBreadcrumbItem',
  20734. props: {
  20735. to: {},
  20736. replace: Boolean
  20737. },
  20738. data: function data() {
  20739. return {
  20740. separator: '',
  20741. separatorClass: ''
  20742. };
  20743. },
  20744. inject: ['elBreadcrumb'],
  20745. mounted: function mounted() {
  20746. var _this = this;
  20747. this.separator = this.elBreadcrumb.separator;
  20748. this.separatorClass = this.elBreadcrumb.separatorClass;
  20749. var link = this.$refs.link;
  20750. link.setAttribute('role', 'link');
  20751. link.addEventListener('click', function (_) {
  20752. var to = _this.to,
  20753. $router = _this.$router;
  20754. if (!to || !$router) return;
  20755. _this.replace ? $router.replace(to) : $router.push(to);
  20756. });
  20757. }
  20758. });
  20759. // CONCATENATED MODULE: ./packages/breadcrumb/src/breadcrumb-item.vue?vue&type=script&lang=js&
  20760. /* harmony default export */ var src_breadcrumb_itemvue_type_script_lang_js_ = (breadcrumb_itemvue_type_script_lang_js_);
  20761. // CONCATENATED MODULE: ./packages/breadcrumb/src/breadcrumb-item.vue
  20762. /* normalize component */
  20763. var breadcrumb_item_component = normalizeComponent(
  20764. src_breadcrumb_itemvue_type_script_lang_js_,
  20765. breadcrumb_itemvue_type_template_id_fcf9eaac_render,
  20766. breadcrumb_itemvue_type_template_id_fcf9eaac_staticRenderFns,
  20767. false,
  20768. null,
  20769. null,
  20770. null
  20771. )
  20772. /* hot reload */
  20773. if (false) { var breadcrumb_item_api; }
  20774. breadcrumb_item_component.options.__file = "packages/breadcrumb/src/breadcrumb-item.vue"
  20775. /* harmony default export */ var breadcrumb_item = (breadcrumb_item_component.exports);
  20776. // CONCATENATED MODULE: ./packages/breadcrumb-item/index.js
  20777. /* istanbul ignore next */
  20778. breadcrumb_item.install = function (Vue) {
  20779. Vue.component(breadcrumb_item.name, breadcrumb_item);
  20780. };
  20781. /* harmony default export */ var packages_breadcrumb_item = (breadcrumb_item);
  20782. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/form/src/form.vue?vue&type=template&id=a1b5ff34&
  20783. var formvue_type_template_id_a1b5ff34_render = function() {
  20784. var _vm = this
  20785. var _h = _vm.$createElement
  20786. var _c = _vm._self._c || _h
  20787. return _c(
  20788. "form",
  20789. {
  20790. staticClass: "el-form",
  20791. class: [
  20792. _vm.labelPosition ? "el-form--label-" + _vm.labelPosition : "",
  20793. { "el-form--inline": _vm.inline }
  20794. ]
  20795. },
  20796. [_vm._t("default")],
  20797. 2
  20798. )
  20799. }
  20800. var formvue_type_template_id_a1b5ff34_staticRenderFns = []
  20801. formvue_type_template_id_a1b5ff34_render._withStripped = true
  20802. // CONCATENATED MODULE: ./packages/form/src/form.vue?vue&type=template&id=a1b5ff34&
  20803. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/form/src/form.vue?vue&type=script&lang=js&
  20804. //
  20805. //
  20806. //
  20807. //
  20808. //
  20809. //
  20810. //
  20811. //
  20812. /* harmony default export */ var formvue_type_script_lang_js_ = ({
  20813. name: 'ElForm',
  20814. componentName: 'ElForm',
  20815. provide: function provide() {
  20816. return {
  20817. elForm: this
  20818. };
  20819. },
  20820. props: {
  20821. model: Object,
  20822. rules: Object,
  20823. labelPosition: String,
  20824. labelWidth: String,
  20825. labelSuffix: {
  20826. type: String,
  20827. default: ''
  20828. },
  20829. inline: Boolean,
  20830. inlineMessage: Boolean,
  20831. statusIcon: Boolean,
  20832. showMessage: {
  20833. type: Boolean,
  20834. default: true
  20835. },
  20836. size: String,
  20837. disabled: Boolean,
  20838. validateOnRuleChange: {
  20839. type: Boolean,
  20840. default: true
  20841. },
  20842. hideRequiredAsterisk: {
  20843. type: Boolean,
  20844. default: false
  20845. }
  20846. },
  20847. watch: {
  20848. rules: function rules() {
  20849. // remove then add event listeners on form-item after form rules change
  20850. this.fields.forEach(function (field) {
  20851. field.removeValidateEvents();
  20852. field.addValidateEvents();
  20853. });
  20854. if (this.validateOnRuleChange) {
  20855. this.validate(function () {});
  20856. }
  20857. }
  20858. },
  20859. computed: {
  20860. autoLabelWidth: function autoLabelWidth() {
  20861. if (!this.potentialLabelWidthArr.length) return 0;
  20862. var max = Math.max.apply(Math, this.potentialLabelWidthArr);
  20863. return max ? max + 'px' : '';
  20864. }
  20865. },
  20866. data: function data() {
  20867. return {
  20868. fields: [],
  20869. potentialLabelWidthArr: [] // use this array to calculate auto width
  20870. };
  20871. },
  20872. created: function created() {
  20873. var _this = this;
  20874. this.$on('el.form.addField', function (field) {
  20875. if (field) {
  20876. _this.fields.push(field);
  20877. }
  20878. });
  20879. /* istanbul ignore next */
  20880. this.$on('el.form.removeField', function (field) {
  20881. if (field.prop) {
  20882. _this.fields.splice(_this.fields.indexOf(field), 1);
  20883. }
  20884. });
  20885. },
  20886. methods: {
  20887. resetFields: function resetFields() {
  20888. if (!this.model) {
  20889. console.warn('[Element Warn][Form]model is required for resetFields to work.');
  20890. return;
  20891. }
  20892. this.fields.forEach(function (field) {
  20893. field.resetField();
  20894. });
  20895. },
  20896. clearValidate: function clearValidate() {
  20897. var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  20898. var fields = props.length ? typeof props === 'string' ? this.fields.filter(function (field) {
  20899. return props === field.prop;
  20900. }) : this.fields.filter(function (field) {
  20901. return props.indexOf(field.prop) > -1;
  20902. }) : this.fields;
  20903. fields.forEach(function (field) {
  20904. field.clearValidate();
  20905. });
  20906. },
  20907. validate: function validate(callback) {
  20908. var _this2 = this;
  20909. if (!this.model) {
  20910. console.warn('[Element Warn][Form]model is required for validate to work!');
  20911. return;
  20912. }
  20913. var promise = void 0;
  20914. // if no callback, return promise
  20915. if (typeof callback !== 'function' && window.Promise) {
  20916. promise = new window.Promise(function (resolve, reject) {
  20917. callback = function callback(valid, invalidFields) {
  20918. valid ? resolve(valid) : reject(invalidFields);
  20919. };
  20920. });
  20921. }
  20922. var valid = true;
  20923. var count = 0;
  20924. // 如果需要验证的fields为空,调用验证时立刻返回callback
  20925. if (this.fields.length === 0 && callback) {
  20926. callback(true);
  20927. }
  20928. var invalidFields = {};
  20929. this.fields.forEach(function (field) {
  20930. field.validate('', function (message, field) {
  20931. if (message) {
  20932. valid = false;
  20933. }
  20934. invalidFields = merge_default()({}, invalidFields, field);
  20935. if (typeof callback === 'function' && ++count === _this2.fields.length) {
  20936. callback(valid, invalidFields);
  20937. }
  20938. });
  20939. });
  20940. if (promise) {
  20941. return promise;
  20942. }
  20943. },
  20944. validateField: function validateField(props, cb) {
  20945. props = [].concat(props);
  20946. var fields = this.fields.filter(function (field) {
  20947. return props.indexOf(field.prop) !== -1;
  20948. });
  20949. if (!fields.length) {
  20950. console.warn('[Element Warn]please pass correct props!');
  20951. return;
  20952. }
  20953. fields.forEach(function (field) {
  20954. field.validate('', cb);
  20955. });
  20956. },
  20957. getLabelWidthIndex: function getLabelWidthIndex(width) {
  20958. var index = this.potentialLabelWidthArr.indexOf(width);
  20959. // it's impossible
  20960. if (index === -1) {
  20961. throw new Error('[ElementForm]unpected width ', width);
  20962. }
  20963. return index;
  20964. },
  20965. registerLabelWidth: function registerLabelWidth(val, oldVal) {
  20966. if (val && oldVal) {
  20967. var index = this.getLabelWidthIndex(oldVal);
  20968. this.potentialLabelWidthArr.splice(index, 1, val);
  20969. } else if (val) {
  20970. this.potentialLabelWidthArr.push(val);
  20971. }
  20972. },
  20973. deregisterLabelWidth: function deregisterLabelWidth(val) {
  20974. var index = this.getLabelWidthIndex(val);
  20975. this.potentialLabelWidthArr.splice(index, 1);
  20976. }
  20977. }
  20978. });
  20979. // CONCATENATED MODULE: ./packages/form/src/form.vue?vue&type=script&lang=js&
  20980. /* harmony default export */ var src_formvue_type_script_lang_js_ = (formvue_type_script_lang_js_);
  20981. // CONCATENATED MODULE: ./packages/form/src/form.vue
  20982. /* normalize component */
  20983. var form_component = normalizeComponent(
  20984. src_formvue_type_script_lang_js_,
  20985. formvue_type_template_id_a1b5ff34_render,
  20986. formvue_type_template_id_a1b5ff34_staticRenderFns,
  20987. false,
  20988. null,
  20989. null,
  20990. null
  20991. )
  20992. /* hot reload */
  20993. if (false) { var form_api; }
  20994. form_component.options.__file = "packages/form/src/form.vue"
  20995. /* harmony default export */ var src_form = (form_component.exports);
  20996. // CONCATENATED MODULE: ./packages/form/index.js
  20997. /* istanbul ignore next */
  20998. src_form.install = function (Vue) {
  20999. Vue.component(src_form.name, src_form);
  21000. };
  21001. /* harmony default export */ var packages_form = (src_form);
  21002. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/form/src/form-item.vue?vue&type=template&id=b6f3db6c&
  21003. var form_itemvue_type_template_id_b6f3db6c_render = function() {
  21004. var _vm = this
  21005. var _h = _vm.$createElement
  21006. var _c = _vm._self._c || _h
  21007. return _c(
  21008. "div",
  21009. {
  21010. staticClass: "el-form-item",
  21011. class: [
  21012. {
  21013. "el-form-item--feedback": _vm.elForm && _vm.elForm.statusIcon,
  21014. "is-error": _vm.validateState === "error",
  21015. "is-validating": _vm.validateState === "validating",
  21016. "is-success": _vm.validateState === "success",
  21017. "is-required": _vm.isRequired || _vm.required,
  21018. "is-no-asterisk": _vm.elForm && _vm.elForm.hideRequiredAsterisk
  21019. },
  21020. _vm.sizeClass ? "el-form-item--" + _vm.sizeClass : ""
  21021. ]
  21022. },
  21023. [
  21024. _c(
  21025. "label-wrap",
  21026. {
  21027. attrs: {
  21028. "is-auto-width": _vm.labelStyle && _vm.labelStyle.width === "auto",
  21029. "update-all": _vm.form.labelWidth === "auto"
  21030. }
  21031. },
  21032. [
  21033. _vm.label || _vm.$slots.label
  21034. ? _c(
  21035. "label",
  21036. {
  21037. staticClass: "el-form-item__label",
  21038. style: _vm.labelStyle,
  21039. attrs: { for: _vm.labelFor }
  21040. },
  21041. [
  21042. _vm._t("label", [
  21043. _vm._v(_vm._s(_vm.label + _vm.form.labelSuffix))
  21044. ])
  21045. ],
  21046. 2
  21047. )
  21048. : _vm._e()
  21049. ]
  21050. ),
  21051. _c(
  21052. "div",
  21053. { staticClass: "el-form-item__content", style: _vm.contentStyle },
  21054. [
  21055. _vm._t("default"),
  21056. _c(
  21057. "transition",
  21058. { attrs: { name: "el-zoom-in-top" } },
  21059. [
  21060. _vm.validateState === "error" &&
  21061. _vm.showMessage &&
  21062. _vm.form.showMessage
  21063. ? _vm._t(
  21064. "error",
  21065. [
  21066. _c(
  21067. "div",
  21068. {
  21069. staticClass: "el-form-item__error",
  21070. class: {
  21071. "el-form-item__error--inline":
  21072. typeof _vm.inlineMessage === "boolean"
  21073. ? _vm.inlineMessage
  21074. : (_vm.elForm && _vm.elForm.inlineMessage) ||
  21075. false
  21076. }
  21077. },
  21078. [
  21079. _vm._v(
  21080. "\n " +
  21081. _vm._s(_vm.validateMessage) +
  21082. "\n "
  21083. )
  21084. ]
  21085. )
  21086. ],
  21087. { error: _vm.validateMessage }
  21088. )
  21089. : _vm._e()
  21090. ],
  21091. 2
  21092. )
  21093. ],
  21094. 2
  21095. )
  21096. ],
  21097. 1
  21098. )
  21099. }
  21100. var form_itemvue_type_template_id_b6f3db6c_staticRenderFns = []
  21101. form_itemvue_type_template_id_b6f3db6c_render._withStripped = true
  21102. // CONCATENATED MODULE: ./packages/form/src/form-item.vue?vue&type=template&id=b6f3db6c&
  21103. // EXTERNAL MODULE: external "async-validator"
  21104. var external_async_validator_ = __webpack_require__(41);
  21105. var external_async_validator_default = /*#__PURE__*/__webpack_require__.n(external_async_validator_);
  21106. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/form/src/label-wrap.vue?vue&type=script&lang=js&
  21107. /* harmony default export */ var label_wrapvue_type_script_lang_js_ = ({
  21108. props: {
  21109. isAutoWidth: Boolean,
  21110. updateAll: Boolean
  21111. },
  21112. inject: ['elForm', 'elFormItem'],
  21113. render: function render() {
  21114. var h = arguments[0];
  21115. var slots = this.$slots.default;
  21116. if (!slots) return null;
  21117. if (this.isAutoWidth) {
  21118. var autoLabelWidth = this.elForm.autoLabelWidth;
  21119. var style = {};
  21120. if (autoLabelWidth && autoLabelWidth !== 'auto') {
  21121. var marginLeft = parseInt(autoLabelWidth, 10) - this.computedWidth;
  21122. if (marginLeft) {
  21123. style.marginLeft = marginLeft + 'px';
  21124. }
  21125. }
  21126. return h(
  21127. 'div',
  21128. { 'class': 'el-form-item__label-wrap', style: style },
  21129. [slots]
  21130. );
  21131. } else {
  21132. return slots[0];
  21133. }
  21134. },
  21135. methods: {
  21136. getLabelWidth: function getLabelWidth() {
  21137. if (this.$el && this.$el.firstElementChild) {
  21138. var computedWidth = window.getComputedStyle(this.$el.firstElementChild).width;
  21139. return Math.ceil(parseFloat(computedWidth));
  21140. } else {
  21141. return 0;
  21142. }
  21143. },
  21144. updateLabelWidth: function updateLabelWidth() {
  21145. var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'update';
  21146. if (this.$slots.default && this.isAutoWidth && this.$el.firstElementChild) {
  21147. if (action === 'update') {
  21148. this.computedWidth = this.getLabelWidth();
  21149. } else if (action === 'remove') {
  21150. this.elForm.deregisterLabelWidth(this.computedWidth);
  21151. }
  21152. }
  21153. }
  21154. },
  21155. watch: {
  21156. computedWidth: function computedWidth(val, oldVal) {
  21157. if (this.updateAll) {
  21158. this.elForm.registerLabelWidth(val, oldVal);
  21159. this.elFormItem.updateComputedLabelWidth(val);
  21160. }
  21161. }
  21162. },
  21163. data: function data() {
  21164. return {
  21165. computedWidth: 0
  21166. };
  21167. },
  21168. mounted: function mounted() {
  21169. this.updateLabelWidth('update');
  21170. },
  21171. updated: function updated() {
  21172. this.updateLabelWidth('update');
  21173. },
  21174. beforeDestroy: function beforeDestroy() {
  21175. this.updateLabelWidth('remove');
  21176. }
  21177. });
  21178. // CONCATENATED MODULE: ./packages/form/src/label-wrap.vue?vue&type=script&lang=js&
  21179. /* harmony default export */ var src_label_wrapvue_type_script_lang_js_ = (label_wrapvue_type_script_lang_js_);
  21180. // CONCATENATED MODULE: ./packages/form/src/label-wrap.vue
  21181. var label_wrap_render, label_wrap_staticRenderFns
  21182. /* normalize component */
  21183. var label_wrap_component = normalizeComponent(
  21184. src_label_wrapvue_type_script_lang_js_,
  21185. label_wrap_render,
  21186. label_wrap_staticRenderFns,
  21187. false,
  21188. null,
  21189. null,
  21190. null
  21191. )
  21192. /* hot reload */
  21193. if (false) { var label_wrap_api; }
  21194. label_wrap_component.options.__file = "packages/form/src/label-wrap.vue"
  21195. /* harmony default export */ var label_wrap = (label_wrap_component.exports);
  21196. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/form/src/form-item.vue?vue&type=script&lang=js&
  21197. //
  21198. //
  21199. //
  21200. //
  21201. //
  21202. //
  21203. //
  21204. //
  21205. //
  21206. //
  21207. //
  21208. //
  21209. //
  21210. //
  21211. //
  21212. //
  21213. //
  21214. //
  21215. //
  21216. //
  21217. //
  21218. //
  21219. //
  21220. //
  21221. //
  21222. //
  21223. //
  21224. //
  21225. //
  21226. //
  21227. //
  21228. //
  21229. //
  21230. //
  21231. //
  21232. //
  21233. //
  21234. //
  21235. //
  21236. //
  21237. /* harmony default export */ var form_itemvue_type_script_lang_js_ = ({
  21238. name: 'ElFormItem',
  21239. componentName: 'ElFormItem',
  21240. mixins: [emitter_default.a],
  21241. provide: function provide() {
  21242. return {
  21243. elFormItem: this
  21244. };
  21245. },
  21246. inject: ['elForm'],
  21247. props: {
  21248. label: String,
  21249. labelWidth: String,
  21250. prop: String,
  21251. required: {
  21252. type: Boolean,
  21253. default: undefined
  21254. },
  21255. rules: [Object, Array],
  21256. error: String,
  21257. validateStatus: String,
  21258. for: String,
  21259. inlineMessage: {
  21260. type: [String, Boolean],
  21261. default: ''
  21262. },
  21263. showMessage: {
  21264. type: Boolean,
  21265. default: true
  21266. },
  21267. size: String
  21268. },
  21269. components: {
  21270. // use this component to calculate auto width
  21271. LabelWrap: label_wrap
  21272. },
  21273. watch: {
  21274. error: {
  21275. immediate: true,
  21276. handler: function handler(value) {
  21277. this.validateMessage = value;
  21278. this.validateState = value ? 'error' : '';
  21279. }
  21280. },
  21281. validateStatus: function validateStatus(value) {
  21282. this.validateState = value;
  21283. },
  21284. rules: function rules(value) {
  21285. if ((!value || value.length === 0) && this.required === undefined) {
  21286. this.clearValidate();
  21287. }
  21288. }
  21289. },
  21290. computed: {
  21291. labelFor: function labelFor() {
  21292. return this.for || this.prop;
  21293. },
  21294. labelStyle: function labelStyle() {
  21295. var ret = {};
  21296. if (this.form.labelPosition === 'top') return ret;
  21297. var labelWidth = this.labelWidth || this.form.labelWidth;
  21298. if (labelWidth) {
  21299. ret.width = labelWidth;
  21300. }
  21301. return ret;
  21302. },
  21303. contentStyle: function contentStyle() {
  21304. var ret = {};
  21305. var label = this.label;
  21306. if (this.form.labelPosition === 'top' || this.form.inline) return ret;
  21307. if (!label && !this.labelWidth && this.isNested) return ret;
  21308. var labelWidth = this.labelWidth || this.form.labelWidth;
  21309. if (labelWidth === 'auto') {
  21310. if (this.labelWidth === 'auto') {
  21311. ret.marginLeft = this.computedLabelWidth;
  21312. } else if (this.form.labelWidth === 'auto') {
  21313. ret.marginLeft = this.elForm.autoLabelWidth;
  21314. }
  21315. } else {
  21316. ret.marginLeft = labelWidth;
  21317. }
  21318. return ret;
  21319. },
  21320. form: function form() {
  21321. var parent = this.$parent;
  21322. var parentName = parent.$options.componentName;
  21323. while (parentName !== 'ElForm') {
  21324. if (parentName === 'ElFormItem') {
  21325. this.isNested = true;
  21326. }
  21327. parent = parent.$parent;
  21328. parentName = parent.$options.componentName;
  21329. }
  21330. return parent;
  21331. },
  21332. fieldValue: function fieldValue() {
  21333. var model = this.form.model;
  21334. if (!model || !this.prop) {
  21335. return;
  21336. }
  21337. var path = this.prop;
  21338. if (path.indexOf(':') !== -1) {
  21339. path = path.replace(/:/, '.');
  21340. }
  21341. return Object(util_["getPropByPath"])(model, path, true).v;
  21342. },
  21343. isRequired: function isRequired() {
  21344. var rules = this.getRules();
  21345. var isRequired = false;
  21346. if (rules && rules.length) {
  21347. rules.every(function (rule) {
  21348. if (rule.required) {
  21349. isRequired = true;
  21350. return false;
  21351. }
  21352. return true;
  21353. });
  21354. }
  21355. return isRequired;
  21356. },
  21357. _formSize: function _formSize() {
  21358. return this.elForm.size;
  21359. },
  21360. elFormItemSize: function elFormItemSize() {
  21361. return this.size || this._formSize;
  21362. },
  21363. sizeClass: function sizeClass() {
  21364. return this.elFormItemSize || (this.$ELEMENT || {}).size;
  21365. }
  21366. },
  21367. data: function data() {
  21368. return {
  21369. validateState: '',
  21370. validateMessage: '',
  21371. validateDisabled: false,
  21372. validator: {},
  21373. isNested: false,
  21374. computedLabelWidth: ''
  21375. };
  21376. },
  21377. methods: {
  21378. validate: function validate(trigger) {
  21379. var _this = this;
  21380. var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : util_["noop"];
  21381. this.validateDisabled = false;
  21382. var rules = this.getFilteredRule(trigger);
  21383. if ((!rules || rules.length === 0) && this.required === undefined) {
  21384. callback();
  21385. return true;
  21386. }
  21387. this.validateState = 'validating';
  21388. var descriptor = {};
  21389. if (rules && rules.length > 0) {
  21390. rules.forEach(function (rule) {
  21391. delete rule.trigger;
  21392. });
  21393. }
  21394. descriptor[this.prop] = rules;
  21395. var validator = new external_async_validator_default.a(descriptor);
  21396. var model = {};
  21397. model[this.prop] = this.fieldValue;
  21398. validator.validate(model, { firstFields: true }, function (errors, invalidFields) {
  21399. _this.validateState = !errors ? 'success' : 'error';
  21400. _this.validateMessage = errors ? errors[0].message : '';
  21401. callback(_this.validateMessage, invalidFields);
  21402. _this.elForm && _this.elForm.$emit('validate', _this.prop, !errors, _this.validateMessage || null);
  21403. });
  21404. },
  21405. clearValidate: function clearValidate() {
  21406. this.validateState = '';
  21407. this.validateMessage = '';
  21408. this.validateDisabled = false;
  21409. },
  21410. resetField: function resetField() {
  21411. var _this2 = this;
  21412. this.validateState = '';
  21413. this.validateMessage = '';
  21414. var model = this.form.model;
  21415. var value = this.fieldValue;
  21416. var path = this.prop;
  21417. if (path.indexOf(':') !== -1) {
  21418. path = path.replace(/:/, '.');
  21419. }
  21420. var prop = Object(util_["getPropByPath"])(model, path, true);
  21421. this.validateDisabled = true;
  21422. if (Array.isArray(value)) {
  21423. prop.o[prop.k] = [].concat(this.initialValue);
  21424. } else {
  21425. prop.o[prop.k] = this.initialValue;
  21426. }
  21427. // reset validateDisabled after onFieldChange triggered
  21428. this.$nextTick(function () {
  21429. _this2.validateDisabled = false;
  21430. });
  21431. this.broadcast('ElTimeSelect', 'fieldReset', this.initialValue);
  21432. },
  21433. getRules: function getRules() {
  21434. var formRules = this.form.rules;
  21435. var selfRules = this.rules;
  21436. var requiredRule = this.required !== undefined ? { required: !!this.required } : [];
  21437. var prop = Object(util_["getPropByPath"])(formRules, this.prop || '');
  21438. formRules = formRules ? prop.o[this.prop || ''] || prop.v : [];
  21439. return [].concat(selfRules || formRules || []).concat(requiredRule);
  21440. },
  21441. getFilteredRule: function getFilteredRule(trigger) {
  21442. var rules = this.getRules();
  21443. return rules.filter(function (rule) {
  21444. if (!rule.trigger || trigger === '') return true;
  21445. if (Array.isArray(rule.trigger)) {
  21446. return rule.trigger.indexOf(trigger) > -1;
  21447. } else {
  21448. return rule.trigger === trigger;
  21449. }
  21450. }).map(function (rule) {
  21451. return merge_default()({}, rule);
  21452. });
  21453. },
  21454. onFieldBlur: function onFieldBlur() {
  21455. this.validate('blur');
  21456. },
  21457. onFieldChange: function onFieldChange() {
  21458. if (this.validateDisabled) {
  21459. this.validateDisabled = false;
  21460. return;
  21461. }
  21462. this.validate('change');
  21463. },
  21464. updateComputedLabelWidth: function updateComputedLabelWidth(width) {
  21465. this.computedLabelWidth = width ? width + 'px' : '';
  21466. },
  21467. addValidateEvents: function addValidateEvents() {
  21468. var rules = this.getRules();
  21469. if (rules.length || this.required !== undefined) {
  21470. this.$on('el.form.blur', this.onFieldBlur);
  21471. this.$on('el.form.change', this.onFieldChange);
  21472. }
  21473. },
  21474. removeValidateEvents: function removeValidateEvents() {
  21475. this.$off();
  21476. }
  21477. },
  21478. mounted: function mounted() {
  21479. if (this.prop) {
  21480. this.dispatch('ElForm', 'el.form.addField', [this]);
  21481. var initialValue = this.fieldValue;
  21482. if (Array.isArray(initialValue)) {
  21483. initialValue = [].concat(initialValue);
  21484. }
  21485. Object.defineProperty(this, 'initialValue', {
  21486. value: initialValue
  21487. });
  21488. this.addValidateEvents();
  21489. }
  21490. },
  21491. beforeDestroy: function beforeDestroy() {
  21492. this.dispatch('ElForm', 'el.form.removeField', [this]);
  21493. }
  21494. });
  21495. // CONCATENATED MODULE: ./packages/form/src/form-item.vue?vue&type=script&lang=js&
  21496. /* harmony default export */ var src_form_itemvue_type_script_lang_js_ = (form_itemvue_type_script_lang_js_);
  21497. // CONCATENATED MODULE: ./packages/form/src/form-item.vue
  21498. /* normalize component */
  21499. var form_item_component = normalizeComponent(
  21500. src_form_itemvue_type_script_lang_js_,
  21501. form_itemvue_type_template_id_b6f3db6c_render,
  21502. form_itemvue_type_template_id_b6f3db6c_staticRenderFns,
  21503. false,
  21504. null,
  21505. null,
  21506. null
  21507. )
  21508. /* hot reload */
  21509. if (false) { var form_item_api; }
  21510. form_item_component.options.__file = "packages/form/src/form-item.vue"
  21511. /* harmony default export */ var form_item = (form_item_component.exports);
  21512. // CONCATENATED MODULE: ./packages/form-item/index.js
  21513. /* istanbul ignore next */
  21514. form_item.install = function (Vue) {
  21515. Vue.component(form_item.name, form_item);
  21516. };
  21517. /* harmony default export */ var packages_form_item = (form_item);
  21518. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/tabs/src/tab-bar.vue?vue&type=template&id=2031f33a&
  21519. var tab_barvue_type_template_id_2031f33a_render = function() {
  21520. var _vm = this
  21521. var _h = _vm.$createElement
  21522. var _c = _vm._self._c || _h
  21523. return _c("div", {
  21524. staticClass: "el-tabs__active-bar",
  21525. class: "is-" + _vm.rootTabs.tabPosition,
  21526. style: _vm.barStyle
  21527. })
  21528. }
  21529. var tab_barvue_type_template_id_2031f33a_staticRenderFns = []
  21530. tab_barvue_type_template_id_2031f33a_render._withStripped = true
  21531. // CONCATENATED MODULE: ./packages/tabs/src/tab-bar.vue?vue&type=template&id=2031f33a&
  21532. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/tabs/src/tab-bar.vue?vue&type=script&lang=js&
  21533. //
  21534. //
  21535. //
  21536. /* harmony default export */ var tab_barvue_type_script_lang_js_ = ({
  21537. name: 'TabBar',
  21538. props: {
  21539. tabs: Array
  21540. },
  21541. inject: ['rootTabs'],
  21542. computed: {
  21543. barStyle: {
  21544. get: function get() {
  21545. var _this = this;
  21546. var style = {};
  21547. var offset = 0;
  21548. var tabSize = 0;
  21549. var sizeName = ['top', 'bottom'].indexOf(this.rootTabs.tabPosition) !== -1 ? 'width' : 'height';
  21550. var sizeDir = sizeName === 'width' ? 'x' : 'y';
  21551. var firstUpperCase = function firstUpperCase(str) {
  21552. return str.toLowerCase().replace(/( |^)[a-z]/g, function (L) {
  21553. return L.toUpperCase();
  21554. });
  21555. };
  21556. this.tabs.every(function (tab, index) {
  21557. var $el = Object(util_["arrayFind"])(_this.$parent.$refs.tabs || [], function (t) {
  21558. return t.id.replace('tab-', '') === tab.paneName;
  21559. });
  21560. if (!$el) {
  21561. return false;
  21562. }
  21563. if (!tab.active) {
  21564. offset += $el['client' + firstUpperCase(sizeName)];
  21565. return true;
  21566. } else {
  21567. tabSize = $el['client' + firstUpperCase(sizeName)];
  21568. var tabStyles = window.getComputedStyle($el);
  21569. if (sizeName === 'width' && _this.tabs.length > 1) {
  21570. tabSize -= parseFloat(tabStyles.paddingLeft) + parseFloat(tabStyles.paddingRight);
  21571. }
  21572. if (sizeName === 'width') {
  21573. offset += parseFloat(tabStyles.paddingLeft);
  21574. }
  21575. return false;
  21576. }
  21577. });
  21578. var transform = 'translate' + firstUpperCase(sizeDir) + '(' + offset + 'px)';
  21579. style[sizeName] = tabSize + 'px';
  21580. style.transform = transform;
  21581. style.msTransform = transform;
  21582. style.webkitTransform = transform;
  21583. return style;
  21584. }
  21585. }
  21586. }
  21587. });
  21588. // CONCATENATED MODULE: ./packages/tabs/src/tab-bar.vue?vue&type=script&lang=js&
  21589. /* harmony default export */ var src_tab_barvue_type_script_lang_js_ = (tab_barvue_type_script_lang_js_);
  21590. // CONCATENATED MODULE: ./packages/tabs/src/tab-bar.vue
  21591. /* normalize component */
  21592. var tab_bar_component = normalizeComponent(
  21593. src_tab_barvue_type_script_lang_js_,
  21594. tab_barvue_type_template_id_2031f33a_render,
  21595. tab_barvue_type_template_id_2031f33a_staticRenderFns,
  21596. false,
  21597. null,
  21598. null,
  21599. null
  21600. )
  21601. /* hot reload */
  21602. if (false) { var tab_bar_api; }
  21603. tab_bar_component.options.__file = "packages/tabs/src/tab-bar.vue"
  21604. /* harmony default export */ var tab_bar = (tab_bar_component.exports);
  21605. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/tabs/src/tab-nav.vue?vue&type=script&lang=js&
  21606. function noop() {}
  21607. var tab_navvue_type_script_lang_js_firstUpperCase = function firstUpperCase(str) {
  21608. return str.toLowerCase().replace(/( |^)[a-z]/g, function (L) {
  21609. return L.toUpperCase();
  21610. });
  21611. };
  21612. /* harmony default export */ var tab_navvue_type_script_lang_js_ = ({
  21613. name: 'TabNav',
  21614. components: {
  21615. TabBar: tab_bar
  21616. },
  21617. inject: ['rootTabs'],
  21618. props: {
  21619. panes: Array,
  21620. currentName: String,
  21621. editable: Boolean,
  21622. onTabClick: {
  21623. type: Function,
  21624. default: noop
  21625. },
  21626. onTabRemove: {
  21627. type: Function,
  21628. default: noop
  21629. },
  21630. type: String,
  21631. stretch: Boolean
  21632. },
  21633. data: function data() {
  21634. return {
  21635. scrollable: false,
  21636. navOffset: 0,
  21637. isFocus: false,
  21638. focusable: true
  21639. };
  21640. },
  21641. computed: {
  21642. navStyle: function navStyle() {
  21643. var dir = ['top', 'bottom'].indexOf(this.rootTabs.tabPosition) !== -1 ? 'X' : 'Y';
  21644. return {
  21645. transform: 'translate' + dir + '(-' + this.navOffset + 'px)'
  21646. };
  21647. },
  21648. sizeName: function sizeName() {
  21649. return ['top', 'bottom'].indexOf(this.rootTabs.tabPosition) !== -1 ? 'width' : 'height';
  21650. }
  21651. },
  21652. methods: {
  21653. scrollPrev: function scrollPrev() {
  21654. var containerSize = this.$refs.navScroll['offset' + tab_navvue_type_script_lang_js_firstUpperCase(this.sizeName)];
  21655. var currentOffset = this.navOffset;
  21656. if (!currentOffset) return;
  21657. var newOffset = currentOffset > containerSize ? currentOffset - containerSize : 0;
  21658. this.navOffset = newOffset;
  21659. },
  21660. scrollNext: function scrollNext() {
  21661. var navSize = this.$refs.nav['offset' + tab_navvue_type_script_lang_js_firstUpperCase(this.sizeName)];
  21662. var containerSize = this.$refs.navScroll['offset' + tab_navvue_type_script_lang_js_firstUpperCase(this.sizeName)];
  21663. var currentOffset = this.navOffset;
  21664. if (navSize - currentOffset <= containerSize) return;
  21665. var newOffset = navSize - currentOffset > containerSize * 2 ? currentOffset + containerSize : navSize - containerSize;
  21666. this.navOffset = newOffset;
  21667. },
  21668. scrollToActiveTab: function scrollToActiveTab() {
  21669. if (!this.scrollable) return;
  21670. var nav = this.$refs.nav;
  21671. var activeTab = this.$el.querySelector('.is-active');
  21672. if (!activeTab) return;
  21673. var navScroll = this.$refs.navScroll;
  21674. var isHorizontal = ['top', 'bottom'].indexOf(this.rootTabs.tabPosition) !== -1;
  21675. var activeTabBounding = activeTab.getBoundingClientRect();
  21676. var navScrollBounding = navScroll.getBoundingClientRect();
  21677. var maxOffset = isHorizontal ? nav.offsetWidth - navScrollBounding.width : nav.offsetHeight - navScrollBounding.height;
  21678. var currentOffset = this.navOffset;
  21679. var newOffset = currentOffset;
  21680. if (isHorizontal) {
  21681. if (activeTabBounding.left < navScrollBounding.left) {
  21682. newOffset = currentOffset - (navScrollBounding.left - activeTabBounding.left);
  21683. }
  21684. if (activeTabBounding.right > navScrollBounding.right) {
  21685. newOffset = currentOffset + activeTabBounding.right - navScrollBounding.right;
  21686. }
  21687. } else {
  21688. if (activeTabBounding.top < navScrollBounding.top) {
  21689. newOffset = currentOffset - (navScrollBounding.top - activeTabBounding.top);
  21690. }
  21691. if (activeTabBounding.bottom > navScrollBounding.bottom) {
  21692. newOffset = currentOffset + (activeTabBounding.bottom - navScrollBounding.bottom);
  21693. }
  21694. }
  21695. newOffset = Math.max(newOffset, 0);
  21696. this.navOffset = Math.min(newOffset, maxOffset);
  21697. },
  21698. update: function update() {
  21699. if (!this.$refs.nav) return;
  21700. var sizeName = this.sizeName;
  21701. var navSize = this.$refs.nav['offset' + tab_navvue_type_script_lang_js_firstUpperCase(sizeName)];
  21702. var containerSize = this.$refs.navScroll['offset' + tab_navvue_type_script_lang_js_firstUpperCase(sizeName)];
  21703. var currentOffset = this.navOffset;
  21704. if (containerSize < navSize) {
  21705. var _currentOffset = this.navOffset;
  21706. this.scrollable = this.scrollable || {};
  21707. this.scrollable.prev = _currentOffset;
  21708. this.scrollable.next = _currentOffset + containerSize < navSize;
  21709. if (navSize - _currentOffset < containerSize) {
  21710. this.navOffset = navSize - containerSize;
  21711. }
  21712. } else {
  21713. this.scrollable = false;
  21714. if (currentOffset > 0) {
  21715. this.navOffset = 0;
  21716. }
  21717. }
  21718. },
  21719. changeTab: function changeTab(e) {
  21720. var keyCode = e.keyCode;
  21721. var nextIndex = void 0;
  21722. var currentIndex = void 0,
  21723. tabList = void 0;
  21724. if ([37, 38, 39, 40].indexOf(keyCode) !== -1) {
  21725. // 左右上下键更换tab
  21726. tabList = e.currentTarget.querySelectorAll('[role=tab]');
  21727. currentIndex = Array.prototype.indexOf.call(tabList, e.target);
  21728. } else {
  21729. return;
  21730. }
  21731. if (keyCode === 37 || keyCode === 38) {
  21732. // left
  21733. if (currentIndex === 0) {
  21734. // first
  21735. nextIndex = tabList.length - 1;
  21736. } else {
  21737. nextIndex = currentIndex - 1;
  21738. }
  21739. } else {
  21740. // right
  21741. if (currentIndex < tabList.length - 1) {
  21742. // not last
  21743. nextIndex = currentIndex + 1;
  21744. } else {
  21745. nextIndex = 0;
  21746. }
  21747. }
  21748. tabList[nextIndex].focus(); // 改变焦点元素
  21749. tabList[nextIndex].click(); // 选中下一个tab
  21750. this.setFocus();
  21751. },
  21752. setFocus: function setFocus() {
  21753. if (this.focusable) {
  21754. this.isFocus = true;
  21755. }
  21756. },
  21757. removeFocus: function removeFocus() {
  21758. this.isFocus = false;
  21759. },
  21760. visibilityChangeHandler: function visibilityChangeHandler() {
  21761. var _this = this;
  21762. var visibility = document.visibilityState;
  21763. if (visibility === 'hidden') {
  21764. this.focusable = false;
  21765. } else if (visibility === 'visible') {
  21766. setTimeout(function () {
  21767. _this.focusable = true;
  21768. }, 50);
  21769. }
  21770. },
  21771. windowBlurHandler: function windowBlurHandler() {
  21772. this.focusable = false;
  21773. },
  21774. windowFocusHandler: function windowFocusHandler() {
  21775. var _this2 = this;
  21776. setTimeout(function () {
  21777. _this2.focusable = true;
  21778. }, 50);
  21779. }
  21780. },
  21781. updated: function updated() {
  21782. this.update();
  21783. },
  21784. render: function render(h) {
  21785. var _this3 = this;
  21786. var type = this.type,
  21787. panes = this.panes,
  21788. editable = this.editable,
  21789. stretch = this.stretch,
  21790. onTabClick = this.onTabClick,
  21791. onTabRemove = this.onTabRemove,
  21792. navStyle = this.navStyle,
  21793. scrollable = this.scrollable,
  21794. scrollNext = this.scrollNext,
  21795. scrollPrev = this.scrollPrev,
  21796. changeTab = this.changeTab,
  21797. setFocus = this.setFocus,
  21798. removeFocus = this.removeFocus;
  21799. var scrollBtn = scrollable ? [h(
  21800. 'span',
  21801. { 'class': ['el-tabs__nav-prev', scrollable.prev ? '' : 'is-disabled'], on: {
  21802. 'click': scrollPrev
  21803. }
  21804. },
  21805. [h('i', { 'class': 'el-icon-arrow-left' })]
  21806. ), h(
  21807. 'span',
  21808. { 'class': ['el-tabs__nav-next', scrollable.next ? '' : 'is-disabled'], on: {
  21809. 'click': scrollNext
  21810. }
  21811. },
  21812. [h('i', { 'class': 'el-icon-arrow-right' })]
  21813. )] : null;
  21814. var tabs = this._l(panes, function (pane, index) {
  21815. var _ref;
  21816. var tabName = pane.name || pane.index || index;
  21817. var closable = pane.isClosable || editable;
  21818. pane.index = '' + index;
  21819. var btnClose = closable ? h('span', { 'class': 'el-icon-close', on: {
  21820. 'click': function click(ev) {
  21821. onTabRemove(pane, ev);
  21822. }
  21823. }
  21824. }) : null;
  21825. var tabLabelContent = pane.$slots.label || pane.label;
  21826. var tabindex = pane.active ? 0 : -1;
  21827. return h(
  21828. 'div',
  21829. {
  21830. 'class': (_ref = {
  21831. 'el-tabs__item': true
  21832. }, _ref['is-' + _this3.rootTabs.tabPosition] = true, _ref['is-active'] = pane.active, _ref['is-disabled'] = pane.disabled, _ref['is-closable'] = closable, _ref['is-focus'] = _this3.isFocus, _ref),
  21833. attrs: { id: 'tab-' + tabName,
  21834. 'aria-controls': 'pane-' + tabName,
  21835. role: 'tab',
  21836. 'aria-selected': pane.active,
  21837. tabindex: tabindex
  21838. },
  21839. key: 'tab-' + tabName, ref: 'tabs', refInFor: true,
  21840. on: {
  21841. 'focus': function focus() {
  21842. setFocus();
  21843. },
  21844. 'blur': function blur() {
  21845. removeFocus();
  21846. },
  21847. 'click': function click(ev) {
  21848. removeFocus();onTabClick(pane, tabName, ev);
  21849. },
  21850. 'keydown': function keydown(ev) {
  21851. if (closable && (ev.keyCode === 46 || ev.keyCode === 8)) {
  21852. onTabRemove(pane, ev);
  21853. }
  21854. }
  21855. }
  21856. },
  21857. [tabLabelContent, btnClose]
  21858. );
  21859. });
  21860. return h(
  21861. 'div',
  21862. { 'class': ['el-tabs__nav-wrap', scrollable ? 'is-scrollable' : '', 'is-' + this.rootTabs.tabPosition] },
  21863. [scrollBtn, h(
  21864. 'div',
  21865. { 'class': ['el-tabs__nav-scroll'], ref: 'navScroll' },
  21866. [h(
  21867. 'div',
  21868. {
  21869. 'class': ['el-tabs__nav', 'is-' + this.rootTabs.tabPosition, stretch && ['top', 'bottom'].indexOf(this.rootTabs.tabPosition) !== -1 ? 'is-stretch' : ''],
  21870. ref: 'nav',
  21871. style: navStyle,
  21872. attrs: { role: 'tablist'
  21873. },
  21874. on: {
  21875. 'keydown': changeTab
  21876. }
  21877. },
  21878. [!type ? h('tab-bar', {
  21879. attrs: { tabs: panes }
  21880. }) : null, tabs]
  21881. )]
  21882. )]
  21883. );
  21884. },
  21885. mounted: function mounted() {
  21886. var _this4 = this;
  21887. Object(resize_event_["addResizeListener"])(this.$el, this.update);
  21888. document.addEventListener('visibilitychange', this.visibilityChangeHandler);
  21889. window.addEventListener('blur', this.windowBlurHandler);
  21890. window.addEventListener('focus', this.windowFocusHandler);
  21891. setTimeout(function () {
  21892. _this4.scrollToActiveTab();
  21893. }, 0);
  21894. },
  21895. beforeDestroy: function beforeDestroy() {
  21896. if (this.$el && this.update) Object(resize_event_["removeResizeListener"])(this.$el, this.update);
  21897. document.removeEventListener('visibilitychange', this.visibilityChangeHandler);
  21898. window.removeEventListener('blur', this.windowBlurHandler);
  21899. window.removeEventListener('focus', this.windowFocusHandler);
  21900. }
  21901. });
  21902. // CONCATENATED MODULE: ./packages/tabs/src/tab-nav.vue?vue&type=script&lang=js&
  21903. /* harmony default export */ var src_tab_navvue_type_script_lang_js_ = (tab_navvue_type_script_lang_js_);
  21904. // CONCATENATED MODULE: ./packages/tabs/src/tab-nav.vue
  21905. var tab_nav_render, tab_nav_staticRenderFns
  21906. /* normalize component */
  21907. var tab_nav_component = normalizeComponent(
  21908. src_tab_navvue_type_script_lang_js_,
  21909. tab_nav_render,
  21910. tab_nav_staticRenderFns,
  21911. false,
  21912. null,
  21913. null,
  21914. null
  21915. )
  21916. /* hot reload */
  21917. if (false) { var tab_nav_api; }
  21918. tab_nav_component.options.__file = "packages/tabs/src/tab-nav.vue"
  21919. /* harmony default export */ var tab_nav = (tab_nav_component.exports);
  21920. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/tabs/src/tabs.vue?vue&type=script&lang=js&
  21921. /* harmony default export */ var tabsvue_type_script_lang_js_ = ({
  21922. name: 'ElTabs',
  21923. components: {
  21924. TabNav: tab_nav
  21925. },
  21926. props: {
  21927. type: String,
  21928. activeName: String,
  21929. closable: Boolean,
  21930. addable: Boolean,
  21931. value: {},
  21932. editable: Boolean,
  21933. tabPosition: {
  21934. type: String,
  21935. default: 'top'
  21936. },
  21937. beforeLeave: Function,
  21938. stretch: Boolean
  21939. },
  21940. provide: function provide() {
  21941. return {
  21942. rootTabs: this
  21943. };
  21944. },
  21945. data: function data() {
  21946. return {
  21947. currentName: this.value || this.activeName,
  21948. panes: []
  21949. };
  21950. },
  21951. watch: {
  21952. activeName: function activeName(value) {
  21953. this.setCurrentName(value);
  21954. },
  21955. value: function value(_value) {
  21956. this.setCurrentName(_value);
  21957. },
  21958. currentName: function currentName(value) {
  21959. var _this = this;
  21960. if (this.$refs.nav) {
  21961. this.$nextTick(function () {
  21962. _this.$refs.nav.$nextTick(function (_) {
  21963. _this.$refs.nav.scrollToActiveTab();
  21964. });
  21965. });
  21966. }
  21967. }
  21968. },
  21969. methods: {
  21970. calcPaneInstances: function calcPaneInstances() {
  21971. var _this2 = this;
  21972. var isForceUpdate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  21973. if (this.$slots.default) {
  21974. var paneSlots = this.$slots.default.filter(function (vnode) {
  21975. return vnode.tag && vnode.componentOptions && vnode.componentOptions.Ctor.options.name === 'ElTabPane';
  21976. });
  21977. // update indeed
  21978. var panes = paneSlots.map(function (_ref) {
  21979. var componentInstance = _ref.componentInstance;
  21980. return componentInstance;
  21981. });
  21982. var panesChanged = !(panes.length === this.panes.length && panes.every(function (pane, index) {
  21983. return pane === _this2.panes[index];
  21984. }));
  21985. if (isForceUpdate || panesChanged) {
  21986. this.panes = panes;
  21987. }
  21988. } else if (this.panes.length !== 0) {
  21989. this.panes = [];
  21990. }
  21991. },
  21992. handleTabClick: function handleTabClick(tab, tabName, event) {
  21993. if (tab.disabled) return;
  21994. this.setCurrentName(tabName);
  21995. this.$emit('tab-click', tab, event);
  21996. },
  21997. handleTabRemove: function handleTabRemove(pane, ev) {
  21998. if (pane.disabled) return;
  21999. ev.stopPropagation();
  22000. this.$emit('edit', pane.name, 'remove');
  22001. this.$emit('tab-remove', pane.name);
  22002. },
  22003. handleTabAdd: function handleTabAdd() {
  22004. this.$emit('edit', null, 'add');
  22005. this.$emit('tab-add');
  22006. },
  22007. setCurrentName: function setCurrentName(value) {
  22008. var _this3 = this;
  22009. var changeCurrentName = function changeCurrentName() {
  22010. _this3.currentName = value;
  22011. _this3.$emit('input', value);
  22012. };
  22013. if (this.currentName !== value && this.beforeLeave) {
  22014. var before = this.beforeLeave(value, this.currentName);
  22015. if (before && before.then) {
  22016. before.then(function () {
  22017. changeCurrentName();
  22018. _this3.$refs.nav && _this3.$refs.nav.removeFocus();
  22019. }, function () {
  22020. // https://github.com/ElemeFE/element/pull/14816
  22021. // ignore promise rejection in `before-leave` hook
  22022. });
  22023. } else if (before !== false) {
  22024. changeCurrentName();
  22025. }
  22026. } else {
  22027. changeCurrentName();
  22028. }
  22029. }
  22030. },
  22031. render: function render(h) {
  22032. var _ref2;
  22033. var type = this.type,
  22034. handleTabClick = this.handleTabClick,
  22035. handleTabRemove = this.handleTabRemove,
  22036. handleTabAdd = this.handleTabAdd,
  22037. currentName = this.currentName,
  22038. panes = this.panes,
  22039. editable = this.editable,
  22040. addable = this.addable,
  22041. tabPosition = this.tabPosition,
  22042. stretch = this.stretch;
  22043. var newButton = editable || addable ? h(
  22044. 'span',
  22045. {
  22046. 'class': 'el-tabs__new-tab',
  22047. on: {
  22048. 'click': handleTabAdd,
  22049. 'keydown': function keydown(ev) {
  22050. if (ev.keyCode === 13) {
  22051. handleTabAdd();
  22052. }
  22053. }
  22054. },
  22055. attrs: {
  22056. tabindex: '0'
  22057. }
  22058. },
  22059. [h('i', { 'class': 'el-icon-plus' })]
  22060. ) : null;
  22061. var navData = {
  22062. props: {
  22063. currentName: currentName,
  22064. onTabClick: handleTabClick,
  22065. onTabRemove: handleTabRemove,
  22066. editable: editable,
  22067. type: type,
  22068. panes: panes,
  22069. stretch: stretch
  22070. },
  22071. ref: 'nav'
  22072. };
  22073. var header = h(
  22074. 'div',
  22075. { 'class': ['el-tabs__header', 'is-' + tabPosition] },
  22076. [newButton, h('tab-nav', navData)]
  22077. );
  22078. var panels = h(
  22079. 'div',
  22080. { 'class': 'el-tabs__content' },
  22081. [this.$slots.default]
  22082. );
  22083. return h(
  22084. 'div',
  22085. { 'class': (_ref2 = {
  22086. 'el-tabs': true,
  22087. 'el-tabs--card': type === 'card'
  22088. }, _ref2['el-tabs--' + tabPosition] = true, _ref2['el-tabs--border-card'] = type === 'border-card', _ref2) },
  22089. [tabPosition !== 'bottom' ? [header, panels] : [panels, header]]
  22090. );
  22091. },
  22092. created: function created() {
  22093. if (!this.currentName) {
  22094. this.setCurrentName('0');
  22095. }
  22096. this.$on('tab-nav-update', this.calcPaneInstances.bind(null, true));
  22097. },
  22098. mounted: function mounted() {
  22099. this.calcPaneInstances();
  22100. },
  22101. updated: function updated() {
  22102. this.calcPaneInstances();
  22103. }
  22104. });
  22105. // CONCATENATED MODULE: ./packages/tabs/src/tabs.vue?vue&type=script&lang=js&
  22106. /* harmony default export */ var src_tabsvue_type_script_lang_js_ = (tabsvue_type_script_lang_js_);
  22107. // CONCATENATED MODULE: ./packages/tabs/src/tabs.vue
  22108. var tabs_render, tabs_staticRenderFns
  22109. /* normalize component */
  22110. var tabs_component = normalizeComponent(
  22111. src_tabsvue_type_script_lang_js_,
  22112. tabs_render,
  22113. tabs_staticRenderFns,
  22114. false,
  22115. null,
  22116. null,
  22117. null
  22118. )
  22119. /* hot reload */
  22120. if (false) { var tabs_api; }
  22121. tabs_component.options.__file = "packages/tabs/src/tabs.vue"
  22122. /* harmony default export */ var tabs = (tabs_component.exports);
  22123. // CONCATENATED MODULE: ./packages/tabs/index.js
  22124. /* istanbul ignore next */
  22125. tabs.install = function (Vue) {
  22126. Vue.component(tabs.name, tabs);
  22127. };
  22128. /* harmony default export */ var packages_tabs = (tabs);
  22129. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/tabs/src/tab-pane.vue?vue&type=template&id=9145a070&
  22130. var tab_panevue_type_template_id_9145a070_render = function() {
  22131. var _vm = this
  22132. var _h = _vm.$createElement
  22133. var _c = _vm._self._c || _h
  22134. return !_vm.lazy || _vm.loaded || _vm.active
  22135. ? _c(
  22136. "div",
  22137. {
  22138. directives: [
  22139. {
  22140. name: "show",
  22141. rawName: "v-show",
  22142. value: _vm.active,
  22143. expression: "active"
  22144. }
  22145. ],
  22146. staticClass: "el-tab-pane",
  22147. attrs: {
  22148. role: "tabpanel",
  22149. "aria-hidden": !_vm.active,
  22150. id: "pane-" + _vm.paneName,
  22151. "aria-labelledby": "tab-" + _vm.paneName
  22152. }
  22153. },
  22154. [_vm._t("default")],
  22155. 2
  22156. )
  22157. : _vm._e()
  22158. }
  22159. var tab_panevue_type_template_id_9145a070_staticRenderFns = []
  22160. tab_panevue_type_template_id_9145a070_render._withStripped = true
  22161. // CONCATENATED MODULE: ./packages/tabs/src/tab-pane.vue?vue&type=template&id=9145a070&
  22162. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/tabs/src/tab-pane.vue?vue&type=script&lang=js&
  22163. //
  22164. //
  22165. //
  22166. //
  22167. //
  22168. //
  22169. //
  22170. //
  22171. //
  22172. //
  22173. //
  22174. //
  22175. //
  22176. /* harmony default export */ var tab_panevue_type_script_lang_js_ = ({
  22177. name: 'ElTabPane',
  22178. componentName: 'ElTabPane',
  22179. props: {
  22180. label: String,
  22181. labelContent: Function,
  22182. name: String,
  22183. closable: Boolean,
  22184. disabled: Boolean,
  22185. lazy: Boolean
  22186. },
  22187. data: function data() {
  22188. return {
  22189. index: null,
  22190. loaded: false
  22191. };
  22192. },
  22193. computed: {
  22194. isClosable: function isClosable() {
  22195. return this.closable || this.$parent.closable;
  22196. },
  22197. active: function active() {
  22198. var active = this.$parent.currentName === (this.name || this.index);
  22199. if (active) {
  22200. this.loaded = true;
  22201. }
  22202. return active;
  22203. },
  22204. paneName: function paneName() {
  22205. return this.name || this.index;
  22206. }
  22207. },
  22208. updated: function updated() {
  22209. this.$parent.$emit('tab-nav-update');
  22210. }
  22211. });
  22212. // CONCATENATED MODULE: ./packages/tabs/src/tab-pane.vue?vue&type=script&lang=js&
  22213. /* harmony default export */ var src_tab_panevue_type_script_lang_js_ = (tab_panevue_type_script_lang_js_);
  22214. // CONCATENATED MODULE: ./packages/tabs/src/tab-pane.vue
  22215. /* normalize component */
  22216. var tab_pane_component = normalizeComponent(
  22217. src_tab_panevue_type_script_lang_js_,
  22218. tab_panevue_type_template_id_9145a070_render,
  22219. tab_panevue_type_template_id_9145a070_staticRenderFns,
  22220. false,
  22221. null,
  22222. null,
  22223. null
  22224. )
  22225. /* hot reload */
  22226. if (false) { var tab_pane_api; }
  22227. tab_pane_component.options.__file = "packages/tabs/src/tab-pane.vue"
  22228. /* harmony default export */ var tab_pane = (tab_pane_component.exports);
  22229. // CONCATENATED MODULE: ./packages/tab-pane/index.js
  22230. /* istanbul ignore next */
  22231. tab_pane.install = function (Vue) {
  22232. Vue.component(tab_pane.name, tab_pane);
  22233. };
  22234. /* harmony default export */ var packages_tab_pane = (tab_pane);
  22235. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/tag/src/tag.vue?vue&type=script&lang=js&
  22236. /* harmony default export */ var tagvue_type_script_lang_js_ = ({
  22237. name: 'ElTag',
  22238. props: {
  22239. text: String,
  22240. closable: Boolean,
  22241. type: String,
  22242. hit: Boolean,
  22243. disableTransitions: Boolean,
  22244. color: String,
  22245. size: String,
  22246. effect: {
  22247. type: String,
  22248. default: 'light',
  22249. validator: function validator(val) {
  22250. return ['dark', 'light', 'plain'].indexOf(val) !== -1;
  22251. }
  22252. }
  22253. },
  22254. methods: {
  22255. handleClose: function handleClose(event) {
  22256. event.stopPropagation();
  22257. this.$emit('close', event);
  22258. },
  22259. handleClick: function handleClick(event) {
  22260. this.$emit('click', event);
  22261. }
  22262. },
  22263. computed: {
  22264. tagSize: function tagSize() {
  22265. return this.size || (this.$ELEMENT || {}).size;
  22266. }
  22267. },
  22268. render: function render(h) {
  22269. var type = this.type,
  22270. tagSize = this.tagSize,
  22271. hit = this.hit,
  22272. effect = this.effect;
  22273. var classes = ['el-tag', type ? 'el-tag--' + type : '', tagSize ? 'el-tag--' + tagSize : '', effect ? 'el-tag--' + effect : '', hit && 'is-hit'];
  22274. var tagEl = h(
  22275. 'span',
  22276. {
  22277. 'class': classes,
  22278. style: { backgroundColor: this.color },
  22279. on: {
  22280. 'click': this.handleClick
  22281. }
  22282. },
  22283. [this.$slots.default, this.closable && h('i', { 'class': 'el-tag__close el-icon-close', on: {
  22284. 'click': this.handleClose
  22285. }
  22286. })]
  22287. );
  22288. return this.disableTransitions ? tagEl : h(
  22289. 'transition',
  22290. {
  22291. attrs: { name: 'el-zoom-in-center' }
  22292. },
  22293. [tagEl]
  22294. );
  22295. }
  22296. });
  22297. // CONCATENATED MODULE: ./packages/tag/src/tag.vue?vue&type=script&lang=js&
  22298. /* harmony default export */ var src_tagvue_type_script_lang_js_ = (tagvue_type_script_lang_js_);
  22299. // CONCATENATED MODULE: ./packages/tag/src/tag.vue
  22300. var tag_render, tag_staticRenderFns
  22301. /* normalize component */
  22302. var tag_component = normalizeComponent(
  22303. src_tagvue_type_script_lang_js_,
  22304. tag_render,
  22305. tag_staticRenderFns,
  22306. false,
  22307. null,
  22308. null,
  22309. null
  22310. )
  22311. /* hot reload */
  22312. if (false) { var tag_api; }
  22313. tag_component.options.__file = "packages/tag/src/tag.vue"
  22314. /* harmony default export */ var src_tag = (tag_component.exports);
  22315. // CONCATENATED MODULE: ./packages/tag/index.js
  22316. /* istanbul ignore next */
  22317. src_tag.install = function (Vue) {
  22318. Vue.component(src_tag.name, src_tag);
  22319. };
  22320. /* harmony default export */ var packages_tag = (src_tag);
  22321. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/tree/src/tree.vue?vue&type=template&id=547575a6&
  22322. var treevue_type_template_id_547575a6_render = function() {
  22323. var _vm = this
  22324. var _h = _vm.$createElement
  22325. var _c = _vm._self._c || _h
  22326. return _c(
  22327. "div",
  22328. {
  22329. staticClass: "el-tree",
  22330. class: {
  22331. "el-tree--highlight-current": _vm.highlightCurrent,
  22332. "is-dragging": !!_vm.dragState.draggingNode,
  22333. "is-drop-not-allow": !_vm.dragState.allowDrop,
  22334. "is-drop-inner": _vm.dragState.dropType === "inner"
  22335. },
  22336. attrs: { role: "tree" }
  22337. },
  22338. [
  22339. _vm._l(_vm.root.childNodes, function(child) {
  22340. return _c("el-tree-node", {
  22341. key: _vm.getNodeKey(child),
  22342. attrs: {
  22343. node: child,
  22344. props: _vm.props,
  22345. "render-after-expand": _vm.renderAfterExpand,
  22346. "show-checkbox": _vm.showCheckbox,
  22347. "render-content": _vm.renderContent
  22348. },
  22349. on: { "node-expand": _vm.handleNodeExpand }
  22350. })
  22351. }),
  22352. _vm.isEmpty
  22353. ? _c("div", { staticClass: "el-tree__empty-block" }, [
  22354. _c("span", { staticClass: "el-tree__empty-text" }, [
  22355. _vm._v(_vm._s(_vm.emptyText))
  22356. ])
  22357. ])
  22358. : _vm._e(),
  22359. _c("div", {
  22360. directives: [
  22361. {
  22362. name: "show",
  22363. rawName: "v-show",
  22364. value: _vm.dragState.showDropIndicator,
  22365. expression: "dragState.showDropIndicator"
  22366. }
  22367. ],
  22368. ref: "dropIndicator",
  22369. staticClass: "el-tree__drop-indicator"
  22370. })
  22371. ],
  22372. 2
  22373. )
  22374. }
  22375. var treevue_type_template_id_547575a6_staticRenderFns = []
  22376. treevue_type_template_id_547575a6_render._withStripped = true
  22377. // CONCATENATED MODULE: ./packages/tree/src/tree.vue?vue&type=template&id=547575a6&
  22378. // CONCATENATED MODULE: ./packages/tree/src/model/util.js
  22379. var NODE_KEY = '$treeNodeId';
  22380. var markNodeData = function markNodeData(node, data) {
  22381. if (!data || data[NODE_KEY]) return;
  22382. Object.defineProperty(data, NODE_KEY, {
  22383. value: node.id,
  22384. enumerable: false,
  22385. configurable: false,
  22386. writable: false
  22387. });
  22388. };
  22389. var util_getNodeKey = function getNodeKey(key, data) {
  22390. if (!key) return data[NODE_KEY];
  22391. return data[key];
  22392. };
  22393. var findNearestComponent = function findNearestComponent(element, componentName) {
  22394. var target = element;
  22395. while (target && target.tagName !== 'BODY') {
  22396. if (target.__vue__ && target.__vue__.$options.name === componentName) {
  22397. return target.__vue__;
  22398. }
  22399. target = target.parentNode;
  22400. }
  22401. return null;
  22402. };
  22403. // CONCATENATED MODULE: ./packages/tree/src/model/node.js
  22404. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  22405. function node_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22406. var getChildState = function getChildState(node) {
  22407. var all = true;
  22408. var none = true;
  22409. var allWithoutDisable = true;
  22410. for (var i = 0, j = node.length; i < j; i++) {
  22411. var n = node[i];
  22412. if (n.checked !== true || n.indeterminate) {
  22413. all = false;
  22414. if (!n.disabled) {
  22415. allWithoutDisable = false;
  22416. }
  22417. }
  22418. if (n.checked !== false || n.indeterminate) {
  22419. none = false;
  22420. }
  22421. }
  22422. return { all: all, none: none, allWithoutDisable: allWithoutDisable, half: !all && !none };
  22423. };
  22424. var reInitChecked = function reInitChecked(node) {
  22425. if (node.childNodes.length === 0 || node.loading) return;
  22426. var _getChildState = getChildState(node.childNodes),
  22427. all = _getChildState.all,
  22428. none = _getChildState.none,
  22429. half = _getChildState.half;
  22430. if (all) {
  22431. node.checked = true;
  22432. node.indeterminate = false;
  22433. } else if (half) {
  22434. node.checked = false;
  22435. node.indeterminate = true;
  22436. } else if (none) {
  22437. node.checked = false;
  22438. node.indeterminate = false;
  22439. }
  22440. var parent = node.parent;
  22441. if (!parent || parent.level === 0) return;
  22442. if (!node.store.checkStrictly) {
  22443. reInitChecked(parent);
  22444. }
  22445. };
  22446. var getPropertyFromData = function getPropertyFromData(node, prop) {
  22447. var props = node.store.props;
  22448. var data = node.data || {};
  22449. var config = props[prop];
  22450. if (typeof config === 'function') {
  22451. return config(data, node);
  22452. } else if (typeof config === 'string') {
  22453. return data[config];
  22454. } else if (typeof config === 'undefined') {
  22455. var dataProp = data[prop];
  22456. return dataProp === undefined ? '' : dataProp;
  22457. }
  22458. };
  22459. var nodeIdSeed = 0;
  22460. var node_Node = function () {
  22461. function Node(options) {
  22462. node_classCallCheck(this, Node);
  22463. this.id = nodeIdSeed++;
  22464. this.text = null;
  22465. this.checked = false;
  22466. this.indeterminate = false;
  22467. this.data = null;
  22468. this.expanded = false;
  22469. this.parent = null;
  22470. this.visible = true;
  22471. this.isCurrent = false;
  22472. for (var name in options) {
  22473. if (options.hasOwnProperty(name)) {
  22474. this[name] = options[name];
  22475. }
  22476. }
  22477. // internal
  22478. this.level = 0;
  22479. this.loaded = false;
  22480. this.childNodes = [];
  22481. this.loading = false;
  22482. if (this.parent) {
  22483. this.level = this.parent.level + 1;
  22484. }
  22485. var store = this.store;
  22486. if (!store) {
  22487. throw new Error('[Node]store is required!');
  22488. }
  22489. store.registerNode(this);
  22490. var props = store.props;
  22491. if (props && typeof props.isLeaf !== 'undefined') {
  22492. var isLeaf = getPropertyFromData(this, 'isLeaf');
  22493. if (typeof isLeaf === 'boolean') {
  22494. this.isLeafByUser = isLeaf;
  22495. }
  22496. }
  22497. if (store.lazy !== true && this.data) {
  22498. this.setData(this.data);
  22499. if (store.defaultExpandAll) {
  22500. this.expanded = true;
  22501. }
  22502. } else if (this.level > 0 && store.lazy && store.defaultExpandAll) {
  22503. this.expand();
  22504. }
  22505. if (!Array.isArray(this.data)) {
  22506. markNodeData(this, this.data);
  22507. }
  22508. if (!this.data) return;
  22509. var defaultExpandedKeys = store.defaultExpandedKeys;
  22510. var key = store.key;
  22511. if (key && defaultExpandedKeys && defaultExpandedKeys.indexOf(this.key) !== -1) {
  22512. this.expand(null, store.autoExpandParent);
  22513. }
  22514. if (key && store.currentNodeKey !== undefined && this.key === store.currentNodeKey) {
  22515. store.currentNode = this;
  22516. store.currentNode.isCurrent = true;
  22517. }
  22518. if (store.lazy) {
  22519. store._initDefaultCheckedNode(this);
  22520. }
  22521. this.updateLeafState();
  22522. }
  22523. Node.prototype.setData = function setData(data) {
  22524. if (!Array.isArray(data)) {
  22525. markNodeData(this, data);
  22526. }
  22527. this.data = data;
  22528. this.childNodes = [];
  22529. var children = void 0;
  22530. if (this.level === 0 && this.data instanceof Array) {
  22531. children = this.data;
  22532. } else {
  22533. children = getPropertyFromData(this, 'children') || [];
  22534. }
  22535. for (var i = 0, j = children.length; i < j; i++) {
  22536. this.insertChild({ data: children[i] });
  22537. }
  22538. };
  22539. Node.prototype.contains = function contains(target) {
  22540. var deep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  22541. var walk = function walk(parent) {
  22542. var children = parent.childNodes || [];
  22543. var result = false;
  22544. for (var i = 0, j = children.length; i < j; i++) {
  22545. var child = children[i];
  22546. if (child === target || deep && walk(child)) {
  22547. result = true;
  22548. break;
  22549. }
  22550. }
  22551. return result;
  22552. };
  22553. return walk(this);
  22554. };
  22555. Node.prototype.remove = function remove() {
  22556. var parent = this.parent;
  22557. if (parent) {
  22558. parent.removeChild(this);
  22559. }
  22560. };
  22561. Node.prototype.insertChild = function insertChild(child, index, batch) {
  22562. if (!child) throw new Error('insertChild error: child is required.');
  22563. if (!(child instanceof Node)) {
  22564. if (!batch) {
  22565. var children = this.getChildren(true) || [];
  22566. if (children.indexOf(child.data) === -1) {
  22567. if (typeof index === 'undefined' || index < 0) {
  22568. children.push(child.data);
  22569. } else {
  22570. children.splice(index, 0, child.data);
  22571. }
  22572. }
  22573. }
  22574. merge_default()(child, {
  22575. parent: this,
  22576. store: this.store
  22577. });
  22578. child = new Node(child);
  22579. }
  22580. child.level = this.level + 1;
  22581. if (typeof index === 'undefined' || index < 0) {
  22582. this.childNodes.push(child);
  22583. } else {
  22584. this.childNodes.splice(index, 0, child);
  22585. }
  22586. this.updateLeafState();
  22587. };
  22588. Node.prototype.insertBefore = function insertBefore(child, ref) {
  22589. var index = void 0;
  22590. if (ref) {
  22591. index = this.childNodes.indexOf(ref);
  22592. }
  22593. this.insertChild(child, index);
  22594. };
  22595. Node.prototype.insertAfter = function insertAfter(child, ref) {
  22596. var index = void 0;
  22597. if (ref) {
  22598. index = this.childNodes.indexOf(ref);
  22599. if (index !== -1) index += 1;
  22600. }
  22601. this.insertChild(child, index);
  22602. };
  22603. Node.prototype.removeChild = function removeChild(child) {
  22604. var children = this.getChildren() || [];
  22605. var dataIndex = children.indexOf(child.data);
  22606. if (dataIndex > -1) {
  22607. children.splice(dataIndex, 1);
  22608. }
  22609. var index = this.childNodes.indexOf(child);
  22610. if (index > -1) {
  22611. this.store && this.store.deregisterNode(child);
  22612. child.parent = null;
  22613. this.childNodes.splice(index, 1);
  22614. }
  22615. this.updateLeafState();
  22616. };
  22617. Node.prototype.removeChildByData = function removeChildByData(data) {
  22618. var targetNode = null;
  22619. for (var i = 0; i < this.childNodes.length; i++) {
  22620. if (this.childNodes[i].data === data) {
  22621. targetNode = this.childNodes[i];
  22622. break;
  22623. }
  22624. }
  22625. if (targetNode) {
  22626. this.removeChild(targetNode);
  22627. }
  22628. };
  22629. Node.prototype.expand = function expand(callback, expandParent) {
  22630. var _this = this;
  22631. var done = function done() {
  22632. if (expandParent) {
  22633. var parent = _this.parent;
  22634. while (parent.level > 0) {
  22635. parent.expanded = true;
  22636. parent = parent.parent;
  22637. }
  22638. }
  22639. _this.expanded = true;
  22640. if (callback) callback();
  22641. };
  22642. if (this.shouldLoadData()) {
  22643. this.loadData(function (data) {
  22644. if (data instanceof Array) {
  22645. if (_this.checked) {
  22646. _this.setChecked(true, true);
  22647. } else if (!_this.store.checkStrictly) {
  22648. reInitChecked(_this);
  22649. }
  22650. done();
  22651. }
  22652. });
  22653. } else {
  22654. done();
  22655. }
  22656. };
  22657. Node.prototype.doCreateChildren = function doCreateChildren(array) {
  22658. var _this2 = this;
  22659. var defaultProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  22660. array.forEach(function (item) {
  22661. _this2.insertChild(merge_default()({ data: item }, defaultProps), undefined, true);
  22662. });
  22663. };
  22664. Node.prototype.collapse = function collapse() {
  22665. this.expanded = false;
  22666. };
  22667. Node.prototype.shouldLoadData = function shouldLoadData() {
  22668. return this.store.lazy === true && this.store.load && !this.loaded;
  22669. };
  22670. Node.prototype.updateLeafState = function updateLeafState() {
  22671. if (this.store.lazy === true && this.loaded !== true && typeof this.isLeafByUser !== 'undefined') {
  22672. this.isLeaf = this.isLeafByUser;
  22673. return;
  22674. }
  22675. var childNodes = this.childNodes;
  22676. if (!this.store.lazy || this.store.lazy === true && this.loaded === true) {
  22677. this.isLeaf = !childNodes || childNodes.length === 0;
  22678. return;
  22679. }
  22680. this.isLeaf = false;
  22681. };
  22682. Node.prototype.setChecked = function setChecked(value, deep, recursion, passValue) {
  22683. var _this3 = this;
  22684. this.indeterminate = value === 'half';
  22685. this.checked = value === true;
  22686. if (this.store.checkStrictly) return;
  22687. if (!(this.shouldLoadData() && !this.store.checkDescendants)) {
  22688. var _getChildState2 = getChildState(this.childNodes),
  22689. all = _getChildState2.all,
  22690. allWithoutDisable = _getChildState2.allWithoutDisable;
  22691. if (!this.isLeaf && !all && allWithoutDisable) {
  22692. this.checked = false;
  22693. value = false;
  22694. }
  22695. var handleDescendants = function handleDescendants() {
  22696. if (deep) {
  22697. var childNodes = _this3.childNodes;
  22698. for (var i = 0, j = childNodes.length; i < j; i++) {
  22699. var child = childNodes[i];
  22700. passValue = passValue || value !== false;
  22701. var isCheck = child.disabled ? child.checked : passValue;
  22702. child.setChecked(isCheck, deep, true, passValue);
  22703. }
  22704. var _getChildState3 = getChildState(childNodes),
  22705. half = _getChildState3.half,
  22706. _all = _getChildState3.all;
  22707. if (!_all) {
  22708. _this3.checked = _all;
  22709. _this3.indeterminate = half;
  22710. }
  22711. }
  22712. };
  22713. if (this.shouldLoadData()) {
  22714. // Only work on lazy load data.
  22715. this.loadData(function () {
  22716. handleDescendants();
  22717. reInitChecked(_this3);
  22718. }, {
  22719. checked: value !== false
  22720. });
  22721. return;
  22722. } else {
  22723. handleDescendants();
  22724. }
  22725. }
  22726. var parent = this.parent;
  22727. if (!parent || parent.level === 0) return;
  22728. if (!recursion) {
  22729. reInitChecked(parent);
  22730. }
  22731. };
  22732. Node.prototype.getChildren = function getChildren() {
  22733. var forceInit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  22734. // this is data
  22735. if (this.level === 0) return this.data;
  22736. var data = this.data;
  22737. if (!data) return null;
  22738. var props = this.store.props;
  22739. var children = 'children';
  22740. if (props) {
  22741. children = props.children || 'children';
  22742. }
  22743. if (data[children] === undefined) {
  22744. data[children] = null;
  22745. }
  22746. if (forceInit && !data[children]) {
  22747. data[children] = [];
  22748. }
  22749. return data[children];
  22750. };
  22751. Node.prototype.updateChildren = function updateChildren() {
  22752. var _this4 = this;
  22753. var newData = this.getChildren() || [];
  22754. var oldData = this.childNodes.map(function (node) {
  22755. return node.data;
  22756. });
  22757. var newDataMap = {};
  22758. var newNodes = [];
  22759. newData.forEach(function (item, index) {
  22760. var key = item[NODE_KEY];
  22761. var isNodeExists = !!key && Object(util_["arrayFindIndex"])(oldData, function (data) {
  22762. return data[NODE_KEY] === key;
  22763. }) >= 0;
  22764. if (isNodeExists) {
  22765. newDataMap[key] = { index: index, data: item };
  22766. } else {
  22767. newNodes.push({ index: index, data: item });
  22768. }
  22769. });
  22770. if (!this.store.lazy) {
  22771. oldData.forEach(function (item) {
  22772. if (!newDataMap[item[NODE_KEY]]) _this4.removeChildByData(item);
  22773. });
  22774. }
  22775. newNodes.forEach(function (_ref) {
  22776. var index = _ref.index,
  22777. data = _ref.data;
  22778. _this4.insertChild({ data: data }, index);
  22779. });
  22780. this.updateLeafState();
  22781. };
  22782. Node.prototype.loadData = function loadData(callback) {
  22783. var _this5 = this;
  22784. var defaultProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  22785. if (this.store.lazy === true && this.store.load && !this.loaded && (!this.loading || Object.keys(defaultProps).length)) {
  22786. this.loading = true;
  22787. var resolve = function resolve(children) {
  22788. _this5.childNodes = [];
  22789. _this5.doCreateChildren(children, defaultProps);
  22790. _this5.loaded = true;
  22791. _this5.loading = false;
  22792. _this5.updateLeafState();
  22793. if (callback) {
  22794. callback.call(_this5, children);
  22795. }
  22796. };
  22797. this.store.load(this, resolve);
  22798. } else {
  22799. if (callback) {
  22800. callback.call(this);
  22801. }
  22802. }
  22803. };
  22804. _createClass(Node, [{
  22805. key: 'label',
  22806. get: function get() {
  22807. return getPropertyFromData(this, 'label');
  22808. }
  22809. }, {
  22810. key: 'key',
  22811. get: function get() {
  22812. var nodeKey = this.store.key;
  22813. if (this.data) return this.data[nodeKey];
  22814. return null;
  22815. }
  22816. }, {
  22817. key: 'disabled',
  22818. get: function get() {
  22819. return getPropertyFromData(this, 'disabled');
  22820. }
  22821. }, {
  22822. key: 'nextSibling',
  22823. get: function get() {
  22824. var parent = this.parent;
  22825. if (parent) {
  22826. var index = parent.childNodes.indexOf(this);
  22827. if (index > -1) {
  22828. return parent.childNodes[index + 1];
  22829. }
  22830. }
  22831. return null;
  22832. }
  22833. }, {
  22834. key: 'previousSibling',
  22835. get: function get() {
  22836. var parent = this.parent;
  22837. if (parent) {
  22838. var index = parent.childNodes.indexOf(this);
  22839. if (index > -1) {
  22840. return index > 0 ? parent.childNodes[index - 1] : null;
  22841. }
  22842. }
  22843. return null;
  22844. }
  22845. }]);
  22846. return Node;
  22847. }();
  22848. /* harmony default export */ var model_node = (node_Node);
  22849. // CONCATENATED MODULE: ./packages/tree/src/model/tree-store.js
  22850. var tree_store_typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  22851. function tree_store_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22852. var tree_store_TreeStore = function () {
  22853. function TreeStore(options) {
  22854. var _this = this;
  22855. tree_store_classCallCheck(this, TreeStore);
  22856. this.currentNode = null;
  22857. this.currentNodeKey = null;
  22858. for (var option in options) {
  22859. if (options.hasOwnProperty(option)) {
  22860. this[option] = options[option];
  22861. }
  22862. }
  22863. this.nodesMap = {};
  22864. this.root = new model_node({
  22865. data: this.data,
  22866. store: this
  22867. });
  22868. if (this.lazy && this.load) {
  22869. var loadFn = this.load;
  22870. loadFn(this.root, function (data) {
  22871. _this.root.doCreateChildren(data);
  22872. _this._initDefaultCheckedNodes();
  22873. });
  22874. } else {
  22875. this._initDefaultCheckedNodes();
  22876. }
  22877. }
  22878. TreeStore.prototype.filter = function filter(value) {
  22879. var filterNodeMethod = this.filterNodeMethod;
  22880. var lazy = this.lazy;
  22881. var traverse = function traverse(node) {
  22882. var childNodes = node.root ? node.root.childNodes : node.childNodes;
  22883. childNodes.forEach(function (child) {
  22884. child.visible = filterNodeMethod.call(child, value, child.data, child);
  22885. traverse(child);
  22886. });
  22887. if (!node.visible && childNodes.length) {
  22888. var allHidden = true;
  22889. allHidden = !childNodes.some(function (child) {
  22890. return child.visible;
  22891. });
  22892. if (node.root) {
  22893. node.root.visible = allHidden === false;
  22894. } else {
  22895. node.visible = allHidden === false;
  22896. }
  22897. }
  22898. if (!value) return;
  22899. if (node.visible && !node.isLeaf && !lazy) node.expand();
  22900. };
  22901. traverse(this);
  22902. };
  22903. TreeStore.prototype.setData = function setData(newVal) {
  22904. var instanceChanged = newVal !== this.root.data;
  22905. if (instanceChanged) {
  22906. this.root.setData(newVal);
  22907. this._initDefaultCheckedNodes();
  22908. } else {
  22909. this.root.updateChildren();
  22910. }
  22911. };
  22912. TreeStore.prototype.getNode = function getNode(data) {
  22913. if (data instanceof model_node) return data;
  22914. var key = (typeof data === 'undefined' ? 'undefined' : tree_store_typeof(data)) !== 'object' ? data : util_getNodeKey(this.key, data);
  22915. return this.nodesMap[key] || null;
  22916. };
  22917. TreeStore.prototype.insertBefore = function insertBefore(data, refData) {
  22918. var refNode = this.getNode(refData);
  22919. refNode.parent.insertBefore({ data: data }, refNode);
  22920. };
  22921. TreeStore.prototype.insertAfter = function insertAfter(data, refData) {
  22922. var refNode = this.getNode(refData);
  22923. refNode.parent.insertAfter({ data: data }, refNode);
  22924. };
  22925. TreeStore.prototype.remove = function remove(data) {
  22926. var node = this.getNode(data);
  22927. if (node && node.parent) {
  22928. if (node === this.currentNode) {
  22929. this.currentNode = null;
  22930. }
  22931. node.parent.removeChild(node);
  22932. }
  22933. };
  22934. TreeStore.prototype.append = function append(data, parentData) {
  22935. var parentNode = parentData ? this.getNode(parentData) : this.root;
  22936. if (parentNode) {
  22937. parentNode.insertChild({ data: data });
  22938. }
  22939. };
  22940. TreeStore.prototype._initDefaultCheckedNodes = function _initDefaultCheckedNodes() {
  22941. var _this2 = this;
  22942. var defaultCheckedKeys = this.defaultCheckedKeys || [];
  22943. var nodesMap = this.nodesMap;
  22944. defaultCheckedKeys.forEach(function (checkedKey) {
  22945. var node = nodesMap[checkedKey];
  22946. if (node) {
  22947. node.setChecked(true, !_this2.checkStrictly);
  22948. }
  22949. });
  22950. };
  22951. TreeStore.prototype._initDefaultCheckedNode = function _initDefaultCheckedNode(node) {
  22952. var defaultCheckedKeys = this.defaultCheckedKeys || [];
  22953. if (defaultCheckedKeys.indexOf(node.key) !== -1) {
  22954. node.setChecked(true, !this.checkStrictly);
  22955. }
  22956. };
  22957. TreeStore.prototype.setDefaultCheckedKey = function setDefaultCheckedKey(newVal) {
  22958. if (newVal !== this.defaultCheckedKeys) {
  22959. this.defaultCheckedKeys = newVal;
  22960. this._initDefaultCheckedNodes();
  22961. }
  22962. };
  22963. TreeStore.prototype.registerNode = function registerNode(node) {
  22964. var key = this.key;
  22965. if (!key || !node || !node.data) return;
  22966. var nodeKey = node.key;
  22967. if (nodeKey !== undefined) this.nodesMap[node.key] = node;
  22968. };
  22969. TreeStore.prototype.deregisterNode = function deregisterNode(node) {
  22970. var _this3 = this;
  22971. var key = this.key;
  22972. if (!key || !node || !node.data) return;
  22973. node.childNodes.forEach(function (child) {
  22974. _this3.deregisterNode(child);
  22975. });
  22976. delete this.nodesMap[node.key];
  22977. };
  22978. TreeStore.prototype.getCheckedNodes = function getCheckedNodes() {
  22979. var leafOnly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  22980. var includeHalfChecked = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  22981. var checkedNodes = [];
  22982. var traverse = function traverse(node) {
  22983. var childNodes = node.root ? node.root.childNodes : node.childNodes;
  22984. childNodes.forEach(function (child) {
  22985. if ((child.checked || includeHalfChecked && child.indeterminate) && (!leafOnly || leafOnly && child.isLeaf)) {
  22986. checkedNodes.push(child.data);
  22987. }
  22988. traverse(child);
  22989. });
  22990. };
  22991. traverse(this);
  22992. return checkedNodes;
  22993. };
  22994. TreeStore.prototype.getCheckedKeys = function getCheckedKeys() {
  22995. var _this4 = this;
  22996. var leafOnly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  22997. return this.getCheckedNodes(leafOnly).map(function (data) {
  22998. return (data || {})[_this4.key];
  22999. });
  23000. };
  23001. TreeStore.prototype.getHalfCheckedNodes = function getHalfCheckedNodes() {
  23002. var nodes = [];
  23003. var traverse = function traverse(node) {
  23004. var childNodes = node.root ? node.root.childNodes : node.childNodes;
  23005. childNodes.forEach(function (child) {
  23006. if (child.indeterminate) {
  23007. nodes.push(child.data);
  23008. }
  23009. traverse(child);
  23010. });
  23011. };
  23012. traverse(this);
  23013. return nodes;
  23014. };
  23015. TreeStore.prototype.getHalfCheckedKeys = function getHalfCheckedKeys() {
  23016. var _this5 = this;
  23017. return this.getHalfCheckedNodes().map(function (data) {
  23018. return (data || {})[_this5.key];
  23019. });
  23020. };
  23021. TreeStore.prototype._getAllNodes = function _getAllNodes() {
  23022. var allNodes = [];
  23023. var nodesMap = this.nodesMap;
  23024. for (var nodeKey in nodesMap) {
  23025. if (nodesMap.hasOwnProperty(nodeKey)) {
  23026. allNodes.push(nodesMap[nodeKey]);
  23027. }
  23028. }
  23029. return allNodes;
  23030. };
  23031. TreeStore.prototype.updateChildren = function updateChildren(key, data) {
  23032. var node = this.nodesMap[key];
  23033. if (!node) return;
  23034. var childNodes = node.childNodes;
  23035. for (var i = childNodes.length - 1; i >= 0; i--) {
  23036. var child = childNodes[i];
  23037. this.remove(child.data);
  23038. }
  23039. for (var _i = 0, j = data.length; _i < j; _i++) {
  23040. var _child = data[_i];
  23041. this.append(_child, node.data);
  23042. }
  23043. };
  23044. TreeStore.prototype._setCheckedKeys = function _setCheckedKeys(key) {
  23045. var leafOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  23046. var checkedKeys = arguments[2];
  23047. var allNodes = this._getAllNodes().sort(function (a, b) {
  23048. return b.level - a.level;
  23049. });
  23050. var cache = Object.create(null);
  23051. var keys = Object.keys(checkedKeys);
  23052. allNodes.forEach(function (node) {
  23053. return node.setChecked(false, false);
  23054. });
  23055. for (var i = 0, j = allNodes.length; i < j; i++) {
  23056. var node = allNodes[i];
  23057. var nodeKey = node.data[key].toString();
  23058. var checked = keys.indexOf(nodeKey) > -1;
  23059. if (!checked) {
  23060. if (node.checked && !cache[nodeKey]) {
  23061. node.setChecked(false, false);
  23062. }
  23063. continue;
  23064. }
  23065. var parent = node.parent;
  23066. while (parent && parent.level > 0) {
  23067. cache[parent.data[key]] = true;
  23068. parent = parent.parent;
  23069. }
  23070. if (node.isLeaf || this.checkStrictly) {
  23071. node.setChecked(true, false);
  23072. continue;
  23073. }
  23074. node.setChecked(true, true);
  23075. if (leafOnly) {
  23076. (function () {
  23077. node.setChecked(false, false);
  23078. var traverse = function traverse(node) {
  23079. var childNodes = node.childNodes;
  23080. childNodes.forEach(function (child) {
  23081. if (!child.isLeaf) {
  23082. child.setChecked(false, false);
  23083. }
  23084. traverse(child);
  23085. });
  23086. };
  23087. traverse(node);
  23088. })();
  23089. }
  23090. }
  23091. };
  23092. TreeStore.prototype.setCheckedNodes = function setCheckedNodes(array) {
  23093. var leafOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  23094. var key = this.key;
  23095. var checkedKeys = {};
  23096. array.forEach(function (item) {
  23097. checkedKeys[(item || {})[key]] = true;
  23098. });
  23099. this._setCheckedKeys(key, leafOnly, checkedKeys);
  23100. };
  23101. TreeStore.prototype.setCheckedKeys = function setCheckedKeys(keys) {
  23102. var leafOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  23103. this.defaultCheckedKeys = keys;
  23104. var key = this.key;
  23105. var checkedKeys = {};
  23106. keys.forEach(function (key) {
  23107. checkedKeys[key] = true;
  23108. });
  23109. this._setCheckedKeys(key, leafOnly, checkedKeys);
  23110. };
  23111. TreeStore.prototype.setDefaultExpandedKeys = function setDefaultExpandedKeys(keys) {
  23112. var _this6 = this;
  23113. keys = keys || [];
  23114. this.defaultExpandedKeys = keys;
  23115. keys.forEach(function (key) {
  23116. var node = _this6.getNode(key);
  23117. if (node) node.expand(null, _this6.autoExpandParent);
  23118. });
  23119. };
  23120. TreeStore.prototype.setChecked = function setChecked(data, checked, deep) {
  23121. var node = this.getNode(data);
  23122. if (node) {
  23123. node.setChecked(!!checked, deep);
  23124. }
  23125. };
  23126. TreeStore.prototype.getCurrentNode = function getCurrentNode() {
  23127. return this.currentNode;
  23128. };
  23129. TreeStore.prototype.setCurrentNode = function setCurrentNode(currentNode) {
  23130. var prevCurrentNode = this.currentNode;
  23131. if (prevCurrentNode) {
  23132. prevCurrentNode.isCurrent = false;
  23133. }
  23134. this.currentNode = currentNode;
  23135. this.currentNode.isCurrent = true;
  23136. };
  23137. TreeStore.prototype.setUserCurrentNode = function setUserCurrentNode(node) {
  23138. var key = node[this.key];
  23139. var currNode = this.nodesMap[key];
  23140. this.setCurrentNode(currNode);
  23141. };
  23142. TreeStore.prototype.setCurrentNodeKey = function setCurrentNodeKey(key) {
  23143. if (key === null || key === undefined) {
  23144. this.currentNode && (this.currentNode.isCurrent = false);
  23145. this.currentNode = null;
  23146. return;
  23147. }
  23148. var node = this.getNode(key);
  23149. if (node) {
  23150. this.setCurrentNode(node);
  23151. }
  23152. };
  23153. return TreeStore;
  23154. }();
  23155. /* harmony default export */ var tree_store = (tree_store_TreeStore);
  23156. ;
  23157. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/tree/src/tree-node.vue?vue&type=template&id=3ba3ef0e&
  23158. var tree_nodevue_type_template_id_3ba3ef0e_render = function() {
  23159. var this$1 = this
  23160. var _vm = this
  23161. var _h = _vm.$createElement
  23162. var _c = _vm._self._c || _h
  23163. return _c(
  23164. "div",
  23165. {
  23166. directives: [
  23167. {
  23168. name: "show",
  23169. rawName: "v-show",
  23170. value: _vm.node.visible,
  23171. expression: "node.visible"
  23172. }
  23173. ],
  23174. ref: "node",
  23175. staticClass: "el-tree-node",
  23176. class: {
  23177. "is-expanded": _vm.expanded,
  23178. "is-current": _vm.node.isCurrent,
  23179. "is-hidden": !_vm.node.visible,
  23180. "is-focusable": !_vm.node.disabled,
  23181. "is-checked": !_vm.node.disabled && _vm.node.checked
  23182. },
  23183. attrs: {
  23184. role: "treeitem",
  23185. tabindex: "-1",
  23186. "aria-expanded": _vm.expanded,
  23187. "aria-disabled": _vm.node.disabled,
  23188. "aria-checked": _vm.node.checked,
  23189. draggable: _vm.tree.draggable
  23190. },
  23191. on: {
  23192. click: function($event) {
  23193. $event.stopPropagation()
  23194. return _vm.handleClick($event)
  23195. },
  23196. contextmenu: function($event) {
  23197. return this$1.handleContextMenu($event)
  23198. },
  23199. dragstart: function($event) {
  23200. $event.stopPropagation()
  23201. return _vm.handleDragStart($event)
  23202. },
  23203. dragover: function($event) {
  23204. $event.stopPropagation()
  23205. return _vm.handleDragOver($event)
  23206. },
  23207. dragend: function($event) {
  23208. $event.stopPropagation()
  23209. return _vm.handleDragEnd($event)
  23210. },
  23211. drop: function($event) {
  23212. $event.stopPropagation()
  23213. return _vm.handleDrop($event)
  23214. }
  23215. }
  23216. },
  23217. [
  23218. _c(
  23219. "div",
  23220. {
  23221. staticClass: "el-tree-node__content",
  23222. style: {
  23223. "padding-left": (_vm.node.level - 1) * _vm.tree.indent + "px"
  23224. }
  23225. },
  23226. [
  23227. _c("span", {
  23228. class: [
  23229. {
  23230. "is-leaf": _vm.node.isLeaf,
  23231. expanded: !_vm.node.isLeaf && _vm.expanded
  23232. },
  23233. "el-tree-node__expand-icon",
  23234. _vm.tree.iconClass ? _vm.tree.iconClass : "el-icon-caret-right"
  23235. ],
  23236. on: {
  23237. click: function($event) {
  23238. $event.stopPropagation()
  23239. return _vm.handleExpandIconClick($event)
  23240. }
  23241. }
  23242. }),
  23243. _vm.showCheckbox
  23244. ? _c("el-checkbox", {
  23245. attrs: {
  23246. indeterminate: _vm.node.indeterminate,
  23247. disabled: !!_vm.node.disabled
  23248. },
  23249. on: { change: _vm.handleCheckChange },
  23250. nativeOn: {
  23251. click: function($event) {
  23252. $event.stopPropagation()
  23253. }
  23254. },
  23255. model: {
  23256. value: _vm.node.checked,
  23257. callback: function($$v) {
  23258. _vm.$set(_vm.node, "checked", $$v)
  23259. },
  23260. expression: "node.checked"
  23261. }
  23262. })
  23263. : _vm._e(),
  23264. _vm.node.loading
  23265. ? _c("span", {
  23266. staticClass: "el-tree-node__loading-icon el-icon-loading"
  23267. })
  23268. : _vm._e(),
  23269. _c("node-content", { attrs: { node: _vm.node } })
  23270. ],
  23271. 1
  23272. ),
  23273. _c("el-collapse-transition", [
  23274. !_vm.renderAfterExpand || _vm.childNodeRendered
  23275. ? _c(
  23276. "div",
  23277. {
  23278. directives: [
  23279. {
  23280. name: "show",
  23281. rawName: "v-show",
  23282. value: _vm.expanded,
  23283. expression: "expanded"
  23284. }
  23285. ],
  23286. staticClass: "el-tree-node__children",
  23287. attrs: { role: "group", "aria-expanded": _vm.expanded }
  23288. },
  23289. _vm._l(_vm.node.childNodes, function(child) {
  23290. return _c("el-tree-node", {
  23291. key: _vm.getNodeKey(child),
  23292. attrs: {
  23293. "render-content": _vm.renderContent,
  23294. "render-after-expand": _vm.renderAfterExpand,
  23295. "show-checkbox": _vm.showCheckbox,
  23296. node: child
  23297. },
  23298. on: { "node-expand": _vm.handleChildNodeExpand }
  23299. })
  23300. }),
  23301. 1
  23302. )
  23303. : _vm._e()
  23304. ])
  23305. ],
  23306. 1
  23307. )
  23308. }
  23309. var tree_nodevue_type_template_id_3ba3ef0e_staticRenderFns = []
  23310. tree_nodevue_type_template_id_3ba3ef0e_render._withStripped = true
  23311. // CONCATENATED MODULE: ./packages/tree/src/tree-node.vue?vue&type=template&id=3ba3ef0e&
  23312. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/tree/src/tree-node.vue?vue&type=script&lang=js&
  23313. //
  23314. //
  23315. //
  23316. //
  23317. //
  23318. //
  23319. //
  23320. //
  23321. //
  23322. //
  23323. //
  23324. //
  23325. //
  23326. //
  23327. //
  23328. //
  23329. //
  23330. //
  23331. //
  23332. //
  23333. //
  23334. //
  23335. //
  23336. //
  23337. //
  23338. //
  23339. //
  23340. //
  23341. //
  23342. //
  23343. //
  23344. //
  23345. //
  23346. //
  23347. //
  23348. //
  23349. //
  23350. //
  23351. //
  23352. //
  23353. //
  23354. //
  23355. //
  23356. //
  23357. //
  23358. //
  23359. //
  23360. //
  23361. //
  23362. //
  23363. //
  23364. //
  23365. //
  23366. //
  23367. //
  23368. //
  23369. //
  23370. //
  23371. //
  23372. //
  23373. //
  23374. //
  23375. //
  23376. //
  23377. //
  23378. //
  23379. //
  23380. //
  23381. //
  23382. //
  23383. //
  23384. //
  23385. //
  23386. /* harmony default export */ var tree_nodevue_type_script_lang_js_ = ({
  23387. name: 'ElTreeNode',
  23388. componentName: 'ElTreeNode',
  23389. mixins: [emitter_default.a],
  23390. props: {
  23391. node: {
  23392. default: function _default() {
  23393. return {};
  23394. }
  23395. },
  23396. props: {},
  23397. renderContent: Function,
  23398. renderAfterExpand: {
  23399. type: Boolean,
  23400. default: true
  23401. },
  23402. showCheckbox: {
  23403. type: Boolean,
  23404. default: false
  23405. }
  23406. },
  23407. components: {
  23408. ElCollapseTransition: collapse_transition_default.a,
  23409. ElCheckbox: checkbox_default.a,
  23410. NodeContent: {
  23411. props: {
  23412. node: {
  23413. required: true
  23414. }
  23415. },
  23416. render: function render(h) {
  23417. var parent = this.$parent;
  23418. var tree = parent.tree;
  23419. var node = this.node;
  23420. var data = node.data,
  23421. store = node.store;
  23422. return parent.renderContent ? parent.renderContent.call(parent._renderProxy, h, { _self: tree.$vnode.context, node: node, data: data, store: store }) : tree.$scopedSlots.default ? tree.$scopedSlots.default({ node: node, data: data }) : h(
  23423. 'span',
  23424. { 'class': 'el-tree-node__label' },
  23425. [node.label]
  23426. );
  23427. }
  23428. }
  23429. },
  23430. data: function data() {
  23431. return {
  23432. tree: null,
  23433. expanded: false,
  23434. childNodeRendered: false,
  23435. oldChecked: null,
  23436. oldIndeterminate: null
  23437. };
  23438. },
  23439. watch: {
  23440. 'node.indeterminate': function nodeIndeterminate(val) {
  23441. this.handleSelectChange(this.node.checked, val);
  23442. },
  23443. 'node.checked': function nodeChecked(val) {
  23444. this.handleSelectChange(val, this.node.indeterminate);
  23445. },
  23446. 'node.expanded': function nodeExpanded(val) {
  23447. var _this = this;
  23448. this.$nextTick(function () {
  23449. return _this.expanded = val;
  23450. });
  23451. if (val) {
  23452. this.childNodeRendered = true;
  23453. }
  23454. }
  23455. },
  23456. methods: {
  23457. getNodeKey: function getNodeKey(node) {
  23458. return util_getNodeKey(this.tree.nodeKey, node.data);
  23459. },
  23460. handleSelectChange: function handleSelectChange(checked, indeterminate) {
  23461. if (this.oldChecked !== checked && this.oldIndeterminate !== indeterminate) {
  23462. this.tree.$emit('check-change', this.node.data, checked, indeterminate);
  23463. }
  23464. this.oldChecked = checked;
  23465. this.indeterminate = indeterminate;
  23466. },
  23467. handleClick: function handleClick() {
  23468. var store = this.tree.store;
  23469. store.setCurrentNode(this.node);
  23470. this.tree.$emit('current-change', store.currentNode ? store.currentNode.data : null, store.currentNode);
  23471. this.tree.currentNode = this;
  23472. if (this.tree.expandOnClickNode) {
  23473. this.handleExpandIconClick();
  23474. }
  23475. if (this.tree.checkOnClickNode && !this.node.disabled) {
  23476. this.handleCheckChange(null, {
  23477. target: { checked: !this.node.checked }
  23478. });
  23479. }
  23480. this.tree.$emit('node-click', this.node.data, this.node, this);
  23481. },
  23482. handleContextMenu: function handleContextMenu(event) {
  23483. if (this.tree._events['node-contextmenu'] && this.tree._events['node-contextmenu'].length > 0) {
  23484. event.stopPropagation();
  23485. event.preventDefault();
  23486. }
  23487. this.tree.$emit('node-contextmenu', event, this.node.data, this.node, this);
  23488. },
  23489. handleExpandIconClick: function handleExpandIconClick() {
  23490. if (this.node.isLeaf) return;
  23491. if (this.expanded) {
  23492. this.tree.$emit('node-collapse', this.node.data, this.node, this);
  23493. this.node.collapse();
  23494. } else {
  23495. this.node.expand();
  23496. this.$emit('node-expand', this.node.data, this.node, this);
  23497. }
  23498. },
  23499. handleCheckChange: function handleCheckChange(value, ev) {
  23500. var _this2 = this;
  23501. this.node.setChecked(ev.target.checked, !this.tree.checkStrictly);
  23502. this.$nextTick(function () {
  23503. var store = _this2.tree.store;
  23504. _this2.tree.$emit('check', _this2.node.data, {
  23505. checkedNodes: store.getCheckedNodes(),
  23506. checkedKeys: store.getCheckedKeys(),
  23507. halfCheckedNodes: store.getHalfCheckedNodes(),
  23508. halfCheckedKeys: store.getHalfCheckedKeys()
  23509. });
  23510. });
  23511. },
  23512. handleChildNodeExpand: function handleChildNodeExpand(nodeData, node, instance) {
  23513. this.broadcast('ElTreeNode', 'tree-node-expand', node);
  23514. this.tree.$emit('node-expand', nodeData, node, instance);
  23515. },
  23516. handleDragStart: function handleDragStart(event) {
  23517. if (!this.tree.draggable) return;
  23518. this.tree.$emit('tree-node-drag-start', event, this);
  23519. },
  23520. handleDragOver: function handleDragOver(event) {
  23521. if (!this.tree.draggable) return;
  23522. this.tree.$emit('tree-node-drag-over', event, this);
  23523. event.preventDefault();
  23524. },
  23525. handleDrop: function handleDrop(event) {
  23526. event.preventDefault();
  23527. },
  23528. handleDragEnd: function handleDragEnd(event) {
  23529. if (!this.tree.draggable) return;
  23530. this.tree.$emit('tree-node-drag-end', event, this);
  23531. }
  23532. },
  23533. created: function created() {
  23534. var _this3 = this;
  23535. var parent = this.$parent;
  23536. if (parent.isTree) {
  23537. this.tree = parent;
  23538. } else {
  23539. this.tree = parent.tree;
  23540. }
  23541. var tree = this.tree;
  23542. if (!tree) {
  23543. console.warn('Can not find node\'s tree.');
  23544. }
  23545. var props = tree.props || {};
  23546. var childrenKey = props['children'] || 'children';
  23547. this.$watch('node.data.' + childrenKey, function () {
  23548. _this3.node.updateChildren();
  23549. });
  23550. if (this.node.expanded) {
  23551. this.expanded = true;
  23552. this.childNodeRendered = true;
  23553. }
  23554. if (this.tree.accordion) {
  23555. this.$on('tree-node-expand', function (node) {
  23556. if (_this3.node !== node) {
  23557. _this3.node.collapse();
  23558. }
  23559. });
  23560. }
  23561. }
  23562. });
  23563. // CONCATENATED MODULE: ./packages/tree/src/tree-node.vue?vue&type=script&lang=js&
  23564. /* harmony default export */ var src_tree_nodevue_type_script_lang_js_ = (tree_nodevue_type_script_lang_js_);
  23565. // CONCATENATED MODULE: ./packages/tree/src/tree-node.vue
  23566. /* normalize component */
  23567. var tree_node_component = normalizeComponent(
  23568. src_tree_nodevue_type_script_lang_js_,
  23569. tree_nodevue_type_template_id_3ba3ef0e_render,
  23570. tree_nodevue_type_template_id_3ba3ef0e_staticRenderFns,
  23571. false,
  23572. null,
  23573. null,
  23574. null
  23575. )
  23576. /* hot reload */
  23577. if (false) { var tree_node_api; }
  23578. tree_node_component.options.__file = "packages/tree/src/tree-node.vue"
  23579. /* harmony default export */ var tree_node = (tree_node_component.exports);
  23580. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/tree/src/tree.vue?vue&type=script&lang=js&
  23581. //
  23582. //
  23583. //
  23584. //
  23585. //
  23586. //
  23587. //
  23588. //
  23589. //
  23590. //
  23591. //
  23592. //
  23593. //
  23594. //
  23595. //
  23596. //
  23597. //
  23598. //
  23599. //
  23600. //
  23601. //
  23602. //
  23603. //
  23604. //
  23605. //
  23606. //
  23607. //
  23608. //
  23609. //
  23610. //
  23611. //
  23612. //
  23613. /* harmony default export */ var treevue_type_script_lang_js_ = ({
  23614. name: 'ElTree',
  23615. mixins: [emitter_default.a],
  23616. components: {
  23617. ElTreeNode: tree_node
  23618. },
  23619. data: function data() {
  23620. return {
  23621. store: null,
  23622. root: null,
  23623. currentNode: null,
  23624. treeItems: null,
  23625. checkboxItems: [],
  23626. dragState: {
  23627. showDropIndicator: false,
  23628. draggingNode: null,
  23629. dropNode: null,
  23630. allowDrop: true
  23631. }
  23632. };
  23633. },
  23634. props: {
  23635. data: {
  23636. type: Array
  23637. },
  23638. emptyText: {
  23639. type: String,
  23640. default: function _default() {
  23641. return Object(lib_locale_["t"])('el.tree.emptyText');
  23642. }
  23643. },
  23644. renderAfterExpand: {
  23645. type: Boolean,
  23646. default: true
  23647. },
  23648. nodeKey: String,
  23649. checkStrictly: Boolean,
  23650. defaultExpandAll: Boolean,
  23651. expandOnClickNode: {
  23652. type: Boolean,
  23653. default: true
  23654. },
  23655. checkOnClickNode: Boolean,
  23656. checkDescendants: {
  23657. type: Boolean,
  23658. default: false
  23659. },
  23660. autoExpandParent: {
  23661. type: Boolean,
  23662. default: true
  23663. },
  23664. defaultCheckedKeys: Array,
  23665. defaultExpandedKeys: Array,
  23666. currentNodeKey: [String, Number],
  23667. renderContent: Function,
  23668. showCheckbox: {
  23669. type: Boolean,
  23670. default: false
  23671. },
  23672. draggable: {
  23673. type: Boolean,
  23674. default: false
  23675. },
  23676. allowDrag: Function,
  23677. allowDrop: Function,
  23678. props: {
  23679. default: function _default() {
  23680. return {
  23681. children: 'children',
  23682. label: 'label',
  23683. disabled: 'disabled'
  23684. };
  23685. }
  23686. },
  23687. lazy: {
  23688. type: Boolean,
  23689. default: false
  23690. },
  23691. highlightCurrent: Boolean,
  23692. load: Function,
  23693. filterNodeMethod: Function,
  23694. accordion: Boolean,
  23695. indent: {
  23696. type: Number,
  23697. default: 18
  23698. },
  23699. iconClass: String
  23700. },
  23701. computed: {
  23702. children: {
  23703. set: function set(value) {
  23704. this.data = value;
  23705. },
  23706. get: function get() {
  23707. return this.data;
  23708. }
  23709. },
  23710. treeItemArray: function treeItemArray() {
  23711. return Array.prototype.slice.call(this.treeItems);
  23712. },
  23713. isEmpty: function isEmpty() {
  23714. var childNodes = this.root.childNodes;
  23715. return !childNodes || childNodes.length === 0 || childNodes.every(function (_ref) {
  23716. var visible = _ref.visible;
  23717. return !visible;
  23718. });
  23719. }
  23720. },
  23721. watch: {
  23722. defaultCheckedKeys: function defaultCheckedKeys(newVal) {
  23723. this.store.setDefaultCheckedKey(newVal);
  23724. },
  23725. defaultExpandedKeys: function defaultExpandedKeys(newVal) {
  23726. this.store.defaultExpandedKeys = newVal;
  23727. this.store.setDefaultExpandedKeys(newVal);
  23728. },
  23729. data: function data(newVal) {
  23730. this.store.setData(newVal);
  23731. },
  23732. checkboxItems: function checkboxItems(val) {
  23733. Array.prototype.forEach.call(val, function (checkbox) {
  23734. checkbox.setAttribute('tabindex', -1);
  23735. });
  23736. },
  23737. checkStrictly: function checkStrictly(newVal) {
  23738. this.store.checkStrictly = newVal;
  23739. }
  23740. },
  23741. methods: {
  23742. filter: function filter(value) {
  23743. if (!this.filterNodeMethod) throw new Error('[Tree] filterNodeMethod is required when filter');
  23744. this.store.filter(value);
  23745. },
  23746. getNodeKey: function getNodeKey(node) {
  23747. return util_getNodeKey(this.nodeKey, node.data);
  23748. },
  23749. getNodePath: function getNodePath(data) {
  23750. if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in getNodePath');
  23751. var node = this.store.getNode(data);
  23752. if (!node) return [];
  23753. var path = [node.data];
  23754. var parent = node.parent;
  23755. while (parent && parent !== this.root) {
  23756. path.push(parent.data);
  23757. parent = parent.parent;
  23758. }
  23759. return path.reverse();
  23760. },
  23761. getCheckedNodes: function getCheckedNodes(leafOnly, includeHalfChecked) {
  23762. return this.store.getCheckedNodes(leafOnly, includeHalfChecked);
  23763. },
  23764. getCheckedKeys: function getCheckedKeys(leafOnly) {
  23765. return this.store.getCheckedKeys(leafOnly);
  23766. },
  23767. getCurrentNode: function getCurrentNode() {
  23768. var currentNode = this.store.getCurrentNode();
  23769. return currentNode ? currentNode.data : null;
  23770. },
  23771. getCurrentKey: function getCurrentKey() {
  23772. if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in getCurrentKey');
  23773. var currentNode = this.getCurrentNode();
  23774. return currentNode ? currentNode[this.nodeKey] : null;
  23775. },
  23776. setCheckedNodes: function setCheckedNodes(nodes, leafOnly) {
  23777. if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in setCheckedNodes');
  23778. this.store.setCheckedNodes(nodes, leafOnly);
  23779. },
  23780. setCheckedKeys: function setCheckedKeys(keys, leafOnly) {
  23781. if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in setCheckedKeys');
  23782. this.store.setCheckedKeys(keys, leafOnly);
  23783. },
  23784. setChecked: function setChecked(data, checked, deep) {
  23785. this.store.setChecked(data, checked, deep);
  23786. },
  23787. getHalfCheckedNodes: function getHalfCheckedNodes() {
  23788. return this.store.getHalfCheckedNodes();
  23789. },
  23790. getHalfCheckedKeys: function getHalfCheckedKeys() {
  23791. return this.store.getHalfCheckedKeys();
  23792. },
  23793. setCurrentNode: function setCurrentNode(node) {
  23794. if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in setCurrentNode');
  23795. this.store.setUserCurrentNode(node);
  23796. },
  23797. setCurrentKey: function setCurrentKey(key) {
  23798. if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in setCurrentKey');
  23799. this.store.setCurrentNodeKey(key);
  23800. },
  23801. getNode: function getNode(data) {
  23802. return this.store.getNode(data);
  23803. },
  23804. remove: function remove(data) {
  23805. this.store.remove(data);
  23806. },
  23807. append: function append(data, parentNode) {
  23808. this.store.append(data, parentNode);
  23809. },
  23810. insertBefore: function insertBefore(data, refNode) {
  23811. this.store.insertBefore(data, refNode);
  23812. },
  23813. insertAfter: function insertAfter(data, refNode) {
  23814. this.store.insertAfter(data, refNode);
  23815. },
  23816. handleNodeExpand: function handleNodeExpand(nodeData, node, instance) {
  23817. this.broadcast('ElTreeNode', 'tree-node-expand', node);
  23818. this.$emit('node-expand', nodeData, node, instance);
  23819. },
  23820. updateKeyChildren: function updateKeyChildren(key, data) {
  23821. if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in updateKeyChild');
  23822. this.store.updateChildren(key, data);
  23823. },
  23824. initTabIndex: function initTabIndex() {
  23825. this.treeItems = this.$el.querySelectorAll('.is-focusable[role=treeitem]');
  23826. this.checkboxItems = this.$el.querySelectorAll('input[type=checkbox]');
  23827. var checkedItem = this.$el.querySelectorAll('.is-checked[role=treeitem]');
  23828. if (checkedItem.length) {
  23829. checkedItem[0].setAttribute('tabindex', 0);
  23830. return;
  23831. }
  23832. this.treeItems[0] && this.treeItems[0].setAttribute('tabindex', 0);
  23833. },
  23834. handleKeydown: function handleKeydown(ev) {
  23835. var currentItem = ev.target;
  23836. if (currentItem.className.indexOf('el-tree-node') === -1) return;
  23837. var keyCode = ev.keyCode;
  23838. this.treeItems = this.$el.querySelectorAll('.is-focusable[role=treeitem]');
  23839. var currentIndex = this.treeItemArray.indexOf(currentItem);
  23840. var nextIndex = void 0;
  23841. if ([38, 40].indexOf(keyCode) > -1) {
  23842. // up、down
  23843. ev.preventDefault();
  23844. if (keyCode === 38) {
  23845. // up
  23846. nextIndex = currentIndex !== 0 ? currentIndex - 1 : 0;
  23847. } else {
  23848. nextIndex = currentIndex < this.treeItemArray.length - 1 ? currentIndex + 1 : 0;
  23849. }
  23850. this.treeItemArray[nextIndex].focus(); // 选中
  23851. }
  23852. if ([37, 39].indexOf(keyCode) > -1) {
  23853. // left、right 展开
  23854. ev.preventDefault();
  23855. currentItem.click(); // 选中
  23856. }
  23857. var hasInput = currentItem.querySelector('[type="checkbox"]');
  23858. if ([13, 32].indexOf(keyCode) > -1 && hasInput) {
  23859. // space enter选中checkbox
  23860. ev.preventDefault();
  23861. hasInput.click();
  23862. }
  23863. }
  23864. },
  23865. created: function created() {
  23866. var _this = this;
  23867. this.isTree = true;
  23868. this.store = new tree_store({
  23869. key: this.nodeKey,
  23870. data: this.data,
  23871. lazy: this.lazy,
  23872. props: this.props,
  23873. load: this.load,
  23874. currentNodeKey: this.currentNodeKey,
  23875. checkStrictly: this.checkStrictly,
  23876. checkDescendants: this.checkDescendants,
  23877. defaultCheckedKeys: this.defaultCheckedKeys,
  23878. defaultExpandedKeys: this.defaultExpandedKeys,
  23879. autoExpandParent: this.autoExpandParent,
  23880. defaultExpandAll: this.defaultExpandAll,
  23881. filterNodeMethod: this.filterNodeMethod
  23882. });
  23883. this.root = this.store.root;
  23884. var dragState = this.dragState;
  23885. this.$on('tree-node-drag-start', function (event, treeNode) {
  23886. if (typeof _this.allowDrag === 'function' && !_this.allowDrag(treeNode.node)) {
  23887. event.preventDefault();
  23888. return false;
  23889. }
  23890. event.dataTransfer.effectAllowed = 'move';
  23891. // wrap in try catch to address IE's error when first param is 'text/plain'
  23892. try {
  23893. // setData is required for draggable to work in FireFox
  23894. // the content has to be '' so dragging a node out of the tree won't open a new tab in FireFox
  23895. event.dataTransfer.setData('text/plain', '');
  23896. } catch (e) {}
  23897. dragState.draggingNode = treeNode;
  23898. _this.$emit('node-drag-start', treeNode.node, event);
  23899. });
  23900. this.$on('tree-node-drag-over', function (event, treeNode) {
  23901. var dropNode = findNearestComponent(event.target, 'ElTreeNode');
  23902. var oldDropNode = dragState.dropNode;
  23903. if (oldDropNode && oldDropNode !== dropNode) {
  23904. Object(dom_["removeClass"])(oldDropNode.$el, 'is-drop-inner');
  23905. }
  23906. var draggingNode = dragState.draggingNode;
  23907. if (!draggingNode || !dropNode) return;
  23908. var dropPrev = true;
  23909. var dropInner = true;
  23910. var dropNext = true;
  23911. var userAllowDropInner = true;
  23912. if (typeof _this.allowDrop === 'function') {
  23913. dropPrev = _this.allowDrop(draggingNode.node, dropNode.node, 'prev');
  23914. userAllowDropInner = dropInner = _this.allowDrop(draggingNode.node, dropNode.node, 'inner');
  23915. dropNext = _this.allowDrop(draggingNode.node, dropNode.node, 'next');
  23916. }
  23917. event.dataTransfer.dropEffect = dropInner ? 'move' : 'none';
  23918. if ((dropPrev || dropInner || dropNext) && oldDropNode !== dropNode) {
  23919. if (oldDropNode) {
  23920. _this.$emit('node-drag-leave', draggingNode.node, oldDropNode.node, event);
  23921. }
  23922. _this.$emit('node-drag-enter', draggingNode.node, dropNode.node, event);
  23923. }
  23924. if (dropPrev || dropInner || dropNext) {
  23925. dragState.dropNode = dropNode;
  23926. }
  23927. if (dropNode.node.nextSibling === draggingNode.node) {
  23928. dropNext = false;
  23929. }
  23930. if (dropNode.node.previousSibling === draggingNode.node) {
  23931. dropPrev = false;
  23932. }
  23933. if (dropNode.node.contains(draggingNode.node, false)) {
  23934. dropInner = false;
  23935. }
  23936. if (draggingNode.node === dropNode.node || draggingNode.node.contains(dropNode.node)) {
  23937. dropPrev = false;
  23938. dropInner = false;
  23939. dropNext = false;
  23940. }
  23941. var targetPosition = dropNode.$el.getBoundingClientRect();
  23942. var treePosition = _this.$el.getBoundingClientRect();
  23943. var dropType = void 0;
  23944. var prevPercent = dropPrev ? dropInner ? 0.25 : dropNext ? 0.45 : 1 : -1;
  23945. var nextPercent = dropNext ? dropInner ? 0.75 : dropPrev ? 0.55 : 0 : 1;
  23946. var indicatorTop = -9999;
  23947. var distance = event.clientY - targetPosition.top;
  23948. if (distance < targetPosition.height * prevPercent) {
  23949. dropType = 'before';
  23950. } else if (distance > targetPosition.height * nextPercent) {
  23951. dropType = 'after';
  23952. } else if (dropInner) {
  23953. dropType = 'inner';
  23954. } else {
  23955. dropType = 'none';
  23956. }
  23957. var iconPosition = dropNode.$el.querySelector('.el-tree-node__expand-icon').getBoundingClientRect();
  23958. var dropIndicator = _this.$refs.dropIndicator;
  23959. if (dropType === 'before') {
  23960. indicatorTop = iconPosition.top - treePosition.top;
  23961. } else if (dropType === 'after') {
  23962. indicatorTop = iconPosition.bottom - treePosition.top;
  23963. }
  23964. dropIndicator.style.top = indicatorTop + 'px';
  23965. dropIndicator.style.left = iconPosition.right - treePosition.left + 'px';
  23966. if (dropType === 'inner') {
  23967. Object(dom_["addClass"])(dropNode.$el, 'is-drop-inner');
  23968. } else {
  23969. Object(dom_["removeClass"])(dropNode.$el, 'is-drop-inner');
  23970. }
  23971. dragState.showDropIndicator = dropType === 'before' || dropType === 'after';
  23972. dragState.allowDrop = dragState.showDropIndicator || userAllowDropInner;
  23973. dragState.dropType = dropType;
  23974. _this.$emit('node-drag-over', draggingNode.node, dropNode.node, event);
  23975. });
  23976. this.$on('tree-node-drag-end', function (event) {
  23977. var draggingNode = dragState.draggingNode,
  23978. dropType = dragState.dropType,
  23979. dropNode = dragState.dropNode;
  23980. event.preventDefault();
  23981. event.dataTransfer.dropEffect = 'move';
  23982. if (draggingNode && dropNode) {
  23983. var draggingNodeCopy = { data: draggingNode.node.data };
  23984. if (dropType !== 'none') {
  23985. draggingNode.node.remove();
  23986. }
  23987. if (dropType === 'before') {
  23988. dropNode.node.parent.insertBefore(draggingNodeCopy, dropNode.node);
  23989. } else if (dropType === 'after') {
  23990. dropNode.node.parent.insertAfter(draggingNodeCopy, dropNode.node);
  23991. } else if (dropType === 'inner') {
  23992. dropNode.node.insertChild(draggingNodeCopy);
  23993. }
  23994. if (dropType !== 'none') {
  23995. _this.store.registerNode(draggingNodeCopy);
  23996. }
  23997. Object(dom_["removeClass"])(dropNode.$el, 'is-drop-inner');
  23998. _this.$emit('node-drag-end', draggingNode.node, dropNode.node, dropType, event);
  23999. if (dropType !== 'none') {
  24000. _this.$emit('node-drop', draggingNode.node, dropNode.node, dropType, event);
  24001. }
  24002. }
  24003. if (draggingNode && !dropNode) {
  24004. _this.$emit('node-drag-end', draggingNode.node, null, dropType, event);
  24005. }
  24006. dragState.showDropIndicator = false;
  24007. dragState.draggingNode = null;
  24008. dragState.dropNode = null;
  24009. dragState.allowDrop = true;
  24010. });
  24011. },
  24012. mounted: function mounted() {
  24013. this.initTabIndex();
  24014. this.$el.addEventListener('keydown', this.handleKeydown);
  24015. },
  24016. updated: function updated() {
  24017. this.treeItems = this.$el.querySelectorAll('[role=treeitem]');
  24018. this.checkboxItems = this.$el.querySelectorAll('input[type=checkbox]');
  24019. }
  24020. });
  24021. // CONCATENATED MODULE: ./packages/tree/src/tree.vue?vue&type=script&lang=js&
  24022. /* harmony default export */ var src_treevue_type_script_lang_js_ = (treevue_type_script_lang_js_);
  24023. // CONCATENATED MODULE: ./packages/tree/src/tree.vue
  24024. /* normalize component */
  24025. var tree_component = normalizeComponent(
  24026. src_treevue_type_script_lang_js_,
  24027. treevue_type_template_id_547575a6_render,
  24028. treevue_type_template_id_547575a6_staticRenderFns,
  24029. false,
  24030. null,
  24031. null,
  24032. null
  24033. )
  24034. /* hot reload */
  24035. if (false) { var tree_api; }
  24036. tree_component.options.__file = "packages/tree/src/tree.vue"
  24037. /* harmony default export */ var src_tree = (tree_component.exports);
  24038. // CONCATENATED MODULE: ./packages/tree/index.js
  24039. /* istanbul ignore next */
  24040. src_tree.install = function (Vue) {
  24041. Vue.component(src_tree.name, src_tree);
  24042. };
  24043. /* harmony default export */ var packages_tree = (src_tree);
  24044. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/alert/src/main.vue?vue&type=template&id=6e53341b&
  24045. var mainvue_type_template_id_6e53341b_render = function() {
  24046. var _vm = this
  24047. var _h = _vm.$createElement
  24048. var _c = _vm._self._c || _h
  24049. return _c("transition", { attrs: { name: "el-alert-fade" } }, [
  24050. _c(
  24051. "div",
  24052. {
  24053. directives: [
  24054. {
  24055. name: "show",
  24056. rawName: "v-show",
  24057. value: _vm.visible,
  24058. expression: "visible"
  24059. }
  24060. ],
  24061. staticClass: "el-alert",
  24062. class: [
  24063. _vm.typeClass,
  24064. _vm.center ? "is-center" : "",
  24065. "is-" + _vm.effect
  24066. ],
  24067. attrs: { role: "alert" }
  24068. },
  24069. [
  24070. _vm.showIcon
  24071. ? _c("i", {
  24072. staticClass: "el-alert__icon",
  24073. class: [_vm.iconClass, _vm.isBigIcon]
  24074. })
  24075. : _vm._e(),
  24076. _c("div", { staticClass: "el-alert__content" }, [
  24077. _vm.title || _vm.$slots.title
  24078. ? _c(
  24079. "span",
  24080. { staticClass: "el-alert__title", class: [_vm.isBoldTitle] },
  24081. [_vm._t("title", [_vm._v(_vm._s(_vm.title))])],
  24082. 2
  24083. )
  24084. : _vm._e(),
  24085. _vm.$slots.default && !_vm.description
  24086. ? _c(
  24087. "p",
  24088. { staticClass: "el-alert__description" },
  24089. [_vm._t("default")],
  24090. 2
  24091. )
  24092. : _vm._e(),
  24093. _vm.description && !_vm.$slots.default
  24094. ? _c("p", { staticClass: "el-alert__description" }, [
  24095. _vm._v(_vm._s(_vm.description))
  24096. ])
  24097. : _vm._e(),
  24098. _c(
  24099. "i",
  24100. {
  24101. directives: [
  24102. {
  24103. name: "show",
  24104. rawName: "v-show",
  24105. value: _vm.closable,
  24106. expression: "closable"
  24107. }
  24108. ],
  24109. staticClass: "el-alert__closebtn",
  24110. class: {
  24111. "is-customed": _vm.closeText !== "",
  24112. "el-icon-close": _vm.closeText === ""
  24113. },
  24114. on: {
  24115. click: function($event) {
  24116. _vm.close()
  24117. }
  24118. }
  24119. },
  24120. [_vm._v(_vm._s(_vm.closeText))]
  24121. )
  24122. ])
  24123. ]
  24124. )
  24125. ])
  24126. }
  24127. var mainvue_type_template_id_6e53341b_staticRenderFns = []
  24128. mainvue_type_template_id_6e53341b_render._withStripped = true
  24129. // CONCATENATED MODULE: ./packages/alert/src/main.vue?vue&type=template&id=6e53341b&
  24130. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/alert/src/main.vue?vue&type=script&lang=js&
  24131. //
  24132. //
  24133. //
  24134. //
  24135. //
  24136. //
  24137. //
  24138. //
  24139. //
  24140. //
  24141. //
  24142. //
  24143. //
  24144. //
  24145. //
  24146. //
  24147. //
  24148. //
  24149. //
  24150. //
  24151. //
  24152. var TYPE_CLASSES_MAP = {
  24153. 'success': 'el-icon-success',
  24154. 'warning': 'el-icon-warning',
  24155. 'error': 'el-icon-error'
  24156. };
  24157. /* harmony default export */ var alert_src_mainvue_type_script_lang_js_ = ({
  24158. name: 'ElAlert',
  24159. props: {
  24160. title: {
  24161. type: String,
  24162. default: ''
  24163. },
  24164. description: {
  24165. type: String,
  24166. default: ''
  24167. },
  24168. type: {
  24169. type: String,
  24170. default: 'info'
  24171. },
  24172. closable: {
  24173. type: Boolean,
  24174. default: true
  24175. },
  24176. closeText: {
  24177. type: String,
  24178. default: ''
  24179. },
  24180. showIcon: Boolean,
  24181. center: Boolean,
  24182. effect: {
  24183. type: String,
  24184. default: 'light',
  24185. validator: function validator(value) {
  24186. return ['light', 'dark'].indexOf(value) !== -1;
  24187. }
  24188. }
  24189. },
  24190. data: function data() {
  24191. return {
  24192. visible: true
  24193. };
  24194. },
  24195. methods: {
  24196. close: function close() {
  24197. this.visible = false;
  24198. this.$emit('close');
  24199. }
  24200. },
  24201. computed: {
  24202. typeClass: function typeClass() {
  24203. return 'el-alert--' + this.type;
  24204. },
  24205. iconClass: function iconClass() {
  24206. return TYPE_CLASSES_MAP[this.type] || 'el-icon-info';
  24207. },
  24208. isBigIcon: function isBigIcon() {
  24209. return this.description || this.$slots.default ? 'is-big' : '';
  24210. },
  24211. isBoldTitle: function isBoldTitle() {
  24212. return this.description || this.$slots.default ? 'is-bold' : '';
  24213. }
  24214. }
  24215. });
  24216. // CONCATENATED MODULE: ./packages/alert/src/main.vue?vue&type=script&lang=js&
  24217. /* harmony default export */ var packages_alert_src_mainvue_type_script_lang_js_ = (alert_src_mainvue_type_script_lang_js_);
  24218. // CONCATENATED MODULE: ./packages/alert/src/main.vue
  24219. /* normalize component */
  24220. var alert_src_main_component = normalizeComponent(
  24221. packages_alert_src_mainvue_type_script_lang_js_,
  24222. mainvue_type_template_id_6e53341b_render,
  24223. mainvue_type_template_id_6e53341b_staticRenderFns,
  24224. false,
  24225. null,
  24226. null,
  24227. null
  24228. )
  24229. /* hot reload */
  24230. if (false) { var alert_src_main_api; }
  24231. alert_src_main_component.options.__file = "packages/alert/src/main.vue"
  24232. /* harmony default export */ var alert_src_main = (alert_src_main_component.exports);
  24233. // CONCATENATED MODULE: ./packages/alert/index.js
  24234. /* istanbul ignore next */
  24235. alert_src_main.install = function (Vue) {
  24236. Vue.component(alert_src_main.name, alert_src_main);
  24237. };
  24238. /* harmony default export */ var packages_alert = (alert_src_main);
  24239. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/notification/src/main.vue?vue&type=template&id=43dbc3d8&
  24240. var mainvue_type_template_id_43dbc3d8_render = function() {
  24241. var _vm = this
  24242. var _h = _vm.$createElement
  24243. var _c = _vm._self._c || _h
  24244. return _c("transition", { attrs: { name: "el-notification-fade" } }, [
  24245. _c(
  24246. "div",
  24247. {
  24248. directives: [
  24249. {
  24250. name: "show",
  24251. rawName: "v-show",
  24252. value: _vm.visible,
  24253. expression: "visible"
  24254. }
  24255. ],
  24256. class: ["el-notification", _vm.customClass, _vm.horizontalClass],
  24257. style: _vm.positionStyle,
  24258. attrs: { role: "alert" },
  24259. on: {
  24260. mouseenter: function($event) {
  24261. _vm.clearTimer()
  24262. },
  24263. mouseleave: function($event) {
  24264. _vm.startTimer()
  24265. },
  24266. click: _vm.click
  24267. }
  24268. },
  24269. [
  24270. _vm.type || _vm.iconClass
  24271. ? _c("i", {
  24272. staticClass: "el-notification__icon",
  24273. class: [_vm.typeClass, _vm.iconClass]
  24274. })
  24275. : _vm._e(),
  24276. _c(
  24277. "div",
  24278. {
  24279. staticClass: "el-notification__group",
  24280. class: { "is-with-icon": _vm.typeClass || _vm.iconClass }
  24281. },
  24282. [
  24283. _c("h2", {
  24284. staticClass: "el-notification__title",
  24285. domProps: { textContent: _vm._s(_vm.title) }
  24286. }),
  24287. _c(
  24288. "div",
  24289. {
  24290. directives: [
  24291. {
  24292. name: "show",
  24293. rawName: "v-show",
  24294. value: _vm.message,
  24295. expression: "message"
  24296. }
  24297. ],
  24298. staticClass: "el-notification__content"
  24299. },
  24300. [
  24301. _vm._t("default", [
  24302. !_vm.dangerouslyUseHTMLString
  24303. ? _c("p", [_vm._v(_vm._s(_vm.message))])
  24304. : _c("p", { domProps: { innerHTML: _vm._s(_vm.message) } })
  24305. ])
  24306. ],
  24307. 2
  24308. ),
  24309. _vm.showClose
  24310. ? _c("div", {
  24311. staticClass: "el-notification__closeBtn el-icon-close",
  24312. on: {
  24313. click: function($event) {
  24314. $event.stopPropagation()
  24315. return _vm.close($event)
  24316. }
  24317. }
  24318. })
  24319. : _vm._e()
  24320. ]
  24321. )
  24322. ]
  24323. )
  24324. ])
  24325. }
  24326. var mainvue_type_template_id_43dbc3d8_staticRenderFns = []
  24327. mainvue_type_template_id_43dbc3d8_render._withStripped = true
  24328. // CONCATENATED MODULE: ./packages/notification/src/main.vue?vue&type=template&id=43dbc3d8&
  24329. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/notification/src/main.vue?vue&type=script&lang=js&
  24330. //
  24331. //
  24332. //
  24333. //
  24334. //
  24335. //
  24336. //
  24337. //
  24338. //
  24339. //
  24340. //
  24341. //
  24342. //
  24343. //
  24344. //
  24345. //
  24346. //
  24347. //
  24348. //
  24349. //
  24350. //
  24351. //
  24352. //
  24353. //
  24354. //
  24355. //
  24356. //
  24357. //
  24358. //
  24359. //
  24360. //
  24361. //
  24362. //
  24363. var mainvue_type_script_lang_js_typeMap = {
  24364. success: 'success',
  24365. info: 'info',
  24366. warning: 'warning',
  24367. error: 'error'
  24368. };
  24369. /* harmony default export */ var notification_src_mainvue_type_script_lang_js_ = ({
  24370. data: function data() {
  24371. return {
  24372. visible: false,
  24373. title: '',
  24374. message: '',
  24375. duration: 4500,
  24376. type: '',
  24377. showClose: true,
  24378. customClass: '',
  24379. iconClass: '',
  24380. onClose: null,
  24381. onClick: null,
  24382. closed: false,
  24383. verticalOffset: 0,
  24384. timer: null,
  24385. dangerouslyUseHTMLString: false,
  24386. position: 'top-right'
  24387. };
  24388. },
  24389. computed: {
  24390. typeClass: function typeClass() {
  24391. return this.type && mainvue_type_script_lang_js_typeMap[this.type] ? 'el-icon-' + mainvue_type_script_lang_js_typeMap[this.type] : '';
  24392. },
  24393. horizontalClass: function horizontalClass() {
  24394. return this.position.indexOf('right') > -1 ? 'right' : 'left';
  24395. },
  24396. verticalProperty: function verticalProperty() {
  24397. return (/^top-/.test(this.position) ? 'top' : 'bottom'
  24398. );
  24399. },
  24400. positionStyle: function positionStyle() {
  24401. var _ref;
  24402. return _ref = {}, _ref[this.verticalProperty] = this.verticalOffset + 'px', _ref;
  24403. }
  24404. },
  24405. watch: {
  24406. closed: function closed(newVal) {
  24407. if (newVal) {
  24408. this.visible = false;
  24409. this.$el.addEventListener('transitionend', this.destroyElement);
  24410. }
  24411. }
  24412. },
  24413. methods: {
  24414. destroyElement: function destroyElement() {
  24415. this.$el.removeEventListener('transitionend', this.destroyElement);
  24416. this.$destroy(true);
  24417. this.$el.parentNode.removeChild(this.$el);
  24418. },
  24419. click: function click() {
  24420. if (typeof this.onClick === 'function') {
  24421. this.onClick();
  24422. }
  24423. },
  24424. close: function close() {
  24425. this.closed = true;
  24426. if (typeof this.onClose === 'function') {
  24427. this.onClose();
  24428. }
  24429. },
  24430. clearTimer: function clearTimer() {
  24431. clearTimeout(this.timer);
  24432. },
  24433. startTimer: function startTimer() {
  24434. var _this = this;
  24435. if (this.duration > 0) {
  24436. this.timer = setTimeout(function () {
  24437. if (!_this.closed) {
  24438. _this.close();
  24439. }
  24440. }, this.duration);
  24441. }
  24442. },
  24443. keydown: function keydown(e) {
  24444. if (e.keyCode === 46 || e.keyCode === 8) {
  24445. this.clearTimer(); // detele 取消倒计时
  24446. } else if (e.keyCode === 27) {
  24447. // esc关闭消息
  24448. if (!this.closed) {
  24449. this.close();
  24450. }
  24451. } else {
  24452. this.startTimer(); // 恢复倒计时
  24453. }
  24454. }
  24455. },
  24456. mounted: function mounted() {
  24457. var _this2 = this;
  24458. if (this.duration > 0) {
  24459. this.timer = setTimeout(function () {
  24460. if (!_this2.closed) {
  24461. _this2.close();
  24462. }
  24463. }, this.duration);
  24464. }
  24465. document.addEventListener('keydown', this.keydown);
  24466. },
  24467. beforeDestroy: function beforeDestroy() {
  24468. document.removeEventListener('keydown', this.keydown);
  24469. }
  24470. });
  24471. // CONCATENATED MODULE: ./packages/notification/src/main.vue?vue&type=script&lang=js&
  24472. /* harmony default export */ var packages_notification_src_mainvue_type_script_lang_js_ = (notification_src_mainvue_type_script_lang_js_);
  24473. // CONCATENATED MODULE: ./packages/notification/src/main.vue
  24474. /* normalize component */
  24475. var notification_src_main_component = normalizeComponent(
  24476. packages_notification_src_mainvue_type_script_lang_js_,
  24477. mainvue_type_template_id_43dbc3d8_render,
  24478. mainvue_type_template_id_43dbc3d8_staticRenderFns,
  24479. false,
  24480. null,
  24481. null,
  24482. null
  24483. )
  24484. /* hot reload */
  24485. if (false) { var notification_src_main_api; }
  24486. notification_src_main_component.options.__file = "packages/notification/src/main.vue"
  24487. /* harmony default export */ var notification_src_main = (notification_src_main_component.exports);
  24488. // CONCATENATED MODULE: ./packages/notification/src/main.js
  24489. var NotificationConstructor = external_vue_default.a.extend(notification_src_main);
  24490. var src_main_instance = void 0;
  24491. var instances = [];
  24492. var seed = 1;
  24493. var main_Notification = function Notification(options) {
  24494. if (external_vue_default.a.prototype.$isServer) return;
  24495. options = merge_default()({}, options);
  24496. var userOnClose = options.onClose;
  24497. var id = 'notification_' + seed++;
  24498. var position = options.position || 'top-right';
  24499. options.onClose = function () {
  24500. Notification.close(id, userOnClose);
  24501. };
  24502. src_main_instance = new NotificationConstructor({
  24503. data: options
  24504. });
  24505. if (Object(vdom_["isVNode"])(options.message)) {
  24506. src_main_instance.$slots.default = [options.message];
  24507. options.message = 'REPLACED_BY_VNODE';
  24508. }
  24509. src_main_instance.id = id;
  24510. src_main_instance.$mount();
  24511. document.body.appendChild(src_main_instance.$el);
  24512. src_main_instance.visible = true;
  24513. src_main_instance.dom = src_main_instance.$el;
  24514. src_main_instance.dom.style.zIndex = popup_["PopupManager"].nextZIndex();
  24515. var verticalOffset = options.offset || 0;
  24516. instances.filter(function (item) {
  24517. return item.position === position;
  24518. }).forEach(function (item) {
  24519. verticalOffset += item.$el.offsetHeight + 16;
  24520. });
  24521. verticalOffset += 16;
  24522. src_main_instance.verticalOffset = verticalOffset;
  24523. instances.push(src_main_instance);
  24524. return src_main_instance;
  24525. };
  24526. ['success', 'warning', 'info', 'error'].forEach(function (type) {
  24527. main_Notification[type] = function (options) {
  24528. if (typeof options === 'string' || Object(vdom_["isVNode"])(options)) {
  24529. options = {
  24530. message: options
  24531. };
  24532. }
  24533. options.type = type;
  24534. return main_Notification(options);
  24535. };
  24536. });
  24537. main_Notification.close = function (id, userOnClose) {
  24538. var index = -1;
  24539. var len = instances.length;
  24540. var instance = instances.filter(function (instance, i) {
  24541. if (instance.id === id) {
  24542. index = i;
  24543. return true;
  24544. }
  24545. return false;
  24546. })[0];
  24547. if (!instance) return;
  24548. if (typeof userOnClose === 'function') {
  24549. userOnClose(instance);
  24550. }
  24551. instances.splice(index, 1);
  24552. if (len <= 1) return;
  24553. var position = instance.position;
  24554. var removedHeight = instance.dom.offsetHeight;
  24555. for (var i = index; i < len - 1; i++) {
  24556. if (instances[i].position === position) {
  24557. instances[i].dom.style[instance.verticalProperty] = parseInt(instances[i].dom.style[instance.verticalProperty], 10) - removedHeight - 16 + 'px';
  24558. }
  24559. }
  24560. };
  24561. main_Notification.closeAll = function () {
  24562. for (var i = instances.length - 1; i >= 0; i--) {
  24563. instances[i].close();
  24564. }
  24565. };
  24566. /* harmony default export */ var packages_notification_src_main = (main_Notification);
  24567. // CONCATENATED MODULE: ./packages/notification/index.js
  24568. /* harmony default export */ var notification = (packages_notification_src_main);
  24569. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/slider/src/main.vue?vue&type=template&id=32708644&
  24570. var mainvue_type_template_id_32708644_render = function() {
  24571. var _vm = this
  24572. var _h = _vm.$createElement
  24573. var _c = _vm._self._c || _h
  24574. return _c(
  24575. "div",
  24576. {
  24577. staticClass: "el-slider",
  24578. class: {
  24579. "is-vertical": _vm.vertical,
  24580. "el-slider--with-input": _vm.showInput
  24581. },
  24582. attrs: {
  24583. role: "slider",
  24584. "aria-valuemin": _vm.min,
  24585. "aria-valuemax": _vm.max,
  24586. "aria-orientation": _vm.vertical ? "vertical" : "horizontal",
  24587. "aria-disabled": _vm.sliderDisabled
  24588. }
  24589. },
  24590. [
  24591. _vm.showInput && !_vm.range
  24592. ? _c("el-input-number", {
  24593. ref: "input",
  24594. staticClass: "el-slider__input",
  24595. attrs: {
  24596. step: _vm.step,
  24597. disabled: _vm.sliderDisabled,
  24598. controls: _vm.showInputControls,
  24599. min: _vm.min,
  24600. max: _vm.max,
  24601. debounce: _vm.debounce,
  24602. size: _vm.inputSize
  24603. },
  24604. on: { change: _vm.emitChange },
  24605. model: {
  24606. value: _vm.firstValue,
  24607. callback: function($$v) {
  24608. _vm.firstValue = $$v
  24609. },
  24610. expression: "firstValue"
  24611. }
  24612. })
  24613. : _vm._e(),
  24614. _c(
  24615. "div",
  24616. {
  24617. ref: "slider",
  24618. staticClass: "el-slider__runway",
  24619. class: { "show-input": _vm.showInput, disabled: _vm.sliderDisabled },
  24620. style: _vm.runwayStyle,
  24621. on: { click: _vm.onSliderClick }
  24622. },
  24623. [
  24624. _c("div", { staticClass: "el-slider__bar", style: _vm.barStyle }),
  24625. _c("slider-button", {
  24626. ref: "button1",
  24627. attrs: {
  24628. vertical: _vm.vertical,
  24629. "tooltip-class": _vm.tooltipClass
  24630. },
  24631. model: {
  24632. value: _vm.firstValue,
  24633. callback: function($$v) {
  24634. _vm.firstValue = $$v
  24635. },
  24636. expression: "firstValue"
  24637. }
  24638. }),
  24639. _vm.range
  24640. ? _c("slider-button", {
  24641. ref: "button2",
  24642. attrs: {
  24643. vertical: _vm.vertical,
  24644. "tooltip-class": _vm.tooltipClass
  24645. },
  24646. model: {
  24647. value: _vm.secondValue,
  24648. callback: function($$v) {
  24649. _vm.secondValue = $$v
  24650. },
  24651. expression: "secondValue"
  24652. }
  24653. })
  24654. : _vm._e(),
  24655. _vm._l(_vm.stops, function(item, key) {
  24656. return _vm.showStops
  24657. ? _c("div", {
  24658. key: key,
  24659. staticClass: "el-slider__stop",
  24660. style: _vm.getStopStyle(item)
  24661. })
  24662. : _vm._e()
  24663. }),
  24664. _vm.markList.length > 0
  24665. ? [
  24666. _c(
  24667. "div",
  24668. _vm._l(_vm.markList, function(item, key) {
  24669. return _c("div", {
  24670. key: key,
  24671. staticClass: "el-slider__stop el-slider__marks-stop",
  24672. style: _vm.getStopStyle(item.position)
  24673. })
  24674. }),
  24675. 0
  24676. ),
  24677. _c(
  24678. "div",
  24679. { staticClass: "el-slider__marks" },
  24680. _vm._l(_vm.markList, function(item, key) {
  24681. return _c("slider-marker", {
  24682. key: key,
  24683. style: _vm.getStopStyle(item.position),
  24684. attrs: { mark: item.mark }
  24685. })
  24686. }),
  24687. 1
  24688. )
  24689. ]
  24690. : _vm._e()
  24691. ],
  24692. 2
  24693. )
  24694. ],
  24695. 1
  24696. )
  24697. }
  24698. var mainvue_type_template_id_32708644_staticRenderFns = []
  24699. mainvue_type_template_id_32708644_render._withStripped = true
  24700. // CONCATENATED MODULE: ./packages/slider/src/main.vue?vue&type=template&id=32708644&
  24701. // EXTERNAL MODULE: external "element-ui/lib/input-number"
  24702. var input_number_ = __webpack_require__(42);
  24703. var input_number_default = /*#__PURE__*/__webpack_require__.n(input_number_);
  24704. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/slider/src/button.vue?vue&type=template&id=e72d2ad2&
  24705. var buttonvue_type_template_id_e72d2ad2_render = function() {
  24706. var _vm = this
  24707. var _h = _vm.$createElement
  24708. var _c = _vm._self._c || _h
  24709. return _c(
  24710. "div",
  24711. {
  24712. ref: "button",
  24713. staticClass: "el-slider__button-wrapper",
  24714. class: { hover: _vm.hovering, dragging: _vm.dragging },
  24715. style: _vm.wrapperStyle,
  24716. attrs: { tabindex: "0" },
  24717. on: {
  24718. mouseenter: _vm.handleMouseEnter,
  24719. mouseleave: _vm.handleMouseLeave,
  24720. mousedown: _vm.onButtonDown,
  24721. touchstart: _vm.onButtonDown,
  24722. focus: _vm.handleMouseEnter,
  24723. blur: _vm.handleMouseLeave,
  24724. keydown: [
  24725. function($event) {
  24726. if (
  24727. !("button" in $event) &&
  24728. _vm._k($event.keyCode, "left", 37, $event.key, [
  24729. "Left",
  24730. "ArrowLeft"
  24731. ])
  24732. ) {
  24733. return null
  24734. }
  24735. if ("button" in $event && $event.button !== 0) {
  24736. return null
  24737. }
  24738. return _vm.onLeftKeyDown($event)
  24739. },
  24740. function($event) {
  24741. if (
  24742. !("button" in $event) &&
  24743. _vm._k($event.keyCode, "right", 39, $event.key, [
  24744. "Right",
  24745. "ArrowRight"
  24746. ])
  24747. ) {
  24748. return null
  24749. }
  24750. if ("button" in $event && $event.button !== 2) {
  24751. return null
  24752. }
  24753. return _vm.onRightKeyDown($event)
  24754. },
  24755. function($event) {
  24756. if (
  24757. !("button" in $event) &&
  24758. _vm._k($event.keyCode, "down", 40, $event.key, [
  24759. "Down",
  24760. "ArrowDown"
  24761. ])
  24762. ) {
  24763. return null
  24764. }
  24765. $event.preventDefault()
  24766. return _vm.onLeftKeyDown($event)
  24767. },
  24768. function($event) {
  24769. if (
  24770. !("button" in $event) &&
  24771. _vm._k($event.keyCode, "up", 38, $event.key, ["Up", "ArrowUp"])
  24772. ) {
  24773. return null
  24774. }
  24775. $event.preventDefault()
  24776. return _vm.onRightKeyDown($event)
  24777. }
  24778. ]
  24779. }
  24780. },
  24781. [
  24782. _c(
  24783. "el-tooltip",
  24784. {
  24785. ref: "tooltip",
  24786. attrs: {
  24787. placement: "top",
  24788. "popper-class": _vm.tooltipClass,
  24789. disabled: !_vm.showTooltip
  24790. }
  24791. },
  24792. [
  24793. _c("span", { attrs: { slot: "content" }, slot: "content" }, [
  24794. _vm._v(_vm._s(_vm.formatValue))
  24795. ]),
  24796. _c("div", {
  24797. staticClass: "el-slider__button",
  24798. class: { hover: _vm.hovering, dragging: _vm.dragging }
  24799. })
  24800. ]
  24801. )
  24802. ],
  24803. 1
  24804. )
  24805. }
  24806. var buttonvue_type_template_id_e72d2ad2_staticRenderFns = []
  24807. buttonvue_type_template_id_e72d2ad2_render._withStripped = true
  24808. // CONCATENATED MODULE: ./packages/slider/src/button.vue?vue&type=template&id=e72d2ad2&
  24809. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/slider/src/button.vue?vue&type=script&lang=js&
  24810. //
  24811. //
  24812. //
  24813. //
  24814. //
  24815. //
  24816. //
  24817. //
  24818. //
  24819. //
  24820. //
  24821. //
  24822. //
  24823. //
  24824. //
  24825. //
  24826. //
  24827. //
  24828. //
  24829. //
  24830. //
  24831. //
  24832. //
  24833. //
  24834. //
  24835. //
  24836. //
  24837. //
  24838. //
  24839. /* harmony default export */ var slider_src_buttonvue_type_script_lang_js_ = ({
  24840. name: 'ElSliderButton',
  24841. components: {
  24842. ElTooltip: tooltip_default.a
  24843. },
  24844. props: {
  24845. value: {
  24846. type: Number,
  24847. default: 0
  24848. },
  24849. vertical: {
  24850. type: Boolean,
  24851. default: false
  24852. },
  24853. tooltipClass: String
  24854. },
  24855. data: function data() {
  24856. return {
  24857. hovering: false,
  24858. dragging: false,
  24859. isClick: false,
  24860. startX: 0,
  24861. currentX: 0,
  24862. startY: 0,
  24863. currentY: 0,
  24864. startPosition: 0,
  24865. newPosition: null,
  24866. oldValue: this.value
  24867. };
  24868. },
  24869. computed: {
  24870. disabled: function disabled() {
  24871. return this.$parent.sliderDisabled;
  24872. },
  24873. max: function max() {
  24874. return this.$parent.max;
  24875. },
  24876. min: function min() {
  24877. return this.$parent.min;
  24878. },
  24879. step: function step() {
  24880. return this.$parent.step;
  24881. },
  24882. showTooltip: function showTooltip() {
  24883. return this.$parent.showTooltip;
  24884. },
  24885. precision: function precision() {
  24886. return this.$parent.precision;
  24887. },
  24888. currentPosition: function currentPosition() {
  24889. return (this.value - this.min) / (this.max - this.min) * 100 + '%';
  24890. },
  24891. enableFormat: function enableFormat() {
  24892. return this.$parent.formatTooltip instanceof Function;
  24893. },
  24894. formatValue: function formatValue() {
  24895. return this.enableFormat && this.$parent.formatTooltip(this.value) || this.value;
  24896. },
  24897. wrapperStyle: function wrapperStyle() {
  24898. return this.vertical ? { bottom: this.currentPosition } : { left: this.currentPosition };
  24899. }
  24900. },
  24901. watch: {
  24902. dragging: function dragging(val) {
  24903. this.$parent.dragging = val;
  24904. }
  24905. },
  24906. methods: {
  24907. displayTooltip: function displayTooltip() {
  24908. this.$refs.tooltip && (this.$refs.tooltip.showPopper = true);
  24909. },
  24910. hideTooltip: function hideTooltip() {
  24911. this.$refs.tooltip && (this.$refs.tooltip.showPopper = false);
  24912. },
  24913. handleMouseEnter: function handleMouseEnter() {
  24914. this.hovering = true;
  24915. this.displayTooltip();
  24916. },
  24917. handleMouseLeave: function handleMouseLeave() {
  24918. this.hovering = false;
  24919. this.hideTooltip();
  24920. },
  24921. onButtonDown: function onButtonDown(event) {
  24922. if (this.disabled) return;
  24923. event.preventDefault();
  24924. this.onDragStart(event);
  24925. window.addEventListener('mousemove', this.onDragging);
  24926. window.addEventListener('touchmove', this.onDragging);
  24927. window.addEventListener('mouseup', this.onDragEnd);
  24928. window.addEventListener('touchend', this.onDragEnd);
  24929. window.addEventListener('contextmenu', this.onDragEnd);
  24930. },
  24931. onLeftKeyDown: function onLeftKeyDown() {
  24932. if (this.disabled) return;
  24933. this.newPosition = parseFloat(this.currentPosition) - this.step / (this.max - this.min) * 100;
  24934. this.setPosition(this.newPosition);
  24935. this.$parent.emitChange();
  24936. },
  24937. onRightKeyDown: function onRightKeyDown() {
  24938. if (this.disabled) return;
  24939. this.newPosition = parseFloat(this.currentPosition) + this.step / (this.max - this.min) * 100;
  24940. this.setPosition(this.newPosition);
  24941. this.$parent.emitChange();
  24942. },
  24943. onDragStart: function onDragStart(event) {
  24944. this.dragging = true;
  24945. this.isClick = true;
  24946. if (event.type === 'touchstart') {
  24947. event.clientY = event.touches[0].clientY;
  24948. event.clientX = event.touches[0].clientX;
  24949. }
  24950. if (this.vertical) {
  24951. this.startY = event.clientY;
  24952. } else {
  24953. this.startX = event.clientX;
  24954. }
  24955. this.startPosition = parseFloat(this.currentPosition);
  24956. this.newPosition = this.startPosition;
  24957. },
  24958. onDragging: function onDragging(event) {
  24959. if (this.dragging) {
  24960. this.isClick = false;
  24961. this.displayTooltip();
  24962. this.$parent.resetSize();
  24963. var diff = 0;
  24964. if (event.type === 'touchmove') {
  24965. event.clientY = event.touches[0].clientY;
  24966. event.clientX = event.touches[0].clientX;
  24967. }
  24968. if (this.vertical) {
  24969. this.currentY = event.clientY;
  24970. diff = (this.startY - this.currentY) / this.$parent.sliderSize * 100;
  24971. } else {
  24972. this.currentX = event.clientX;
  24973. diff = (this.currentX - this.startX) / this.$parent.sliderSize * 100;
  24974. }
  24975. this.newPosition = this.startPosition + diff;
  24976. this.setPosition(this.newPosition);
  24977. }
  24978. },
  24979. onDragEnd: function onDragEnd() {
  24980. var _this = this;
  24981. if (this.dragging) {
  24982. /*
  24983. * 防止在 mouseup 后立即触发 click,导致滑块有几率产生一小段位移
  24984. * 不使用 preventDefault 是因为 mouseup 和 click 没有注册在同一个 DOM 上
  24985. */
  24986. setTimeout(function () {
  24987. _this.dragging = false;
  24988. _this.hideTooltip();
  24989. if (!_this.isClick) {
  24990. _this.setPosition(_this.newPosition);
  24991. _this.$parent.emitChange();
  24992. }
  24993. }, 0);
  24994. window.removeEventListener('mousemove', this.onDragging);
  24995. window.removeEventListener('touchmove', this.onDragging);
  24996. window.removeEventListener('mouseup', this.onDragEnd);
  24997. window.removeEventListener('touchend', this.onDragEnd);
  24998. window.removeEventListener('contextmenu', this.onDragEnd);
  24999. }
  25000. },
  25001. setPosition: function setPosition(newPosition) {
  25002. var _this2 = this;
  25003. if (newPosition === null || isNaN(newPosition)) return;
  25004. if (newPosition < 0) {
  25005. newPosition = 0;
  25006. } else if (newPosition > 100) {
  25007. newPosition = 100;
  25008. }
  25009. var lengthPerStep = 100 / ((this.max - this.min) / this.step);
  25010. var steps = Math.round(newPosition / lengthPerStep);
  25011. var value = steps * lengthPerStep * (this.max - this.min) * 0.01 + this.min;
  25012. value = parseFloat(value.toFixed(this.precision));
  25013. this.$emit('input', value);
  25014. this.$nextTick(function () {
  25015. _this2.displayTooltip();
  25016. _this2.$refs.tooltip && _this2.$refs.tooltip.updatePopper();
  25017. });
  25018. if (!this.dragging && this.value !== this.oldValue) {
  25019. this.oldValue = this.value;
  25020. }
  25021. }
  25022. }
  25023. });
  25024. // CONCATENATED MODULE: ./packages/slider/src/button.vue?vue&type=script&lang=js&
  25025. /* harmony default export */ var packages_slider_src_buttonvue_type_script_lang_js_ = (slider_src_buttonvue_type_script_lang_js_);
  25026. // CONCATENATED MODULE: ./packages/slider/src/button.vue
  25027. /* normalize component */
  25028. var src_button_component = normalizeComponent(
  25029. packages_slider_src_buttonvue_type_script_lang_js_,
  25030. buttonvue_type_template_id_e72d2ad2_render,
  25031. buttonvue_type_template_id_e72d2ad2_staticRenderFns,
  25032. false,
  25033. null,
  25034. null,
  25035. null
  25036. )
  25037. /* hot reload */
  25038. if (false) { var src_button_api; }
  25039. src_button_component.options.__file = "packages/slider/src/button.vue"
  25040. /* harmony default export */ var slider_src_button = (src_button_component.exports);
  25041. // CONCATENATED MODULE: ./packages/slider/src/marker.js
  25042. /* harmony default export */ var marker = ({
  25043. name: 'ElMarker',
  25044. props: {
  25045. mark: {
  25046. type: [String, Object]
  25047. }
  25048. },
  25049. render: function render() {
  25050. var h = arguments[0];
  25051. var label = typeof this.mark === 'string' ? this.mark : this.mark.label;
  25052. return h(
  25053. 'div',
  25054. { 'class': 'el-slider__marks-text', style: this.mark.style || {} },
  25055. [label]
  25056. );
  25057. }
  25058. });
  25059. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/slider/src/main.vue?vue&type=script&lang=js&
  25060. //
  25061. //
  25062. //
  25063. //
  25064. //
  25065. //
  25066. //
  25067. //
  25068. //
  25069. //
  25070. //
  25071. //
  25072. //
  25073. //
  25074. //
  25075. //
  25076. //
  25077. //
  25078. //
  25079. //
  25080. //
  25081. //
  25082. //
  25083. //
  25084. //
  25085. //
  25086. //
  25087. //
  25088. //
  25089. //
  25090. //
  25091. //
  25092. //
  25093. //
  25094. //
  25095. //
  25096. //
  25097. //
  25098. //
  25099. //
  25100. //
  25101. //
  25102. //
  25103. //
  25104. //
  25105. //
  25106. //
  25107. //
  25108. //
  25109. //
  25110. //
  25111. //
  25112. //
  25113. //
  25114. //
  25115. //
  25116. //
  25117. //
  25118. //
  25119. //
  25120. //
  25121. //
  25122. //
  25123. //
  25124. //
  25125. //
  25126. //
  25127. //
  25128. //
  25129. //
  25130. //
  25131. //
  25132. //
  25133. //
  25134. //
  25135. /* harmony default export */ var slider_src_mainvue_type_script_lang_js_ = ({
  25136. name: 'ElSlider',
  25137. mixins: [emitter_default.a],
  25138. inject: {
  25139. elForm: {
  25140. default: ''
  25141. }
  25142. },
  25143. props: {
  25144. min: {
  25145. type: Number,
  25146. default: 0
  25147. },
  25148. max: {
  25149. type: Number,
  25150. default: 100
  25151. },
  25152. step: {
  25153. type: Number,
  25154. default: 1
  25155. },
  25156. value: {
  25157. type: [Number, Array],
  25158. default: 0
  25159. },
  25160. showInput: {
  25161. type: Boolean,
  25162. default: false
  25163. },
  25164. showInputControls: {
  25165. type: Boolean,
  25166. default: true
  25167. },
  25168. inputSize: {
  25169. type: String,
  25170. default: 'small'
  25171. },
  25172. showStops: {
  25173. type: Boolean,
  25174. default: false
  25175. },
  25176. showTooltip: {
  25177. type: Boolean,
  25178. default: true
  25179. },
  25180. formatTooltip: Function,
  25181. disabled: {
  25182. type: Boolean,
  25183. default: false
  25184. },
  25185. range: {
  25186. type: Boolean,
  25187. default: false
  25188. },
  25189. vertical: {
  25190. type: Boolean,
  25191. default: false
  25192. },
  25193. height: {
  25194. type: String
  25195. },
  25196. debounce: {
  25197. type: Number,
  25198. default: 300
  25199. },
  25200. label: {
  25201. type: String
  25202. },
  25203. tooltipClass: String,
  25204. marks: Object
  25205. },
  25206. components: {
  25207. ElInputNumber: input_number_default.a,
  25208. SliderButton: slider_src_button,
  25209. SliderMarker: marker
  25210. },
  25211. data: function data() {
  25212. return {
  25213. firstValue: null,
  25214. secondValue: null,
  25215. oldValue: null,
  25216. dragging: false,
  25217. sliderSize: 1
  25218. };
  25219. },
  25220. watch: {
  25221. value: function value(val, oldVal) {
  25222. if (this.dragging || Array.isArray(val) && Array.isArray(oldVal) && val.every(function (item, index) {
  25223. return item === oldVal[index];
  25224. })) {
  25225. return;
  25226. }
  25227. this.setValues();
  25228. },
  25229. dragging: function dragging(val) {
  25230. if (!val) {
  25231. this.setValues();
  25232. }
  25233. },
  25234. firstValue: function firstValue(val) {
  25235. if (this.range) {
  25236. this.$emit('input', [this.minValue, this.maxValue]);
  25237. } else {
  25238. this.$emit('input', val);
  25239. }
  25240. },
  25241. secondValue: function secondValue() {
  25242. if (this.range) {
  25243. this.$emit('input', [this.minValue, this.maxValue]);
  25244. }
  25245. },
  25246. min: function min() {
  25247. this.setValues();
  25248. },
  25249. max: function max() {
  25250. this.setValues();
  25251. }
  25252. },
  25253. methods: {
  25254. valueChanged: function valueChanged() {
  25255. var _this = this;
  25256. if (this.range) {
  25257. return ![this.minValue, this.maxValue].every(function (item, index) {
  25258. return item === _this.oldValue[index];
  25259. });
  25260. } else {
  25261. return this.value !== this.oldValue;
  25262. }
  25263. },
  25264. setValues: function setValues() {
  25265. if (this.min > this.max) {
  25266. console.error('[Element Error][Slider]min should not be greater than max.');
  25267. return;
  25268. }
  25269. var val = this.value;
  25270. if (this.range && Array.isArray(val)) {
  25271. if (val[1] < this.min) {
  25272. this.$emit('input', [this.min, this.min]);
  25273. } else if (val[0] > this.max) {
  25274. this.$emit('input', [this.max, this.max]);
  25275. } else if (val[0] < this.min) {
  25276. this.$emit('input', [this.min, val[1]]);
  25277. } else if (val[1] > this.max) {
  25278. this.$emit('input', [val[0], this.max]);
  25279. } else {
  25280. this.firstValue = val[0];
  25281. this.secondValue = val[1];
  25282. if (this.valueChanged()) {
  25283. this.dispatch('ElFormItem', 'el.form.change', [this.minValue, this.maxValue]);
  25284. this.oldValue = val.slice();
  25285. }
  25286. }
  25287. } else if (!this.range && typeof val === 'number' && !isNaN(val)) {
  25288. if (val < this.min) {
  25289. this.$emit('input', this.min);
  25290. } else if (val > this.max) {
  25291. this.$emit('input', this.max);
  25292. } else {
  25293. this.firstValue = val;
  25294. if (this.valueChanged()) {
  25295. this.dispatch('ElFormItem', 'el.form.change', val);
  25296. this.oldValue = val;
  25297. }
  25298. }
  25299. }
  25300. },
  25301. setPosition: function setPosition(percent) {
  25302. var targetValue = this.min + percent * (this.max - this.min) / 100;
  25303. if (!this.range) {
  25304. this.$refs.button1.setPosition(percent);
  25305. return;
  25306. }
  25307. var button = void 0;
  25308. if (Math.abs(this.minValue - targetValue) < Math.abs(this.maxValue - targetValue)) {
  25309. button = this.firstValue < this.secondValue ? 'button1' : 'button2';
  25310. } else {
  25311. button = this.firstValue > this.secondValue ? 'button1' : 'button2';
  25312. }
  25313. this.$refs[button].setPosition(percent);
  25314. },
  25315. onSliderClick: function onSliderClick(event) {
  25316. if (this.sliderDisabled || this.dragging) return;
  25317. this.resetSize();
  25318. if (this.vertical) {
  25319. var sliderOffsetBottom = this.$refs.slider.getBoundingClientRect().bottom;
  25320. this.setPosition((sliderOffsetBottom - event.clientY) / this.sliderSize * 100);
  25321. } else {
  25322. var sliderOffsetLeft = this.$refs.slider.getBoundingClientRect().left;
  25323. this.setPosition((event.clientX - sliderOffsetLeft) / this.sliderSize * 100);
  25324. }
  25325. this.emitChange();
  25326. },
  25327. resetSize: function resetSize() {
  25328. if (this.$refs.slider) {
  25329. this.sliderSize = this.$refs.slider['client' + (this.vertical ? 'Height' : 'Width')];
  25330. }
  25331. },
  25332. emitChange: function emitChange() {
  25333. var _this2 = this;
  25334. this.$nextTick(function () {
  25335. _this2.$emit('change', _this2.range ? [_this2.minValue, _this2.maxValue] : _this2.value);
  25336. });
  25337. },
  25338. getStopStyle: function getStopStyle(position) {
  25339. return this.vertical ? { 'bottom': position + '%' } : { 'left': position + '%' };
  25340. }
  25341. },
  25342. computed: {
  25343. stops: function stops() {
  25344. var _this3 = this;
  25345. if (!this.showStops || this.min > this.max) return [];
  25346. if (this.step === 0) {
  25347. false && false;
  25348. return [];
  25349. }
  25350. var stopCount = (this.max - this.min) / this.step;
  25351. var stepWidth = 100 * this.step / (this.max - this.min);
  25352. var result = [];
  25353. for (var i = 1; i < stopCount; i++) {
  25354. result.push(i * stepWidth);
  25355. }
  25356. if (this.range) {
  25357. return result.filter(function (step) {
  25358. return step < 100 * (_this3.minValue - _this3.min) / (_this3.max - _this3.min) || step > 100 * (_this3.maxValue - _this3.min) / (_this3.max - _this3.min);
  25359. });
  25360. } else {
  25361. return result.filter(function (step) {
  25362. return step > 100 * (_this3.firstValue - _this3.min) / (_this3.max - _this3.min);
  25363. });
  25364. }
  25365. },
  25366. markList: function markList() {
  25367. var _this4 = this;
  25368. if (!this.marks) {
  25369. return [];
  25370. }
  25371. var marksKeys = Object.keys(this.marks);
  25372. return marksKeys.map(parseFloat).sort(function (a, b) {
  25373. return a - b;
  25374. }).filter(function (point) {
  25375. return point <= _this4.max && point >= _this4.min;
  25376. }).map(function (point) {
  25377. return {
  25378. point: point,
  25379. position: (point - _this4.min) * 100 / (_this4.max - _this4.min),
  25380. mark: _this4.marks[point]
  25381. };
  25382. });
  25383. },
  25384. minValue: function minValue() {
  25385. return Math.min(this.firstValue, this.secondValue);
  25386. },
  25387. maxValue: function maxValue() {
  25388. return Math.max(this.firstValue, this.secondValue);
  25389. },
  25390. barSize: function barSize() {
  25391. return this.range ? 100 * (this.maxValue - this.minValue) / (this.max - this.min) + '%' : 100 * (this.firstValue - this.min) / (this.max - this.min) + '%';
  25392. },
  25393. barStart: function barStart() {
  25394. return this.range ? 100 * (this.minValue - this.min) / (this.max - this.min) + '%' : '0%';
  25395. },
  25396. precision: function precision() {
  25397. var precisions = [this.min, this.max, this.step].map(function (item) {
  25398. var decimal = ('' + item).split('.')[1];
  25399. return decimal ? decimal.length : 0;
  25400. });
  25401. return Math.max.apply(null, precisions);
  25402. },
  25403. runwayStyle: function runwayStyle() {
  25404. return this.vertical ? { height: this.height } : {};
  25405. },
  25406. barStyle: function barStyle() {
  25407. return this.vertical ? {
  25408. height: this.barSize,
  25409. bottom: this.barStart
  25410. } : {
  25411. width: this.barSize,
  25412. left: this.barStart
  25413. };
  25414. },
  25415. sliderDisabled: function sliderDisabled() {
  25416. return this.disabled || (this.elForm || {}).disabled;
  25417. }
  25418. },
  25419. mounted: function mounted() {
  25420. var valuetext = void 0;
  25421. if (this.range) {
  25422. if (Array.isArray(this.value)) {
  25423. this.firstValue = Math.max(this.min, this.value[0]);
  25424. this.secondValue = Math.min(this.max, this.value[1]);
  25425. } else {
  25426. this.firstValue = this.min;
  25427. this.secondValue = this.max;
  25428. }
  25429. this.oldValue = [this.firstValue, this.secondValue];
  25430. valuetext = this.firstValue + '-' + this.secondValue;
  25431. } else {
  25432. if (typeof this.value !== 'number' || isNaN(this.value)) {
  25433. this.firstValue = this.min;
  25434. } else {
  25435. this.firstValue = Math.min(this.max, Math.max(this.min, this.value));
  25436. }
  25437. this.oldValue = this.firstValue;
  25438. valuetext = this.firstValue;
  25439. }
  25440. this.$el.setAttribute('aria-valuetext', valuetext);
  25441. // label screen reader
  25442. this.$el.setAttribute('aria-label', this.label ? this.label : 'slider between ' + this.min + ' and ' + this.max);
  25443. this.resetSize();
  25444. window.addEventListener('resize', this.resetSize);
  25445. },
  25446. beforeDestroy: function beforeDestroy() {
  25447. window.removeEventListener('resize', this.resetSize);
  25448. }
  25449. });
  25450. // CONCATENATED MODULE: ./packages/slider/src/main.vue?vue&type=script&lang=js&
  25451. /* harmony default export */ var packages_slider_src_mainvue_type_script_lang_js_ = (slider_src_mainvue_type_script_lang_js_);
  25452. // CONCATENATED MODULE: ./packages/slider/src/main.vue
  25453. /* normalize component */
  25454. var slider_src_main_component = normalizeComponent(
  25455. packages_slider_src_mainvue_type_script_lang_js_,
  25456. mainvue_type_template_id_32708644_render,
  25457. mainvue_type_template_id_32708644_staticRenderFns,
  25458. false,
  25459. null,
  25460. null,
  25461. null
  25462. )
  25463. /* hot reload */
  25464. if (false) { var slider_src_main_api; }
  25465. slider_src_main_component.options.__file = "packages/slider/src/main.vue"
  25466. /* harmony default export */ var slider_src_main = (slider_src_main_component.exports);
  25467. // CONCATENATED MODULE: ./packages/slider/index.js
  25468. /* istanbul ignore next */
  25469. slider_src_main.install = function (Vue) {
  25470. Vue.component(slider_src_main.name, slider_src_main);
  25471. };
  25472. /* harmony default export */ var slider = (slider_src_main);
  25473. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/loading/src/loading.vue?vue&type=template&id=eee0a7ac&
  25474. var loadingvue_type_template_id_eee0a7ac_render = function() {
  25475. var _vm = this
  25476. var _h = _vm.$createElement
  25477. var _c = _vm._self._c || _h
  25478. return _c(
  25479. "transition",
  25480. {
  25481. attrs: { name: "el-loading-fade" },
  25482. on: { "after-leave": _vm.handleAfterLeave }
  25483. },
  25484. [
  25485. _c(
  25486. "div",
  25487. {
  25488. directives: [
  25489. {
  25490. name: "show",
  25491. rawName: "v-show",
  25492. value: _vm.visible,
  25493. expression: "visible"
  25494. }
  25495. ],
  25496. staticClass: "el-loading-mask",
  25497. class: [_vm.customClass, { "is-fullscreen": _vm.fullscreen }],
  25498. style: { backgroundColor: _vm.background || "" }
  25499. },
  25500. [
  25501. _c("div", { staticClass: "el-loading-spinner" }, [
  25502. !_vm.spinner
  25503. ? _c(
  25504. "svg",
  25505. {
  25506. staticClass: "circular",
  25507. attrs: { viewBox: "25 25 50 50" }
  25508. },
  25509. [
  25510. _c("circle", {
  25511. staticClass: "path",
  25512. attrs: { cx: "50", cy: "50", r: "20", fill: "none" }
  25513. })
  25514. ]
  25515. )
  25516. : _c("i", { class: _vm.spinner }),
  25517. _vm.text
  25518. ? _c("p", { staticClass: "el-loading-text" }, [
  25519. _vm._v(_vm._s(_vm.text))
  25520. ])
  25521. : _vm._e()
  25522. ])
  25523. ]
  25524. )
  25525. ]
  25526. )
  25527. }
  25528. var loadingvue_type_template_id_eee0a7ac_staticRenderFns = []
  25529. loadingvue_type_template_id_eee0a7ac_render._withStripped = true
  25530. // CONCATENATED MODULE: ./packages/loading/src/loading.vue?vue&type=template&id=eee0a7ac&
  25531. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/loading/src/loading.vue?vue&type=script&lang=js&
  25532. //
  25533. //
  25534. //
  25535. //
  25536. //
  25537. //
  25538. //
  25539. //
  25540. //
  25541. //
  25542. //
  25543. //
  25544. //
  25545. //
  25546. //
  25547. //
  25548. //
  25549. //
  25550. /* harmony default export */ var loadingvue_type_script_lang_js_ = ({
  25551. data: function data() {
  25552. return {
  25553. text: null,
  25554. spinner: null,
  25555. background: null,
  25556. fullscreen: true,
  25557. visible: false,
  25558. customClass: ''
  25559. };
  25560. },
  25561. methods: {
  25562. handleAfterLeave: function handleAfterLeave() {
  25563. this.$emit('after-leave');
  25564. },
  25565. setText: function setText(text) {
  25566. this.text = text;
  25567. }
  25568. }
  25569. });
  25570. // CONCATENATED MODULE: ./packages/loading/src/loading.vue?vue&type=script&lang=js&
  25571. /* harmony default export */ var src_loadingvue_type_script_lang_js_ = (loadingvue_type_script_lang_js_);
  25572. // CONCATENATED MODULE: ./packages/loading/src/loading.vue
  25573. /* normalize component */
  25574. var loading_component = normalizeComponent(
  25575. src_loadingvue_type_script_lang_js_,
  25576. loadingvue_type_template_id_eee0a7ac_render,
  25577. loadingvue_type_template_id_eee0a7ac_staticRenderFns,
  25578. false,
  25579. null,
  25580. null,
  25581. null
  25582. )
  25583. /* hot reload */
  25584. if (false) { var loading_api; }
  25585. loading_component.options.__file = "packages/loading/src/loading.vue"
  25586. /* harmony default export */ var loading = (loading_component.exports);
  25587. // EXTERNAL MODULE: external "element-ui/lib/utils/after-leave"
  25588. var after_leave_ = __webpack_require__(33);
  25589. var after_leave_default = /*#__PURE__*/__webpack_require__.n(after_leave_);
  25590. // CONCATENATED MODULE: ./packages/loading/src/directive.js
  25591. var Mask = external_vue_default.a.extend(loading);
  25592. var loadingDirective = {};
  25593. loadingDirective.install = function (Vue) {
  25594. if (Vue.prototype.$isServer) return;
  25595. var toggleLoading = function toggleLoading(el, binding) {
  25596. if (binding.value) {
  25597. Vue.nextTick(function () {
  25598. if (binding.modifiers.fullscreen) {
  25599. el.originalPosition = Object(dom_["getStyle"])(document.body, 'position');
  25600. el.originalOverflow = Object(dom_["getStyle"])(document.body, 'overflow');
  25601. el.maskStyle.zIndex = popup_["PopupManager"].nextZIndex();
  25602. Object(dom_["addClass"])(el.mask, 'is-fullscreen');
  25603. insertDom(document.body, el, binding);
  25604. } else {
  25605. Object(dom_["removeClass"])(el.mask, 'is-fullscreen');
  25606. if (binding.modifiers.body) {
  25607. el.originalPosition = Object(dom_["getStyle"])(document.body, 'position');
  25608. ['top', 'left'].forEach(function (property) {
  25609. var scroll = property === 'top' ? 'scrollTop' : 'scrollLeft';
  25610. el.maskStyle[property] = el.getBoundingClientRect()[property] + document.body[scroll] + document.documentElement[scroll] - parseInt(Object(dom_["getStyle"])(document.body, 'margin-' + property), 10) + 'px';
  25611. });
  25612. ['height', 'width'].forEach(function (property) {
  25613. el.maskStyle[property] = el.getBoundingClientRect()[property] + 'px';
  25614. });
  25615. insertDom(document.body, el, binding);
  25616. } else {
  25617. el.originalPosition = Object(dom_["getStyle"])(el, 'position');
  25618. insertDom(el, el, binding);
  25619. }
  25620. }
  25621. });
  25622. } else {
  25623. after_leave_default()(el.instance, function (_) {
  25624. if (!el.instance.hiding) return;
  25625. el.domVisible = false;
  25626. var target = binding.modifiers.fullscreen || binding.modifiers.body ? document.body : el;
  25627. Object(dom_["removeClass"])(target, 'el-loading-parent--relative');
  25628. Object(dom_["removeClass"])(target, 'el-loading-parent--hidden');
  25629. el.instance.hiding = false;
  25630. }, 300, true);
  25631. el.instance.visible = false;
  25632. el.instance.hiding = true;
  25633. }
  25634. };
  25635. var insertDom = function insertDom(parent, el, binding) {
  25636. if (!el.domVisible && Object(dom_["getStyle"])(el, 'display') !== 'none' && Object(dom_["getStyle"])(el, 'visibility') !== 'hidden') {
  25637. Object.keys(el.maskStyle).forEach(function (property) {
  25638. el.mask.style[property] = el.maskStyle[property];
  25639. });
  25640. if (el.originalPosition !== 'absolute' && el.originalPosition !== 'fixed' && el.originalPosition !== 'sticky') {
  25641. Object(dom_["addClass"])(parent, 'el-loading-parent--relative');
  25642. }
  25643. if (binding.modifiers.fullscreen && binding.modifiers.lock) {
  25644. Object(dom_["addClass"])(parent, 'el-loading-parent--hidden');
  25645. }
  25646. el.domVisible = true;
  25647. parent.appendChild(el.mask);
  25648. Vue.nextTick(function () {
  25649. if (el.instance.hiding) {
  25650. el.instance.$emit('after-leave');
  25651. } else {
  25652. el.instance.visible = true;
  25653. }
  25654. });
  25655. el.domInserted = true;
  25656. } else if (el.domVisible && el.instance.hiding === true) {
  25657. el.instance.visible = true;
  25658. el.instance.hiding = false;
  25659. }
  25660. };
  25661. Vue.directive('loading', {
  25662. bind: function bind(el, binding, vnode) {
  25663. var textExr = el.getAttribute('element-loading-text');
  25664. var spinnerExr = el.getAttribute('element-loading-spinner');
  25665. var backgroundExr = el.getAttribute('element-loading-background');
  25666. var customClassExr = el.getAttribute('element-loading-custom-class');
  25667. var vm = vnode.context;
  25668. var mask = new Mask({
  25669. el: document.createElement('div'),
  25670. data: {
  25671. text: vm && vm[textExr] || textExr,
  25672. spinner: vm && vm[spinnerExr] || spinnerExr,
  25673. background: vm && vm[backgroundExr] || backgroundExr,
  25674. customClass: vm && vm[customClassExr] || customClassExr,
  25675. fullscreen: !!binding.modifiers.fullscreen
  25676. }
  25677. });
  25678. el.instance = mask;
  25679. el.mask = mask.$el;
  25680. el.maskStyle = {};
  25681. binding.value && toggleLoading(el, binding);
  25682. },
  25683. update: function update(el, binding) {
  25684. el.instance.setText(el.getAttribute('element-loading-text'));
  25685. if (binding.oldValue !== binding.value) {
  25686. toggleLoading(el, binding);
  25687. }
  25688. },
  25689. unbind: function unbind(el, binding) {
  25690. if (el.domInserted) {
  25691. el.mask && el.mask.parentNode && el.mask.parentNode.removeChild(el.mask);
  25692. toggleLoading(el, { value: false, modifiers: binding.modifiers });
  25693. }
  25694. el.instance && el.instance.$destroy();
  25695. }
  25696. });
  25697. };
  25698. /* harmony default export */ var src_directive = (loadingDirective);
  25699. // CONCATENATED MODULE: ./packages/loading/src/index.js
  25700. var LoadingConstructor = external_vue_default.a.extend(loading);
  25701. var src_defaults = {
  25702. text: null,
  25703. fullscreen: true,
  25704. body: false,
  25705. lock: false,
  25706. customClass: ''
  25707. };
  25708. var fullscreenLoading = void 0;
  25709. LoadingConstructor.prototype.originalPosition = '';
  25710. LoadingConstructor.prototype.originalOverflow = '';
  25711. LoadingConstructor.prototype.close = function () {
  25712. var _this = this;
  25713. if (this.fullscreen) {
  25714. fullscreenLoading = undefined;
  25715. }
  25716. after_leave_default()(this, function (_) {
  25717. var target = _this.fullscreen || _this.body ? document.body : _this.target;
  25718. Object(dom_["removeClass"])(target, 'el-loading-parent--relative');
  25719. Object(dom_["removeClass"])(target, 'el-loading-parent--hidden');
  25720. if (_this.$el && _this.$el.parentNode) {
  25721. _this.$el.parentNode.removeChild(_this.$el);
  25722. }
  25723. _this.$destroy();
  25724. }, 300);
  25725. this.visible = false;
  25726. };
  25727. var src_addStyle = function addStyle(options, parent, instance) {
  25728. var maskStyle = {};
  25729. if (options.fullscreen) {
  25730. instance.originalPosition = Object(dom_["getStyle"])(document.body, 'position');
  25731. instance.originalOverflow = Object(dom_["getStyle"])(document.body, 'overflow');
  25732. maskStyle.zIndex = popup_["PopupManager"].nextZIndex();
  25733. } else if (options.body) {
  25734. instance.originalPosition = Object(dom_["getStyle"])(document.body, 'position');
  25735. ['top', 'left'].forEach(function (property) {
  25736. var scroll = property === 'top' ? 'scrollTop' : 'scrollLeft';
  25737. maskStyle[property] = options.target.getBoundingClientRect()[property] + document.body[scroll] + document.documentElement[scroll] + 'px';
  25738. });
  25739. ['height', 'width'].forEach(function (property) {
  25740. maskStyle[property] = options.target.getBoundingClientRect()[property] + 'px';
  25741. });
  25742. } else {
  25743. instance.originalPosition = Object(dom_["getStyle"])(parent, 'position');
  25744. }
  25745. Object.keys(maskStyle).forEach(function (property) {
  25746. instance.$el.style[property] = maskStyle[property];
  25747. });
  25748. };
  25749. var src_Loading = function Loading() {
  25750. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  25751. if (external_vue_default.a.prototype.$isServer) return;
  25752. options = merge_default()({}, src_defaults, options);
  25753. if (typeof options.target === 'string') {
  25754. options.target = document.querySelector(options.target);
  25755. }
  25756. options.target = options.target || document.body;
  25757. if (options.target !== document.body) {
  25758. options.fullscreen = false;
  25759. } else {
  25760. options.body = true;
  25761. }
  25762. if (options.fullscreen && fullscreenLoading) {
  25763. return fullscreenLoading;
  25764. }
  25765. var parent = options.body ? document.body : options.target;
  25766. var instance = new LoadingConstructor({
  25767. el: document.createElement('div'),
  25768. data: options
  25769. });
  25770. src_addStyle(options, parent, instance);
  25771. if (instance.originalPosition !== 'absolute' && instance.originalPosition !== 'fixed' && instance.originalPosition !== 'sticky') {
  25772. Object(dom_["addClass"])(parent, 'el-loading-parent--relative');
  25773. }
  25774. if (options.fullscreen && options.lock) {
  25775. Object(dom_["addClass"])(parent, 'el-loading-parent--hidden');
  25776. }
  25777. parent.appendChild(instance.$el);
  25778. external_vue_default.a.nextTick(function () {
  25779. instance.visible = true;
  25780. });
  25781. if (options.fullscreen) {
  25782. fullscreenLoading = instance;
  25783. }
  25784. return instance;
  25785. };
  25786. /* harmony default export */ var src = (src_Loading);
  25787. // CONCATENATED MODULE: ./packages/loading/index.js
  25788. /* harmony default export */ var packages_loading = ({
  25789. install: function install(Vue) {
  25790. Vue.use(src_directive);
  25791. Vue.prototype.$loading = src;
  25792. },
  25793. directive: src_directive,
  25794. service: src
  25795. });
  25796. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/icon/src/icon.vue?vue&type=template&id=cb3fe7f4&
  25797. var iconvue_type_template_id_cb3fe7f4_render = function() {
  25798. var _vm = this
  25799. var _h = _vm.$createElement
  25800. var _c = _vm._self._c || _h
  25801. return _c("i", { class: "el-icon-" + _vm.name })
  25802. }
  25803. var iconvue_type_template_id_cb3fe7f4_staticRenderFns = []
  25804. iconvue_type_template_id_cb3fe7f4_render._withStripped = true
  25805. // CONCATENATED MODULE: ./packages/icon/src/icon.vue?vue&type=template&id=cb3fe7f4&
  25806. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/icon/src/icon.vue?vue&type=script&lang=js&
  25807. //
  25808. //
  25809. //
  25810. //
  25811. /* harmony default export */ var iconvue_type_script_lang_js_ = ({
  25812. name: 'ElIcon',
  25813. props: {
  25814. name: String
  25815. }
  25816. });
  25817. // CONCATENATED MODULE: ./packages/icon/src/icon.vue?vue&type=script&lang=js&
  25818. /* harmony default export */ var src_iconvue_type_script_lang_js_ = (iconvue_type_script_lang_js_);
  25819. // CONCATENATED MODULE: ./packages/icon/src/icon.vue
  25820. /* normalize component */
  25821. var icon_component = normalizeComponent(
  25822. src_iconvue_type_script_lang_js_,
  25823. iconvue_type_template_id_cb3fe7f4_render,
  25824. iconvue_type_template_id_cb3fe7f4_staticRenderFns,
  25825. false,
  25826. null,
  25827. null,
  25828. null
  25829. )
  25830. /* hot reload */
  25831. if (false) { var icon_api; }
  25832. icon_component.options.__file = "packages/icon/src/icon.vue"
  25833. /* harmony default export */ var icon = (icon_component.exports);
  25834. // CONCATENATED MODULE: ./packages/icon/index.js
  25835. /* istanbul ignore next */
  25836. icon.install = function (Vue) {
  25837. Vue.component(icon.name, icon);
  25838. };
  25839. /* harmony default export */ var packages_icon = (icon);
  25840. // CONCATENATED MODULE: ./packages/row/src/row.js
  25841. /* harmony default export */ var src_row = ({
  25842. name: 'ElRow',
  25843. componentName: 'ElRow',
  25844. props: {
  25845. tag: {
  25846. type: String,
  25847. default: 'div'
  25848. },
  25849. gutter: Number,
  25850. type: String,
  25851. justify: {
  25852. type: String,
  25853. default: 'start'
  25854. },
  25855. align: String
  25856. },
  25857. computed: {
  25858. style: function style() {
  25859. var ret = {};
  25860. if (this.gutter) {
  25861. ret.marginLeft = '-' + this.gutter / 2 + 'px';
  25862. ret.marginRight = ret.marginLeft;
  25863. }
  25864. return ret;
  25865. }
  25866. },
  25867. render: function render(h) {
  25868. return h(this.tag, {
  25869. class: ['el-row', this.justify !== 'start' ? 'is-justify-' + this.justify : '', this.align ? 'is-align-' + this.align : '', { 'el-row--flex': this.type === 'flex' }],
  25870. style: this.style
  25871. }, this.$slots.default);
  25872. }
  25873. });
  25874. // CONCATENATED MODULE: ./packages/row/index.js
  25875. /* istanbul ignore next */
  25876. src_row.install = function (Vue) {
  25877. Vue.component(src_row.name, src_row);
  25878. };
  25879. /* harmony default export */ var packages_row = (src_row);
  25880. // CONCATENATED MODULE: ./packages/col/src/col.js
  25881. var col_typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  25882. /* harmony default export */ var col = ({
  25883. name: 'ElCol',
  25884. props: {
  25885. span: {
  25886. type: Number,
  25887. default: 24
  25888. },
  25889. tag: {
  25890. type: String,
  25891. default: 'div'
  25892. },
  25893. offset: Number,
  25894. pull: Number,
  25895. push: Number,
  25896. xs: [Number, Object],
  25897. sm: [Number, Object],
  25898. md: [Number, Object],
  25899. lg: [Number, Object],
  25900. xl: [Number, Object]
  25901. },
  25902. computed: {
  25903. gutter: function gutter() {
  25904. var parent = this.$parent;
  25905. while (parent && parent.$options.componentName !== 'ElRow') {
  25906. parent = parent.$parent;
  25907. }
  25908. return parent ? parent.gutter : 0;
  25909. }
  25910. },
  25911. render: function render(h) {
  25912. var _this = this;
  25913. var classList = [];
  25914. var style = {};
  25915. if (this.gutter) {
  25916. style.paddingLeft = this.gutter / 2 + 'px';
  25917. style.paddingRight = style.paddingLeft;
  25918. }
  25919. ['span', 'offset', 'pull', 'push'].forEach(function (prop) {
  25920. if (_this[prop] || _this[prop] === 0) {
  25921. classList.push(prop !== 'span' ? 'el-col-' + prop + '-' + _this[prop] : 'el-col-' + _this[prop]);
  25922. }
  25923. });
  25924. ['xs', 'sm', 'md', 'lg', 'xl'].forEach(function (size) {
  25925. if (typeof _this[size] === 'number') {
  25926. classList.push('el-col-' + size + '-' + _this[size]);
  25927. } else if (col_typeof(_this[size]) === 'object') {
  25928. var props = _this[size];
  25929. Object.keys(props).forEach(function (prop) {
  25930. classList.push(prop !== 'span' ? 'el-col-' + size + '-' + prop + '-' + props[prop] : 'el-col-' + size + '-' + props[prop]);
  25931. });
  25932. }
  25933. });
  25934. return h(this.tag, {
  25935. class: ['el-col', classList],
  25936. style: style
  25937. }, this.$slots.default);
  25938. }
  25939. });
  25940. // CONCATENATED MODULE: ./packages/col/index.js
  25941. /* istanbul ignore next */
  25942. col.install = function (Vue) {
  25943. Vue.component(col.name, col);
  25944. };
  25945. /* harmony default export */ var packages_col = (col);
  25946. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/upload-list.vue?vue&type=template&id=173fedf5&
  25947. var upload_listvue_type_template_id_173fedf5_render = function() {
  25948. var _vm = this
  25949. var _h = _vm.$createElement
  25950. var _c = _vm._self._c || _h
  25951. return _c(
  25952. "transition-group",
  25953. {
  25954. class: [
  25955. "el-upload-list",
  25956. "el-upload-list--" + _vm.listType,
  25957. { "is-disabled": _vm.disabled }
  25958. ],
  25959. attrs: { tag: "ul", name: "el-list" }
  25960. },
  25961. _vm._l(_vm.files, function(file) {
  25962. return _c(
  25963. "li",
  25964. {
  25965. key: file.uid,
  25966. class: [
  25967. "el-upload-list__item",
  25968. "is-" + file.status,
  25969. _vm.focusing ? "focusing" : ""
  25970. ],
  25971. attrs: { tabindex: "0" },
  25972. on: {
  25973. keydown: function($event) {
  25974. if (
  25975. !("button" in $event) &&
  25976. _vm._k($event.keyCode, "delete", [8, 46], $event.key, [
  25977. "Backspace",
  25978. "Delete",
  25979. "Del"
  25980. ])
  25981. ) {
  25982. return null
  25983. }
  25984. !_vm.disabled && _vm.$emit("remove", file)
  25985. },
  25986. focus: function($event) {
  25987. _vm.focusing = true
  25988. },
  25989. blur: function($event) {
  25990. _vm.focusing = false
  25991. },
  25992. click: function($event) {
  25993. _vm.focusing = false
  25994. }
  25995. }
  25996. },
  25997. [
  25998. _vm._t(
  25999. "default",
  26000. [
  26001. file.status !== "uploading" &&
  26002. ["picture-card", "picture"].indexOf(_vm.listType) > -1
  26003. ? _c("img", {
  26004. staticClass: "el-upload-list__item-thumbnail",
  26005. attrs: { src: file.url, alt: "" }
  26006. })
  26007. : _vm._e(),
  26008. _c(
  26009. "a",
  26010. {
  26011. staticClass: "el-upload-list__item-name",
  26012. on: {
  26013. click: function($event) {
  26014. _vm.handleClick(file)
  26015. }
  26016. }
  26017. },
  26018. [
  26019. _c("i", { staticClass: "el-icon-document" }),
  26020. _vm._v(_vm._s(file.name) + "\n ")
  26021. ]
  26022. ),
  26023. _c(
  26024. "label",
  26025. { staticClass: "el-upload-list__item-status-label" },
  26026. [
  26027. _c("i", {
  26028. class: {
  26029. "el-icon-upload-success": true,
  26030. "el-icon-circle-check": _vm.listType === "text",
  26031. "el-icon-check":
  26032. ["picture-card", "picture"].indexOf(_vm.listType) > -1
  26033. }
  26034. })
  26035. ]
  26036. ),
  26037. !_vm.disabled
  26038. ? _c("i", {
  26039. staticClass: "el-icon-close",
  26040. on: {
  26041. click: function($event) {
  26042. _vm.$emit("remove", file)
  26043. }
  26044. }
  26045. })
  26046. : _vm._e(),
  26047. !_vm.disabled
  26048. ? _c("i", { staticClass: "el-icon-close-tip" }, [
  26049. _vm._v(_vm._s(_vm.t("el.upload.deleteTip")))
  26050. ])
  26051. : _vm._e(),
  26052. file.status === "uploading"
  26053. ? _c("el-progress", {
  26054. attrs: {
  26055. type: _vm.listType === "picture-card" ? "circle" : "line",
  26056. "stroke-width": _vm.listType === "picture-card" ? 6 : 2,
  26057. percentage: _vm.parsePercentage(file.percentage)
  26058. }
  26059. })
  26060. : _vm._e(),
  26061. _vm.listType === "picture-card"
  26062. ? _c("span", { staticClass: "el-upload-list__item-actions" }, [
  26063. _vm.handlePreview && _vm.listType === "picture-card"
  26064. ? _c(
  26065. "span",
  26066. {
  26067. staticClass: "el-upload-list__item-preview",
  26068. on: {
  26069. click: function($event) {
  26070. _vm.handlePreview(file)
  26071. }
  26072. }
  26073. },
  26074. [_c("i", { staticClass: "el-icon-zoom-in" })]
  26075. )
  26076. : _vm._e(),
  26077. !_vm.disabled
  26078. ? _c(
  26079. "span",
  26080. {
  26081. staticClass: "el-upload-list__item-delete",
  26082. on: {
  26083. click: function($event) {
  26084. _vm.$emit("remove", file)
  26085. }
  26086. }
  26087. },
  26088. [_c("i", { staticClass: "el-icon-delete" })]
  26089. )
  26090. : _vm._e()
  26091. ])
  26092. : _vm._e()
  26093. ],
  26094. { file: file }
  26095. )
  26096. ],
  26097. 2
  26098. )
  26099. }),
  26100. 0
  26101. )
  26102. }
  26103. var upload_listvue_type_template_id_173fedf5_staticRenderFns = []
  26104. upload_listvue_type_template_id_173fedf5_render._withStripped = true
  26105. // CONCATENATED MODULE: ./packages/upload/src/upload-list.vue?vue&type=template&id=173fedf5&
  26106. // EXTERNAL MODULE: external "element-ui/lib/progress"
  26107. var progress_ = __webpack_require__(34);
  26108. var progress_default = /*#__PURE__*/__webpack_require__.n(progress_);
  26109. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/upload-list.vue?vue&type=script&lang=js&
  26110. //
  26111. //
  26112. //
  26113. //
  26114. //
  26115. //
  26116. //
  26117. //
  26118. //
  26119. //
  26120. //
  26121. //
  26122. //
  26123. //
  26124. //
  26125. //
  26126. //
  26127. //
  26128. //
  26129. //
  26130. //
  26131. //
  26132. //
  26133. //
  26134. //
  26135. //
  26136. //
  26137. //
  26138. //
  26139. //
  26140. //
  26141. //
  26142. //
  26143. //
  26144. //
  26145. //
  26146. //
  26147. //
  26148. //
  26149. //
  26150. //
  26151. //
  26152. //
  26153. //
  26154. //
  26155. //
  26156. //
  26157. //
  26158. //
  26159. //
  26160. //
  26161. //
  26162. //
  26163. //
  26164. //
  26165. //
  26166. //
  26167. //
  26168. //
  26169. //
  26170. //
  26171. //
  26172. //
  26173. //
  26174. /* harmony default export */ var upload_listvue_type_script_lang_js_ = ({
  26175. name: 'ElUploadList',
  26176. mixins: [locale_default.a],
  26177. data: function data() {
  26178. return {
  26179. focusing: false
  26180. };
  26181. },
  26182. components: { ElProgress: progress_default.a },
  26183. props: {
  26184. files: {
  26185. type: Array,
  26186. default: function _default() {
  26187. return [];
  26188. }
  26189. },
  26190. disabled: {
  26191. type: Boolean,
  26192. default: false
  26193. },
  26194. handlePreview: Function,
  26195. listType: String
  26196. },
  26197. methods: {
  26198. parsePercentage: function parsePercentage(val) {
  26199. return parseInt(val, 10);
  26200. },
  26201. handleClick: function handleClick(file) {
  26202. this.handlePreview && this.handlePreview(file);
  26203. }
  26204. }
  26205. });
  26206. // CONCATENATED MODULE: ./packages/upload/src/upload-list.vue?vue&type=script&lang=js&
  26207. /* harmony default export */ var src_upload_listvue_type_script_lang_js_ = (upload_listvue_type_script_lang_js_);
  26208. // CONCATENATED MODULE: ./packages/upload/src/upload-list.vue
  26209. /* normalize component */
  26210. var upload_list_component = normalizeComponent(
  26211. src_upload_listvue_type_script_lang_js_,
  26212. upload_listvue_type_template_id_173fedf5_render,
  26213. upload_listvue_type_template_id_173fedf5_staticRenderFns,
  26214. false,
  26215. null,
  26216. null,
  26217. null
  26218. )
  26219. /* hot reload */
  26220. if (false) { var upload_list_api; }
  26221. upload_list_component.options.__file = "packages/upload/src/upload-list.vue"
  26222. /* harmony default export */ var upload_list = (upload_list_component.exports);
  26223. // EXTERNAL MODULE: external "babel-helper-vue-jsx-merge-props"
  26224. var external_babel_helper_vue_jsx_merge_props_ = __webpack_require__(24);
  26225. var external_babel_helper_vue_jsx_merge_props_default = /*#__PURE__*/__webpack_require__.n(external_babel_helper_vue_jsx_merge_props_);
  26226. // CONCATENATED MODULE: ./packages/upload/src/ajax.js
  26227. function getError(action, option, xhr) {
  26228. var msg = void 0;
  26229. if (xhr.response) {
  26230. msg = '' + (xhr.response.error || xhr.response);
  26231. } else if (xhr.responseText) {
  26232. msg = '' + xhr.responseText;
  26233. } else {
  26234. msg = 'fail to post ' + action + ' ' + xhr.status;
  26235. }
  26236. var err = new Error(msg);
  26237. err.status = xhr.status;
  26238. err.method = 'post';
  26239. err.url = action;
  26240. return err;
  26241. }
  26242. function getBody(xhr) {
  26243. var text = xhr.responseText || xhr.response;
  26244. if (!text) {
  26245. return text;
  26246. }
  26247. try {
  26248. return JSON.parse(text);
  26249. } catch (e) {
  26250. return text;
  26251. }
  26252. }
  26253. function upload(option) {
  26254. if (typeof XMLHttpRequest === 'undefined') {
  26255. return;
  26256. }
  26257. var xhr = new XMLHttpRequest();
  26258. var action = option.action;
  26259. if (xhr.upload) {
  26260. xhr.upload.onprogress = function progress(e) {
  26261. if (e.total > 0) {
  26262. e.percent = e.loaded / e.total * 100;
  26263. }
  26264. option.onProgress(e);
  26265. };
  26266. }
  26267. var formData = new FormData();
  26268. if (option.data) {
  26269. Object.keys(option.data).forEach(function (key) {
  26270. formData.append(key, option.data[key]);
  26271. });
  26272. }
  26273. formData.append(option.filename, option.file, option.file.name);
  26274. xhr.onerror = function error(e) {
  26275. option.onError(e);
  26276. };
  26277. xhr.onload = function onload() {
  26278. if (xhr.status < 200 || xhr.status >= 300) {
  26279. return option.onError(getError(action, option, xhr));
  26280. }
  26281. option.onSuccess(getBody(xhr));
  26282. };
  26283. xhr.open('post', action, true);
  26284. if (option.withCredentials && 'withCredentials' in xhr) {
  26285. xhr.withCredentials = true;
  26286. }
  26287. var headers = option.headers || {};
  26288. for (var item in headers) {
  26289. if (headers.hasOwnProperty(item) && headers[item] !== null) {
  26290. xhr.setRequestHeader(item, headers[item]);
  26291. }
  26292. }
  26293. xhr.send(formData);
  26294. return xhr;
  26295. }
  26296. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/upload-dragger.vue?vue&type=template&id=7ebbf219&
  26297. var upload_draggervue_type_template_id_7ebbf219_render = function() {
  26298. var _vm = this
  26299. var _h = _vm.$createElement
  26300. var _c = _vm._self._c || _h
  26301. return _c(
  26302. "div",
  26303. {
  26304. staticClass: "el-upload-dragger",
  26305. class: {
  26306. "is-dragover": _vm.dragover
  26307. },
  26308. on: {
  26309. drop: function($event) {
  26310. $event.preventDefault()
  26311. return _vm.onDrop($event)
  26312. },
  26313. dragover: function($event) {
  26314. $event.preventDefault()
  26315. return _vm.onDragover($event)
  26316. },
  26317. dragleave: function($event) {
  26318. $event.preventDefault()
  26319. _vm.dragover = false
  26320. }
  26321. }
  26322. },
  26323. [_vm._t("default")],
  26324. 2
  26325. )
  26326. }
  26327. var upload_draggervue_type_template_id_7ebbf219_staticRenderFns = []
  26328. upload_draggervue_type_template_id_7ebbf219_render._withStripped = true
  26329. // CONCATENATED MODULE: ./packages/upload/src/upload-dragger.vue?vue&type=template&id=7ebbf219&
  26330. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/upload-dragger.vue?vue&type=script&lang=js&
  26331. //
  26332. //
  26333. //
  26334. //
  26335. //
  26336. //
  26337. //
  26338. //
  26339. //
  26340. //
  26341. //
  26342. //
  26343. //
  26344. /* harmony default export */ var upload_draggervue_type_script_lang_js_ = ({
  26345. name: 'ElUploadDrag',
  26346. props: {
  26347. disabled: Boolean
  26348. },
  26349. inject: {
  26350. uploader: {
  26351. default: ''
  26352. }
  26353. },
  26354. data: function data() {
  26355. return {
  26356. dragover: false
  26357. };
  26358. },
  26359. methods: {
  26360. onDragover: function onDragover() {
  26361. if (!this.disabled) {
  26362. this.dragover = true;
  26363. }
  26364. },
  26365. onDrop: function onDrop(e) {
  26366. if (this.disabled || !this.uploader) return;
  26367. var accept = this.uploader.accept;
  26368. this.dragover = false;
  26369. if (!accept) {
  26370. this.$emit('file', e.dataTransfer.files);
  26371. return;
  26372. }
  26373. this.$emit('file', [].slice.call(e.dataTransfer.files).filter(function (file) {
  26374. var type = file.type,
  26375. name = file.name;
  26376. var extension = name.indexOf('.') > -1 ? '.' + name.split('.').pop() : '';
  26377. var baseType = type.replace(/\/.*$/, '');
  26378. return accept.split(',').map(function (type) {
  26379. return type.trim();
  26380. }).filter(function (type) {
  26381. return type;
  26382. }).some(function (acceptedType) {
  26383. if (/\..+$/.test(acceptedType)) {
  26384. return extension === acceptedType;
  26385. }
  26386. if (/\/\*$/.test(acceptedType)) {
  26387. return baseType === acceptedType.replace(/\/\*$/, '');
  26388. }
  26389. if (/^[^\/]+\/[^\/]+$/.test(acceptedType)) {
  26390. return type === acceptedType;
  26391. }
  26392. return false;
  26393. });
  26394. }));
  26395. }
  26396. }
  26397. });
  26398. // CONCATENATED MODULE: ./packages/upload/src/upload-dragger.vue?vue&type=script&lang=js&
  26399. /* harmony default export */ var src_upload_draggervue_type_script_lang_js_ = (upload_draggervue_type_script_lang_js_);
  26400. // CONCATENATED MODULE: ./packages/upload/src/upload-dragger.vue
  26401. /* normalize component */
  26402. var upload_dragger_component = normalizeComponent(
  26403. src_upload_draggervue_type_script_lang_js_,
  26404. upload_draggervue_type_template_id_7ebbf219_render,
  26405. upload_draggervue_type_template_id_7ebbf219_staticRenderFns,
  26406. false,
  26407. null,
  26408. null,
  26409. null
  26410. )
  26411. /* hot reload */
  26412. if (false) { var upload_dragger_api; }
  26413. upload_dragger_component.options.__file = "packages/upload/src/upload-dragger.vue"
  26414. /* harmony default export */ var upload_dragger = (upload_dragger_component.exports);
  26415. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/upload.vue?vue&type=script&lang=js&
  26416. /* harmony default export */ var uploadvue_type_script_lang_js_ = ({
  26417. inject: ['uploader'],
  26418. components: {
  26419. UploadDragger: upload_dragger
  26420. },
  26421. props: {
  26422. type: String,
  26423. action: {
  26424. type: String,
  26425. required: true
  26426. },
  26427. name: {
  26428. type: String,
  26429. default: 'file'
  26430. },
  26431. data: Object,
  26432. headers: Object,
  26433. withCredentials: Boolean,
  26434. multiple: Boolean,
  26435. accept: String,
  26436. onStart: Function,
  26437. onProgress: Function,
  26438. onSuccess: Function,
  26439. onError: Function,
  26440. beforeUpload: Function,
  26441. drag: Boolean,
  26442. onPreview: {
  26443. type: Function,
  26444. default: function _default() {}
  26445. },
  26446. onRemove: {
  26447. type: Function,
  26448. default: function _default() {}
  26449. },
  26450. fileList: Array,
  26451. autoUpload: Boolean,
  26452. listType: String,
  26453. httpRequest: {
  26454. type: Function,
  26455. default: upload
  26456. },
  26457. disabled: Boolean,
  26458. limit: Number,
  26459. onExceed: Function
  26460. },
  26461. data: function data() {
  26462. return {
  26463. mouseover: false,
  26464. reqs: {}
  26465. };
  26466. },
  26467. methods: {
  26468. isImage: function isImage(str) {
  26469. return str.indexOf('image') !== -1;
  26470. },
  26471. handleChange: function handleChange(ev) {
  26472. var files = ev.target.files;
  26473. if (!files) return;
  26474. this.uploadFiles(files);
  26475. },
  26476. uploadFiles: function uploadFiles(files) {
  26477. var _this = this;
  26478. if (this.limit && this.fileList.length + files.length > this.limit) {
  26479. this.onExceed && this.onExceed(files, this.fileList);
  26480. return;
  26481. }
  26482. var postFiles = Array.prototype.slice.call(files);
  26483. if (!this.multiple) {
  26484. postFiles = postFiles.slice(0, 1);
  26485. }
  26486. if (postFiles.length === 0) {
  26487. return;
  26488. }
  26489. postFiles.forEach(function (rawFile) {
  26490. _this.onStart(rawFile);
  26491. if (_this.autoUpload) _this.upload(rawFile);
  26492. });
  26493. },
  26494. upload: function upload(rawFile) {
  26495. var _this2 = this;
  26496. this.$refs.input.value = null;
  26497. if (!this.beforeUpload) {
  26498. return this.post(rawFile);
  26499. }
  26500. var before = this.beforeUpload(rawFile);
  26501. if (before && before.then) {
  26502. before.then(function (processedFile) {
  26503. var fileType = Object.prototype.toString.call(processedFile);
  26504. if (fileType === '[object File]' || fileType === '[object Blob]') {
  26505. if (fileType === '[object Blob]') {
  26506. processedFile = new File([processedFile], rawFile.name, {
  26507. type: rawFile.type
  26508. });
  26509. }
  26510. for (var p in rawFile) {
  26511. if (rawFile.hasOwnProperty(p)) {
  26512. processedFile[p] = rawFile[p];
  26513. }
  26514. }
  26515. _this2.post(processedFile);
  26516. } else {
  26517. _this2.post(rawFile);
  26518. }
  26519. }, function () {
  26520. _this2.onRemove(null, rawFile);
  26521. });
  26522. } else if (before !== false) {
  26523. this.post(rawFile);
  26524. } else {
  26525. this.onRemove(null, rawFile);
  26526. }
  26527. },
  26528. abort: function abort(file) {
  26529. var reqs = this.reqs;
  26530. if (file) {
  26531. var uid = file;
  26532. if (file.uid) uid = file.uid;
  26533. if (reqs[uid]) {
  26534. reqs[uid].abort();
  26535. }
  26536. } else {
  26537. Object.keys(reqs).forEach(function (uid) {
  26538. if (reqs[uid]) reqs[uid].abort();
  26539. delete reqs[uid];
  26540. });
  26541. }
  26542. },
  26543. post: function post(rawFile) {
  26544. var _this3 = this;
  26545. var uid = rawFile.uid;
  26546. var options = {
  26547. headers: this.headers,
  26548. withCredentials: this.withCredentials,
  26549. file: rawFile,
  26550. data: this.data,
  26551. filename: this.name,
  26552. action: this.action,
  26553. onProgress: function onProgress(e) {
  26554. _this3.onProgress(e, rawFile);
  26555. },
  26556. onSuccess: function onSuccess(res) {
  26557. _this3.onSuccess(res, rawFile);
  26558. delete _this3.reqs[uid];
  26559. },
  26560. onError: function onError(err) {
  26561. _this3.onError(err, rawFile);
  26562. delete _this3.reqs[uid];
  26563. }
  26564. };
  26565. var req = this.httpRequest(options);
  26566. this.reqs[uid] = req;
  26567. if (req && req.then) {
  26568. req.then(options.onSuccess, options.onError);
  26569. }
  26570. },
  26571. handleClick: function handleClick() {
  26572. if (!this.disabled) {
  26573. this.$refs.input.value = null;
  26574. this.$refs.input.click();
  26575. }
  26576. },
  26577. handleKeydown: function handleKeydown(e) {
  26578. if (e.target !== e.currentTarget) return;
  26579. if (e.keyCode === 13 || e.keyCode === 32) {
  26580. this.handleClick();
  26581. }
  26582. }
  26583. },
  26584. render: function render(h) {
  26585. var handleClick = this.handleClick,
  26586. drag = this.drag,
  26587. name = this.name,
  26588. handleChange = this.handleChange,
  26589. multiple = this.multiple,
  26590. accept = this.accept,
  26591. listType = this.listType,
  26592. uploadFiles = this.uploadFiles,
  26593. disabled = this.disabled,
  26594. handleKeydown = this.handleKeydown;
  26595. var data = {
  26596. class: {
  26597. 'el-upload': true
  26598. },
  26599. on: {
  26600. click: handleClick,
  26601. keydown: handleKeydown
  26602. }
  26603. };
  26604. data.class['el-upload--' + listType] = true;
  26605. return h(
  26606. 'div',
  26607. external_babel_helper_vue_jsx_merge_props_default()([data, {
  26608. attrs: { tabindex: '0' }
  26609. }]),
  26610. [drag ? h(
  26611. 'upload-dragger',
  26612. {
  26613. attrs: { disabled: disabled },
  26614. on: {
  26615. 'file': uploadFiles
  26616. }
  26617. },
  26618. [this.$slots.default]
  26619. ) : this.$slots.default, h('input', { 'class': 'el-upload__input', attrs: { type: 'file', name: name, multiple: multiple, accept: accept },
  26620. ref: 'input', on: {
  26621. 'change': handleChange
  26622. }
  26623. })]
  26624. );
  26625. }
  26626. });
  26627. // CONCATENATED MODULE: ./packages/upload/src/upload.vue?vue&type=script&lang=js&
  26628. /* harmony default export */ var src_uploadvue_type_script_lang_js_ = (uploadvue_type_script_lang_js_);
  26629. // CONCATENATED MODULE: ./packages/upload/src/upload.vue
  26630. var upload_render, upload_staticRenderFns
  26631. /* normalize component */
  26632. var upload_component = normalizeComponent(
  26633. src_uploadvue_type_script_lang_js_,
  26634. upload_render,
  26635. upload_staticRenderFns,
  26636. false,
  26637. null,
  26638. null,
  26639. null
  26640. )
  26641. /* hot reload */
  26642. if (false) { var upload_api; }
  26643. upload_component.options.__file = "packages/upload/src/upload.vue"
  26644. /* harmony default export */ var src_upload = (upload_component.exports);
  26645. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/upload/src/index.vue?vue&type=script&lang=js&
  26646. function srcvue_type_script_lang_js_noop() {}
  26647. /* harmony default export */ var srcvue_type_script_lang_js_ = ({
  26648. name: 'ElUpload',
  26649. mixins: [migrating_default.a],
  26650. components: {
  26651. ElProgress: progress_default.a,
  26652. UploadList: upload_list,
  26653. Upload: src_upload
  26654. },
  26655. provide: function provide() {
  26656. return {
  26657. uploader: this
  26658. };
  26659. },
  26660. inject: {
  26661. elForm: {
  26662. default: ''
  26663. }
  26664. },
  26665. props: {
  26666. action: {
  26667. type: String,
  26668. required: true
  26669. },
  26670. headers: {
  26671. type: Object,
  26672. default: function _default() {
  26673. return {};
  26674. }
  26675. },
  26676. data: Object,
  26677. multiple: Boolean,
  26678. name: {
  26679. type: String,
  26680. default: 'file'
  26681. },
  26682. drag: Boolean,
  26683. dragger: Boolean,
  26684. withCredentials: Boolean,
  26685. showFileList: {
  26686. type: Boolean,
  26687. default: true
  26688. },
  26689. accept: String,
  26690. type: {
  26691. type: String,
  26692. default: 'select'
  26693. },
  26694. beforeUpload: Function,
  26695. beforeRemove: Function,
  26696. onRemove: {
  26697. type: Function,
  26698. default: srcvue_type_script_lang_js_noop
  26699. },
  26700. onChange: {
  26701. type: Function,
  26702. default: srcvue_type_script_lang_js_noop
  26703. },
  26704. onPreview: {
  26705. type: Function
  26706. },
  26707. onSuccess: {
  26708. type: Function,
  26709. default: srcvue_type_script_lang_js_noop
  26710. },
  26711. onProgress: {
  26712. type: Function,
  26713. default: srcvue_type_script_lang_js_noop
  26714. },
  26715. onError: {
  26716. type: Function,
  26717. default: srcvue_type_script_lang_js_noop
  26718. },
  26719. fileList: {
  26720. type: Array,
  26721. default: function _default() {
  26722. return [];
  26723. }
  26724. },
  26725. autoUpload: {
  26726. type: Boolean,
  26727. default: true
  26728. },
  26729. listType: {
  26730. type: String,
  26731. default: 'text' // text,picture,picture-card
  26732. },
  26733. httpRequest: Function,
  26734. disabled: Boolean,
  26735. limit: Number,
  26736. onExceed: {
  26737. type: Function,
  26738. default: srcvue_type_script_lang_js_noop
  26739. }
  26740. },
  26741. data: function data() {
  26742. return {
  26743. uploadFiles: [],
  26744. dragOver: false,
  26745. draging: false,
  26746. tempIndex: 1
  26747. };
  26748. },
  26749. computed: {
  26750. uploadDisabled: function uploadDisabled() {
  26751. return this.disabled || (this.elForm || {}).disabled;
  26752. }
  26753. },
  26754. watch: {
  26755. listType: function listType(type) {
  26756. if (type === 'picture-card' || type === 'picture') {
  26757. this.uploadFiles = this.uploadFiles.map(function (file) {
  26758. if (!file.url && file.raw) {
  26759. try {
  26760. file.url = URL.createObjectURL(file.raw);
  26761. } catch (err) {
  26762. console.error('[Element Error][Upload]', err);
  26763. }
  26764. }
  26765. return file;
  26766. });
  26767. }
  26768. },
  26769. fileList: {
  26770. immediate: true,
  26771. handler: function handler(fileList) {
  26772. var _this = this;
  26773. this.uploadFiles = fileList.map(function (item) {
  26774. item.uid = item.uid || Date.now() + _this.tempIndex++;
  26775. item.status = item.status || 'success';
  26776. return item;
  26777. });
  26778. }
  26779. }
  26780. },
  26781. methods: {
  26782. handleStart: function handleStart(rawFile) {
  26783. rawFile.uid = Date.now() + this.tempIndex++;
  26784. var file = {
  26785. status: 'ready',
  26786. name: rawFile.name,
  26787. size: rawFile.size,
  26788. percentage: 0,
  26789. uid: rawFile.uid,
  26790. raw: rawFile
  26791. };
  26792. if (this.listType === 'picture-card' || this.listType === 'picture') {
  26793. try {
  26794. file.url = URL.createObjectURL(rawFile);
  26795. } catch (err) {
  26796. console.error('[Element Error][Upload]', err);
  26797. return;
  26798. }
  26799. }
  26800. this.uploadFiles.push(file);
  26801. this.onChange(file, this.uploadFiles);
  26802. },
  26803. handleProgress: function handleProgress(ev, rawFile) {
  26804. var file = this.getFile(rawFile);
  26805. this.onProgress(ev, file, this.uploadFiles);
  26806. file.status = 'uploading';
  26807. file.percentage = ev.percent || 0;
  26808. },
  26809. handleSuccess: function handleSuccess(res, rawFile) {
  26810. var file = this.getFile(rawFile);
  26811. if (file) {
  26812. file.status = 'success';
  26813. file.response = res;
  26814. this.onSuccess(res, file, this.uploadFiles);
  26815. this.onChange(file, this.uploadFiles);
  26816. }
  26817. },
  26818. handleError: function handleError(err, rawFile) {
  26819. var file = this.getFile(rawFile);
  26820. var fileList = this.uploadFiles;
  26821. file.status = 'fail';
  26822. fileList.splice(fileList.indexOf(file), 1);
  26823. this.onError(err, file, this.uploadFiles);
  26824. this.onChange(file, this.uploadFiles);
  26825. },
  26826. handleRemove: function handleRemove(file, raw) {
  26827. var _this2 = this;
  26828. if (raw) {
  26829. file = this.getFile(raw);
  26830. }
  26831. var doRemove = function doRemove() {
  26832. _this2.abort(file);
  26833. var fileList = _this2.uploadFiles;
  26834. fileList.splice(fileList.indexOf(file), 1);
  26835. _this2.onRemove(file, fileList);
  26836. };
  26837. if (!this.beforeRemove) {
  26838. doRemove();
  26839. } else if (typeof this.beforeRemove === 'function') {
  26840. var before = this.beforeRemove(file, this.uploadFiles);
  26841. if (before && before.then) {
  26842. before.then(function () {
  26843. doRemove();
  26844. }, srcvue_type_script_lang_js_noop);
  26845. } else if (before !== false) {
  26846. doRemove();
  26847. }
  26848. }
  26849. },
  26850. getFile: function getFile(rawFile) {
  26851. var fileList = this.uploadFiles;
  26852. var target = void 0;
  26853. fileList.every(function (item) {
  26854. target = rawFile.uid === item.uid ? item : null;
  26855. return !target;
  26856. });
  26857. return target;
  26858. },
  26859. abort: function abort(file) {
  26860. this.$refs['upload-inner'].abort(file);
  26861. },
  26862. clearFiles: function clearFiles() {
  26863. this.uploadFiles = [];
  26864. },
  26865. submit: function submit() {
  26866. var _this3 = this;
  26867. this.uploadFiles.filter(function (file) {
  26868. return file.status === 'ready';
  26869. }).forEach(function (file) {
  26870. _this3.$refs['upload-inner'].upload(file.raw);
  26871. });
  26872. },
  26873. getMigratingConfig: function getMigratingConfig() {
  26874. return {
  26875. props: {
  26876. 'default-file-list': 'default-file-list is renamed to file-list.',
  26877. 'show-upload-list': 'show-upload-list is renamed to show-file-list.',
  26878. 'thumbnail-mode': 'thumbnail-mode has been deprecated, you can implement the same effect according to this case: http://element.eleme.io/#/zh-CN/component/upload#yong-hu-tou-xiang-shang-chuan'
  26879. }
  26880. };
  26881. }
  26882. },
  26883. beforeDestroy: function beforeDestroy() {
  26884. this.uploadFiles.forEach(function (file) {
  26885. if (file.url && file.url.indexOf('blob:') === 0) {
  26886. URL.revokeObjectURL(file.url);
  26887. }
  26888. });
  26889. },
  26890. render: function render(h) {
  26891. var _this4 = this;
  26892. var uploadList = void 0;
  26893. if (this.showFileList) {
  26894. uploadList = h(
  26895. upload_list,
  26896. {
  26897. attrs: {
  26898. disabled: this.uploadDisabled,
  26899. listType: this.listType,
  26900. files: this.uploadFiles,
  26901. handlePreview: this.onPreview },
  26902. on: {
  26903. 'remove': this.handleRemove
  26904. }
  26905. },
  26906. [function (props) {
  26907. if (_this4.$scopedSlots.file) {
  26908. return _this4.$scopedSlots.file({
  26909. file: props.file
  26910. });
  26911. }
  26912. }]
  26913. );
  26914. }
  26915. var uploadData = {
  26916. props: {
  26917. type: this.type,
  26918. drag: this.drag,
  26919. action: this.action,
  26920. multiple: this.multiple,
  26921. 'before-upload': this.beforeUpload,
  26922. 'with-credentials': this.withCredentials,
  26923. headers: this.headers,
  26924. name: this.name,
  26925. data: this.data,
  26926. accept: this.accept,
  26927. fileList: this.uploadFiles,
  26928. autoUpload: this.autoUpload,
  26929. listType: this.listType,
  26930. disabled: this.uploadDisabled,
  26931. limit: this.limit,
  26932. 'on-exceed': this.onExceed,
  26933. 'on-start': this.handleStart,
  26934. 'on-progress': this.handleProgress,
  26935. 'on-success': this.handleSuccess,
  26936. 'on-error': this.handleError,
  26937. 'on-preview': this.onPreview,
  26938. 'on-remove': this.handleRemove,
  26939. 'http-request': this.httpRequest
  26940. },
  26941. ref: 'upload-inner'
  26942. };
  26943. var trigger = this.$slots.trigger || this.$slots.default;
  26944. var uploadComponent = h(
  26945. 'upload',
  26946. uploadData,
  26947. [trigger]
  26948. );
  26949. return h('div', [this.listType === 'picture-card' ? uploadList : '', this.$slots.trigger ? [uploadComponent, this.$slots.default] : uploadComponent, this.$slots.tip, this.listType !== 'picture-card' ? uploadList : '']);
  26950. }
  26951. });
  26952. // CONCATENATED MODULE: ./packages/upload/src/index.vue?vue&type=script&lang=js&
  26953. /* harmony default export */ var upload_srcvue_type_script_lang_js_ = (srcvue_type_script_lang_js_);
  26954. // CONCATENATED MODULE: ./packages/upload/src/index.vue
  26955. var src_render, src_staticRenderFns
  26956. /* normalize component */
  26957. var upload_src_component = normalizeComponent(
  26958. upload_srcvue_type_script_lang_js_,
  26959. src_render,
  26960. src_staticRenderFns,
  26961. false,
  26962. null,
  26963. null,
  26964. null
  26965. )
  26966. /* hot reload */
  26967. if (false) { var src_api; }
  26968. upload_src_component.options.__file = "packages/upload/src/index.vue"
  26969. /* harmony default export */ var upload_src = (upload_src_component.exports);
  26970. // CONCATENATED MODULE: ./packages/upload/index.js
  26971. /* istanbul ignore next */
  26972. upload_src.install = function (Vue) {
  26973. Vue.component(upload_src.name, upload_src);
  26974. };
  26975. /* harmony default export */ var packages_upload = (upload_src);
  26976. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/progress/src/progress.vue?vue&type=template&id=229ee406&
  26977. var progressvue_type_template_id_229ee406_render = function() {
  26978. var _vm = this
  26979. var _h = _vm.$createElement
  26980. var _c = _vm._self._c || _h
  26981. return _c(
  26982. "div",
  26983. {
  26984. staticClass: "el-progress",
  26985. class: [
  26986. "el-progress--" + _vm.type,
  26987. _vm.status ? "is-" + _vm.status : "",
  26988. {
  26989. "el-progress--without-text": !_vm.showText,
  26990. "el-progress--text-inside": _vm.textInside
  26991. }
  26992. ],
  26993. attrs: {
  26994. role: "progressbar",
  26995. "aria-valuenow": _vm.percentage,
  26996. "aria-valuemin": "0",
  26997. "aria-valuemax": "100"
  26998. }
  26999. },
  27000. [
  27001. _vm.type === "line"
  27002. ? _c("div", { staticClass: "el-progress-bar" }, [
  27003. _c(
  27004. "div",
  27005. {
  27006. staticClass: "el-progress-bar__outer",
  27007. style: {
  27008. height: _vm.strokeWidth + "px",
  27009. backgroundColor: _vm.defineBackColor
  27010. }
  27011. },
  27012. [
  27013. _c(
  27014. "div",
  27015. {
  27016. staticClass: "el-progress-bar__inner",
  27017. style: _vm.barStyle
  27018. },
  27019. [
  27020. _vm.showText && _vm.textInside
  27021. ? _c(
  27022. "div",
  27023. {
  27024. staticClass: "el-progress-bar__innerText",
  27025. style: { color: _vm.textColor }
  27026. },
  27027. [_vm._v(_vm._s(_vm.content))]
  27028. )
  27029. : _vm._e()
  27030. ]
  27031. )
  27032. ]
  27033. )
  27034. ])
  27035. : _c(
  27036. "div",
  27037. {
  27038. staticClass: "el-progress-circle",
  27039. style: { height: _vm.width + "px", width: _vm.width + "px" }
  27040. },
  27041. [
  27042. _c("svg", { attrs: { viewBox: "0 0 100 100" } }, [
  27043. _c("path", {
  27044. staticClass: "el-progress-circle__track",
  27045. style: _vm.trailPathStyle,
  27046. attrs: {
  27047. d: _vm.trackPath,
  27048. stroke: _vm.defineBackColor,
  27049. "stroke-width": _vm.relativeStrokeWidth,
  27050. fill: "none"
  27051. }
  27052. }),
  27053. _c("path", {
  27054. staticClass: "el-progress-circle__path",
  27055. style: _vm.circlePathStyle,
  27056. attrs: {
  27057. d: _vm.trackPath,
  27058. stroke: _vm.stroke,
  27059. fill: "none",
  27060. "stroke-linecap": _vm.strokeLinecap,
  27061. "stroke-width": _vm.percentage ? _vm.relativeStrokeWidth : 0
  27062. }
  27063. })
  27064. ])
  27065. ]
  27066. ),
  27067. _vm.showText && !_vm.textInside
  27068. ? _c(
  27069. "div",
  27070. {
  27071. staticClass: "el-progress__text",
  27072. style: {
  27073. fontSize: _vm.progressTextSize + "px",
  27074. color: _vm.textColor
  27075. }
  27076. },
  27077. [
  27078. !_vm.status
  27079. ? [_vm._v(_vm._s(_vm.content))]
  27080. : _c("i", { class: _vm.iconClass })
  27081. ],
  27082. 2
  27083. )
  27084. : _vm._e()
  27085. ]
  27086. )
  27087. }
  27088. var progressvue_type_template_id_229ee406_staticRenderFns = []
  27089. progressvue_type_template_id_229ee406_render._withStripped = true
  27090. // CONCATENATED MODULE: ./packages/progress/src/progress.vue?vue&type=template&id=229ee406&
  27091. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/progress/src/progress.vue?vue&type=script&lang=js&
  27092. //
  27093. //
  27094. //
  27095. //
  27096. //
  27097. //
  27098. //
  27099. //
  27100. //
  27101. //
  27102. //
  27103. //
  27104. //
  27105. //
  27106. //
  27107. //
  27108. //
  27109. //
  27110. //
  27111. //
  27112. //
  27113. //
  27114. //
  27115. //
  27116. //
  27117. //
  27118. //
  27119. //
  27120. //
  27121. //
  27122. //
  27123. //
  27124. //
  27125. //
  27126. //
  27127. //
  27128. //
  27129. //
  27130. //
  27131. //
  27132. //
  27133. //
  27134. //
  27135. //
  27136. //
  27137. //
  27138. //
  27139. //
  27140. //
  27141. //
  27142. //
  27143. //
  27144. /* harmony default export */ var progressvue_type_script_lang_js_ = ({
  27145. name: 'ElProgress',
  27146. props: {
  27147. type: {
  27148. type: String,
  27149. default: 'line',
  27150. validator: function validator(val) {
  27151. return ['line', 'circle', 'dashboard'].indexOf(val) > -1;
  27152. }
  27153. },
  27154. percentage: {
  27155. type: Number,
  27156. default: 0,
  27157. required: true,
  27158. validator: function validator(val) {
  27159. return val >= 0 && val <= 100;
  27160. }
  27161. },
  27162. status: {
  27163. type: String,
  27164. validator: function validator(val) {
  27165. return ['success', 'exception', 'warning'].indexOf(val) > -1;
  27166. }
  27167. },
  27168. strokeWidth: {
  27169. type: Number,
  27170. default: 6
  27171. },
  27172. strokeLinecap: {
  27173. type: String,
  27174. default: 'round'
  27175. },
  27176. textInside: {
  27177. type: Boolean,
  27178. default: false
  27179. },
  27180. width: {
  27181. type: Number,
  27182. default: 126
  27183. },
  27184. showText: {
  27185. type: Boolean,
  27186. default: true
  27187. },
  27188. color: {
  27189. type: [String, Array, Function],
  27190. default: ''
  27191. },
  27192. defineBackColor: {
  27193. type: [String, Array, Function],
  27194. default: '#ebeef5'
  27195. },
  27196. textColor: {
  27197. type: [String, Array, Function],
  27198. default: '#606266'
  27199. },
  27200. format: Function
  27201. },
  27202. computed: {
  27203. barStyle: function barStyle() {
  27204. var style = {};
  27205. style.width = this.percentage + '%';
  27206. style.backgroundColor = this.getCurrentColor(this.percentage);
  27207. return style;
  27208. },
  27209. relativeStrokeWidth: function relativeStrokeWidth() {
  27210. return (this.strokeWidth / this.width * 100).toFixed(1);
  27211. },
  27212. radius: function radius() {
  27213. if (this.type === 'circle' || this.type === 'dashboard') {
  27214. return parseInt(50 - parseFloat(this.relativeStrokeWidth) / 2, 10);
  27215. } else {
  27216. return 0;
  27217. }
  27218. },
  27219. trackPath: function trackPath() {
  27220. var radius = this.radius;
  27221. var isDashboard = this.type === 'dashboard';
  27222. return '\n M 50 50\n m 0 ' + (isDashboard ? '' : '-') + radius + '\n a ' + radius + ' ' + radius + ' 0 1 1 0 ' + (isDashboard ? '-' : '') + radius * 2 + '\n a ' + radius + ' ' + radius + ' 0 1 1 0 ' + (isDashboard ? '' : '-') + radius * 2 + '\n ';
  27223. },
  27224. perimeter: function perimeter() {
  27225. return 2 * Math.PI * this.radius;
  27226. },
  27227. rate: function rate() {
  27228. return this.type === 'dashboard' ? 0.75 : 1;
  27229. },
  27230. strokeDashoffset: function strokeDashoffset() {
  27231. var offset = -1 * this.perimeter * (1 - this.rate) / 2;
  27232. return offset + 'px';
  27233. },
  27234. trailPathStyle: function trailPathStyle() {
  27235. return {
  27236. strokeDasharray: this.perimeter * this.rate + 'px, ' + this.perimeter + 'px',
  27237. strokeDashoffset: this.strokeDashoffset
  27238. };
  27239. },
  27240. circlePathStyle: function circlePathStyle() {
  27241. return {
  27242. strokeDasharray: this.perimeter * this.rate * (this.percentage / 100) + 'px, ' + this.perimeter + 'px',
  27243. strokeDashoffset: this.strokeDashoffset,
  27244. transition: 'stroke-dasharray 0.6s ease 0s, stroke 0.6s ease'
  27245. };
  27246. },
  27247. stroke: function stroke() {
  27248. var ret = void 0;
  27249. if (this.color) {
  27250. ret = this.getCurrentColor(this.percentage);
  27251. } else {
  27252. switch (this.status) {
  27253. case 'success':
  27254. ret = '#13ce66';
  27255. break;
  27256. case 'exception':
  27257. ret = '#ff4949';
  27258. break;
  27259. case 'warning':
  27260. ret = '#e6a23c';
  27261. break;
  27262. default:
  27263. ret = '#20a0ff';
  27264. }
  27265. }
  27266. return ret;
  27267. },
  27268. iconClass: function iconClass() {
  27269. if (this.status === 'warning') {
  27270. return 'el-icon-warning';
  27271. }
  27272. if (this.type === 'line') {
  27273. return this.status === 'success' ? 'el-icon-circle-check' : 'el-icon-circle-close';
  27274. } else {
  27275. return this.status === 'success' ? 'el-icon-check' : 'el-icon-close';
  27276. }
  27277. },
  27278. progressTextSize: function progressTextSize() {
  27279. return this.type === 'line' ? 12 + this.strokeWidth * 0.4 : this.width * 0.111111 + 2;
  27280. },
  27281. content: function content() {
  27282. if (typeof this.format === 'function') {
  27283. return this.format(this.percentage) || '';
  27284. } else {
  27285. return this.percentage + '%';
  27286. }
  27287. }
  27288. },
  27289. methods: {
  27290. getCurrentColor: function getCurrentColor(percentage) {
  27291. if (typeof this.color === 'function') {
  27292. return this.color(percentage);
  27293. } else if (typeof this.color === 'string') {
  27294. return this.color;
  27295. } else {
  27296. return this.getLevelColor(percentage);
  27297. }
  27298. },
  27299. getLevelColor: function getLevelColor(percentage) {
  27300. var colorArray = this.getColorArray().sort(function (a, b) {
  27301. return a.percentage - b.percentage;
  27302. });
  27303. for (var i = 0; i < colorArray.length; i++) {
  27304. if (colorArray[i].percentage > percentage) {
  27305. return colorArray[i].color;
  27306. }
  27307. }
  27308. return colorArray[colorArray.length - 1].color;
  27309. },
  27310. getColorArray: function getColorArray() {
  27311. var color = this.color;
  27312. var span = 100 / color.length;
  27313. return color.map(function (seriesColor, index) {
  27314. if (typeof seriesColor === 'string') {
  27315. return {
  27316. color: seriesColor,
  27317. percentage: (index + 1) * span
  27318. };
  27319. }
  27320. return seriesColor;
  27321. });
  27322. }
  27323. }
  27324. });
  27325. // CONCATENATED MODULE: ./packages/progress/src/progress.vue?vue&type=script&lang=js&
  27326. /* harmony default export */ var src_progressvue_type_script_lang_js_ = (progressvue_type_script_lang_js_);
  27327. // CONCATENATED MODULE: ./packages/progress/src/progress.vue
  27328. /* normalize component */
  27329. var progress_component = normalizeComponent(
  27330. src_progressvue_type_script_lang_js_,
  27331. progressvue_type_template_id_229ee406_render,
  27332. progressvue_type_template_id_229ee406_staticRenderFns,
  27333. false,
  27334. null,
  27335. null,
  27336. null
  27337. )
  27338. /* hot reload */
  27339. if (false) { var progress_api; }
  27340. progress_component.options.__file = "packages/progress/src/progress.vue"
  27341. /* harmony default export */ var progress = (progress_component.exports);
  27342. // CONCATENATED MODULE: ./packages/progress/index.js
  27343. /* istanbul ignore next */
  27344. progress.install = function (Vue) {
  27345. Vue.component(progress.name, progress);
  27346. };
  27347. /* harmony default export */ var packages_progress = (progress);
  27348. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/spinner/src/spinner.vue?vue&type=template&id=697b8538&
  27349. var spinnervue_type_template_id_697b8538_render = function() {
  27350. var _vm = this
  27351. var _h = _vm.$createElement
  27352. var _c = _vm._self._c || _h
  27353. return _c("span", { staticClass: "el-spinner" }, [
  27354. _c(
  27355. "svg",
  27356. {
  27357. staticClass: "el-spinner-inner",
  27358. style: { width: _vm.radius / 2 + "px", height: _vm.radius / 2 + "px" },
  27359. attrs: { viewBox: "0 0 50 50" }
  27360. },
  27361. [
  27362. _c("circle", {
  27363. staticClass: "path",
  27364. attrs: {
  27365. cx: "25",
  27366. cy: "25",
  27367. r: "20",
  27368. fill: "none",
  27369. stroke: _vm.strokeColor,
  27370. "stroke-width": _vm.strokeWidth
  27371. }
  27372. })
  27373. ]
  27374. )
  27375. ])
  27376. }
  27377. var spinnervue_type_template_id_697b8538_staticRenderFns = []
  27378. spinnervue_type_template_id_697b8538_render._withStripped = true
  27379. // CONCATENATED MODULE: ./packages/spinner/src/spinner.vue?vue&type=template&id=697b8538&
  27380. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/spinner/src/spinner.vue?vue&type=script&lang=js&
  27381. //
  27382. //
  27383. //
  27384. //
  27385. //
  27386. //
  27387. //
  27388. /* harmony default export */ var spinnervue_type_script_lang_js_ = ({
  27389. name: 'ElSpinner',
  27390. props: {
  27391. type: String,
  27392. radius: {
  27393. type: Number,
  27394. default: 100
  27395. },
  27396. strokeWidth: {
  27397. type: Number,
  27398. default: 5
  27399. },
  27400. strokeColor: {
  27401. type: String,
  27402. default: '#efefef'
  27403. }
  27404. }
  27405. });
  27406. // CONCATENATED MODULE: ./packages/spinner/src/spinner.vue?vue&type=script&lang=js&
  27407. /* harmony default export */ var src_spinnervue_type_script_lang_js_ = (spinnervue_type_script_lang_js_);
  27408. // CONCATENATED MODULE: ./packages/spinner/src/spinner.vue
  27409. /* normalize component */
  27410. var spinner_component = normalizeComponent(
  27411. src_spinnervue_type_script_lang_js_,
  27412. spinnervue_type_template_id_697b8538_render,
  27413. spinnervue_type_template_id_697b8538_staticRenderFns,
  27414. false,
  27415. null,
  27416. null,
  27417. null
  27418. )
  27419. /* hot reload */
  27420. if (false) { var spinner_api; }
  27421. spinner_component.options.__file = "packages/spinner/src/spinner.vue"
  27422. /* harmony default export */ var spinner = (spinner_component.exports);
  27423. // CONCATENATED MODULE: ./packages/spinner/index.js
  27424. /* istanbul ignore next */
  27425. spinner.install = function (Vue) {
  27426. Vue.component(spinner.name, spinner);
  27427. };
  27428. /* harmony default export */ var packages_spinner = (spinner);
  27429. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/message/src/main.vue?vue&type=template&id=455b9f60&
  27430. var mainvue_type_template_id_455b9f60_render = function() {
  27431. var _vm = this
  27432. var _h = _vm.$createElement
  27433. var _c = _vm._self._c || _h
  27434. return _c(
  27435. "transition",
  27436. {
  27437. attrs: { name: "el-message-fade" },
  27438. on: { "after-leave": _vm.handleAfterLeave }
  27439. },
  27440. [
  27441. _c(
  27442. "div",
  27443. {
  27444. directives: [
  27445. {
  27446. name: "show",
  27447. rawName: "v-show",
  27448. value: _vm.visible,
  27449. expression: "visible"
  27450. }
  27451. ],
  27452. class: [
  27453. "el-message",
  27454. _vm.type && !_vm.iconClass ? "el-message--" + _vm.type : "",
  27455. _vm.center ? "is-center" : "",
  27456. _vm.showClose ? "is-closable" : "",
  27457. _vm.customClass
  27458. ],
  27459. style: _vm.positionStyle,
  27460. attrs: { role: "alert" },
  27461. on: { mouseenter: _vm.clearTimer, mouseleave: _vm.startTimer }
  27462. },
  27463. [
  27464. _vm.iconClass
  27465. ? _c("i", { class: _vm.iconClass })
  27466. : _c("i", { class: _vm.typeClass }),
  27467. _vm._t("default", [
  27468. !_vm.dangerouslyUseHTMLString
  27469. ? _c("p", { staticClass: "el-message__content" }, [
  27470. _vm._v(_vm._s(_vm.message))
  27471. ])
  27472. : _c("p", {
  27473. staticClass: "el-message__content",
  27474. domProps: { innerHTML: _vm._s(_vm.message) }
  27475. })
  27476. ]),
  27477. _vm.showClose
  27478. ? _c("i", {
  27479. staticClass: "el-message__closeBtn el-icon-close",
  27480. on: { click: _vm.close }
  27481. })
  27482. : _vm._e()
  27483. ],
  27484. 2
  27485. )
  27486. ]
  27487. )
  27488. }
  27489. var mainvue_type_template_id_455b9f60_staticRenderFns = []
  27490. mainvue_type_template_id_455b9f60_render._withStripped = true
  27491. // CONCATENATED MODULE: ./packages/message/src/main.vue?vue&type=template&id=455b9f60&
  27492. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/message/src/main.vue?vue&type=script&lang=js&
  27493. //
  27494. //
  27495. //
  27496. //
  27497. //
  27498. //
  27499. //
  27500. //
  27501. //
  27502. //
  27503. //
  27504. //
  27505. //
  27506. //
  27507. //
  27508. //
  27509. //
  27510. //
  27511. //
  27512. //
  27513. //
  27514. //
  27515. //
  27516. //
  27517. //
  27518. //
  27519. var src_mainvue_type_script_lang_js_typeMap = {
  27520. success: 'success',
  27521. info: 'info',
  27522. warning: 'warning',
  27523. error: 'error'
  27524. };
  27525. /* harmony default export */ var message_src_mainvue_type_script_lang_js_ = ({
  27526. data: function data() {
  27527. return {
  27528. visible: false,
  27529. message: '',
  27530. duration: 3000,
  27531. type: 'info',
  27532. iconClass: '',
  27533. customClass: '',
  27534. onClose: null,
  27535. showClose: false,
  27536. closed: false,
  27537. verticalOffset: 20,
  27538. timer: null,
  27539. dangerouslyUseHTMLString: false,
  27540. center: false
  27541. };
  27542. },
  27543. computed: {
  27544. typeClass: function typeClass() {
  27545. return this.type && !this.iconClass ? 'el-message__icon el-icon-' + src_mainvue_type_script_lang_js_typeMap[this.type] : '';
  27546. },
  27547. positionStyle: function positionStyle() {
  27548. return {
  27549. 'top': this.verticalOffset + 'px'
  27550. };
  27551. }
  27552. },
  27553. watch: {
  27554. closed: function closed(newVal) {
  27555. if (newVal) {
  27556. this.visible = false;
  27557. }
  27558. }
  27559. },
  27560. methods: {
  27561. handleAfterLeave: function handleAfterLeave() {
  27562. this.$destroy(true);
  27563. this.$el.parentNode.removeChild(this.$el);
  27564. },
  27565. close: function close() {
  27566. this.closed = true;
  27567. if (typeof this.onClose === 'function') {
  27568. this.onClose(this);
  27569. }
  27570. },
  27571. clearTimer: function clearTimer() {
  27572. clearTimeout(this.timer);
  27573. },
  27574. startTimer: function startTimer() {
  27575. var _this = this;
  27576. if (this.duration > 0) {
  27577. this.timer = setTimeout(function () {
  27578. if (!_this.closed) {
  27579. _this.close();
  27580. }
  27581. }, this.duration);
  27582. }
  27583. },
  27584. keydown: function keydown(e) {
  27585. if (e.keyCode === 27) {
  27586. // esc关闭消息
  27587. if (!this.closed) {
  27588. this.close();
  27589. }
  27590. }
  27591. }
  27592. },
  27593. mounted: function mounted() {
  27594. this.startTimer();
  27595. document.addEventListener('keydown', this.keydown);
  27596. },
  27597. beforeDestroy: function beforeDestroy() {
  27598. document.removeEventListener('keydown', this.keydown);
  27599. }
  27600. });
  27601. // CONCATENATED MODULE: ./packages/message/src/main.vue?vue&type=script&lang=js&
  27602. /* harmony default export */ var packages_message_src_mainvue_type_script_lang_js_ = (message_src_mainvue_type_script_lang_js_);
  27603. // CONCATENATED MODULE: ./packages/message/src/main.vue
  27604. /* normalize component */
  27605. var message_src_main_component = normalizeComponent(
  27606. packages_message_src_mainvue_type_script_lang_js_,
  27607. mainvue_type_template_id_455b9f60_render,
  27608. mainvue_type_template_id_455b9f60_staticRenderFns,
  27609. false,
  27610. null,
  27611. null,
  27612. null
  27613. )
  27614. /* hot reload */
  27615. if (false) { var message_src_main_api; }
  27616. message_src_main_component.options.__file = "packages/message/src/main.vue"
  27617. /* harmony default export */ var message_src_main = (message_src_main_component.exports);
  27618. // EXTERNAL MODULE: external "element-ui/lib/utils/types"
  27619. var types_ = __webpack_require__(16);
  27620. // CONCATENATED MODULE: ./packages/message/src/main.js
  27621. var main_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; };
  27622. var MessageConstructor = external_vue_default.a.extend(message_src_main);
  27623. var message_src_main_instance = void 0;
  27624. var main_instances = [];
  27625. var main_seed = 1;
  27626. var main_Message = function Message(options) {
  27627. if (external_vue_default.a.prototype.$isServer) return;
  27628. options = options || {};
  27629. if (typeof options === 'string') {
  27630. options = {
  27631. message: options
  27632. };
  27633. }
  27634. var userOnClose = options.onClose;
  27635. var id = 'message_' + main_seed++;
  27636. options.onClose = function () {
  27637. Message.close(id, userOnClose);
  27638. };
  27639. message_src_main_instance = new MessageConstructor({
  27640. data: options
  27641. });
  27642. message_src_main_instance.id = id;
  27643. if (Object(vdom_["isVNode"])(message_src_main_instance.message)) {
  27644. message_src_main_instance.$slots.default = [message_src_main_instance.message];
  27645. message_src_main_instance.message = null;
  27646. }
  27647. message_src_main_instance.$mount();
  27648. document.body.appendChild(message_src_main_instance.$el);
  27649. var verticalOffset = options.offset || 20;
  27650. main_instances.forEach(function (item) {
  27651. verticalOffset += item.$el.offsetHeight + 16;
  27652. });
  27653. message_src_main_instance.verticalOffset = verticalOffset;
  27654. message_src_main_instance.visible = true;
  27655. message_src_main_instance.$el.style.zIndex = popup_["PopupManager"].nextZIndex();
  27656. main_instances.push(message_src_main_instance);
  27657. return message_src_main_instance;
  27658. };
  27659. ['success', 'warning', 'info', 'error'].forEach(function (type) {
  27660. main_Message[type] = function (options) {
  27661. if (Object(types_["isObject"])(options) && !Object(vdom_["isVNode"])(options)) {
  27662. return main_Message(main_extends({}, options, {
  27663. type: type
  27664. }));
  27665. }
  27666. return main_Message({
  27667. type: type,
  27668. message: options
  27669. });
  27670. };
  27671. });
  27672. main_Message.close = function (id, userOnClose) {
  27673. var len = main_instances.length;
  27674. var index = -1;
  27675. var removedHeight = void 0;
  27676. for (var i = 0; i < len; i++) {
  27677. if (id === main_instances[i].id) {
  27678. removedHeight = main_instances[i].$el.offsetHeight;
  27679. index = i;
  27680. if (typeof userOnClose === 'function') {
  27681. userOnClose(main_instances[i]);
  27682. }
  27683. main_instances.splice(i, 1);
  27684. break;
  27685. }
  27686. }
  27687. if (len <= 1 || index === -1 || index > main_instances.length - 1) return;
  27688. for (var _i = index; _i < len - 1; _i++) {
  27689. var dom = main_instances[_i].$el;
  27690. dom.style['top'] = parseInt(dom.style['top'], 10) - removedHeight - 16 + 'px';
  27691. }
  27692. };
  27693. main_Message.closeAll = function () {
  27694. for (var i = main_instances.length - 1; i >= 0; i--) {
  27695. main_instances[i].close();
  27696. }
  27697. };
  27698. /* harmony default export */ var packages_message_src_main = (main_Message);
  27699. // CONCATENATED MODULE: ./packages/message/index.js
  27700. /* harmony default export */ var packages_message = (packages_message_src_main);
  27701. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/badge/src/main.vue?vue&type=template&id=7ccb6598&
  27702. var mainvue_type_template_id_7ccb6598_render = function() {
  27703. var _vm = this
  27704. var _h = _vm.$createElement
  27705. var _c = _vm._self._c || _h
  27706. return _c(
  27707. "div",
  27708. { staticClass: "el-badge" },
  27709. [
  27710. _vm._t("default"),
  27711. _c("transition", { attrs: { name: "el-zoom-in-center" } }, [
  27712. _c("sup", {
  27713. directives: [
  27714. {
  27715. name: "show",
  27716. rawName: "v-show",
  27717. value:
  27718. !_vm.hidden && (_vm.content || _vm.content === 0 || _vm.isDot),
  27719. expression: "!hidden && (content || content === 0 || isDot)"
  27720. }
  27721. ],
  27722. staticClass: "el-badge__content",
  27723. class: [
  27724. _vm.type ? "el-badge__content--" + _vm.type : null,
  27725. {
  27726. "is-fixed": _vm.$slots.default,
  27727. "is-dot": _vm.isDot
  27728. }
  27729. ],
  27730. domProps: { textContent: _vm._s(_vm.content) }
  27731. })
  27732. ])
  27733. ],
  27734. 2
  27735. )
  27736. }
  27737. var mainvue_type_template_id_7ccb6598_staticRenderFns = []
  27738. mainvue_type_template_id_7ccb6598_render._withStripped = true
  27739. // CONCATENATED MODULE: ./packages/badge/src/main.vue?vue&type=template&id=7ccb6598&
  27740. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/badge/src/main.vue?vue&type=script&lang=js&
  27741. //
  27742. //
  27743. //
  27744. //
  27745. //
  27746. //
  27747. //
  27748. //
  27749. //
  27750. //
  27751. //
  27752. //
  27753. //
  27754. //
  27755. //
  27756. //
  27757. //
  27758. //
  27759. //
  27760. //
  27761. /* harmony default export */ var badge_src_mainvue_type_script_lang_js_ = ({
  27762. name: 'ElBadge',
  27763. props: {
  27764. value: [String, Number],
  27765. max: Number,
  27766. isDot: Boolean,
  27767. hidden: Boolean,
  27768. type: {
  27769. type: String,
  27770. validator: function validator(val) {
  27771. return ['primary', 'success', 'warning', 'info', 'danger'].indexOf(val) > -1;
  27772. }
  27773. }
  27774. },
  27775. computed: {
  27776. content: function content() {
  27777. if (this.isDot) return;
  27778. var value = this.value;
  27779. var max = this.max;
  27780. if (typeof value === 'number' && typeof max === 'number') {
  27781. return max < value ? max + '+' : value;
  27782. }
  27783. return value;
  27784. }
  27785. }
  27786. });
  27787. // CONCATENATED MODULE: ./packages/badge/src/main.vue?vue&type=script&lang=js&
  27788. /* harmony default export */ var packages_badge_src_mainvue_type_script_lang_js_ = (badge_src_mainvue_type_script_lang_js_);
  27789. // CONCATENATED MODULE: ./packages/badge/src/main.vue
  27790. /* normalize component */
  27791. var badge_src_main_component = normalizeComponent(
  27792. packages_badge_src_mainvue_type_script_lang_js_,
  27793. mainvue_type_template_id_7ccb6598_render,
  27794. mainvue_type_template_id_7ccb6598_staticRenderFns,
  27795. false,
  27796. null,
  27797. null,
  27798. null
  27799. )
  27800. /* hot reload */
  27801. if (false) { var badge_src_main_api; }
  27802. badge_src_main_component.options.__file = "packages/badge/src/main.vue"
  27803. /* harmony default export */ var badge_src_main = (badge_src_main_component.exports);
  27804. // CONCATENATED MODULE: ./packages/badge/index.js
  27805. /* istanbul ignore next */
  27806. badge_src_main.install = function (Vue) {
  27807. Vue.component(badge_src_main.name, badge_src_main);
  27808. };
  27809. /* harmony default export */ var badge = (badge_src_main);
  27810. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/card/src/main.vue?vue&type=template&id=59a4a40f&
  27811. var mainvue_type_template_id_59a4a40f_render = function() {
  27812. var _vm = this
  27813. var _h = _vm.$createElement
  27814. var _c = _vm._self._c || _h
  27815. return _c(
  27816. "div",
  27817. {
  27818. staticClass: "el-card",
  27819. class: _vm.shadow ? "is-" + _vm.shadow + "-shadow" : "is-always-shadow"
  27820. },
  27821. [
  27822. _vm.$slots.header || _vm.header
  27823. ? _c(
  27824. "div",
  27825. { staticClass: "el-card__header" },
  27826. [_vm._t("header", [_vm._v(_vm._s(_vm.header))])],
  27827. 2
  27828. )
  27829. : _vm._e(),
  27830. _c(
  27831. "div",
  27832. { staticClass: "el-card__body", style: _vm.bodyStyle },
  27833. [_vm._t("default")],
  27834. 2
  27835. )
  27836. ]
  27837. )
  27838. }
  27839. var mainvue_type_template_id_59a4a40f_staticRenderFns = []
  27840. mainvue_type_template_id_59a4a40f_render._withStripped = true
  27841. // CONCATENATED MODULE: ./packages/card/src/main.vue?vue&type=template&id=59a4a40f&
  27842. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/card/src/main.vue?vue&type=script&lang=js&
  27843. //
  27844. //
  27845. //
  27846. //
  27847. //
  27848. //
  27849. //
  27850. //
  27851. //
  27852. //
  27853. //
  27854. /* harmony default export */ var card_src_mainvue_type_script_lang_js_ = ({
  27855. name: 'ElCard',
  27856. props: {
  27857. header: {},
  27858. bodyStyle: {},
  27859. shadow: {
  27860. type: String
  27861. }
  27862. }
  27863. });
  27864. // CONCATENATED MODULE: ./packages/card/src/main.vue?vue&type=script&lang=js&
  27865. /* harmony default export */ var packages_card_src_mainvue_type_script_lang_js_ = (card_src_mainvue_type_script_lang_js_);
  27866. // CONCATENATED MODULE: ./packages/card/src/main.vue
  27867. /* normalize component */
  27868. var card_src_main_component = normalizeComponent(
  27869. packages_card_src_mainvue_type_script_lang_js_,
  27870. mainvue_type_template_id_59a4a40f_render,
  27871. mainvue_type_template_id_59a4a40f_staticRenderFns,
  27872. false,
  27873. null,
  27874. null,
  27875. null
  27876. )
  27877. /* hot reload */
  27878. if (false) { var card_src_main_api; }
  27879. card_src_main_component.options.__file = "packages/card/src/main.vue"
  27880. /* harmony default export */ var card_src_main = (card_src_main_component.exports);
  27881. // CONCATENATED MODULE: ./packages/card/index.js
  27882. /* istanbul ignore next */
  27883. card_src_main.install = function (Vue) {
  27884. Vue.component(card_src_main.name, card_src_main);
  27885. };
  27886. /* harmony default export */ var card = (card_src_main);
  27887. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/rate/src/main.vue?vue&type=template&id=ada57782&
  27888. var mainvue_type_template_id_ada57782_render = function() {
  27889. var _vm = this
  27890. var _h = _vm.$createElement
  27891. var _c = _vm._self._c || _h
  27892. return _c(
  27893. "div",
  27894. {
  27895. staticClass: "el-rate",
  27896. attrs: {
  27897. role: "slider",
  27898. "aria-valuenow": _vm.currentValue,
  27899. "aria-valuetext": _vm.text,
  27900. "aria-valuemin": "0",
  27901. "aria-valuemax": _vm.max,
  27902. tabindex: "0"
  27903. },
  27904. on: { keydown: _vm.handleKey }
  27905. },
  27906. [
  27907. _vm._l(_vm.max, function(item, key) {
  27908. return _c(
  27909. "span",
  27910. {
  27911. key: key,
  27912. staticClass: "el-rate__item",
  27913. style: { cursor: _vm.rateDisabled ? "auto" : "pointer" },
  27914. on: {
  27915. mousemove: function($event) {
  27916. _vm.setCurrentValue(item, $event)
  27917. },
  27918. mouseleave: _vm.resetCurrentValue,
  27919. click: function($event) {
  27920. _vm.selectValue(item)
  27921. }
  27922. }
  27923. },
  27924. [
  27925. _c(
  27926. "i",
  27927. {
  27928. staticClass: "el-rate__icon",
  27929. class: [
  27930. _vm.classes[item - 1],
  27931. { hover: _vm.hoverIndex === item }
  27932. ],
  27933. style: _vm.getIconStyle(item)
  27934. },
  27935. [
  27936. _vm.showDecimalIcon(item)
  27937. ? _c("i", {
  27938. staticClass: "el-rate__decimal",
  27939. class: _vm.decimalIconClass,
  27940. style: _vm.decimalStyle
  27941. })
  27942. : _vm._e()
  27943. ]
  27944. )
  27945. ]
  27946. )
  27947. }),
  27948. _vm.showText || _vm.showScore
  27949. ? _c(
  27950. "span",
  27951. { staticClass: "el-rate__text", style: { color: _vm.textColor } },
  27952. [_vm._v(_vm._s(_vm.text))]
  27953. )
  27954. : _vm._e()
  27955. ],
  27956. 2
  27957. )
  27958. }
  27959. var mainvue_type_template_id_ada57782_staticRenderFns = []
  27960. mainvue_type_template_id_ada57782_render._withStripped = true
  27961. // CONCATENATED MODULE: ./packages/rate/src/main.vue?vue&type=template&id=ada57782&
  27962. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/rate/src/main.vue?vue&type=script&lang=js&
  27963. //
  27964. //
  27965. //
  27966. //
  27967. //
  27968. //
  27969. //
  27970. //
  27971. //
  27972. //
  27973. //
  27974. //
  27975. //
  27976. //
  27977. //
  27978. //
  27979. //
  27980. //
  27981. //
  27982. //
  27983. //
  27984. //
  27985. //
  27986. //
  27987. //
  27988. //
  27989. //
  27990. //
  27991. //
  27992. //
  27993. //
  27994. //
  27995. //
  27996. //
  27997. /* harmony default export */ var rate_src_mainvue_type_script_lang_js_ = ({
  27998. name: 'ElRate',
  27999. mixins: [migrating_default.a],
  28000. inject: {
  28001. elForm: {
  28002. default: ''
  28003. }
  28004. },
  28005. data: function data() {
  28006. return {
  28007. pointerAtLeftHalf: true,
  28008. currentValue: this.value,
  28009. hoverIndex: -1
  28010. };
  28011. },
  28012. props: {
  28013. value: {
  28014. type: Number,
  28015. default: 0
  28016. },
  28017. lowThreshold: {
  28018. type: Number,
  28019. default: 2
  28020. },
  28021. highThreshold: {
  28022. type: Number,
  28023. default: 4
  28024. },
  28025. max: {
  28026. type: Number,
  28027. default: 5
  28028. },
  28029. colors: {
  28030. type: [Array, Object],
  28031. default: function _default() {
  28032. return ['#F7BA2A', '#F7BA2A', '#F7BA2A'];
  28033. }
  28034. },
  28035. voidColor: {
  28036. type: String,
  28037. default: '#C6D1DE'
  28038. },
  28039. disabledVoidColor: {
  28040. type: String,
  28041. default: '#EFF2F7'
  28042. },
  28043. iconClasses: {
  28044. type: [Array, Object],
  28045. default: function _default() {
  28046. return ['el-icon-star-on', 'el-icon-star-on', 'el-icon-star-on'];
  28047. }
  28048. },
  28049. voidIconClass: {
  28050. type: String,
  28051. default: 'el-icon-star-off'
  28052. },
  28053. disabledVoidIconClass: {
  28054. type: String,
  28055. default: 'el-icon-star-on'
  28056. },
  28057. disabled: {
  28058. type: Boolean,
  28059. default: false
  28060. },
  28061. allowHalf: {
  28062. type: Boolean,
  28063. default: false
  28064. },
  28065. showText: {
  28066. type: Boolean,
  28067. default: false
  28068. },
  28069. showScore: {
  28070. type: Boolean,
  28071. default: false
  28072. },
  28073. textColor: {
  28074. type: String,
  28075. default: '#1f2d3d'
  28076. },
  28077. texts: {
  28078. type: Array,
  28079. default: function _default() {
  28080. return ['极差', '失望', '一般', '满意', '惊喜'];
  28081. }
  28082. },
  28083. scoreTemplate: {
  28084. type: String,
  28085. default: '{value}'
  28086. }
  28087. },
  28088. computed: {
  28089. text: function text() {
  28090. var result = '';
  28091. if (this.showScore) {
  28092. result = this.scoreTemplate.replace(/\{\s*value\s*\}/, this.rateDisabled ? this.value : this.currentValue);
  28093. } else if (this.showText) {
  28094. result = this.texts[Math.ceil(this.currentValue) - 1];
  28095. }
  28096. return result;
  28097. },
  28098. decimalStyle: function decimalStyle() {
  28099. var width = '';
  28100. if (this.rateDisabled) {
  28101. width = this.valueDecimal + '%';
  28102. } else if (this.allowHalf) {
  28103. width = '50%';
  28104. }
  28105. return {
  28106. color: this.activeColor,
  28107. width: width
  28108. };
  28109. },
  28110. valueDecimal: function valueDecimal() {
  28111. return this.value * 100 - Math.floor(this.value) * 100;
  28112. },
  28113. classMap: function classMap() {
  28114. var _ref;
  28115. return Array.isArray(this.iconClasses) ? (_ref = {}, _ref[this.lowThreshold] = this.iconClasses[0], _ref[this.highThreshold] = { value: this.iconClasses[1], excluded: true }, _ref[this.max] = this.iconClasses[2], _ref) : this.iconClasses;
  28116. },
  28117. decimalIconClass: function decimalIconClass() {
  28118. return this.getValueFromMap(this.value, this.classMap);
  28119. },
  28120. voidClass: function voidClass() {
  28121. return this.rateDisabled ? this.disabledVoidIconClass : this.voidIconClass;
  28122. },
  28123. activeClass: function activeClass() {
  28124. return this.getValueFromMap(this.currentValue, this.classMap);
  28125. },
  28126. colorMap: function colorMap() {
  28127. var _ref2;
  28128. return Array.isArray(this.colors) ? (_ref2 = {}, _ref2[this.lowThreshold] = this.colors[0], _ref2[this.highThreshold] = { value: this.colors[1], excluded: true }, _ref2[this.max] = this.colors[2], _ref2) : this.colors;
  28129. },
  28130. activeColor: function activeColor() {
  28131. return this.getValueFromMap(this.currentValue, this.colorMap);
  28132. },
  28133. classes: function classes() {
  28134. var result = [];
  28135. var i = 0;
  28136. var threshold = this.currentValue;
  28137. if (this.allowHalf && this.currentValue !== Math.floor(this.currentValue)) {
  28138. threshold--;
  28139. }
  28140. for (; i < threshold; i++) {
  28141. result.push(this.activeClass);
  28142. }
  28143. for (; i < this.max; i++) {
  28144. result.push(this.voidClass);
  28145. }
  28146. return result;
  28147. },
  28148. rateDisabled: function rateDisabled() {
  28149. return this.disabled || (this.elForm || {}).disabled;
  28150. }
  28151. },
  28152. watch: {
  28153. value: function value(val) {
  28154. this.currentValue = val;
  28155. this.pointerAtLeftHalf = this.value !== Math.floor(this.value);
  28156. }
  28157. },
  28158. methods: {
  28159. getMigratingConfig: function getMigratingConfig() {
  28160. return {
  28161. props: {
  28162. 'text-template': 'text-template is renamed to score-template.'
  28163. }
  28164. };
  28165. },
  28166. getValueFromMap: function getValueFromMap(value, map) {
  28167. var matchedKeys = Object.keys(map).filter(function (key) {
  28168. var val = map[key];
  28169. var excluded = Object(types_["isObject"])(val) ? val.excluded : false;
  28170. return excluded ? value < key : value <= key;
  28171. }).sort(function (a, b) {
  28172. return a - b;
  28173. });
  28174. var matchedValue = map[matchedKeys[0]];
  28175. return Object(types_["isObject"])(matchedValue) ? matchedValue.value : matchedValue || '';
  28176. },
  28177. showDecimalIcon: function showDecimalIcon(item) {
  28178. var showWhenDisabled = this.rateDisabled && this.valueDecimal > 0 && item - 1 < this.value && item > this.value;
  28179. /* istanbul ignore next */
  28180. var showWhenAllowHalf = this.allowHalf && this.pointerAtLeftHalf && item - 0.5 <= this.currentValue && item > this.currentValue;
  28181. return showWhenDisabled || showWhenAllowHalf;
  28182. },
  28183. getIconStyle: function getIconStyle(item) {
  28184. var voidColor = this.rateDisabled ? this.disabledVoidColor : this.voidColor;
  28185. return {
  28186. color: item <= this.currentValue ? this.activeColor : voidColor
  28187. };
  28188. },
  28189. selectValue: function selectValue(value) {
  28190. if (this.rateDisabled) {
  28191. return;
  28192. }
  28193. if (this.allowHalf && this.pointerAtLeftHalf) {
  28194. this.$emit('input', this.currentValue);
  28195. this.$emit('change', this.currentValue);
  28196. } else {
  28197. this.$emit('input', value);
  28198. this.$emit('change', value);
  28199. }
  28200. },
  28201. handleKey: function handleKey(e) {
  28202. if (this.rateDisabled) {
  28203. return;
  28204. }
  28205. var currentValue = this.currentValue;
  28206. var keyCode = e.keyCode;
  28207. if (keyCode === 38 || keyCode === 39) {
  28208. // left / down
  28209. if (this.allowHalf) {
  28210. currentValue += 0.5;
  28211. } else {
  28212. currentValue += 1;
  28213. }
  28214. e.stopPropagation();
  28215. e.preventDefault();
  28216. } else if (keyCode === 37 || keyCode === 40) {
  28217. if (this.allowHalf) {
  28218. currentValue -= 0.5;
  28219. } else {
  28220. currentValue -= 1;
  28221. }
  28222. e.stopPropagation();
  28223. e.preventDefault();
  28224. }
  28225. currentValue = currentValue < 0 ? 0 : currentValue;
  28226. currentValue = currentValue > this.max ? this.max : currentValue;
  28227. this.$emit('input', currentValue);
  28228. this.$emit('change', currentValue);
  28229. },
  28230. setCurrentValue: function setCurrentValue(value, event) {
  28231. if (this.rateDisabled) {
  28232. return;
  28233. }
  28234. /* istanbul ignore if */
  28235. if (this.allowHalf) {
  28236. var target = event.target;
  28237. if (Object(dom_["hasClass"])(target, 'el-rate__item')) {
  28238. target = target.querySelector('.el-rate__icon');
  28239. }
  28240. if (Object(dom_["hasClass"])(target, 'el-rate__decimal')) {
  28241. target = target.parentNode;
  28242. }
  28243. this.pointerAtLeftHalf = event.offsetX * 2 <= target.clientWidth;
  28244. this.currentValue = this.pointerAtLeftHalf ? value - 0.5 : value;
  28245. } else {
  28246. this.currentValue = value;
  28247. }
  28248. this.hoverIndex = value;
  28249. },
  28250. resetCurrentValue: function resetCurrentValue() {
  28251. if (this.rateDisabled) {
  28252. return;
  28253. }
  28254. if (this.allowHalf) {
  28255. this.pointerAtLeftHalf = this.value !== Math.floor(this.value);
  28256. }
  28257. this.currentValue = this.value;
  28258. this.hoverIndex = -1;
  28259. }
  28260. },
  28261. created: function created() {
  28262. if (!this.value) {
  28263. this.$emit('input', 0);
  28264. }
  28265. }
  28266. });
  28267. // CONCATENATED MODULE: ./packages/rate/src/main.vue?vue&type=script&lang=js&
  28268. /* harmony default export */ var packages_rate_src_mainvue_type_script_lang_js_ = (rate_src_mainvue_type_script_lang_js_);
  28269. // CONCATENATED MODULE: ./packages/rate/src/main.vue
  28270. /* normalize component */
  28271. var rate_src_main_component = normalizeComponent(
  28272. packages_rate_src_mainvue_type_script_lang_js_,
  28273. mainvue_type_template_id_ada57782_render,
  28274. mainvue_type_template_id_ada57782_staticRenderFns,
  28275. false,
  28276. null,
  28277. null,
  28278. null
  28279. )
  28280. /* hot reload */
  28281. if (false) { var rate_src_main_api; }
  28282. rate_src_main_component.options.__file = "packages/rate/src/main.vue"
  28283. /* harmony default export */ var rate_src_main = (rate_src_main_component.exports);
  28284. // CONCATENATED MODULE: ./packages/rate/index.js
  28285. /* istanbul ignore next */
  28286. rate_src_main.install = function (Vue) {
  28287. Vue.component(rate_src_main.name, rate_src_main);
  28288. };
  28289. /* harmony default export */ var packages_rate = (rate_src_main);
  28290. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/steps/src/steps.vue?vue&type=template&id=3c6b6dc0&
  28291. var stepsvue_type_template_id_3c6b6dc0_render = function() {
  28292. var _vm = this
  28293. var _h = _vm.$createElement
  28294. var _c = _vm._self._c || _h
  28295. return _c(
  28296. "div",
  28297. {
  28298. staticClass: "el-steps",
  28299. class: [
  28300. !_vm.simple && "el-steps--" + _vm.direction,
  28301. _vm.simple && "el-steps--simple"
  28302. ]
  28303. },
  28304. [_vm._t("default")],
  28305. 2
  28306. )
  28307. }
  28308. var stepsvue_type_template_id_3c6b6dc0_staticRenderFns = []
  28309. stepsvue_type_template_id_3c6b6dc0_render._withStripped = true
  28310. // CONCATENATED MODULE: ./packages/steps/src/steps.vue?vue&type=template&id=3c6b6dc0&
  28311. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/steps/src/steps.vue?vue&type=script&lang=js&
  28312. //
  28313. //
  28314. //
  28315. //
  28316. //
  28317. //
  28318. //
  28319. //
  28320. //
  28321. //
  28322. //
  28323. /* harmony default export */ var stepsvue_type_script_lang_js_ = ({
  28324. name: 'ElSteps',
  28325. mixins: [migrating_default.a],
  28326. props: {
  28327. space: [Number, String],
  28328. active: Number,
  28329. direction: {
  28330. type: String,
  28331. default: 'horizontal'
  28332. },
  28333. alignCenter: Boolean,
  28334. simple: Boolean,
  28335. finishStatus: {
  28336. type: String,
  28337. default: 'finish'
  28338. },
  28339. processStatus: {
  28340. type: String,
  28341. default: 'process'
  28342. }
  28343. },
  28344. data: function data() {
  28345. return {
  28346. steps: [],
  28347. stepOffset: 0
  28348. };
  28349. },
  28350. methods: {
  28351. getMigratingConfig: function getMigratingConfig() {
  28352. return {
  28353. props: {
  28354. 'center': 'center is removed.'
  28355. }
  28356. };
  28357. }
  28358. },
  28359. watch: {
  28360. active: function active(newVal, oldVal) {
  28361. this.$emit('change', newVal, oldVal);
  28362. },
  28363. steps: function steps(_steps) {
  28364. _steps.forEach(function (child, index) {
  28365. child.index = index;
  28366. });
  28367. }
  28368. }
  28369. });
  28370. // CONCATENATED MODULE: ./packages/steps/src/steps.vue?vue&type=script&lang=js&
  28371. /* harmony default export */ var src_stepsvue_type_script_lang_js_ = (stepsvue_type_script_lang_js_);
  28372. // CONCATENATED MODULE: ./packages/steps/src/steps.vue
  28373. /* normalize component */
  28374. var steps_component = normalizeComponent(
  28375. src_stepsvue_type_script_lang_js_,
  28376. stepsvue_type_template_id_3c6b6dc0_render,
  28377. stepsvue_type_template_id_3c6b6dc0_staticRenderFns,
  28378. false,
  28379. null,
  28380. null,
  28381. null
  28382. )
  28383. /* hot reload */
  28384. if (false) { var steps_api; }
  28385. steps_component.options.__file = "packages/steps/src/steps.vue"
  28386. /* harmony default export */ var steps = (steps_component.exports);
  28387. // CONCATENATED MODULE: ./packages/steps/index.js
  28388. /* istanbul ignore next */
  28389. steps.install = function (Vue) {
  28390. Vue.component(steps.name, steps);
  28391. };
  28392. /* harmony default export */ var packages_steps = (steps);
  28393. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/steps/src/step.vue?vue&type=template&id=f414a87a&
  28394. var stepvue_type_template_id_f414a87a_render = function() {
  28395. var _vm = this
  28396. var _h = _vm.$createElement
  28397. var _c = _vm._self._c || _h
  28398. return _c(
  28399. "div",
  28400. {
  28401. staticClass: "el-step",
  28402. class: [
  28403. !_vm.isSimple && "is-" + _vm.$parent.direction,
  28404. _vm.isSimple && "is-simple",
  28405. _vm.isLast && !_vm.space && !_vm.isCenter && "is-flex",
  28406. _vm.isCenter && !_vm.isVertical && !_vm.isSimple && "is-center"
  28407. ],
  28408. style: _vm.style
  28409. },
  28410. [
  28411. _c(
  28412. "div",
  28413. { staticClass: "el-step__head", class: "is-" + _vm.currentStatus },
  28414. [
  28415. _c(
  28416. "div",
  28417. {
  28418. staticClass: "el-step__line",
  28419. style: _vm.isLast
  28420. ? ""
  28421. : { marginRight: _vm.$parent.stepOffset + "px" }
  28422. },
  28423. [
  28424. _c("i", {
  28425. staticClass: "el-step__line-inner",
  28426. style: _vm.lineStyle
  28427. })
  28428. ]
  28429. ),
  28430. _c(
  28431. "div",
  28432. {
  28433. staticClass: "el-step__icon",
  28434. class: "is-" + (_vm.icon ? "icon" : "text")
  28435. },
  28436. [
  28437. _vm.currentStatus !== "success" && _vm.currentStatus !== "error"
  28438. ? _vm._t("icon", [
  28439. _vm.icon
  28440. ? _c("i", {
  28441. staticClass: "el-step__icon-inner",
  28442. class: [_vm.icon]
  28443. })
  28444. : _vm._e(),
  28445. !_vm.icon && !_vm.isSimple
  28446. ? _c("div", { staticClass: "el-step__icon-inner" }, [
  28447. _vm._v(_vm._s(_vm.index + 1))
  28448. ])
  28449. : _vm._e()
  28450. ])
  28451. : _c("i", {
  28452. staticClass: "el-step__icon-inner is-status",
  28453. class: [
  28454. "el-icon-" +
  28455. (_vm.currentStatus === "success" ? "check" : "close")
  28456. ]
  28457. })
  28458. ],
  28459. 2
  28460. )
  28461. ]
  28462. ),
  28463. _c("div", { staticClass: "el-step__main" }, [
  28464. _c(
  28465. "div",
  28466. {
  28467. ref: "title",
  28468. staticClass: "el-step__title",
  28469. class: ["is-" + _vm.currentStatus]
  28470. },
  28471. [_vm._t("title", [_vm._v(_vm._s(_vm.title))])],
  28472. 2
  28473. ),
  28474. _vm.isSimple
  28475. ? _c("div", { staticClass: "el-step__arrow" })
  28476. : _c(
  28477. "div",
  28478. {
  28479. staticClass: "el-step__description",
  28480. class: ["is-" + _vm.currentStatus]
  28481. },
  28482. [_vm._t("description", [_vm._v(_vm._s(_vm.description))])],
  28483. 2
  28484. )
  28485. ])
  28486. ]
  28487. )
  28488. }
  28489. var stepvue_type_template_id_f414a87a_staticRenderFns = []
  28490. stepvue_type_template_id_f414a87a_render._withStripped = true
  28491. // CONCATENATED MODULE: ./packages/steps/src/step.vue?vue&type=template&id=f414a87a&
  28492. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/steps/src/step.vue?vue&type=script&lang=js&
  28493. //
  28494. //
  28495. //
  28496. //
  28497. //
  28498. //
  28499. //
  28500. //
  28501. //
  28502. //
  28503. //
  28504. //
  28505. //
  28506. //
  28507. //
  28508. //
  28509. //
  28510. //
  28511. //
  28512. //
  28513. //
  28514. //
  28515. //
  28516. //
  28517. //
  28518. //
  28519. //
  28520. //
  28521. //
  28522. //
  28523. //
  28524. //
  28525. //
  28526. //
  28527. //
  28528. //
  28529. //
  28530. //
  28531. //
  28532. //
  28533. //
  28534. //
  28535. //
  28536. //
  28537. //
  28538. //
  28539. //
  28540. //
  28541. //
  28542. //
  28543. //
  28544. //
  28545. //
  28546. //
  28547. //
  28548. /* harmony default export */ var stepvue_type_script_lang_js_ = ({
  28549. name: 'ElStep',
  28550. props: {
  28551. title: String,
  28552. icon: String,
  28553. description: String,
  28554. status: String
  28555. },
  28556. data: function data() {
  28557. return {
  28558. index: -1,
  28559. lineStyle: {},
  28560. internalStatus: ''
  28561. };
  28562. },
  28563. beforeCreate: function beforeCreate() {
  28564. this.$parent.steps.push(this);
  28565. },
  28566. beforeDestroy: function beforeDestroy() {
  28567. var steps = this.$parent.steps;
  28568. var index = steps.indexOf(this);
  28569. if (index >= 0) {
  28570. steps.splice(index, 1);
  28571. }
  28572. },
  28573. computed: {
  28574. currentStatus: function currentStatus() {
  28575. return this.status || this.internalStatus;
  28576. },
  28577. prevStatus: function prevStatus() {
  28578. var prevStep = this.$parent.steps[this.index - 1];
  28579. return prevStep ? prevStep.currentStatus : 'wait';
  28580. },
  28581. isCenter: function isCenter() {
  28582. return this.$parent.alignCenter;
  28583. },
  28584. isVertical: function isVertical() {
  28585. return this.$parent.direction === 'vertical';
  28586. },
  28587. isSimple: function isSimple() {
  28588. return this.$parent.simple;
  28589. },
  28590. isLast: function isLast() {
  28591. var parent = this.$parent;
  28592. return parent.steps[parent.steps.length - 1] === this;
  28593. },
  28594. stepsCount: function stepsCount() {
  28595. return this.$parent.steps.length;
  28596. },
  28597. space: function space() {
  28598. var isSimple = this.isSimple,
  28599. space = this.$parent.space;
  28600. return isSimple ? '' : space;
  28601. },
  28602. style: function style() {
  28603. var style = {};
  28604. var parent = this.$parent;
  28605. var len = parent.steps.length;
  28606. var space = typeof this.space === 'number' ? this.space + 'px' : this.space ? this.space : 100 / (len - (this.isCenter ? 0 : 1)) + '%';
  28607. style.flexBasis = space;
  28608. if (this.isVertical) return style;
  28609. if (this.isLast) {
  28610. style.maxWidth = 100 / this.stepsCount + '%';
  28611. } else {
  28612. style.marginRight = -this.$parent.stepOffset + 'px';
  28613. }
  28614. return style;
  28615. }
  28616. },
  28617. methods: {
  28618. updateStatus: function updateStatus(val) {
  28619. var prevChild = this.$parent.$children[this.index - 1];
  28620. if (val > this.index) {
  28621. this.internalStatus = this.$parent.finishStatus;
  28622. } else if (val === this.index && this.prevStatus !== 'error') {
  28623. this.internalStatus = this.$parent.processStatus;
  28624. } else {
  28625. this.internalStatus = 'wait';
  28626. }
  28627. if (prevChild) prevChild.calcProgress(this.internalStatus);
  28628. },
  28629. calcProgress: function calcProgress(status) {
  28630. var step = 100;
  28631. var style = {};
  28632. style.transitionDelay = 150 * this.index + 'ms';
  28633. if (status === this.$parent.processStatus) {
  28634. step = this.currentStatus !== 'error' ? 0 : 0;
  28635. } else if (status === 'wait') {
  28636. step = 0;
  28637. style.transitionDelay = -150 * this.index + 'ms';
  28638. }
  28639. style.borderWidth = step && !this.isSimple ? '1px' : 0;
  28640. this.$parent.direction === 'vertical' ? style.height = step + '%' : style.width = step + '%';
  28641. this.lineStyle = style;
  28642. }
  28643. },
  28644. mounted: function mounted() {
  28645. var _this = this;
  28646. var unwatch = this.$watch('index', function (val) {
  28647. _this.$watch('$parent.active', _this.updateStatus, { immediate: true });
  28648. _this.$watch('$parent.processStatus', function () {
  28649. var activeIndex = _this.$parent.active;
  28650. _this.updateStatus(activeIndex);
  28651. }, { immediate: true });
  28652. unwatch();
  28653. });
  28654. }
  28655. });
  28656. // CONCATENATED MODULE: ./packages/steps/src/step.vue?vue&type=script&lang=js&
  28657. /* harmony default export */ var src_stepvue_type_script_lang_js_ = (stepvue_type_script_lang_js_);
  28658. // CONCATENATED MODULE: ./packages/steps/src/step.vue
  28659. /* normalize component */
  28660. var step_component = normalizeComponent(
  28661. src_stepvue_type_script_lang_js_,
  28662. stepvue_type_template_id_f414a87a_render,
  28663. stepvue_type_template_id_f414a87a_staticRenderFns,
  28664. false,
  28665. null,
  28666. null,
  28667. null
  28668. )
  28669. /* hot reload */
  28670. if (false) { var step_api; }
  28671. step_component.options.__file = "packages/steps/src/step.vue"
  28672. /* harmony default export */ var step = (step_component.exports);
  28673. // CONCATENATED MODULE: ./packages/step/index.js
  28674. /* istanbul ignore next */
  28675. step.install = function (Vue) {
  28676. Vue.component(step.name, step);
  28677. };
  28678. /* harmony default export */ var packages_step = (step);
  28679. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/carousel/src/main.vue?vue&type=template&id=5d5d1482&
  28680. var mainvue_type_template_id_5d5d1482_render = function() {
  28681. var _vm = this
  28682. var _h = _vm.$createElement
  28683. var _c = _vm._self._c || _h
  28684. return _c(
  28685. "div",
  28686. {
  28687. class: _vm.carouselClasses,
  28688. on: {
  28689. mouseenter: function($event) {
  28690. $event.stopPropagation()
  28691. return _vm.handleMouseEnter($event)
  28692. },
  28693. mouseleave: function($event) {
  28694. $event.stopPropagation()
  28695. return _vm.handleMouseLeave($event)
  28696. }
  28697. }
  28698. },
  28699. [
  28700. _c(
  28701. "div",
  28702. {
  28703. staticClass: "el-carousel__container",
  28704. style: { height: _vm.height }
  28705. },
  28706. [
  28707. _vm.arrowDisplay
  28708. ? _c("transition", { attrs: { name: "carousel-arrow-left" } }, [
  28709. _c(
  28710. "button",
  28711. {
  28712. directives: [
  28713. {
  28714. name: "show",
  28715. rawName: "v-show",
  28716. value:
  28717. (_vm.arrow === "always" || _vm.hover) &&
  28718. (_vm.loop || _vm.activeIndex > 0),
  28719. expression:
  28720. "(arrow === 'always' || hover) && (loop || activeIndex > 0)"
  28721. }
  28722. ],
  28723. staticClass: "el-carousel__arrow el-carousel__arrow--left",
  28724. attrs: { type: "button" },
  28725. on: {
  28726. mouseenter: function($event) {
  28727. _vm.handleButtonEnter("left")
  28728. },
  28729. mouseleave: _vm.handleButtonLeave,
  28730. click: function($event) {
  28731. $event.stopPropagation()
  28732. _vm.throttledArrowClick(_vm.activeIndex - 1)
  28733. }
  28734. }
  28735. },
  28736. [_c("i", { staticClass: "el-icon-arrow-left" })]
  28737. )
  28738. ])
  28739. : _vm._e(),
  28740. _vm.arrowDisplay
  28741. ? _c("transition", { attrs: { name: "carousel-arrow-right" } }, [
  28742. _c(
  28743. "button",
  28744. {
  28745. directives: [
  28746. {
  28747. name: "show",
  28748. rawName: "v-show",
  28749. value:
  28750. (_vm.arrow === "always" || _vm.hover) &&
  28751. (_vm.loop || _vm.activeIndex < _vm.items.length - 1),
  28752. expression:
  28753. "(arrow === 'always' || hover) && (loop || activeIndex < items.length - 1)"
  28754. }
  28755. ],
  28756. staticClass: "el-carousel__arrow el-carousel__arrow--right",
  28757. attrs: { type: "button" },
  28758. on: {
  28759. mouseenter: function($event) {
  28760. _vm.handleButtonEnter("right")
  28761. },
  28762. mouseleave: _vm.handleButtonLeave,
  28763. click: function($event) {
  28764. $event.stopPropagation()
  28765. _vm.throttledArrowClick(_vm.activeIndex + 1)
  28766. }
  28767. }
  28768. },
  28769. [_c("i", { staticClass: "el-icon-arrow-right" })]
  28770. )
  28771. ])
  28772. : _vm._e(),
  28773. _vm._t("default")
  28774. ],
  28775. 2
  28776. ),
  28777. _vm.indicatorPosition !== "none"
  28778. ? _c(
  28779. "ul",
  28780. { class: _vm.indicatorsClasses },
  28781. _vm._l(_vm.items, function(item, index) {
  28782. return _c(
  28783. "li",
  28784. {
  28785. key: index,
  28786. class: [
  28787. "el-carousel__indicator",
  28788. "el-carousel__indicator--" + _vm.direction,
  28789. { "is-active": index === _vm.activeIndex }
  28790. ],
  28791. on: {
  28792. mouseenter: function($event) {
  28793. _vm.throttledIndicatorHover(index)
  28794. },
  28795. click: function($event) {
  28796. $event.stopPropagation()
  28797. _vm.handleIndicatorClick(index)
  28798. }
  28799. }
  28800. },
  28801. [
  28802. _c("button", { staticClass: "el-carousel__button" }, [
  28803. _vm.hasLabel
  28804. ? _c("span", [_vm._v(_vm._s(item.label))])
  28805. : _vm._e()
  28806. ])
  28807. ]
  28808. )
  28809. }),
  28810. 0
  28811. )
  28812. : _vm._e()
  28813. ]
  28814. )
  28815. }
  28816. var mainvue_type_template_id_5d5d1482_staticRenderFns = []
  28817. mainvue_type_template_id_5d5d1482_render._withStripped = true
  28818. // CONCATENATED MODULE: ./packages/carousel/src/main.vue?vue&type=template&id=5d5d1482&
  28819. // EXTERNAL MODULE: external "throttle-debounce/throttle"
  28820. var throttle_ = __webpack_require__(25);
  28821. var throttle_default = /*#__PURE__*/__webpack_require__.n(throttle_);
  28822. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/carousel/src/main.vue?vue&type=script&lang=js&
  28823. //
  28824. //
  28825. //
  28826. //
  28827. //
  28828. //
  28829. //
  28830. //
  28831. //
  28832. //
  28833. //
  28834. //
  28835. //
  28836. //
  28837. //
  28838. //
  28839. //
  28840. //
  28841. //
  28842. //
  28843. //
  28844. //
  28845. //
  28846. //
  28847. //
  28848. //
  28849. //
  28850. //
  28851. //
  28852. //
  28853. //
  28854. //
  28855. //
  28856. //
  28857. //
  28858. //
  28859. //
  28860. //
  28861. //
  28862. //
  28863. //
  28864. //
  28865. //
  28866. //
  28867. //
  28868. //
  28869. //
  28870. //
  28871. //
  28872. //
  28873. //
  28874. //
  28875. //
  28876. //
  28877. //
  28878. //
  28879. /* harmony default export */ var carousel_src_mainvue_type_script_lang_js_ = ({
  28880. name: 'ElCarousel',
  28881. props: {
  28882. initialIndex: {
  28883. type: Number,
  28884. default: 0
  28885. },
  28886. height: String,
  28887. trigger: {
  28888. type: String,
  28889. default: 'hover'
  28890. },
  28891. autoplay: {
  28892. type: Boolean,
  28893. default: true
  28894. },
  28895. interval: {
  28896. type: Number,
  28897. default: 3000
  28898. },
  28899. indicatorPosition: String,
  28900. indicator: {
  28901. type: Boolean,
  28902. default: true
  28903. },
  28904. arrow: {
  28905. type: String,
  28906. default: 'hover'
  28907. },
  28908. type: String,
  28909. loop: {
  28910. type: Boolean,
  28911. default: true
  28912. },
  28913. direction: {
  28914. type: String,
  28915. default: 'horizontal',
  28916. validator: function validator(val) {
  28917. return ['horizontal', 'vertical'].indexOf(val) !== -1;
  28918. }
  28919. }
  28920. },
  28921. data: function data() {
  28922. return {
  28923. items: [],
  28924. activeIndex: -1,
  28925. containerWidth: 0,
  28926. timer: null,
  28927. hover: false
  28928. };
  28929. },
  28930. computed: {
  28931. arrowDisplay: function arrowDisplay() {
  28932. return this.arrow !== 'never' && this.direction !== 'vertical';
  28933. },
  28934. hasLabel: function hasLabel() {
  28935. return this.items.some(function (item) {
  28936. return item.label.toString().length > 0;
  28937. });
  28938. },
  28939. carouselClasses: function carouselClasses() {
  28940. var classes = ['el-carousel', 'el-carousel--' + this.direction];
  28941. if (this.type === 'card') {
  28942. classes.push('el-carousel--card');
  28943. }
  28944. return classes;
  28945. },
  28946. indicatorsClasses: function indicatorsClasses() {
  28947. var classes = ['el-carousel__indicators', 'el-carousel__indicators--' + this.direction];
  28948. if (this.hasLabel) {
  28949. classes.push('el-carousel__indicators--labels');
  28950. }
  28951. if (this.indicatorPosition === 'outside' || this.type === 'card') {
  28952. classes.push('el-carousel__indicators--outside');
  28953. }
  28954. return classes;
  28955. }
  28956. },
  28957. watch: {
  28958. items: function items(val) {
  28959. if (val.length > 0) this.setActiveItem(this.initialIndex);
  28960. },
  28961. activeIndex: function activeIndex(val, oldVal) {
  28962. this.resetItemPosition(oldVal);
  28963. if (oldVal > -1) {
  28964. this.$emit('change', val, oldVal);
  28965. }
  28966. },
  28967. autoplay: function autoplay(val) {
  28968. val ? this.startTimer() : this.pauseTimer();
  28969. },
  28970. loop: function loop() {
  28971. this.setActiveItem(this.activeIndex);
  28972. },
  28973. interval: function interval() {
  28974. this.pauseTimer();
  28975. this.startTimer();
  28976. }
  28977. },
  28978. methods: {
  28979. handleMouseEnter: function handleMouseEnter() {
  28980. this.hover = true;
  28981. this.pauseTimer();
  28982. },
  28983. handleMouseLeave: function handleMouseLeave() {
  28984. this.hover = false;
  28985. this.startTimer();
  28986. },
  28987. itemInStage: function itemInStage(item, index) {
  28988. var length = this.items.length;
  28989. if (index === length - 1 && item.inStage && this.items[0].active || item.inStage && this.items[index + 1] && this.items[index + 1].active) {
  28990. return 'left';
  28991. } else if (index === 0 && item.inStage && this.items[length - 1].active || item.inStage && this.items[index - 1] && this.items[index - 1].active) {
  28992. return 'right';
  28993. }
  28994. return false;
  28995. },
  28996. handleButtonEnter: function handleButtonEnter(arrow) {
  28997. var _this = this;
  28998. if (this.direction === 'vertical') return;
  28999. this.items.forEach(function (item, index) {
  29000. if (arrow === _this.itemInStage(item, index)) {
  29001. item.hover = true;
  29002. }
  29003. });
  29004. },
  29005. handleButtonLeave: function handleButtonLeave() {
  29006. if (this.direction === 'vertical') return;
  29007. this.items.forEach(function (item) {
  29008. item.hover = false;
  29009. });
  29010. },
  29011. updateItems: function updateItems() {
  29012. this.items = this.$children.filter(function (child) {
  29013. return child.$options.name === 'ElCarouselItem';
  29014. });
  29015. },
  29016. resetItemPosition: function resetItemPosition(oldIndex) {
  29017. var _this2 = this;
  29018. this.items.forEach(function (item, index) {
  29019. item.translateItem(index, _this2.activeIndex, oldIndex);
  29020. });
  29021. },
  29022. playSlides: function playSlides() {
  29023. if (this.activeIndex < this.items.length - 1) {
  29024. this.activeIndex++;
  29025. } else if (this.loop) {
  29026. this.activeIndex = 0;
  29027. }
  29028. },
  29029. pauseTimer: function pauseTimer() {
  29030. if (this.timer) {
  29031. clearInterval(this.timer);
  29032. this.timer = null;
  29033. }
  29034. },
  29035. startTimer: function startTimer() {
  29036. if (this.interval <= 0 || !this.autoplay || this.timer) return;
  29037. this.timer = setInterval(this.playSlides, this.interval);
  29038. },
  29039. resetTimer: function resetTimer() {
  29040. this.pauseTimer();
  29041. this.startTimer();
  29042. },
  29043. setActiveItem: function setActiveItem(index) {
  29044. if (typeof index === 'string') {
  29045. var filteredItems = this.items.filter(function (item) {
  29046. return item.name === index;
  29047. });
  29048. if (filteredItems.length > 0) {
  29049. index = this.items.indexOf(filteredItems[0]);
  29050. }
  29051. }
  29052. index = Number(index);
  29053. if (isNaN(index) || index !== Math.floor(index)) {
  29054. console.warn('[Element Warn][Carousel]index must be an integer.');
  29055. return;
  29056. }
  29057. var length = this.items.length;
  29058. var oldIndex = this.activeIndex;
  29059. if (index < 0) {
  29060. this.activeIndex = this.loop ? length - 1 : 0;
  29061. } else if (index >= length) {
  29062. this.activeIndex = this.loop ? 0 : length - 1;
  29063. } else {
  29064. this.activeIndex = index;
  29065. }
  29066. if (oldIndex === this.activeIndex) {
  29067. this.resetItemPosition(oldIndex);
  29068. }
  29069. this.resetTimer();
  29070. },
  29071. prev: function prev() {
  29072. this.setActiveItem(this.activeIndex - 1);
  29073. },
  29074. next: function next() {
  29075. this.setActiveItem(this.activeIndex + 1);
  29076. },
  29077. handleIndicatorClick: function handleIndicatorClick(index) {
  29078. this.activeIndex = index;
  29079. },
  29080. handleIndicatorHover: function handleIndicatorHover(index) {
  29081. if (this.trigger === 'hover' && index !== this.activeIndex) {
  29082. this.activeIndex = index;
  29083. }
  29084. }
  29085. },
  29086. created: function created() {
  29087. var _this3 = this;
  29088. this.throttledArrowClick = throttle_default()(300, true, function (index) {
  29089. _this3.setActiveItem(index);
  29090. });
  29091. this.throttledIndicatorHover = throttle_default()(300, function (index) {
  29092. _this3.handleIndicatorHover(index);
  29093. });
  29094. },
  29095. mounted: function mounted() {
  29096. var _this4 = this;
  29097. this.updateItems();
  29098. this.$nextTick(function () {
  29099. Object(resize_event_["addResizeListener"])(_this4.$el, _this4.resetItemPosition);
  29100. if (_this4.initialIndex < _this4.items.length && _this4.initialIndex >= 0) {
  29101. _this4.activeIndex = _this4.initialIndex;
  29102. }
  29103. _this4.startTimer();
  29104. });
  29105. },
  29106. beforeDestroy: function beforeDestroy() {
  29107. if (this.$el) Object(resize_event_["removeResizeListener"])(this.$el, this.resetItemPosition);
  29108. this.pauseTimer();
  29109. }
  29110. });
  29111. // CONCATENATED MODULE: ./packages/carousel/src/main.vue?vue&type=script&lang=js&
  29112. /* harmony default export */ var packages_carousel_src_mainvue_type_script_lang_js_ = (carousel_src_mainvue_type_script_lang_js_);
  29113. // CONCATENATED MODULE: ./packages/carousel/src/main.vue
  29114. /* normalize component */
  29115. var carousel_src_main_component = normalizeComponent(
  29116. packages_carousel_src_mainvue_type_script_lang_js_,
  29117. mainvue_type_template_id_5d5d1482_render,
  29118. mainvue_type_template_id_5d5d1482_staticRenderFns,
  29119. false,
  29120. null,
  29121. null,
  29122. null
  29123. )
  29124. /* hot reload */
  29125. if (false) { var carousel_src_main_api; }
  29126. carousel_src_main_component.options.__file = "packages/carousel/src/main.vue"
  29127. /* harmony default export */ var carousel_src_main = (carousel_src_main_component.exports);
  29128. // CONCATENATED MODULE: ./packages/carousel/index.js
  29129. /* istanbul ignore next */
  29130. carousel_src_main.install = function (Vue) {
  29131. Vue.component(carousel_src_main.name, carousel_src_main);
  29132. };
  29133. /* harmony default export */ var carousel = (carousel_src_main);
  29134. // CONCATENATED MODULE: ./packages/scrollbar/src/util.js
  29135. var BAR_MAP = {
  29136. vertical: {
  29137. offset: 'offsetHeight',
  29138. scroll: 'scrollTop',
  29139. scrollSize: 'scrollHeight',
  29140. size: 'height',
  29141. key: 'vertical',
  29142. axis: 'Y',
  29143. client: 'clientY',
  29144. direction: 'top'
  29145. },
  29146. horizontal: {
  29147. offset: 'offsetWidth',
  29148. scroll: 'scrollLeft',
  29149. scrollSize: 'scrollWidth',
  29150. size: 'width',
  29151. key: 'horizontal',
  29152. axis: 'X',
  29153. client: 'clientX',
  29154. direction: 'left'
  29155. }
  29156. };
  29157. function renderThumbStyle(_ref) {
  29158. var move = _ref.move,
  29159. size = _ref.size,
  29160. bar = _ref.bar;
  29161. var style = {};
  29162. var translate = 'translate' + bar.axis + '(' + move + '%)';
  29163. style[bar.size] = size;
  29164. style.transform = translate;
  29165. style.msTransform = translate;
  29166. style.webkitTransform = translate;
  29167. return style;
  29168. };
  29169. // CONCATENATED MODULE: ./packages/scrollbar/src/bar.js
  29170. /* istanbul ignore next */
  29171. /* harmony default export */ var src_bar = ({
  29172. name: 'Bar',
  29173. props: {
  29174. vertical: Boolean,
  29175. size: String,
  29176. move: Number
  29177. },
  29178. computed: {
  29179. bar: function bar() {
  29180. return BAR_MAP[this.vertical ? 'vertical' : 'horizontal'];
  29181. },
  29182. wrap: function wrap() {
  29183. return this.$parent.wrap;
  29184. }
  29185. },
  29186. render: function render(h) {
  29187. var size = this.size,
  29188. move = this.move,
  29189. bar = this.bar;
  29190. return h(
  29191. 'div',
  29192. {
  29193. 'class': ['el-scrollbar__bar', 'is-' + bar.key],
  29194. on: {
  29195. 'mousedown': this.clickTrackHandler
  29196. }
  29197. },
  29198. [h('div', {
  29199. ref: 'thumb',
  29200. 'class': 'el-scrollbar__thumb',
  29201. on: {
  29202. 'mousedown': this.clickThumbHandler
  29203. },
  29204. style: renderThumbStyle({ size: size, move: move, bar: bar }) })]
  29205. );
  29206. },
  29207. methods: {
  29208. clickThumbHandler: function clickThumbHandler(e) {
  29209. // prevent click event of right button
  29210. if (e.ctrlKey || e.button === 2) {
  29211. return;
  29212. }
  29213. this.startDrag(e);
  29214. this[this.bar.axis] = e.currentTarget[this.bar.offset] - (e[this.bar.client] - e.currentTarget.getBoundingClientRect()[this.bar.direction]);
  29215. },
  29216. clickTrackHandler: function clickTrackHandler(e) {
  29217. var offset = Math.abs(e.target.getBoundingClientRect()[this.bar.direction] - e[this.bar.client]);
  29218. var thumbHalf = this.$refs.thumb[this.bar.offset] / 2;
  29219. var thumbPositionPercentage = (offset - thumbHalf) * 100 / this.$el[this.bar.offset];
  29220. this.wrap[this.bar.scroll] = thumbPositionPercentage * this.wrap[this.bar.scrollSize] / 100;
  29221. },
  29222. startDrag: function startDrag(e) {
  29223. e.stopImmediatePropagation();
  29224. this.cursorDown = true;
  29225. Object(dom_["on"])(document, 'mousemove', this.mouseMoveDocumentHandler);
  29226. Object(dom_["on"])(document, 'mouseup', this.mouseUpDocumentHandler);
  29227. document.onselectstart = function () {
  29228. return false;
  29229. };
  29230. },
  29231. mouseMoveDocumentHandler: function mouseMoveDocumentHandler(e) {
  29232. if (this.cursorDown === false) return;
  29233. var prevPage = this[this.bar.axis];
  29234. if (!prevPage) return;
  29235. var offset = (this.$el.getBoundingClientRect()[this.bar.direction] - e[this.bar.client]) * -1;
  29236. var thumbClickPosition = this.$refs.thumb[this.bar.offset] - prevPage;
  29237. var thumbPositionPercentage = (offset - thumbClickPosition) * 100 / this.$el[this.bar.offset];
  29238. this.wrap[this.bar.scroll] = thumbPositionPercentage * this.wrap[this.bar.scrollSize] / 100;
  29239. },
  29240. mouseUpDocumentHandler: function mouseUpDocumentHandler(e) {
  29241. this.cursorDown = false;
  29242. this[this.bar.axis] = 0;
  29243. Object(dom_["off"])(document, 'mousemove', this.mouseMoveDocumentHandler);
  29244. document.onselectstart = null;
  29245. }
  29246. },
  29247. destroyed: function destroyed() {
  29248. Object(dom_["off"])(document, 'mouseup', this.mouseUpDocumentHandler);
  29249. }
  29250. });
  29251. // CONCATENATED MODULE: ./packages/scrollbar/src/main.js
  29252. // reference https://github.com/noeldelgado/gemini-scrollbar/blob/master/index.js
  29253. /* istanbul ignore next */
  29254. /* harmony default export */ var scrollbar_src_main = ({
  29255. name: 'ElScrollbar',
  29256. components: { Bar: src_bar },
  29257. props: {
  29258. native: Boolean,
  29259. wrapStyle: {},
  29260. wrapClass: {},
  29261. viewClass: {},
  29262. viewStyle: {},
  29263. noresize: Boolean, // 如果 container 尺寸不会发生变化,最好设置它可以优化性能
  29264. tag: {
  29265. type: String,
  29266. default: 'div'
  29267. }
  29268. },
  29269. data: function data() {
  29270. return {
  29271. sizeWidth: '0',
  29272. sizeHeight: '0',
  29273. moveX: 0,
  29274. moveY: 0
  29275. };
  29276. },
  29277. computed: {
  29278. wrap: function wrap() {
  29279. return this.$refs.wrap;
  29280. }
  29281. },
  29282. render: function render(h) {
  29283. var gutter = scrollbar_width_default()();
  29284. var style = this.wrapStyle;
  29285. if (gutter) {
  29286. var gutterWith = '-' + gutter + 'px';
  29287. var gutterStyle = 'margin-bottom: ' + gutterWith + '; margin-right: ' + gutterWith + ';';
  29288. if (Array.isArray(this.wrapStyle)) {
  29289. style = Object(util_["toObject"])(this.wrapStyle);
  29290. style.marginRight = style.marginBottom = gutterWith;
  29291. } else if (typeof this.wrapStyle === 'string') {
  29292. style += gutterStyle;
  29293. } else {
  29294. style = gutterStyle;
  29295. }
  29296. }
  29297. var view = h(this.tag, {
  29298. class: ['el-scrollbar__view', this.viewClass],
  29299. style: this.viewStyle,
  29300. ref: 'resize'
  29301. }, this.$slots.default);
  29302. var wrap = h(
  29303. 'div',
  29304. {
  29305. ref: 'wrap',
  29306. style: style,
  29307. on: {
  29308. 'scroll': this.handleScroll
  29309. },
  29310. 'class': [this.wrapClass, 'el-scrollbar__wrap', gutter ? '' : 'el-scrollbar__wrap--hidden-default'] },
  29311. [[view]]
  29312. );
  29313. var nodes = void 0;
  29314. if (!this.native) {
  29315. nodes = [wrap, h(src_bar, {
  29316. attrs: {
  29317. move: this.moveX,
  29318. size: this.sizeWidth }
  29319. }), h(src_bar, {
  29320. attrs: {
  29321. vertical: true,
  29322. move: this.moveY,
  29323. size: this.sizeHeight }
  29324. })];
  29325. } else {
  29326. nodes = [h(
  29327. 'div',
  29328. {
  29329. ref: 'wrap',
  29330. 'class': [this.wrapClass, 'el-scrollbar__wrap'],
  29331. style: style },
  29332. [[view]]
  29333. )];
  29334. }
  29335. return h('div', { class: 'el-scrollbar' }, nodes);
  29336. },
  29337. methods: {
  29338. handleScroll: function handleScroll() {
  29339. var wrap = this.wrap;
  29340. this.moveY = wrap.scrollTop * 100 / wrap.clientHeight;
  29341. this.moveX = wrap.scrollLeft * 100 / wrap.clientWidth;
  29342. },
  29343. update: function update() {
  29344. var heightPercentage = void 0,
  29345. widthPercentage = void 0;
  29346. var wrap = this.wrap;
  29347. if (!wrap) return;
  29348. heightPercentage = wrap.clientHeight * 100 / wrap.scrollHeight;
  29349. widthPercentage = wrap.clientWidth * 100 / wrap.scrollWidth;
  29350. this.sizeHeight = heightPercentage < 100 ? heightPercentage + '%' : '';
  29351. this.sizeWidth = widthPercentage < 100 ? widthPercentage + '%' : '';
  29352. }
  29353. },
  29354. mounted: function mounted() {
  29355. if (this.native) return;
  29356. this.$nextTick(this.update);
  29357. !this.noresize && Object(resize_event_["addResizeListener"])(this.$refs.resize, this.update);
  29358. },
  29359. beforeDestroy: function beforeDestroy() {
  29360. if (this.native) return;
  29361. !this.noresize && Object(resize_event_["removeResizeListener"])(this.$refs.resize, this.update);
  29362. }
  29363. });
  29364. // CONCATENATED MODULE: ./packages/scrollbar/index.js
  29365. /* istanbul ignore next */
  29366. scrollbar_src_main.install = function (Vue) {
  29367. Vue.component(scrollbar_src_main.name, scrollbar_src_main);
  29368. };
  29369. /* harmony default export */ var scrollbar = (scrollbar_src_main);
  29370. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/carousel/src/item.vue?vue&type=template&id=1801ae19&
  29371. var itemvue_type_template_id_1801ae19_render = function() {
  29372. var _vm = this
  29373. var _h = _vm.$createElement
  29374. var _c = _vm._self._c || _h
  29375. return _c(
  29376. "div",
  29377. {
  29378. directives: [
  29379. {
  29380. name: "show",
  29381. rawName: "v-show",
  29382. value: _vm.ready,
  29383. expression: "ready"
  29384. }
  29385. ],
  29386. staticClass: "el-carousel__item",
  29387. class: {
  29388. "is-active": _vm.active,
  29389. "el-carousel__item--card": _vm.$parent.type === "card",
  29390. "is-in-stage": _vm.inStage,
  29391. "is-hover": _vm.hover,
  29392. "is-animating": _vm.animating
  29393. },
  29394. style: _vm.itemStyle,
  29395. on: { click: _vm.handleItemClick }
  29396. },
  29397. [
  29398. _vm.$parent.type === "card"
  29399. ? _c("div", {
  29400. directives: [
  29401. {
  29402. name: "show",
  29403. rawName: "v-show",
  29404. value: !_vm.active,
  29405. expression: "!active"
  29406. }
  29407. ],
  29408. staticClass: "el-carousel__mask"
  29409. })
  29410. : _vm._e(),
  29411. _vm._t("default")
  29412. ],
  29413. 2
  29414. )
  29415. }
  29416. var itemvue_type_template_id_1801ae19_staticRenderFns = []
  29417. itemvue_type_template_id_1801ae19_render._withStripped = true
  29418. // CONCATENATED MODULE: ./packages/carousel/src/item.vue?vue&type=template&id=1801ae19&
  29419. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/carousel/src/item.vue?vue&type=script&lang=js&
  29420. //
  29421. //
  29422. //
  29423. //
  29424. //
  29425. //
  29426. //
  29427. //
  29428. //
  29429. //
  29430. //
  29431. //
  29432. //
  29433. //
  29434. //
  29435. //
  29436. //
  29437. //
  29438. //
  29439. //
  29440. //
  29441. //
  29442. var CARD_SCALE = 0.83;
  29443. /* harmony default export */ var itemvue_type_script_lang_js_ = ({
  29444. name: 'ElCarouselItem',
  29445. props: {
  29446. name: String,
  29447. label: {
  29448. type: [String, Number],
  29449. default: ''
  29450. }
  29451. },
  29452. data: function data() {
  29453. return {
  29454. hover: false,
  29455. translate: 0,
  29456. scale: 1,
  29457. active: false,
  29458. ready: false,
  29459. inStage: false,
  29460. animating: false
  29461. };
  29462. },
  29463. methods: {
  29464. processIndex: function processIndex(index, activeIndex, length) {
  29465. if (activeIndex === 0 && index === length - 1) {
  29466. return -1;
  29467. } else if (activeIndex === length - 1 && index === 0) {
  29468. return length;
  29469. } else if (index < activeIndex - 1 && activeIndex - index >= length / 2) {
  29470. return length + 1;
  29471. } else if (index > activeIndex + 1 && index - activeIndex >= length / 2) {
  29472. return -2;
  29473. }
  29474. return index;
  29475. },
  29476. calcCardTranslate: function calcCardTranslate(index, activeIndex) {
  29477. var parentWidth = this.$parent.$el.offsetWidth;
  29478. if (this.inStage) {
  29479. return parentWidth * ((2 - CARD_SCALE) * (index - activeIndex) + 1) / 4;
  29480. } else if (index < activeIndex) {
  29481. return -(1 + CARD_SCALE) * parentWidth / 4;
  29482. } else {
  29483. return (3 + CARD_SCALE) * parentWidth / 4;
  29484. }
  29485. },
  29486. calcTranslate: function calcTranslate(index, activeIndex, isVertical) {
  29487. var distance = this.$parent.$el[isVertical ? 'offsetHeight' : 'offsetWidth'];
  29488. return distance * (index - activeIndex);
  29489. },
  29490. translateItem: function translateItem(index, activeIndex, oldIndex) {
  29491. var parentType = this.$parent.type;
  29492. var parentDirection = this.parentDirection;
  29493. var length = this.$parent.items.length;
  29494. if (parentType !== 'card' && oldIndex !== undefined) {
  29495. this.animating = index === activeIndex || index === oldIndex;
  29496. }
  29497. if (index !== activeIndex && length > 2 && this.$parent.loop) {
  29498. index = this.processIndex(index, activeIndex, length);
  29499. }
  29500. if (parentType === 'card') {
  29501. if (parentDirection === 'vertical') {
  29502. console.warn('[Element Warn][Carousel]vertical direction is not supported in card mode');
  29503. }
  29504. this.inStage = Math.round(Math.abs(index - activeIndex)) <= 1;
  29505. this.active = index === activeIndex;
  29506. this.translate = this.calcCardTranslate(index, activeIndex);
  29507. this.scale = this.active ? 1 : CARD_SCALE;
  29508. } else {
  29509. this.active = index === activeIndex;
  29510. var isVertical = parentDirection === 'vertical';
  29511. this.translate = this.calcTranslate(index, activeIndex, isVertical);
  29512. this.scale = 1;
  29513. }
  29514. this.ready = true;
  29515. },
  29516. handleItemClick: function handleItemClick() {
  29517. var parent = this.$parent;
  29518. if (parent && parent.type === 'card') {
  29519. var index = parent.items.indexOf(this);
  29520. parent.setActiveItem(index);
  29521. }
  29522. }
  29523. },
  29524. computed: {
  29525. parentDirection: function parentDirection() {
  29526. return this.$parent.direction;
  29527. },
  29528. itemStyle: function itemStyle() {
  29529. var translateType = this.parentDirection === 'vertical' ? 'translateY' : 'translateX';
  29530. var value = translateType + '(' + this.translate + 'px) scale(' + this.scale + ')';
  29531. var style = {
  29532. transform: value
  29533. };
  29534. return Object(util_["autoprefixer"])(style);
  29535. }
  29536. },
  29537. created: function created() {
  29538. this.$parent && this.$parent.updateItems();
  29539. },
  29540. destroyed: function destroyed() {
  29541. this.$parent && this.$parent.updateItems();
  29542. }
  29543. });
  29544. // CONCATENATED MODULE: ./packages/carousel/src/item.vue?vue&type=script&lang=js&
  29545. /* harmony default export */ var src_itemvue_type_script_lang_js_ = (itemvue_type_script_lang_js_);
  29546. // CONCATENATED MODULE: ./packages/carousel/src/item.vue
  29547. /* normalize component */
  29548. var item_component = normalizeComponent(
  29549. src_itemvue_type_script_lang_js_,
  29550. itemvue_type_template_id_1801ae19_render,
  29551. itemvue_type_template_id_1801ae19_staticRenderFns,
  29552. false,
  29553. null,
  29554. null,
  29555. null
  29556. )
  29557. /* hot reload */
  29558. if (false) { var item_api; }
  29559. item_component.options.__file = "packages/carousel/src/item.vue"
  29560. /* harmony default export */ var src_item = (item_component.exports);
  29561. // CONCATENATED MODULE: ./packages/carousel-item/index.js
  29562. /* istanbul ignore next */
  29563. src_item.install = function (Vue) {
  29564. Vue.component(src_item.name, src_item);
  29565. };
  29566. /* harmony default export */ var carousel_item = (src_item);
  29567. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/collapse/src/collapse.vue?vue&type=template&id=461d57f4&
  29568. var collapsevue_type_template_id_461d57f4_render = function() {
  29569. var _vm = this
  29570. var _h = _vm.$createElement
  29571. var _c = _vm._self._c || _h
  29572. return _c(
  29573. "div",
  29574. {
  29575. staticClass: "el-collapse",
  29576. attrs: { role: "tablist", "aria-multiselectable": "true" }
  29577. },
  29578. [_vm._t("default")],
  29579. 2
  29580. )
  29581. }
  29582. var collapsevue_type_template_id_461d57f4_staticRenderFns = []
  29583. collapsevue_type_template_id_461d57f4_render._withStripped = true
  29584. // CONCATENATED MODULE: ./packages/collapse/src/collapse.vue?vue&type=template&id=461d57f4&
  29585. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/collapse/src/collapse.vue?vue&type=script&lang=js&
  29586. //
  29587. //
  29588. //
  29589. //
  29590. //
  29591. /* harmony default export */ var collapsevue_type_script_lang_js_ = ({
  29592. name: 'ElCollapse',
  29593. componentName: 'ElCollapse',
  29594. props: {
  29595. accordion: Boolean,
  29596. value: {
  29597. type: [Array, String, Number],
  29598. default: function _default() {
  29599. return [];
  29600. }
  29601. }
  29602. },
  29603. data: function data() {
  29604. return {
  29605. activeNames: [].concat(this.value)
  29606. };
  29607. },
  29608. provide: function provide() {
  29609. return {
  29610. collapse: this
  29611. };
  29612. },
  29613. watch: {
  29614. value: function value(_value) {
  29615. this.activeNames = [].concat(_value);
  29616. }
  29617. },
  29618. methods: {
  29619. setActiveNames: function setActiveNames(activeNames) {
  29620. activeNames = [].concat(activeNames);
  29621. var value = this.accordion ? activeNames[0] : activeNames;
  29622. this.activeNames = activeNames;
  29623. this.$emit('input', value);
  29624. this.$emit('change', value);
  29625. },
  29626. handleItemClick: function handleItemClick(item) {
  29627. if (this.accordion) {
  29628. this.setActiveNames((this.activeNames[0] || this.activeNames[0] === 0) && this.activeNames[0] === item.name ? '' : item.name);
  29629. } else {
  29630. var activeNames = this.activeNames.slice(0);
  29631. var index = activeNames.indexOf(item.name);
  29632. if (index > -1) {
  29633. activeNames.splice(index, 1);
  29634. } else {
  29635. activeNames.push(item.name);
  29636. }
  29637. this.setActiveNames(activeNames);
  29638. }
  29639. }
  29640. },
  29641. created: function created() {
  29642. this.$on('item-click', this.handleItemClick);
  29643. }
  29644. });
  29645. // CONCATENATED MODULE: ./packages/collapse/src/collapse.vue?vue&type=script&lang=js&
  29646. /* harmony default export */ var src_collapsevue_type_script_lang_js_ = (collapsevue_type_script_lang_js_);
  29647. // CONCATENATED MODULE: ./packages/collapse/src/collapse.vue
  29648. /* normalize component */
  29649. var collapse_component = normalizeComponent(
  29650. src_collapsevue_type_script_lang_js_,
  29651. collapsevue_type_template_id_461d57f4_render,
  29652. collapsevue_type_template_id_461d57f4_staticRenderFns,
  29653. false,
  29654. null,
  29655. null,
  29656. null
  29657. )
  29658. /* hot reload */
  29659. if (false) { var collapse_api; }
  29660. collapse_component.options.__file = "packages/collapse/src/collapse.vue"
  29661. /* harmony default export */ var collapse = (collapse_component.exports);
  29662. // CONCATENATED MODULE: ./packages/collapse/index.js
  29663. /* istanbul ignore next */
  29664. collapse.install = function (Vue) {
  29665. Vue.component(collapse.name, collapse);
  29666. };
  29667. /* harmony default export */ var packages_collapse = (collapse);
  29668. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/collapse/src/collapse-item.vue?vue&type=template&id=2d05faac&
  29669. var collapse_itemvue_type_template_id_2d05faac_render = function() {
  29670. var _vm = this
  29671. var _h = _vm.$createElement
  29672. var _c = _vm._self._c || _h
  29673. return _c(
  29674. "div",
  29675. {
  29676. staticClass: "el-collapse-item",
  29677. class: { "is-active": _vm.isActive, "is-disabled": _vm.disabled }
  29678. },
  29679. [
  29680. _c(
  29681. "div",
  29682. {
  29683. attrs: {
  29684. role: "tab",
  29685. "aria-expanded": _vm.isActive,
  29686. "aria-controls": "el-collapse-content-" + _vm.id,
  29687. "aria-describedby": "el-collapse-content-" + _vm.id
  29688. }
  29689. },
  29690. [
  29691. _c(
  29692. "div",
  29693. {
  29694. staticClass: "el-collapse-item__header",
  29695. class: {
  29696. focusing: _vm.focusing,
  29697. "is-active": _vm.isActive
  29698. },
  29699. attrs: {
  29700. role: "button",
  29701. id: "el-collapse-head-" + _vm.id,
  29702. tabindex: _vm.disabled ? undefined : 0
  29703. },
  29704. on: {
  29705. click: _vm.handleHeaderClick,
  29706. keyup: function($event) {
  29707. if (
  29708. !("button" in $event) &&
  29709. _vm._k($event.keyCode, "space", 32, $event.key, [
  29710. " ",
  29711. "Spacebar"
  29712. ]) &&
  29713. _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")
  29714. ) {
  29715. return null
  29716. }
  29717. $event.stopPropagation()
  29718. return _vm.handleEnterClick($event)
  29719. },
  29720. focus: _vm.handleFocus,
  29721. blur: function($event) {
  29722. _vm.focusing = false
  29723. }
  29724. }
  29725. },
  29726. [
  29727. _vm._t("title", [_vm._v(_vm._s(_vm.title))]),
  29728. _c("i", {
  29729. staticClass: "el-collapse-item__arrow el-icon-arrow-right",
  29730. class: { "is-active": _vm.isActive }
  29731. })
  29732. ],
  29733. 2
  29734. )
  29735. ]
  29736. ),
  29737. _c("el-collapse-transition", [
  29738. _c(
  29739. "div",
  29740. {
  29741. directives: [
  29742. {
  29743. name: "show",
  29744. rawName: "v-show",
  29745. value: _vm.isActive,
  29746. expression: "isActive"
  29747. }
  29748. ],
  29749. staticClass: "el-collapse-item__wrap",
  29750. attrs: {
  29751. role: "tabpanel",
  29752. "aria-hidden": !_vm.isActive,
  29753. "aria-labelledby": "el-collapse-head-" + _vm.id,
  29754. id: "el-collapse-content-" + _vm.id
  29755. }
  29756. },
  29757. [
  29758. _c(
  29759. "div",
  29760. { staticClass: "el-collapse-item__content" },
  29761. [_vm._t("default")],
  29762. 2
  29763. )
  29764. ]
  29765. )
  29766. ])
  29767. ],
  29768. 1
  29769. )
  29770. }
  29771. var collapse_itemvue_type_template_id_2d05faac_staticRenderFns = []
  29772. collapse_itemvue_type_template_id_2d05faac_render._withStripped = true
  29773. // CONCATENATED MODULE: ./packages/collapse/src/collapse-item.vue?vue&type=template&id=2d05faac&
  29774. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/collapse/src/collapse-item.vue?vue&type=script&lang=js&
  29775. //
  29776. //
  29777. //
  29778. //
  29779. //
  29780. //
  29781. //
  29782. //
  29783. //
  29784. //
  29785. //
  29786. //
  29787. //
  29788. //
  29789. //
  29790. //
  29791. //
  29792. //
  29793. //
  29794. //
  29795. //
  29796. //
  29797. //
  29798. //
  29799. //
  29800. //
  29801. //
  29802. //
  29803. //
  29804. //
  29805. //
  29806. //
  29807. //
  29808. //
  29809. //
  29810. //
  29811. //
  29812. //
  29813. //
  29814. //
  29815. //
  29816. //
  29817. //
  29818. //
  29819. //
  29820. //
  29821. /* harmony default export */ var collapse_itemvue_type_script_lang_js_ = ({
  29822. name: 'ElCollapseItem',
  29823. componentName: 'ElCollapseItem',
  29824. mixins: [emitter_default.a],
  29825. components: { ElCollapseTransition: collapse_transition_default.a },
  29826. data: function data() {
  29827. return {
  29828. contentWrapStyle: {
  29829. height: 'auto',
  29830. display: 'block'
  29831. },
  29832. contentHeight: 0,
  29833. focusing: false,
  29834. isClick: false,
  29835. id: Object(util_["generateId"])()
  29836. };
  29837. },
  29838. inject: ['collapse'],
  29839. props: {
  29840. title: String,
  29841. name: {
  29842. type: [String, Number],
  29843. default: function _default() {
  29844. return this._uid;
  29845. }
  29846. },
  29847. disabled: Boolean
  29848. },
  29849. computed: {
  29850. isActive: function isActive() {
  29851. return this.collapse.activeNames.indexOf(this.name) > -1;
  29852. }
  29853. },
  29854. methods: {
  29855. handleFocus: function handleFocus() {
  29856. var _this = this;
  29857. setTimeout(function () {
  29858. if (!_this.isClick) {
  29859. _this.focusing = true;
  29860. } else {
  29861. _this.isClick = false;
  29862. }
  29863. }, 50);
  29864. },
  29865. handleHeaderClick: function handleHeaderClick() {
  29866. if (this.disabled) return;
  29867. this.dispatch('ElCollapse', 'item-click', this);
  29868. this.focusing = false;
  29869. this.isClick = true;
  29870. },
  29871. handleEnterClick: function handleEnterClick() {
  29872. this.dispatch('ElCollapse', 'item-click', this);
  29873. }
  29874. }
  29875. });
  29876. // CONCATENATED MODULE: ./packages/collapse/src/collapse-item.vue?vue&type=script&lang=js&
  29877. /* harmony default export */ var src_collapse_itemvue_type_script_lang_js_ = (collapse_itemvue_type_script_lang_js_);
  29878. // CONCATENATED MODULE: ./packages/collapse/src/collapse-item.vue
  29879. /* normalize component */
  29880. var collapse_item_component = normalizeComponent(
  29881. src_collapse_itemvue_type_script_lang_js_,
  29882. collapse_itemvue_type_template_id_2d05faac_render,
  29883. collapse_itemvue_type_template_id_2d05faac_staticRenderFns,
  29884. false,
  29885. null,
  29886. null,
  29887. null
  29888. )
  29889. /* hot reload */
  29890. if (false) { var collapse_item_api; }
  29891. collapse_item_component.options.__file = "packages/collapse/src/collapse-item.vue"
  29892. /* harmony default export */ var collapse_item = (collapse_item_component.exports);
  29893. // CONCATENATED MODULE: ./packages/collapse-item/index.js
  29894. /* istanbul ignore next */
  29895. collapse_item.install = function (Vue) {
  29896. Vue.component(collapse_item.name, collapse_item);
  29897. };
  29898. /* harmony default export */ var packages_collapse_item = (collapse_item);
  29899. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/cascader/src/cascader.vue?vue&type=template&id=032537a6&
  29900. var cascadervue_type_template_id_032537a6_render = function() {
  29901. var _vm = this
  29902. var _h = _vm.$createElement
  29903. var _c = _vm._self._c || _h
  29904. return _c(
  29905. "div",
  29906. {
  29907. directives: [
  29908. {
  29909. name: "clickoutside",
  29910. rawName: "v-clickoutside",
  29911. value: function() {
  29912. return _vm.toggleDropDownVisible(false)
  29913. },
  29914. expression: "() => toggleDropDownVisible(false)"
  29915. }
  29916. ],
  29917. ref: "reference",
  29918. class: [
  29919. "el-cascader",
  29920. _vm.realSize && "el-cascader--" + _vm.realSize,
  29921. { "is-disabled": _vm.isDisabled }
  29922. ],
  29923. on: {
  29924. mouseenter: function($event) {
  29925. _vm.inputHover = true
  29926. },
  29927. mouseleave: function($event) {
  29928. _vm.inputHover = false
  29929. },
  29930. click: function() {
  29931. return _vm.toggleDropDownVisible(_vm.readonly ? undefined : true)
  29932. },
  29933. keydown: _vm.handleKeyDown
  29934. }
  29935. },
  29936. [
  29937. _c(
  29938. "el-input",
  29939. {
  29940. ref: "input",
  29941. class: { "is-focus": _vm.dropDownVisible },
  29942. attrs: {
  29943. size: _vm.realSize,
  29944. placeholder: _vm.placeholder,
  29945. readonly: _vm.readonly,
  29946. disabled: _vm.isDisabled,
  29947. "validate-event": false
  29948. },
  29949. on: {
  29950. focus: _vm.handleFocus,
  29951. blur: _vm.handleBlur,
  29952. input: _vm.handleInput
  29953. },
  29954. model: {
  29955. value: _vm.multiple ? _vm.presentText : _vm.inputValue,
  29956. callback: function($$v) {
  29957. _vm.multiple ? _vm.presentText : (_vm.inputValue = $$v)
  29958. },
  29959. expression: "multiple ? presentText : inputValue"
  29960. }
  29961. },
  29962. [
  29963. _c("template", { slot: "suffix" }, [
  29964. _vm.clearBtnVisible
  29965. ? _c("i", {
  29966. key: "clear",
  29967. staticClass: "el-input__icon el-icon-circle-close",
  29968. on: {
  29969. click: function($event) {
  29970. $event.stopPropagation()
  29971. return _vm.handleClear($event)
  29972. }
  29973. }
  29974. })
  29975. : _c("i", {
  29976. key: "arrow-down",
  29977. class: [
  29978. "el-input__icon",
  29979. "el-icon-arrow-down",
  29980. _vm.dropDownVisible && "is-reverse"
  29981. ],
  29982. on: {
  29983. click: function($event) {
  29984. $event.stopPropagation()
  29985. _vm.toggleDropDownVisible()
  29986. }
  29987. }
  29988. })
  29989. ])
  29990. ],
  29991. 2
  29992. ),
  29993. _vm.multiple
  29994. ? _c(
  29995. "div",
  29996. { staticClass: "el-cascader__tags" },
  29997. [
  29998. _vm._l(_vm.presentTags, function(tag) {
  29999. return _c(
  30000. "el-tag",
  30001. {
  30002. key: tag.key,
  30003. attrs: {
  30004. type: "info",
  30005. size: _vm.tagSize,
  30006. hit: tag.hitState,
  30007. closable: tag.closable,
  30008. "disable-transitions": ""
  30009. },
  30010. on: {
  30011. close: function($event) {
  30012. _vm.deleteTag(tag)
  30013. }
  30014. }
  30015. },
  30016. [_c("span", [_vm._v(_vm._s(tag.text))])]
  30017. )
  30018. }),
  30019. _vm.filterable && !_vm.isDisabled
  30020. ? _c("input", {
  30021. directives: [
  30022. {
  30023. name: "model",
  30024. rawName: "v-model.trim",
  30025. value: _vm.inputValue,
  30026. expression: "inputValue",
  30027. modifiers: { trim: true }
  30028. }
  30029. ],
  30030. staticClass: "el-cascader__search-input",
  30031. attrs: {
  30032. type: "text",
  30033. placeholder: _vm.presentTags.length ? "" : _vm.placeholder
  30034. },
  30035. domProps: { value: _vm.inputValue },
  30036. on: {
  30037. input: [
  30038. function($event) {
  30039. if ($event.target.composing) {
  30040. return
  30041. }
  30042. _vm.inputValue = $event.target.value.trim()
  30043. },
  30044. function(e) {
  30045. return _vm.handleInput(_vm.inputValue, e)
  30046. }
  30047. ],
  30048. click: function($event) {
  30049. $event.stopPropagation()
  30050. _vm.toggleDropDownVisible(true)
  30051. },
  30052. keydown: function($event) {
  30053. if (
  30054. !("button" in $event) &&
  30055. _vm._k(
  30056. $event.keyCode,
  30057. "delete",
  30058. [8, 46],
  30059. $event.key,
  30060. ["Backspace", "Delete", "Del"]
  30061. )
  30062. ) {
  30063. return null
  30064. }
  30065. return _vm.handleDelete($event)
  30066. },
  30067. blur: function($event) {
  30068. _vm.$forceUpdate()
  30069. }
  30070. }
  30071. })
  30072. : _vm._e()
  30073. ],
  30074. 2
  30075. )
  30076. : _vm._e(),
  30077. _c(
  30078. "transition",
  30079. {
  30080. attrs: { name: "el-zoom-in-top" },
  30081. on: { "after-leave": _vm.handleDropdownLeave }
  30082. },
  30083. [
  30084. _c(
  30085. "div",
  30086. {
  30087. directives: [
  30088. {
  30089. name: "show",
  30090. rawName: "v-show",
  30091. value: _vm.dropDownVisible,
  30092. expression: "dropDownVisible"
  30093. }
  30094. ],
  30095. ref: "popper",
  30096. class: ["el-popper", "el-cascader__dropdown", _vm.popperClass]
  30097. },
  30098. [
  30099. _c("el-cascader-panel", {
  30100. directives: [
  30101. {
  30102. name: "show",
  30103. rawName: "v-show",
  30104. value: !_vm.filtering,
  30105. expression: "!filtering"
  30106. }
  30107. ],
  30108. ref: "panel",
  30109. attrs: {
  30110. options: _vm.options,
  30111. props: _vm.config,
  30112. border: false,
  30113. "render-label": _vm.$scopedSlots.default
  30114. },
  30115. on: {
  30116. "expand-change": _vm.handleExpandChange,
  30117. close: function($event) {
  30118. _vm.toggleDropDownVisible(false)
  30119. }
  30120. },
  30121. model: {
  30122. value: _vm.checkedValue,
  30123. callback: function($$v) {
  30124. _vm.checkedValue = $$v
  30125. },
  30126. expression: "checkedValue"
  30127. }
  30128. }),
  30129. _vm.filterable
  30130. ? _c(
  30131. "el-scrollbar",
  30132. {
  30133. directives: [
  30134. {
  30135. name: "show",
  30136. rawName: "v-show",
  30137. value: _vm.filtering,
  30138. expression: "filtering"
  30139. }
  30140. ],
  30141. ref: "suggestionPanel",
  30142. staticClass: "el-cascader__suggestion-panel",
  30143. attrs: {
  30144. tag: "ul",
  30145. "view-class": "el-cascader__suggestion-list"
  30146. },
  30147. nativeOn: {
  30148. keydown: function($event) {
  30149. return _vm.handleSuggestionKeyDown($event)
  30150. }
  30151. }
  30152. },
  30153. [
  30154. _vm.suggestions.length
  30155. ? _vm._l(_vm.suggestions, function(item, index) {
  30156. return _c(
  30157. "li",
  30158. {
  30159. key: item.uid,
  30160. class: [
  30161. "el-cascader__suggestion-item",
  30162. item.checked && "is-checked"
  30163. ],
  30164. attrs: { tabindex: -1 },
  30165. on: {
  30166. click: function($event) {
  30167. _vm.handleSuggestionClick(index)
  30168. }
  30169. }
  30170. },
  30171. [
  30172. _c("span", [_vm._v(_vm._s(item.text))]),
  30173. item.checked
  30174. ? _c("i", { staticClass: "el-icon-check" })
  30175. : _vm._e()
  30176. ]
  30177. )
  30178. })
  30179. : _vm._t("empty", [
  30180. _c(
  30181. "li",
  30182. { staticClass: "el-cascader__empty-text" },
  30183. [_vm._v(_vm._s(_vm.t("el.cascader.noMatch")))]
  30184. )
  30185. ])
  30186. ],
  30187. 2
  30188. )
  30189. : _vm._e()
  30190. ],
  30191. 1
  30192. )
  30193. ]
  30194. )
  30195. ],
  30196. 1
  30197. )
  30198. }
  30199. var cascadervue_type_template_id_032537a6_staticRenderFns = []
  30200. cascadervue_type_template_id_032537a6_render._withStripped = true
  30201. // CONCATENATED MODULE: ./packages/cascader/src/cascader.vue?vue&type=template&id=032537a6&
  30202. // EXTERNAL MODULE: external "element-ui/lib/cascader-panel"
  30203. var cascader_panel_ = __webpack_require__(43);
  30204. var cascader_panel_default = /*#__PURE__*/__webpack_require__.n(cascader_panel_);
  30205. // EXTERNAL MODULE: external "element-ui/lib/utils/aria-utils"
  30206. var aria_utils_ = __webpack_require__(35);
  30207. var aria_utils_default = /*#__PURE__*/__webpack_require__.n(aria_utils_);
  30208. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/cascader/src/cascader.vue?vue&type=script&lang=js&
  30209. //
  30210. //
  30211. //
  30212. //
  30213. //
  30214. //
  30215. //
  30216. //
  30217. //
  30218. //
  30219. //
  30220. //
  30221. //
  30222. //
  30223. //
  30224. //
  30225. //
  30226. //
  30227. //
  30228. //
  30229. //
  30230. //
  30231. //
  30232. //
  30233. //
  30234. //
  30235. //
  30236. //
  30237. //
  30238. //
  30239. //
  30240. //
  30241. //
  30242. //
  30243. //
  30244. //
  30245. //
  30246. //
  30247. //
  30248. //
  30249. //
  30250. //
  30251. //
  30252. //
  30253. //
  30254. //
  30255. //
  30256. //
  30257. //
  30258. //
  30259. //
  30260. //
  30261. //
  30262. //
  30263. //
  30264. //
  30265. //
  30266. //
  30267. //
  30268. //
  30269. //
  30270. //
  30271. //
  30272. //
  30273. //
  30274. //
  30275. //
  30276. //
  30277. //
  30278. //
  30279. //
  30280. //
  30281. //
  30282. //
  30283. //
  30284. //
  30285. //
  30286. //
  30287. //
  30288. //
  30289. //
  30290. //
  30291. //
  30292. //
  30293. //
  30294. //
  30295. //
  30296. //
  30297. //
  30298. //
  30299. //
  30300. //
  30301. //
  30302. //
  30303. //
  30304. //
  30305. //
  30306. //
  30307. //
  30308. //
  30309. //
  30310. //
  30311. //
  30312. //
  30313. //
  30314. //
  30315. //
  30316. //
  30317. //
  30318. //
  30319. //
  30320. //
  30321. //
  30322. var KeyCode = aria_utils_default.a.keys;
  30323. var MigratingProps = {
  30324. expandTrigger: {
  30325. newProp: 'expandTrigger',
  30326. type: String
  30327. },
  30328. changeOnSelect: {
  30329. newProp: 'checkStrictly',
  30330. type: Boolean
  30331. },
  30332. hoverThreshold: {
  30333. newProp: 'hoverThreshold',
  30334. type: Number
  30335. }
  30336. };
  30337. var PopperMixin = {
  30338. props: {
  30339. placement: {
  30340. type: String,
  30341. default: 'bottom-start'
  30342. },
  30343. appendToBody: vue_popper_default.a.props.appendToBody,
  30344. visibleArrow: {
  30345. type: Boolean,
  30346. default: true
  30347. },
  30348. arrowOffset: vue_popper_default.a.props.arrowOffset,
  30349. offset: vue_popper_default.a.props.offset,
  30350. boundariesPadding: vue_popper_default.a.props.boundariesPadding,
  30351. popperOptions: vue_popper_default.a.props.popperOptions,
  30352. transformOrigin: vue_popper_default.a.props.transformOrigin
  30353. },
  30354. methods: vue_popper_default.a.methods,
  30355. data: vue_popper_default.a.data,
  30356. beforeDestroy: vue_popper_default.a.beforeDestroy
  30357. };
  30358. var InputSizeMap = {
  30359. medium: 36,
  30360. small: 32,
  30361. mini: 28
  30362. };
  30363. /* harmony default export */ var cascadervue_type_script_lang_js_ = ({
  30364. name: 'ElCascader',
  30365. directives: { Clickoutside: clickoutside_default.a },
  30366. mixins: [PopperMixin, emitter_default.a, locale_default.a, migrating_default.a],
  30367. inject: {
  30368. elForm: {
  30369. default: ''
  30370. },
  30371. elFormItem: {
  30372. default: ''
  30373. }
  30374. },
  30375. components: {
  30376. ElInput: input_default.a,
  30377. ElTag: tag_default.a,
  30378. ElScrollbar: scrollbar_default.a,
  30379. ElCascaderPanel: cascader_panel_default.a
  30380. },
  30381. props: {
  30382. value: {},
  30383. options: Array,
  30384. props: Object,
  30385. size: String,
  30386. placeholder: {
  30387. type: String,
  30388. default: function _default() {
  30389. return Object(lib_locale_["t"])('el.cascader.placeholder');
  30390. }
  30391. },
  30392. disabled: Boolean,
  30393. clearable: Boolean,
  30394. filterable: Boolean,
  30395. filterMethod: Function,
  30396. separator: {
  30397. type: String,
  30398. default: ' / '
  30399. },
  30400. showAllLevels: {
  30401. type: Boolean,
  30402. default: true
  30403. },
  30404. collapseTags: Boolean,
  30405. debounce: {
  30406. type: Number,
  30407. default: 300
  30408. },
  30409. beforeFilter: {
  30410. type: Function,
  30411. default: function _default() {
  30412. return function () {};
  30413. }
  30414. },
  30415. popperClass: String
  30416. },
  30417. data: function data() {
  30418. return {
  30419. dropDownVisible: false,
  30420. checkedValue: this.value,
  30421. inputHover: false,
  30422. inputValue: null,
  30423. presentText: null,
  30424. presentTags: [],
  30425. checkedNodes: [],
  30426. filtering: false,
  30427. suggestions: [],
  30428. inputInitialHeight: 0,
  30429. pressDeleteCount: 0
  30430. };
  30431. },
  30432. computed: {
  30433. realSize: function realSize() {
  30434. var _elFormItemSize = (this.elFormItem || {}).elFormItemSize;
  30435. return this.size || _elFormItemSize || (this.$ELEMENT || {}).size;
  30436. },
  30437. tagSize: function tagSize() {
  30438. return ['small', 'mini'].indexOf(this.realSize) > -1 ? 'mini' : 'small';
  30439. },
  30440. isDisabled: function isDisabled() {
  30441. return this.disabled || (this.elForm || {}).disabled;
  30442. },
  30443. config: function config() {
  30444. var config = this.props || {};
  30445. var $attrs = this.$attrs;
  30446. Object.keys(MigratingProps).forEach(function (oldProp) {
  30447. var _MigratingProps$oldPr = MigratingProps[oldProp],
  30448. newProp = _MigratingProps$oldPr.newProp,
  30449. type = _MigratingProps$oldPr.type;
  30450. var oldValue = $attrs[oldProp] || $attrs[Object(util_["kebabCase"])(oldProp)];
  30451. if (Object(shared_["isDef"])(oldProp) && !Object(shared_["isDef"])(config[newProp])) {
  30452. if (type === Boolean && oldValue === '') {
  30453. oldValue = true;
  30454. }
  30455. config[newProp] = oldValue;
  30456. }
  30457. });
  30458. return config;
  30459. },
  30460. multiple: function multiple() {
  30461. return this.config.multiple;
  30462. },
  30463. leafOnly: function leafOnly() {
  30464. return !this.config.checkStrictly;
  30465. },
  30466. readonly: function readonly() {
  30467. return !this.filterable || this.multiple;
  30468. },
  30469. clearBtnVisible: function clearBtnVisible() {
  30470. if (!this.clearable || this.isDisabled || this.filtering || !this.inputHover) {
  30471. return false;
  30472. }
  30473. return this.multiple ? !!this.checkedNodes.filter(function (node) {
  30474. return !node.isDisabled;
  30475. }).length : !!this.presentText;
  30476. },
  30477. panel: function panel() {
  30478. return this.$refs.panel;
  30479. }
  30480. },
  30481. watch: {
  30482. disabled: function disabled() {
  30483. this.computePresentContent();
  30484. },
  30485. value: function value(val) {
  30486. if (!Object(util_["isEqual"])(val, this.checkedValue)) {
  30487. this.checkedValue = val;
  30488. this.computePresentContent();
  30489. }
  30490. },
  30491. checkedValue: function checkedValue(val) {
  30492. var value = this.value,
  30493. dropDownVisible = this.dropDownVisible;
  30494. var _config = this.config,
  30495. checkStrictly = _config.checkStrictly,
  30496. multiple = _config.multiple;
  30497. if (!Object(util_["isEqual"])(val, value) || Object(types_["isUndefined"])(value)) {
  30498. this.computePresentContent();
  30499. // hide dropdown when single mode
  30500. if (!multiple && !checkStrictly && dropDownVisible) {
  30501. this.toggleDropDownVisible(false);
  30502. }
  30503. this.$emit('input', val);
  30504. this.$emit('change', val);
  30505. this.dispatch('ElFormItem', 'el.form.change', [val]);
  30506. }
  30507. },
  30508. options: {
  30509. handler: function handler() {
  30510. this.$nextTick(this.computePresentContent);
  30511. },
  30512. deep: true
  30513. },
  30514. presentText: function presentText(val) {
  30515. this.inputValue = val;
  30516. },
  30517. presentTags: function presentTags(val, oldVal) {
  30518. if (this.multiple && (val.length || oldVal.length)) {
  30519. this.$nextTick(this.updateStyle);
  30520. }
  30521. },
  30522. filtering: function filtering(val) {
  30523. this.$nextTick(this.updatePopper);
  30524. }
  30525. },
  30526. mounted: function mounted() {
  30527. var _this = this;
  30528. var input = this.$refs.input;
  30529. if (input && input.$el) {
  30530. this.inputInitialHeight = input.$el.offsetHeight || InputSizeMap[this.realSize] || 40;
  30531. }
  30532. if (!this.isEmptyValue(this.value)) {
  30533. this.computePresentContent();
  30534. }
  30535. this.filterHandler = debounce_default()(this.debounce, function () {
  30536. var inputValue = _this.inputValue;
  30537. if (!inputValue) {
  30538. _this.filtering = false;
  30539. return;
  30540. }
  30541. var before = _this.beforeFilter(inputValue);
  30542. if (before && before.then) {
  30543. before.then(_this.getSuggestions);
  30544. } else if (before !== false) {
  30545. _this.getSuggestions();
  30546. } else {
  30547. _this.filtering = false;
  30548. }
  30549. });
  30550. Object(resize_event_["addResizeListener"])(this.$el, this.updateStyle);
  30551. },
  30552. beforeDestroy: function beforeDestroy() {
  30553. Object(resize_event_["removeResizeListener"])(this.$el, this.updateStyle);
  30554. },
  30555. methods: {
  30556. getMigratingConfig: function getMigratingConfig() {
  30557. return {
  30558. props: {
  30559. 'expand-trigger': 'expand-trigger is removed, use `props.expandTrigger` instead.',
  30560. 'change-on-select': 'change-on-select is removed, use `props.checkStrictly` instead.',
  30561. 'hover-threshold': 'hover-threshold is removed, use `props.hoverThreshold` instead'
  30562. },
  30563. events: {
  30564. 'active-item-change': 'active-item-change is renamed to expand-change'
  30565. }
  30566. };
  30567. },
  30568. toggleDropDownVisible: function toggleDropDownVisible(visible) {
  30569. var _this2 = this;
  30570. if (this.isDisabled) return;
  30571. var dropDownVisible = this.dropDownVisible;
  30572. var input = this.$refs.input;
  30573. visible = Object(shared_["isDef"])(visible) ? visible : !dropDownVisible;
  30574. if (visible !== dropDownVisible) {
  30575. this.dropDownVisible = visible;
  30576. if (visible) {
  30577. this.$nextTick(function () {
  30578. _this2.updatePopper();
  30579. _this2.panel.scrollIntoView();
  30580. });
  30581. }
  30582. input.$refs.input.setAttribute('aria-expanded', visible);
  30583. this.$emit('visible-change', visible);
  30584. }
  30585. },
  30586. handleDropdownLeave: function handleDropdownLeave() {
  30587. this.filtering = false;
  30588. this.inputValue = this.presentText;
  30589. this.doDestroy();
  30590. },
  30591. handleKeyDown: function handleKeyDown(event) {
  30592. switch (event.keyCode) {
  30593. case KeyCode.enter:
  30594. this.toggleDropDownVisible();
  30595. break;
  30596. case KeyCode.down:
  30597. this.toggleDropDownVisible(true);
  30598. this.focusFirstNode();
  30599. event.preventDefault();
  30600. break;
  30601. case KeyCode.esc:
  30602. case KeyCode.tab:
  30603. this.toggleDropDownVisible(false);
  30604. break;
  30605. }
  30606. },
  30607. handleFocus: function handleFocus(e) {
  30608. this.$emit('focus', e);
  30609. },
  30610. handleBlur: function handleBlur(e) {
  30611. this.$emit('blur', e);
  30612. },
  30613. handleInput: function handleInput(val, event) {
  30614. !this.dropDownVisible && this.toggleDropDownVisible(true);
  30615. if (event && event.isComposing) return;
  30616. if (val) {
  30617. this.filterHandler();
  30618. } else {
  30619. this.filtering = false;
  30620. }
  30621. },
  30622. handleClear: function handleClear() {
  30623. this.presentText = '';
  30624. this.panel.clearCheckedNodes();
  30625. },
  30626. handleExpandChange: function handleExpandChange(value) {
  30627. this.$nextTick(this.updatePopper.bind(this));
  30628. this.$emit('expand-change', value);
  30629. this.$emit('active-item-change', value); // Deprecated
  30630. },
  30631. focusFirstNode: function focusFirstNode() {
  30632. var _this3 = this;
  30633. this.$nextTick(function () {
  30634. var filtering = _this3.filtering;
  30635. var _$refs = _this3.$refs,
  30636. popper = _$refs.popper,
  30637. suggestionPanel = _$refs.suggestionPanel;
  30638. var firstNode = null;
  30639. if (filtering && suggestionPanel) {
  30640. firstNode = suggestionPanel.$el.querySelector('.el-cascader__suggestion-item');
  30641. } else {
  30642. var firstMenu = popper.querySelector('.el-cascader-menu');
  30643. firstNode = firstMenu.querySelector('.el-cascader-node[tabindex="-1"]');
  30644. }
  30645. if (firstNode) {
  30646. firstNode.focus();
  30647. !filtering && firstNode.click();
  30648. }
  30649. });
  30650. },
  30651. computePresentContent: function computePresentContent() {
  30652. var _this4 = this;
  30653. // nextTick is required, because checked nodes may not change right now
  30654. this.$nextTick(function () {
  30655. if (_this4.config.multiple) {
  30656. _this4.computePresentTags();
  30657. _this4.presentText = _this4.presentTags.length ? ' ' : null;
  30658. } else {
  30659. _this4.computePresentText();
  30660. }
  30661. });
  30662. },
  30663. isEmptyValue: function isEmptyValue(val) {
  30664. var multiple = this.multiple;
  30665. var emitPath = this.panel.config.emitPath;
  30666. if (multiple || emitPath) {
  30667. return Object(util_["isEmpty"])(val);
  30668. }
  30669. return false;
  30670. },
  30671. computePresentText: function computePresentText() {
  30672. var checkedValue = this.checkedValue,
  30673. config = this.config;
  30674. if (!this.isEmptyValue(checkedValue)) {
  30675. var node = this.panel.getNodeByValue(checkedValue);
  30676. if (node && (config.checkStrictly || node.isLeaf)) {
  30677. this.presentText = node.getText(this.showAllLevels, this.separator);
  30678. return;
  30679. }
  30680. }
  30681. this.presentText = null;
  30682. },
  30683. computePresentTags: function computePresentTags() {
  30684. var isDisabled = this.isDisabled,
  30685. leafOnly = this.leafOnly,
  30686. showAllLevels = this.showAllLevels,
  30687. separator = this.separator,
  30688. collapseTags = this.collapseTags;
  30689. var checkedNodes = this.getCheckedNodes(leafOnly);
  30690. var tags = [];
  30691. var genTag = function genTag(node) {
  30692. return {
  30693. node: node,
  30694. key: node.uid,
  30695. text: node.getText(showAllLevels, separator),
  30696. hitState: false,
  30697. closable: !isDisabled && !node.isDisabled
  30698. };
  30699. };
  30700. if (checkedNodes.length) {
  30701. var first = checkedNodes[0],
  30702. rest = checkedNodes.slice(1);
  30703. var restCount = rest.length;
  30704. tags.push(genTag(first));
  30705. if (restCount) {
  30706. if (collapseTags) {
  30707. tags.push({
  30708. key: -1,
  30709. text: '+ ' + restCount,
  30710. closable: false
  30711. });
  30712. } else {
  30713. rest.forEach(function (node) {
  30714. return tags.push(genTag(node));
  30715. });
  30716. }
  30717. }
  30718. }
  30719. this.checkedNodes = checkedNodes;
  30720. this.presentTags = tags;
  30721. },
  30722. getSuggestions: function getSuggestions() {
  30723. var _this5 = this;
  30724. var filterMethod = this.filterMethod;
  30725. if (!Object(types_["isFunction"])(filterMethod)) {
  30726. filterMethod = function filterMethod(node, keyword) {
  30727. return node.text.includes(keyword);
  30728. };
  30729. }
  30730. var suggestions = this.panel.getFlattedNodes(this.leafOnly).filter(function (node) {
  30731. if (node.isDisabled) return false;
  30732. node.text = node.getText(_this5.showAllLevels, _this5.separator) || '';
  30733. return filterMethod(node, _this5.inputValue);
  30734. });
  30735. if (this.multiple) {
  30736. this.presentTags.forEach(function (tag) {
  30737. tag.hitState = false;
  30738. });
  30739. } else {
  30740. suggestions.forEach(function (node) {
  30741. node.checked = Object(util_["isEqual"])(_this5.checkedValue, node.getValueByOption());
  30742. });
  30743. }
  30744. this.filtering = true;
  30745. this.suggestions = suggestions;
  30746. this.$nextTick(this.updatePopper);
  30747. },
  30748. handleSuggestionKeyDown: function handleSuggestionKeyDown(event) {
  30749. var keyCode = event.keyCode,
  30750. target = event.target;
  30751. switch (keyCode) {
  30752. case KeyCode.enter:
  30753. target.click();
  30754. break;
  30755. case KeyCode.up:
  30756. var prev = target.previousElementSibling;
  30757. prev && prev.focus();
  30758. break;
  30759. case KeyCode.down:
  30760. var next = target.nextElementSibling;
  30761. next && next.focus();
  30762. break;
  30763. case KeyCode.esc:
  30764. case KeyCode.tab:
  30765. this.toggleDropDownVisible(false);
  30766. break;
  30767. }
  30768. },
  30769. handleDelete: function handleDelete() {
  30770. var inputValue = this.inputValue,
  30771. pressDeleteCount = this.pressDeleteCount,
  30772. presentTags = this.presentTags;
  30773. var lastIndex = presentTags.length - 1;
  30774. var lastTag = presentTags[lastIndex];
  30775. this.pressDeleteCount = inputValue ? 0 : pressDeleteCount + 1;
  30776. if (!lastTag) return;
  30777. if (this.pressDeleteCount) {
  30778. if (lastTag.hitState) {
  30779. this.deleteTag(lastTag);
  30780. } else {
  30781. lastTag.hitState = true;
  30782. }
  30783. }
  30784. },
  30785. handleSuggestionClick: function handleSuggestionClick(index) {
  30786. var multiple = this.multiple;
  30787. var targetNode = this.suggestions[index];
  30788. if (multiple) {
  30789. var checked = targetNode.checked;
  30790. targetNode.doCheck(!checked);
  30791. this.panel.calculateMultiCheckedValue();
  30792. } else {
  30793. this.checkedValue = targetNode.getValueByOption();
  30794. this.toggleDropDownVisible(false);
  30795. }
  30796. },
  30797. deleteTag: function deleteTag(tag) {
  30798. var checkedValue = this.checkedValue;
  30799. var current = tag.node.getValueByOption();
  30800. var val = checkedValue.find(function (n) {
  30801. return Object(util_["isEqual"])(n, current);
  30802. });
  30803. this.checkedValue = checkedValue.filter(function (n) {
  30804. return !Object(util_["isEqual"])(n, current);
  30805. });
  30806. this.$emit('remove-tag', val);
  30807. },
  30808. updateStyle: function updateStyle() {
  30809. var $el = this.$el,
  30810. inputInitialHeight = this.inputInitialHeight;
  30811. if (this.$isServer || !$el) return;
  30812. var suggestionPanel = this.$refs.suggestionPanel;
  30813. var inputInner = $el.querySelector('.el-input__inner');
  30814. if (!inputInner) return;
  30815. var tags = $el.querySelector('.el-cascader__tags');
  30816. var suggestionPanelEl = null;
  30817. if (suggestionPanel && (suggestionPanelEl = suggestionPanel.$el)) {
  30818. var suggestionList = suggestionPanelEl.querySelector('.el-cascader__suggestion-list');
  30819. suggestionList.style.minWidth = inputInner.offsetWidth + 'px';
  30820. }
  30821. if (tags) {
  30822. var offsetHeight = Math.round(tags.getBoundingClientRect().height);
  30823. var height = Math.max(offsetHeight + 6, inputInitialHeight) + 'px';
  30824. inputInner.style.height = height;
  30825. if (this.dropDownVisible) {
  30826. this.updatePopper();
  30827. }
  30828. }
  30829. },
  30830. /**
  30831. * public methods
  30832. */
  30833. getCheckedNodes: function getCheckedNodes(leafOnly) {
  30834. return this.panel.getCheckedNodes(leafOnly);
  30835. }
  30836. }
  30837. });
  30838. // CONCATENATED MODULE: ./packages/cascader/src/cascader.vue?vue&type=script&lang=js&
  30839. /* harmony default export */ var src_cascadervue_type_script_lang_js_ = (cascadervue_type_script_lang_js_);
  30840. // CONCATENATED MODULE: ./packages/cascader/src/cascader.vue
  30841. /* normalize component */
  30842. var cascader_component = normalizeComponent(
  30843. src_cascadervue_type_script_lang_js_,
  30844. cascadervue_type_template_id_032537a6_render,
  30845. cascadervue_type_template_id_032537a6_staticRenderFns,
  30846. false,
  30847. null,
  30848. null,
  30849. null
  30850. )
  30851. /* hot reload */
  30852. if (false) { var cascader_api; }
  30853. cascader_component.options.__file = "packages/cascader/src/cascader.vue"
  30854. /* harmony default export */ var cascader = (cascader_component.exports);
  30855. // CONCATENATED MODULE: ./packages/cascader/index.js
  30856. /* istanbul ignore next */
  30857. cascader.install = function (Vue) {
  30858. Vue.component(cascader.name, cascader);
  30859. };
  30860. /* harmony default export */ var packages_cascader = (cascader);
  30861. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/color-picker/src/main.vue?vue&type=template&id=55c8ade7&
  30862. var mainvue_type_template_id_55c8ade7_render = function() {
  30863. var _vm = this
  30864. var _h = _vm.$createElement
  30865. var _c = _vm._self._c || _h
  30866. return _c(
  30867. "div",
  30868. {
  30869. directives: [
  30870. {
  30871. name: "clickoutside",
  30872. rawName: "v-clickoutside",
  30873. value: _vm.hide,
  30874. expression: "hide"
  30875. }
  30876. ],
  30877. class: [
  30878. "el-color-picker",
  30879. _vm.colorDisabled ? "is-disabled" : "",
  30880. _vm.colorSize ? "el-color-picker--" + _vm.colorSize : ""
  30881. ]
  30882. },
  30883. [
  30884. _vm.colorDisabled
  30885. ? _c("div", { staticClass: "el-color-picker__mask" })
  30886. : _vm._e(),
  30887. _c(
  30888. "div",
  30889. {
  30890. staticClass: "el-color-picker__trigger",
  30891. on: { click: _vm.handleTrigger }
  30892. },
  30893. [
  30894. _c(
  30895. "span",
  30896. {
  30897. staticClass: "el-color-picker__color",
  30898. class: { "is-alpha": _vm.showAlpha }
  30899. },
  30900. [
  30901. _c("span", {
  30902. staticClass: "el-color-picker__color-inner",
  30903. style: {
  30904. backgroundColor: _vm.displayedColor
  30905. }
  30906. }),
  30907. !_vm.value && !_vm.showPanelColor
  30908. ? _c("span", {
  30909. staticClass: "el-color-picker__empty el-icon-close"
  30910. })
  30911. : _vm._e()
  30912. ]
  30913. ),
  30914. _c("span", {
  30915. directives: [
  30916. {
  30917. name: "show",
  30918. rawName: "v-show",
  30919. value: _vm.value || _vm.showPanelColor,
  30920. expression: "value || showPanelColor"
  30921. }
  30922. ],
  30923. staticClass: "el-color-picker__icon el-icon-arrow-down"
  30924. })
  30925. ]
  30926. ),
  30927. _c("picker-dropdown", {
  30928. ref: "dropdown",
  30929. class: ["el-color-picker__panel", _vm.popperClass || ""],
  30930. attrs: {
  30931. color: _vm.color,
  30932. "show-alpha": _vm.showAlpha,
  30933. predefine: _vm.predefine
  30934. },
  30935. on: { pick: _vm.confirmValue, clear: _vm.clearValue },
  30936. model: {
  30937. value: _vm.showPicker,
  30938. callback: function($$v) {
  30939. _vm.showPicker = $$v
  30940. },
  30941. expression: "showPicker"
  30942. }
  30943. })
  30944. ],
  30945. 1
  30946. )
  30947. }
  30948. var mainvue_type_template_id_55c8ade7_staticRenderFns = []
  30949. mainvue_type_template_id_55c8ade7_render._withStripped = true
  30950. // CONCATENATED MODULE: ./packages/color-picker/src/main.vue?vue&type=template&id=55c8ade7&
  30951. // CONCATENATED MODULE: ./packages/color-picker/src/color.js
  30952. var color_typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  30953. function color_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30954. var hsv2hsl = function hsv2hsl(hue, sat, val) {
  30955. return [hue, sat * val / ((hue = (2 - sat) * val) < 1 ? hue : 2 - hue) || 0, hue / 2];
  30956. };
  30957. // Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1
  30958. // <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>
  30959. var isOnePointZero = function isOnePointZero(n) {
  30960. return typeof n === 'string' && n.indexOf('.') !== -1 && parseFloat(n) === 1;
  30961. };
  30962. var isPercentage = function isPercentage(n) {
  30963. return typeof n === 'string' && n.indexOf('%') !== -1;
  30964. };
  30965. // Take input from [0, n] and return it as [0, 1]
  30966. var bound01 = function bound01(value, max) {
  30967. if (isOnePointZero(value)) value = '100%';
  30968. var processPercent = isPercentage(value);
  30969. value = Math.min(max, Math.max(0, parseFloat(value)));
  30970. // Automatically convert percentage into number
  30971. if (processPercent) {
  30972. value = parseInt(value * max, 10) / 100;
  30973. }
  30974. // Handle floating point rounding errors
  30975. if (Math.abs(value - max) < 0.000001) {
  30976. return 1;
  30977. }
  30978. // Convert into [0, 1] range if it isn't already
  30979. return value % max / parseFloat(max);
  30980. };
  30981. var INT_HEX_MAP = { 10: 'A', 11: 'B', 12: 'C', 13: 'D', 14: 'E', 15: 'F' };
  30982. var toHex = function toHex(_ref) {
  30983. var r = _ref.r,
  30984. g = _ref.g,
  30985. b = _ref.b;
  30986. var hexOne = function hexOne(value) {
  30987. value = Math.min(Math.round(value), 255);
  30988. var high = Math.floor(value / 16);
  30989. var low = value % 16;
  30990. return '' + (INT_HEX_MAP[high] || high) + (INT_HEX_MAP[low] || low);
  30991. };
  30992. if (isNaN(r) || isNaN(g) || isNaN(b)) return '';
  30993. return '#' + hexOne(r) + hexOne(g) + hexOne(b);
  30994. };
  30995. var HEX_INT_MAP = { A: 10, B: 11, C: 12, D: 13, E: 14, F: 15 };
  30996. var parseHexChannel = function parseHexChannel(hex) {
  30997. if (hex.length === 2) {
  30998. return (HEX_INT_MAP[hex[0].toUpperCase()] || +hex[0]) * 16 + (HEX_INT_MAP[hex[1].toUpperCase()] || +hex[1]);
  30999. }
  31000. return HEX_INT_MAP[hex[1].toUpperCase()] || +hex[1];
  31001. };
  31002. var hsl2hsv = function hsl2hsv(hue, sat, light) {
  31003. sat = sat / 100;
  31004. light = light / 100;
  31005. var smin = sat;
  31006. var lmin = Math.max(light, 0.01);
  31007. var sv = void 0;
  31008. var v = void 0;
  31009. light *= 2;
  31010. sat *= light <= 1 ? light : 2 - light;
  31011. smin *= lmin <= 1 ? lmin : 2 - lmin;
  31012. v = (light + sat) / 2;
  31013. sv = light === 0 ? 2 * smin / (lmin + smin) : 2 * sat / (light + sat);
  31014. return {
  31015. h: hue,
  31016. s: sv * 100,
  31017. v: v * 100
  31018. };
  31019. };
  31020. // `rgbToHsv`
  31021. // Converts an RGB color value to HSV
  31022. // *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]
  31023. // *Returns:* { h, s, v } in [0,1]
  31024. var rgb2hsv = function rgb2hsv(r, g, b) {
  31025. r = bound01(r, 255);
  31026. g = bound01(g, 255);
  31027. b = bound01(b, 255);
  31028. var max = Math.max(r, g, b);
  31029. var min = Math.min(r, g, b);
  31030. var h = void 0,
  31031. s = void 0;
  31032. var v = max;
  31033. var d = max - min;
  31034. s = max === 0 ? 0 : d / max;
  31035. if (max === min) {
  31036. h = 0; // achromatic
  31037. } else {
  31038. switch (max) {
  31039. case r:
  31040. h = (g - b) / d + (g < b ? 6 : 0);
  31041. break;
  31042. case g:
  31043. h = (b - r) / d + 2;
  31044. break;
  31045. case b:
  31046. h = (r - g) / d + 4;
  31047. break;
  31048. }
  31049. h /= 6;
  31050. }
  31051. return { h: h * 360, s: s * 100, v: v * 100 };
  31052. };
  31053. // `hsvToRgb`
  31054. // Converts an HSV color value to RGB.
  31055. // *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]
  31056. // *Returns:* { r, g, b } in the set [0, 255]
  31057. var hsv2rgb = function hsv2rgb(h, s, v) {
  31058. h = bound01(h, 360) * 6;
  31059. s = bound01(s, 100);
  31060. v = bound01(v, 100);
  31061. var i = Math.floor(h);
  31062. var f = h - i;
  31063. var p = v * (1 - s);
  31064. var q = v * (1 - f * s);
  31065. var t = v * (1 - (1 - f) * s);
  31066. var mod = i % 6;
  31067. var r = [v, q, p, p, t, v][mod];
  31068. var g = [t, v, v, q, p, p][mod];
  31069. var b = [p, p, t, v, v, q][mod];
  31070. return {
  31071. r: Math.round(r * 255),
  31072. g: Math.round(g * 255),
  31073. b: Math.round(b * 255)
  31074. };
  31075. };
  31076. var Color = function () {
  31077. function Color(options) {
  31078. color_classCallCheck(this, Color);
  31079. this._hue = 0;
  31080. this._saturation = 100;
  31081. this._value = 100;
  31082. this._alpha = 100;
  31083. this.enableAlpha = false;
  31084. this.format = 'hex';
  31085. this.value = '';
  31086. options = options || {};
  31087. for (var option in options) {
  31088. if (options.hasOwnProperty(option)) {
  31089. this[option] = options[option];
  31090. }
  31091. }
  31092. this.doOnChange();
  31093. }
  31094. Color.prototype.set = function set(prop, value) {
  31095. if (arguments.length === 1 && (typeof prop === 'undefined' ? 'undefined' : color_typeof(prop)) === 'object') {
  31096. for (var p in prop) {
  31097. if (prop.hasOwnProperty(p)) {
  31098. this.set(p, prop[p]);
  31099. }
  31100. }
  31101. return;
  31102. }
  31103. this['_' + prop] = value;
  31104. this.doOnChange();
  31105. };
  31106. Color.prototype.get = function get(prop) {
  31107. return this['_' + prop];
  31108. };
  31109. Color.prototype.toRgb = function toRgb() {
  31110. return hsv2rgb(this._hue, this._saturation, this._value);
  31111. };
  31112. Color.prototype.fromString = function fromString(value) {
  31113. var _this = this;
  31114. if (!value) {
  31115. this._hue = 0;
  31116. this._saturation = 100;
  31117. this._value = 100;
  31118. this.doOnChange();
  31119. return;
  31120. }
  31121. var fromHSV = function fromHSV(h, s, v) {
  31122. _this._hue = Math.max(0, Math.min(360, h));
  31123. _this._saturation = Math.max(0, Math.min(100, s));
  31124. _this._value = Math.max(0, Math.min(100, v));
  31125. _this.doOnChange();
  31126. };
  31127. if (value.indexOf('hsl') !== -1) {
  31128. var parts = value.replace(/hsla|hsl|\(|\)/gm, '').split(/\s|,/g).filter(function (val) {
  31129. return val !== '';
  31130. }).map(function (val, index) {
  31131. return index > 2 ? parseFloat(val) : parseInt(val, 10);
  31132. });
  31133. if (parts.length === 4) {
  31134. this._alpha = Math.floor(parseFloat(parts[3]) * 100);
  31135. } else if (parts.length === 3) {
  31136. this._alpha = 100;
  31137. }
  31138. if (parts.length >= 3) {
  31139. var _hsl2hsv = hsl2hsv(parts[0], parts[1], parts[2]),
  31140. h = _hsl2hsv.h,
  31141. s = _hsl2hsv.s,
  31142. v = _hsl2hsv.v;
  31143. fromHSV(h, s, v);
  31144. }
  31145. } else if (value.indexOf('hsv') !== -1) {
  31146. var _parts = value.replace(/hsva|hsv|\(|\)/gm, '').split(/\s|,/g).filter(function (val) {
  31147. return val !== '';
  31148. }).map(function (val, index) {
  31149. return index > 2 ? parseFloat(val) : parseInt(val, 10);
  31150. });
  31151. if (_parts.length === 4) {
  31152. this._alpha = Math.floor(parseFloat(_parts[3]) * 100);
  31153. } else if (_parts.length === 3) {
  31154. this._alpha = 100;
  31155. }
  31156. if (_parts.length >= 3) {
  31157. fromHSV(_parts[0], _parts[1], _parts[2]);
  31158. }
  31159. } else if (value.indexOf('rgb') !== -1) {
  31160. var _parts2 = value.replace(/rgba|rgb|\(|\)/gm, '').split(/\s|,/g).filter(function (val) {
  31161. return val !== '';
  31162. }).map(function (val, index) {
  31163. return index > 2 ? parseFloat(val) : parseInt(val, 10);
  31164. });
  31165. if (_parts2.length === 4) {
  31166. this._alpha = Math.floor(parseFloat(_parts2[3]) * 100);
  31167. } else if (_parts2.length === 3) {
  31168. this._alpha = 100;
  31169. }
  31170. if (_parts2.length >= 3) {
  31171. var _rgb2hsv = rgb2hsv(_parts2[0], _parts2[1], _parts2[2]),
  31172. _h = _rgb2hsv.h,
  31173. _s = _rgb2hsv.s,
  31174. _v = _rgb2hsv.v;
  31175. fromHSV(_h, _s, _v);
  31176. }
  31177. } else if (value.indexOf('#') !== -1) {
  31178. var hex = value.replace('#', '').trim();
  31179. if (!/^(?:[0-9a-fA-F]{3}){1,2}|[0-9a-fA-F]{8}$/.test(hex)) return;
  31180. var r = void 0,
  31181. g = void 0,
  31182. b = void 0;
  31183. if (hex.length === 3) {
  31184. r = parseHexChannel(hex[0] + hex[0]);
  31185. g = parseHexChannel(hex[1] + hex[1]);
  31186. b = parseHexChannel(hex[2] + hex[2]);
  31187. } else if (hex.length === 6 || hex.length === 8) {
  31188. r = parseHexChannel(hex.substring(0, 2));
  31189. g = parseHexChannel(hex.substring(2, 4));
  31190. b = parseHexChannel(hex.substring(4, 6));
  31191. }
  31192. if (hex.length === 8) {
  31193. this._alpha = Math.floor(parseHexChannel(hex.substring(6)) / 255 * 100);
  31194. } else if (hex.length === 3 || hex.length === 6) {
  31195. this._alpha = 100;
  31196. }
  31197. var _rgb2hsv2 = rgb2hsv(r, g, b),
  31198. _h2 = _rgb2hsv2.h,
  31199. _s2 = _rgb2hsv2.s,
  31200. _v2 = _rgb2hsv2.v;
  31201. fromHSV(_h2, _s2, _v2);
  31202. }
  31203. };
  31204. Color.prototype.compare = function compare(color) {
  31205. return Math.abs(color._hue - this._hue) < 2 && Math.abs(color._saturation - this._saturation) < 1 && Math.abs(color._value - this._value) < 1 && Math.abs(color._alpha - this._alpha) < 1;
  31206. };
  31207. Color.prototype.doOnChange = function doOnChange() {
  31208. var _hue = this._hue,
  31209. _saturation = this._saturation,
  31210. _value = this._value,
  31211. _alpha = this._alpha,
  31212. format = this.format;
  31213. if (this.enableAlpha) {
  31214. switch (format) {
  31215. case 'hsl':
  31216. var hsl = hsv2hsl(_hue, _saturation / 100, _value / 100);
  31217. this.value = 'hsla(' + _hue + ', ' + Math.round(hsl[1] * 100) + '%, ' + Math.round(hsl[2] * 100) + '%, ' + _alpha / 100 + ')';
  31218. break;
  31219. case 'hsv':
  31220. this.value = 'hsva(' + _hue + ', ' + Math.round(_saturation) + '%, ' + Math.round(_value) + '%, ' + _alpha / 100 + ')';
  31221. break;
  31222. default:
  31223. var _hsv2rgb = hsv2rgb(_hue, _saturation, _value),
  31224. r = _hsv2rgb.r,
  31225. g = _hsv2rgb.g,
  31226. b = _hsv2rgb.b;
  31227. this.value = 'rgba(' + r + ', ' + g + ', ' + b + ', ' + _alpha / 100 + ')';
  31228. }
  31229. } else {
  31230. switch (format) {
  31231. case 'hsl':
  31232. var _hsl = hsv2hsl(_hue, _saturation / 100, _value / 100);
  31233. this.value = 'hsl(' + _hue + ', ' + Math.round(_hsl[1] * 100) + '%, ' + Math.round(_hsl[2] * 100) + '%)';
  31234. break;
  31235. case 'hsv':
  31236. this.value = 'hsv(' + _hue + ', ' + Math.round(_saturation) + '%, ' + Math.round(_value) + '%)';
  31237. break;
  31238. case 'rgb':
  31239. var _hsv2rgb2 = hsv2rgb(_hue, _saturation, _value),
  31240. _r = _hsv2rgb2.r,
  31241. _g = _hsv2rgb2.g,
  31242. _b = _hsv2rgb2.b;
  31243. this.value = 'rgb(' + _r + ', ' + _g + ', ' + _b + ')';
  31244. break;
  31245. default:
  31246. this.value = toHex(hsv2rgb(_hue, _saturation, _value));
  31247. }
  31248. }
  31249. };
  31250. return Color;
  31251. }();
  31252. /* harmony default export */ var src_color = (Color);
  31253. ;
  31254. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/color-picker/src/components/picker-dropdown.vue?vue&type=template&id=06601625&
  31255. var picker_dropdownvue_type_template_id_06601625_render = function() {
  31256. var _vm = this
  31257. var _h = _vm.$createElement
  31258. var _c = _vm._self._c || _h
  31259. return _c(
  31260. "transition",
  31261. { attrs: { name: "el-zoom-in-top" }, on: { "after-leave": _vm.doDestroy } },
  31262. [
  31263. _c(
  31264. "div",
  31265. {
  31266. directives: [
  31267. {
  31268. name: "show",
  31269. rawName: "v-show",
  31270. value: _vm.showPopper,
  31271. expression: "showPopper"
  31272. }
  31273. ],
  31274. staticClass: "el-color-dropdown"
  31275. },
  31276. [
  31277. _c(
  31278. "div",
  31279. { staticClass: "el-color-dropdown__main-wrapper" },
  31280. [
  31281. _c("hue-slider", {
  31282. ref: "hue",
  31283. staticStyle: { float: "right" },
  31284. attrs: { color: _vm.color, vertical: "" }
  31285. }),
  31286. _c("sv-panel", { ref: "sl", attrs: { color: _vm.color } })
  31287. ],
  31288. 1
  31289. ),
  31290. _vm.showAlpha
  31291. ? _c("alpha-slider", { ref: "alpha", attrs: { color: _vm.color } })
  31292. : _vm._e(),
  31293. _vm.predefine
  31294. ? _c("predefine", {
  31295. attrs: { color: _vm.color, colors: _vm.predefine }
  31296. })
  31297. : _vm._e(),
  31298. _c(
  31299. "div",
  31300. { staticClass: "el-color-dropdown__btns" },
  31301. [
  31302. _c(
  31303. "span",
  31304. { staticClass: "el-color-dropdown__value" },
  31305. [
  31306. _c("el-input", {
  31307. attrs: { "validate-event": false, size: "mini" },
  31308. on: { blur: _vm.handleConfirm },
  31309. nativeOn: {
  31310. keyup: function($event) {
  31311. if (
  31312. !("button" in $event) &&
  31313. _vm._k(
  31314. $event.keyCode,
  31315. "enter",
  31316. 13,
  31317. $event.key,
  31318. "Enter"
  31319. )
  31320. ) {
  31321. return null
  31322. }
  31323. return _vm.handleConfirm($event)
  31324. }
  31325. },
  31326. model: {
  31327. value: _vm.customInput,
  31328. callback: function($$v) {
  31329. _vm.customInput = $$v
  31330. },
  31331. expression: "customInput"
  31332. }
  31333. })
  31334. ],
  31335. 1
  31336. ),
  31337. _c(
  31338. "el-button",
  31339. {
  31340. staticClass: "el-color-dropdown__link-btn",
  31341. attrs: { size: "mini", type: "text" },
  31342. on: {
  31343. click: function($event) {
  31344. _vm.$emit("clear")
  31345. }
  31346. }
  31347. },
  31348. [
  31349. _vm._v(
  31350. "\n " +
  31351. _vm._s(_vm.t("el.colorpicker.clear")) +
  31352. "\n "
  31353. )
  31354. ]
  31355. ),
  31356. _c(
  31357. "el-button",
  31358. {
  31359. staticClass: "el-color-dropdown__btn",
  31360. attrs: { plain: "", size: "mini" },
  31361. on: { click: _vm.confirmValue }
  31362. },
  31363. [
  31364. _vm._v(
  31365. "\n " +
  31366. _vm._s(_vm.t("el.colorpicker.confirm")) +
  31367. "\n "
  31368. )
  31369. ]
  31370. )
  31371. ],
  31372. 1
  31373. )
  31374. ],
  31375. 1
  31376. )
  31377. ]
  31378. )
  31379. }
  31380. var picker_dropdownvue_type_template_id_06601625_staticRenderFns = []
  31381. picker_dropdownvue_type_template_id_06601625_render._withStripped = true
  31382. // CONCATENATED MODULE: ./packages/color-picker/src/components/picker-dropdown.vue?vue&type=template&id=06601625&
  31383. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/color-picker/src/components/sv-panel.vue?vue&type=template&id=d8583596&
  31384. var sv_panelvue_type_template_id_d8583596_render = function() {
  31385. var _vm = this
  31386. var _h = _vm.$createElement
  31387. var _c = _vm._self._c || _h
  31388. return _c(
  31389. "div",
  31390. {
  31391. staticClass: "el-color-svpanel",
  31392. style: {
  31393. backgroundColor: _vm.background
  31394. }
  31395. },
  31396. [
  31397. _c("div", { staticClass: "el-color-svpanel__white" }),
  31398. _c("div", { staticClass: "el-color-svpanel__black" }),
  31399. _c(
  31400. "div",
  31401. {
  31402. staticClass: "el-color-svpanel__cursor",
  31403. style: {
  31404. top: _vm.cursorTop + "px",
  31405. left: _vm.cursorLeft + "px"
  31406. }
  31407. },
  31408. [_c("div")]
  31409. )
  31410. ]
  31411. )
  31412. }
  31413. var sv_panelvue_type_template_id_d8583596_staticRenderFns = []
  31414. sv_panelvue_type_template_id_d8583596_render._withStripped = true
  31415. // CONCATENATED MODULE: ./packages/color-picker/src/components/sv-panel.vue?vue&type=template&id=d8583596&
  31416. // CONCATENATED MODULE: ./packages/color-picker/src/draggable.js
  31417. var isDragging = false;
  31418. /* harmony default export */ var draggable = (function (element, options) {
  31419. if (external_vue_default.a.prototype.$isServer) return;
  31420. var moveFn = function moveFn(event) {
  31421. if (options.drag) {
  31422. options.drag(event);
  31423. }
  31424. };
  31425. var upFn = function upFn(event) {
  31426. document.removeEventListener('mousemove', moveFn);
  31427. document.removeEventListener('mouseup', upFn);
  31428. document.onselectstart = null;
  31429. document.ondragstart = null;
  31430. isDragging = false;
  31431. if (options.end) {
  31432. options.end(event);
  31433. }
  31434. };
  31435. element.addEventListener('mousedown', function (event) {
  31436. if (isDragging) return;
  31437. document.onselectstart = function () {
  31438. return false;
  31439. };
  31440. document.ondragstart = function () {
  31441. return false;
  31442. };
  31443. document.addEventListener('mousemove', moveFn);
  31444. document.addEventListener('mouseup', upFn);
  31445. isDragging = true;
  31446. if (options.start) {
  31447. options.start(event);
  31448. }
  31449. });
  31450. });
  31451. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/color-picker/src/components/sv-panel.vue?vue&type=script&lang=js&
  31452. //
  31453. //
  31454. //
  31455. //
  31456. //
  31457. //
  31458. //
  31459. //
  31460. //
  31461. //
  31462. //
  31463. //
  31464. //
  31465. //
  31466. //
  31467. //
  31468. //
  31469. /* harmony default export */ var sv_panelvue_type_script_lang_js_ = ({
  31470. name: 'el-sl-panel',
  31471. props: {
  31472. color: {
  31473. required: true
  31474. }
  31475. },
  31476. computed: {
  31477. colorValue: function colorValue() {
  31478. var hue = this.color.get('hue');
  31479. var value = this.color.get('value');
  31480. return { hue: hue, value: value };
  31481. }
  31482. },
  31483. watch: {
  31484. colorValue: function colorValue() {
  31485. this.update();
  31486. }
  31487. },
  31488. methods: {
  31489. update: function update() {
  31490. var saturation = this.color.get('saturation');
  31491. var value = this.color.get('value');
  31492. var el = this.$el;
  31493. var width = el.clientWidth,
  31494. height = el.clientHeight;
  31495. this.cursorLeft = saturation * width / 100;
  31496. this.cursorTop = (100 - value) * height / 100;
  31497. this.background = 'hsl(' + this.color.get('hue') + ', 100%, 50%)';
  31498. },
  31499. handleDrag: function handleDrag(event) {
  31500. var el = this.$el;
  31501. var rect = el.getBoundingClientRect();
  31502. var left = event.clientX - rect.left;
  31503. var top = event.clientY - rect.top;
  31504. left = Math.max(0, left);
  31505. left = Math.min(left, rect.width);
  31506. top = Math.max(0, top);
  31507. top = Math.min(top, rect.height);
  31508. this.cursorLeft = left;
  31509. this.cursorTop = top;
  31510. this.color.set({
  31511. saturation: left / rect.width * 100,
  31512. value: 100 - top / rect.height * 100
  31513. });
  31514. }
  31515. },
  31516. mounted: function mounted() {
  31517. var _this = this;
  31518. draggable(this.$el, {
  31519. drag: function drag(event) {
  31520. _this.handleDrag(event);
  31521. },
  31522. end: function end(event) {
  31523. _this.handleDrag(event);
  31524. }
  31525. });
  31526. this.update();
  31527. },
  31528. data: function data() {
  31529. return {
  31530. cursorTop: 0,
  31531. cursorLeft: 0,
  31532. background: 'hsl(0, 100%, 50%)'
  31533. };
  31534. }
  31535. });
  31536. // CONCATENATED MODULE: ./packages/color-picker/src/components/sv-panel.vue?vue&type=script&lang=js&
  31537. /* harmony default export */ var components_sv_panelvue_type_script_lang_js_ = (sv_panelvue_type_script_lang_js_);
  31538. // CONCATENATED MODULE: ./packages/color-picker/src/components/sv-panel.vue
  31539. /* normalize component */
  31540. var sv_panel_component = normalizeComponent(
  31541. components_sv_panelvue_type_script_lang_js_,
  31542. sv_panelvue_type_template_id_d8583596_render,
  31543. sv_panelvue_type_template_id_d8583596_staticRenderFns,
  31544. false,
  31545. null,
  31546. null,
  31547. null
  31548. )
  31549. /* hot reload */
  31550. if (false) { var sv_panel_api; }
  31551. sv_panel_component.options.__file = "packages/color-picker/src/components/sv-panel.vue"
  31552. /* harmony default export */ var sv_panel = (sv_panel_component.exports);
  31553. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/color-picker/src/components/hue-slider.vue?vue&type=template&id=5cdc43b1&
  31554. var hue_slidervue_type_template_id_5cdc43b1_render = function() {
  31555. var _vm = this
  31556. var _h = _vm.$createElement
  31557. var _c = _vm._self._c || _h
  31558. return _c(
  31559. "div",
  31560. {
  31561. staticClass: "el-color-hue-slider",
  31562. class: { "is-vertical": _vm.vertical }
  31563. },
  31564. [
  31565. _c("div", {
  31566. ref: "bar",
  31567. staticClass: "el-color-hue-slider__bar",
  31568. on: { click: _vm.handleClick }
  31569. }),
  31570. _c("div", {
  31571. ref: "thumb",
  31572. staticClass: "el-color-hue-slider__thumb",
  31573. style: {
  31574. left: _vm.thumbLeft + "px",
  31575. top: _vm.thumbTop + "px"
  31576. }
  31577. })
  31578. ]
  31579. )
  31580. }
  31581. var hue_slidervue_type_template_id_5cdc43b1_staticRenderFns = []
  31582. hue_slidervue_type_template_id_5cdc43b1_render._withStripped = true
  31583. // CONCATENATED MODULE: ./packages/color-picker/src/components/hue-slider.vue?vue&type=template&id=5cdc43b1&
  31584. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/color-picker/src/components/hue-slider.vue?vue&type=script&lang=js&
  31585. //
  31586. //
  31587. //
  31588. //
  31589. //
  31590. //
  31591. //
  31592. //
  31593. //
  31594. //
  31595. //
  31596. //
  31597. //
  31598. /* harmony default export */ var hue_slidervue_type_script_lang_js_ = ({
  31599. name: 'el-color-hue-slider',
  31600. props: {
  31601. color: {
  31602. required: true
  31603. },
  31604. vertical: Boolean
  31605. },
  31606. data: function data() {
  31607. return {
  31608. thumbLeft: 0,
  31609. thumbTop: 0
  31610. };
  31611. },
  31612. computed: {
  31613. hueValue: function hueValue() {
  31614. var hue = this.color.get('hue');
  31615. return hue;
  31616. }
  31617. },
  31618. watch: {
  31619. hueValue: function hueValue() {
  31620. this.update();
  31621. }
  31622. },
  31623. methods: {
  31624. handleClick: function handleClick(event) {
  31625. var thumb = this.$refs.thumb;
  31626. var target = event.target;
  31627. if (target !== thumb) {
  31628. this.handleDrag(event);
  31629. }
  31630. },
  31631. handleDrag: function handleDrag(event) {
  31632. var rect = this.$el.getBoundingClientRect();
  31633. var thumb = this.$refs.thumb;
  31634. var hue = void 0;
  31635. if (!this.vertical) {
  31636. var left = event.clientX - rect.left;
  31637. left = Math.min(left, rect.width - thumb.offsetWidth / 2);
  31638. left = Math.max(thumb.offsetWidth / 2, left);
  31639. hue = Math.round((left - thumb.offsetWidth / 2) / (rect.width - thumb.offsetWidth) * 360);
  31640. } else {
  31641. var top = event.clientY - rect.top;
  31642. top = Math.min(top, rect.height - thumb.offsetHeight / 2);
  31643. top = Math.max(thumb.offsetHeight / 2, top);
  31644. hue = Math.round((top - thumb.offsetHeight / 2) / (rect.height - thumb.offsetHeight) * 360);
  31645. }
  31646. this.color.set('hue', hue);
  31647. },
  31648. getThumbLeft: function getThumbLeft() {
  31649. if (this.vertical) return 0;
  31650. var el = this.$el;
  31651. var hue = this.color.get('hue');
  31652. if (!el) return 0;
  31653. var thumb = this.$refs.thumb;
  31654. return Math.round(hue * (el.offsetWidth - thumb.offsetWidth / 2) / 360);
  31655. },
  31656. getThumbTop: function getThumbTop() {
  31657. if (!this.vertical) return 0;
  31658. var el = this.$el;
  31659. var hue = this.color.get('hue');
  31660. if (!el) return 0;
  31661. var thumb = this.$refs.thumb;
  31662. return Math.round(hue * (el.offsetHeight - thumb.offsetHeight / 2) / 360);
  31663. },
  31664. update: function update() {
  31665. this.thumbLeft = this.getThumbLeft();
  31666. this.thumbTop = this.getThumbTop();
  31667. }
  31668. },
  31669. mounted: function mounted() {
  31670. var _this = this;
  31671. var _$refs = this.$refs,
  31672. bar = _$refs.bar,
  31673. thumb = _$refs.thumb;
  31674. var dragConfig = {
  31675. drag: function drag(event) {
  31676. _this.handleDrag(event);
  31677. },
  31678. end: function end(event) {
  31679. _this.handleDrag(event);
  31680. }
  31681. };
  31682. draggable(bar, dragConfig);
  31683. draggable(thumb, dragConfig);
  31684. this.update();
  31685. }
  31686. });
  31687. // CONCATENATED MODULE: ./packages/color-picker/src/components/hue-slider.vue?vue&type=script&lang=js&
  31688. /* harmony default export */ var components_hue_slidervue_type_script_lang_js_ = (hue_slidervue_type_script_lang_js_);
  31689. // CONCATENATED MODULE: ./packages/color-picker/src/components/hue-slider.vue
  31690. /* normalize component */
  31691. var hue_slider_component = normalizeComponent(
  31692. components_hue_slidervue_type_script_lang_js_,
  31693. hue_slidervue_type_template_id_5cdc43b1_render,
  31694. hue_slidervue_type_template_id_5cdc43b1_staticRenderFns,
  31695. false,
  31696. null,
  31697. null,
  31698. null
  31699. )
  31700. /* hot reload */
  31701. if (false) { var hue_slider_api; }
  31702. hue_slider_component.options.__file = "packages/color-picker/src/components/hue-slider.vue"
  31703. /* harmony default export */ var hue_slider = (hue_slider_component.exports);
  31704. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/color-picker/src/components/alpha-slider.vue?vue&type=template&id=068c66cb&
  31705. var alpha_slidervue_type_template_id_068c66cb_render = function() {
  31706. var _vm = this
  31707. var _h = _vm.$createElement
  31708. var _c = _vm._self._c || _h
  31709. return _c(
  31710. "div",
  31711. {
  31712. staticClass: "el-color-alpha-slider",
  31713. class: { "is-vertical": _vm.vertical }
  31714. },
  31715. [
  31716. _c("div", {
  31717. ref: "bar",
  31718. staticClass: "el-color-alpha-slider__bar",
  31719. style: {
  31720. background: _vm.background
  31721. },
  31722. on: { click: _vm.handleClick }
  31723. }),
  31724. _c("div", {
  31725. ref: "thumb",
  31726. staticClass: "el-color-alpha-slider__thumb",
  31727. style: {
  31728. left: _vm.thumbLeft + "px",
  31729. top: _vm.thumbTop + "px"
  31730. }
  31731. })
  31732. ]
  31733. )
  31734. }
  31735. var alpha_slidervue_type_template_id_068c66cb_staticRenderFns = []
  31736. alpha_slidervue_type_template_id_068c66cb_render._withStripped = true
  31737. // CONCATENATED MODULE: ./packages/color-picker/src/components/alpha-slider.vue?vue&type=template&id=068c66cb&
  31738. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/color-picker/src/components/alpha-slider.vue?vue&type=script&lang=js&
  31739. //
  31740. //
  31741. //
  31742. //
  31743. //
  31744. //
  31745. //
  31746. //
  31747. //
  31748. //
  31749. //
  31750. //
  31751. //
  31752. //
  31753. //
  31754. //
  31755. //
  31756. //
  31757. //
  31758. /* harmony default export */ var alpha_slidervue_type_script_lang_js_ = ({
  31759. name: 'el-color-alpha-slider',
  31760. props: {
  31761. color: {
  31762. required: true
  31763. },
  31764. vertical: Boolean
  31765. },
  31766. watch: {
  31767. 'color._alpha': function color_alpha() {
  31768. this.update();
  31769. },
  31770. 'color.value': function colorValue() {
  31771. this.update();
  31772. }
  31773. },
  31774. methods: {
  31775. handleClick: function handleClick(event) {
  31776. var thumb = this.$refs.thumb;
  31777. var target = event.target;
  31778. if (target !== thumb) {
  31779. this.handleDrag(event);
  31780. }
  31781. },
  31782. handleDrag: function handleDrag(event) {
  31783. var rect = this.$el.getBoundingClientRect();
  31784. var thumb = this.$refs.thumb;
  31785. if (!this.vertical) {
  31786. var left = event.clientX - rect.left;
  31787. left = Math.max(thumb.offsetWidth / 2, left);
  31788. left = Math.min(left, rect.width - thumb.offsetWidth / 2);
  31789. this.color.set('alpha', Math.round((left - thumb.offsetWidth / 2) / (rect.width - thumb.offsetWidth) * 100));
  31790. } else {
  31791. var top = event.clientY - rect.top;
  31792. top = Math.max(thumb.offsetHeight / 2, top);
  31793. top = Math.min(top, rect.height - thumb.offsetHeight / 2);
  31794. this.color.set('alpha', Math.round((top - thumb.offsetHeight / 2) / (rect.height - thumb.offsetHeight) * 100));
  31795. }
  31796. },
  31797. getThumbLeft: function getThumbLeft() {
  31798. if (this.vertical) return 0;
  31799. var el = this.$el;
  31800. var alpha = this.color._alpha;
  31801. if (!el) return 0;
  31802. var thumb = this.$refs.thumb;
  31803. return Math.round(alpha * (el.offsetWidth - thumb.offsetWidth / 2) / 100);
  31804. },
  31805. getThumbTop: function getThumbTop() {
  31806. if (!this.vertical) return 0;
  31807. var el = this.$el;
  31808. var alpha = this.color._alpha;
  31809. if (!el) return 0;
  31810. var thumb = this.$refs.thumb;
  31811. return Math.round(alpha * (el.offsetHeight - thumb.offsetHeight / 2) / 100);
  31812. },
  31813. getBackground: function getBackground() {
  31814. if (this.color && this.color.value) {
  31815. var _color$toRgb = this.color.toRgb(),
  31816. r = _color$toRgb.r,
  31817. g = _color$toRgb.g,
  31818. b = _color$toRgb.b;
  31819. return 'linear-gradient(to right, rgba(' + r + ', ' + g + ', ' + b + ', 0) 0%, rgba(' + r + ', ' + g + ', ' + b + ', 1) 100%)';
  31820. }
  31821. return null;
  31822. },
  31823. update: function update() {
  31824. this.thumbLeft = this.getThumbLeft();
  31825. this.thumbTop = this.getThumbTop();
  31826. this.background = this.getBackground();
  31827. }
  31828. },
  31829. data: function data() {
  31830. return {
  31831. thumbLeft: 0,
  31832. thumbTop: 0,
  31833. background: null
  31834. };
  31835. },
  31836. mounted: function mounted() {
  31837. var _this = this;
  31838. var _$refs = this.$refs,
  31839. bar = _$refs.bar,
  31840. thumb = _$refs.thumb;
  31841. var dragConfig = {
  31842. drag: function drag(event) {
  31843. _this.handleDrag(event);
  31844. },
  31845. end: function end(event) {
  31846. _this.handleDrag(event);
  31847. }
  31848. };
  31849. draggable(bar, dragConfig);
  31850. draggable(thumb, dragConfig);
  31851. this.update();
  31852. }
  31853. });
  31854. // CONCATENATED MODULE: ./packages/color-picker/src/components/alpha-slider.vue?vue&type=script&lang=js&
  31855. /* harmony default export */ var components_alpha_slidervue_type_script_lang_js_ = (alpha_slidervue_type_script_lang_js_);
  31856. // CONCATENATED MODULE: ./packages/color-picker/src/components/alpha-slider.vue
  31857. /* normalize component */
  31858. var alpha_slider_component = normalizeComponent(
  31859. components_alpha_slidervue_type_script_lang_js_,
  31860. alpha_slidervue_type_template_id_068c66cb_render,
  31861. alpha_slidervue_type_template_id_068c66cb_staticRenderFns,
  31862. false,
  31863. null,
  31864. null,
  31865. null
  31866. )
  31867. /* hot reload */
  31868. if (false) { var alpha_slider_api; }
  31869. alpha_slider_component.options.__file = "packages/color-picker/src/components/alpha-slider.vue"
  31870. /* harmony default export */ var alpha_slider = (alpha_slider_component.exports);
  31871. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/color-picker/src/components/predefine.vue?vue&type=template&id=06e03093&
  31872. var predefinevue_type_template_id_06e03093_render = function() {
  31873. var _vm = this
  31874. var _h = _vm.$createElement
  31875. var _c = _vm._self._c || _h
  31876. return _c("div", { staticClass: "el-color-predefine" }, [
  31877. _c(
  31878. "div",
  31879. { staticClass: "el-color-predefine__colors" },
  31880. _vm._l(_vm.rgbaColors, function(item, index) {
  31881. return _c(
  31882. "div",
  31883. {
  31884. key: _vm.colors[index],
  31885. staticClass: "el-color-predefine__color-selector",
  31886. class: { selected: item.selected, "is-alpha": item._alpha < 100 },
  31887. on: {
  31888. click: function($event) {
  31889. _vm.handleSelect(index)
  31890. }
  31891. }
  31892. },
  31893. [_c("div", { style: { "background-color": item.value } })]
  31894. )
  31895. }),
  31896. 0
  31897. )
  31898. ])
  31899. }
  31900. var predefinevue_type_template_id_06e03093_staticRenderFns = []
  31901. predefinevue_type_template_id_06e03093_render._withStripped = true
  31902. // CONCATENATED MODULE: ./packages/color-picker/src/components/predefine.vue?vue&type=template&id=06e03093&
  31903. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/color-picker/src/components/predefine.vue?vue&type=script&lang=js&
  31904. //
  31905. //
  31906. //
  31907. //
  31908. //
  31909. //
  31910. //
  31911. //
  31912. //
  31913. //
  31914. //
  31915. //
  31916. //
  31917. //
  31918. //
  31919. /* harmony default export */ var predefinevue_type_script_lang_js_ = ({
  31920. props: {
  31921. colors: { type: Array, required: true },
  31922. color: { required: true }
  31923. },
  31924. data: function data() {
  31925. return {
  31926. rgbaColors: this.parseColors(this.colors, this.color)
  31927. };
  31928. },
  31929. methods: {
  31930. handleSelect: function handleSelect(index) {
  31931. this.color.fromString(this.colors[index]);
  31932. },
  31933. parseColors: function parseColors(colors, color) {
  31934. return colors.map(function (value) {
  31935. var c = new src_color();
  31936. c.enableAlpha = true;
  31937. c.format = 'rgba';
  31938. c.fromString(value);
  31939. c.selected = c.value === color.value;
  31940. return c;
  31941. });
  31942. }
  31943. },
  31944. watch: {
  31945. '$parent.currentColor': function $parentCurrentColor(val) {
  31946. var color = new src_color();
  31947. color.fromString(val);
  31948. this.rgbaColors.forEach(function (item) {
  31949. item.selected = color.compare(item);
  31950. });
  31951. },
  31952. colors: function colors(newVal) {
  31953. this.rgbaColors = this.parseColors(newVal, this.color);
  31954. },
  31955. color: function color(newVal) {
  31956. this.rgbaColors = this.parseColors(this.colors, newVal);
  31957. }
  31958. }
  31959. });
  31960. // CONCATENATED MODULE: ./packages/color-picker/src/components/predefine.vue?vue&type=script&lang=js&
  31961. /* harmony default export */ var components_predefinevue_type_script_lang_js_ = (predefinevue_type_script_lang_js_);
  31962. // CONCATENATED MODULE: ./packages/color-picker/src/components/predefine.vue
  31963. /* normalize component */
  31964. var predefine_component = normalizeComponent(
  31965. components_predefinevue_type_script_lang_js_,
  31966. predefinevue_type_template_id_06e03093_render,
  31967. predefinevue_type_template_id_06e03093_staticRenderFns,
  31968. false,
  31969. null,
  31970. null,
  31971. null
  31972. )
  31973. /* hot reload */
  31974. if (false) { var predefine_api; }
  31975. predefine_component.options.__file = "packages/color-picker/src/components/predefine.vue"
  31976. /* harmony default export */ var predefine = (predefine_component.exports);
  31977. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/color-picker/src/components/picker-dropdown.vue?vue&type=script&lang=js&
  31978. //
  31979. //
  31980. //
  31981. //
  31982. //
  31983. //
  31984. //
  31985. //
  31986. //
  31987. //
  31988. //
  31989. //
  31990. //
  31991. //
  31992. //
  31993. //
  31994. //
  31995. //
  31996. //
  31997. //
  31998. //
  31999. //
  32000. //
  32001. //
  32002. //
  32003. //
  32004. //
  32005. //
  32006. //
  32007. //
  32008. //
  32009. //
  32010. //
  32011. //
  32012. //
  32013. //
  32014. //
  32015. //
  32016. //
  32017. //
  32018. /* harmony default export */ var picker_dropdownvue_type_script_lang_js_ = ({
  32019. name: 'el-color-picker-dropdown',
  32020. mixins: [vue_popper_default.a, locale_default.a],
  32021. components: {
  32022. SvPanel: sv_panel,
  32023. HueSlider: hue_slider,
  32024. AlphaSlider: alpha_slider,
  32025. ElInput: input_default.a,
  32026. ElButton: button_default.a,
  32027. Predefine: predefine
  32028. },
  32029. props: {
  32030. color: {
  32031. required: true
  32032. },
  32033. showAlpha: Boolean,
  32034. predefine: Array
  32035. },
  32036. data: function data() {
  32037. return {
  32038. customInput: ''
  32039. };
  32040. },
  32041. computed: {
  32042. currentColor: function currentColor() {
  32043. var parent = this.$parent;
  32044. return !parent.value && !parent.showPanelColor ? '' : parent.color.value;
  32045. }
  32046. },
  32047. methods: {
  32048. confirmValue: function confirmValue() {
  32049. this.$emit('pick');
  32050. },
  32051. handleConfirm: function handleConfirm() {
  32052. this.color.fromString(this.customInput);
  32053. }
  32054. },
  32055. mounted: function mounted() {
  32056. this.$parent.popperElm = this.popperElm = this.$el;
  32057. this.referenceElm = this.$parent.$el;
  32058. },
  32059. watch: {
  32060. showPopper: function showPopper(val) {
  32061. var _this = this;
  32062. if (val === true) {
  32063. this.$nextTick(function () {
  32064. var _$refs = _this.$refs,
  32065. sl = _$refs.sl,
  32066. hue = _$refs.hue,
  32067. alpha = _$refs.alpha;
  32068. sl && sl.update();
  32069. hue && hue.update();
  32070. alpha && alpha.update();
  32071. });
  32072. }
  32073. },
  32074. currentColor: {
  32075. immediate: true,
  32076. handler: function handler(val) {
  32077. this.customInput = val;
  32078. }
  32079. }
  32080. }
  32081. });
  32082. // CONCATENATED MODULE: ./packages/color-picker/src/components/picker-dropdown.vue?vue&type=script&lang=js&
  32083. /* harmony default export */ var components_picker_dropdownvue_type_script_lang_js_ = (picker_dropdownvue_type_script_lang_js_);
  32084. // CONCATENATED MODULE: ./packages/color-picker/src/components/picker-dropdown.vue
  32085. /* normalize component */
  32086. var picker_dropdown_component = normalizeComponent(
  32087. components_picker_dropdownvue_type_script_lang_js_,
  32088. picker_dropdownvue_type_template_id_06601625_render,
  32089. picker_dropdownvue_type_template_id_06601625_staticRenderFns,
  32090. false,
  32091. null,
  32092. null,
  32093. null
  32094. )
  32095. /* hot reload */
  32096. if (false) { var picker_dropdown_api; }
  32097. picker_dropdown_component.options.__file = "packages/color-picker/src/components/picker-dropdown.vue"
  32098. /* harmony default export */ var picker_dropdown = (picker_dropdown_component.exports);
  32099. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/color-picker/src/main.vue?vue&type=script&lang=js&
  32100. //
  32101. //
  32102. //
  32103. //
  32104. //
  32105. //
  32106. //
  32107. //
  32108. //
  32109. //
  32110. //
  32111. //
  32112. //
  32113. //
  32114. //
  32115. //
  32116. //
  32117. //
  32118. //
  32119. //
  32120. //
  32121. //
  32122. //
  32123. //
  32124. //
  32125. //
  32126. //
  32127. //
  32128. //
  32129. //
  32130. //
  32131. //
  32132. /* harmony default export */ var color_picker_src_mainvue_type_script_lang_js_ = ({
  32133. name: 'ElColorPicker',
  32134. mixins: [emitter_default.a],
  32135. props: {
  32136. value: String,
  32137. showAlpha: Boolean,
  32138. colorFormat: String,
  32139. disabled: Boolean,
  32140. size: String,
  32141. popperClass: String,
  32142. predefine: Array
  32143. },
  32144. inject: {
  32145. elForm: {
  32146. default: ''
  32147. },
  32148. elFormItem: {
  32149. default: ''
  32150. }
  32151. },
  32152. directives: { Clickoutside: clickoutside_default.a },
  32153. computed: {
  32154. displayedColor: function displayedColor() {
  32155. if (!this.value && !this.showPanelColor) {
  32156. return 'transparent';
  32157. }
  32158. return this.displayedRgb(this.color, this.showAlpha);
  32159. },
  32160. _elFormItemSize: function _elFormItemSize() {
  32161. return (this.elFormItem || {}).elFormItemSize;
  32162. },
  32163. colorSize: function colorSize() {
  32164. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  32165. },
  32166. colorDisabled: function colorDisabled() {
  32167. return this.disabled || (this.elForm || {}).disabled;
  32168. }
  32169. },
  32170. watch: {
  32171. value: function value(val) {
  32172. if (!val) {
  32173. this.showPanelColor = false;
  32174. } else if (val && val !== this.color.value) {
  32175. this.color.fromString(val);
  32176. }
  32177. },
  32178. color: {
  32179. deep: true,
  32180. handler: function handler() {
  32181. this.showPanelColor = true;
  32182. }
  32183. },
  32184. displayedColor: function displayedColor(val) {
  32185. if (!this.showPicker) return;
  32186. var currentValueColor = new src_color({
  32187. enableAlpha: this.showAlpha,
  32188. format: this.colorFormat
  32189. });
  32190. currentValueColor.fromString(this.value);
  32191. var currentValueColorRgb = this.displayedRgb(currentValueColor, this.showAlpha);
  32192. if (val !== currentValueColorRgb) {
  32193. this.$emit('active-change', val);
  32194. }
  32195. }
  32196. },
  32197. methods: {
  32198. handleTrigger: function handleTrigger() {
  32199. if (this.colorDisabled) return;
  32200. this.showPicker = !this.showPicker;
  32201. },
  32202. confirmValue: function confirmValue() {
  32203. var value = this.color.value;
  32204. this.$emit('input', value);
  32205. this.$emit('change', value);
  32206. this.dispatch('ElFormItem', 'el.form.change', value);
  32207. this.showPicker = false;
  32208. },
  32209. clearValue: function clearValue() {
  32210. this.$emit('input', null);
  32211. this.$emit('change', null);
  32212. if (this.value !== null) {
  32213. this.dispatch('ElFormItem', 'el.form.change', null);
  32214. }
  32215. this.showPanelColor = false;
  32216. this.showPicker = false;
  32217. this.resetColor();
  32218. },
  32219. hide: function hide() {
  32220. this.showPicker = false;
  32221. this.resetColor();
  32222. },
  32223. resetColor: function resetColor() {
  32224. var _this = this;
  32225. this.$nextTick(function (_) {
  32226. if (_this.value) {
  32227. _this.color.fromString(_this.value);
  32228. } else {
  32229. _this.showPanelColor = false;
  32230. }
  32231. });
  32232. },
  32233. displayedRgb: function displayedRgb(color, showAlpha) {
  32234. if (!(color instanceof src_color)) {
  32235. throw Error('color should be instance of Color Class');
  32236. }
  32237. var _color$toRgb = color.toRgb(),
  32238. r = _color$toRgb.r,
  32239. g = _color$toRgb.g,
  32240. b = _color$toRgb.b;
  32241. return showAlpha ? 'rgba(' + r + ', ' + g + ', ' + b + ', ' + color.get('alpha') / 100 + ')' : 'rgb(' + r + ', ' + g + ', ' + b + ')';
  32242. }
  32243. },
  32244. mounted: function mounted() {
  32245. var value = this.value;
  32246. if (value) {
  32247. this.color.fromString(value);
  32248. }
  32249. this.popperElm = this.$refs.dropdown.$el;
  32250. },
  32251. data: function data() {
  32252. var color = new src_color({
  32253. enableAlpha: this.showAlpha,
  32254. format: this.colorFormat
  32255. });
  32256. return {
  32257. color: color,
  32258. showPicker: false,
  32259. showPanelColor: false
  32260. };
  32261. },
  32262. components: {
  32263. PickerDropdown: picker_dropdown
  32264. }
  32265. });
  32266. // CONCATENATED MODULE: ./packages/color-picker/src/main.vue?vue&type=script&lang=js&
  32267. /* harmony default export */ var packages_color_picker_src_mainvue_type_script_lang_js_ = (color_picker_src_mainvue_type_script_lang_js_);
  32268. // CONCATENATED MODULE: ./packages/color-picker/src/main.vue
  32269. /* normalize component */
  32270. var color_picker_src_main_component = normalizeComponent(
  32271. packages_color_picker_src_mainvue_type_script_lang_js_,
  32272. mainvue_type_template_id_55c8ade7_render,
  32273. mainvue_type_template_id_55c8ade7_staticRenderFns,
  32274. false,
  32275. null,
  32276. null,
  32277. null
  32278. )
  32279. /* hot reload */
  32280. if (false) { var color_picker_src_main_api; }
  32281. color_picker_src_main_component.options.__file = "packages/color-picker/src/main.vue"
  32282. /* harmony default export */ var color_picker_src_main = (color_picker_src_main_component.exports);
  32283. // CONCATENATED MODULE: ./packages/color-picker/index.js
  32284. /* istanbul ignore next */
  32285. color_picker_src_main.install = function (Vue) {
  32286. Vue.component(color_picker_src_main.name, color_picker_src_main);
  32287. };
  32288. /* harmony default export */ var color_picker = (color_picker_src_main);
  32289. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/transfer/src/main.vue?vue&type=template&id=5c654dd8&
  32290. var mainvue_type_template_id_5c654dd8_render = function() {
  32291. var _vm = this
  32292. var _h = _vm.$createElement
  32293. var _c = _vm._self._c || _h
  32294. return _c(
  32295. "div",
  32296. { staticClass: "el-transfer" },
  32297. [
  32298. _c(
  32299. "transfer-panel",
  32300. _vm._b(
  32301. {
  32302. ref: "leftPanel",
  32303. attrs: {
  32304. data: _vm.sourceData,
  32305. title: _vm.titles[0] || _vm.t("el.transfer.titles.0"),
  32306. "default-checked": _vm.leftDefaultChecked,
  32307. placeholder:
  32308. _vm.filterPlaceholder || _vm.t("el.transfer.filterPlaceholder")
  32309. },
  32310. on: { "checked-change": _vm.onSourceCheckedChange }
  32311. },
  32312. "transfer-panel",
  32313. _vm.$props,
  32314. false
  32315. ),
  32316. [_vm._t("left-footer")],
  32317. 2
  32318. ),
  32319. _c(
  32320. "div",
  32321. { staticClass: "el-transfer__buttons" },
  32322. [
  32323. _c(
  32324. "el-button",
  32325. {
  32326. class: [
  32327. "el-transfer__button",
  32328. _vm.hasButtonTexts ? "is-with-texts" : ""
  32329. ],
  32330. attrs: {
  32331. type: "primary",
  32332. disabled: _vm.rightChecked.length === 0
  32333. },
  32334. nativeOn: {
  32335. click: function($event) {
  32336. return _vm.addToLeft($event)
  32337. }
  32338. }
  32339. },
  32340. [
  32341. _c("i", { staticClass: "el-icon-arrow-left" }),
  32342. _vm.buttonTexts[0] !== undefined
  32343. ? _c("span", [_vm._v(_vm._s(_vm.buttonTexts[0]))])
  32344. : _vm._e()
  32345. ]
  32346. ),
  32347. _c(
  32348. "el-button",
  32349. {
  32350. class: [
  32351. "el-transfer__button",
  32352. _vm.hasButtonTexts ? "is-with-texts" : ""
  32353. ],
  32354. attrs: {
  32355. type: "primary",
  32356. disabled: _vm.leftChecked.length === 0
  32357. },
  32358. nativeOn: {
  32359. click: function($event) {
  32360. return _vm.addToRight($event)
  32361. }
  32362. }
  32363. },
  32364. [
  32365. _vm.buttonTexts[1] !== undefined
  32366. ? _c("span", [_vm._v(_vm._s(_vm.buttonTexts[1]))])
  32367. : _vm._e(),
  32368. _c("i", { staticClass: "el-icon-arrow-right" })
  32369. ]
  32370. )
  32371. ],
  32372. 1
  32373. ),
  32374. _c(
  32375. "transfer-panel",
  32376. _vm._b(
  32377. {
  32378. ref: "rightPanel",
  32379. attrs: {
  32380. data: _vm.targetData,
  32381. title: _vm.titles[1] || _vm.t("el.transfer.titles.1"),
  32382. "default-checked": _vm.rightDefaultChecked,
  32383. placeholder:
  32384. _vm.filterPlaceholder || _vm.t("el.transfer.filterPlaceholder")
  32385. },
  32386. on: { "checked-change": _vm.onTargetCheckedChange }
  32387. },
  32388. "transfer-panel",
  32389. _vm.$props,
  32390. false
  32391. ),
  32392. [_vm._t("right-footer")],
  32393. 2
  32394. )
  32395. ],
  32396. 1
  32397. )
  32398. }
  32399. var mainvue_type_template_id_5c654dd8_staticRenderFns = []
  32400. mainvue_type_template_id_5c654dd8_render._withStripped = true
  32401. // CONCATENATED MODULE: ./packages/transfer/src/main.vue?vue&type=template&id=5c654dd8&
  32402. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/transfer/src/transfer-panel.vue?vue&type=template&id=2ddab8bd&
  32403. var transfer_panelvue_type_template_id_2ddab8bd_render = function() {
  32404. var _vm = this
  32405. var _h = _vm.$createElement
  32406. var _c = _vm._self._c || _h
  32407. return _c("div", { staticClass: "el-transfer-panel" }, [
  32408. _c(
  32409. "p",
  32410. { staticClass: "el-transfer-panel__header" },
  32411. [
  32412. _c(
  32413. "el-checkbox",
  32414. {
  32415. attrs: { indeterminate: _vm.isIndeterminate },
  32416. on: { change: _vm.handleAllCheckedChange },
  32417. model: {
  32418. value: _vm.allChecked,
  32419. callback: function($$v) {
  32420. _vm.allChecked = $$v
  32421. },
  32422. expression: "allChecked"
  32423. }
  32424. },
  32425. [
  32426. _vm._v("\n " + _vm._s(_vm.title) + "\n "),
  32427. _c("span", [_vm._v(_vm._s(_vm.checkedSummary))])
  32428. ]
  32429. )
  32430. ],
  32431. 1
  32432. ),
  32433. _c(
  32434. "div",
  32435. {
  32436. class: [
  32437. "el-transfer-panel__body",
  32438. _vm.hasFooter ? "is-with-footer" : ""
  32439. ]
  32440. },
  32441. [
  32442. _vm.filterable
  32443. ? _c(
  32444. "el-input",
  32445. {
  32446. staticClass: "el-transfer-panel__filter",
  32447. attrs: { size: "small", placeholder: _vm.placeholder },
  32448. nativeOn: {
  32449. mouseenter: function($event) {
  32450. _vm.inputHover = true
  32451. },
  32452. mouseleave: function($event) {
  32453. _vm.inputHover = false
  32454. }
  32455. },
  32456. model: {
  32457. value: _vm.query,
  32458. callback: function($$v) {
  32459. _vm.query = $$v
  32460. },
  32461. expression: "query"
  32462. }
  32463. },
  32464. [
  32465. _c("i", {
  32466. class: ["el-input__icon", "el-icon-" + _vm.inputIcon],
  32467. attrs: { slot: "prefix" },
  32468. on: { click: _vm.clearQuery },
  32469. slot: "prefix"
  32470. })
  32471. ]
  32472. )
  32473. : _vm._e(),
  32474. _c(
  32475. "el-checkbox-group",
  32476. {
  32477. directives: [
  32478. {
  32479. name: "show",
  32480. rawName: "v-show",
  32481. value: !_vm.hasNoMatch && _vm.data.length > 0,
  32482. expression: "!hasNoMatch && data.length > 0"
  32483. }
  32484. ],
  32485. staticClass: "el-transfer-panel__list",
  32486. class: { "is-filterable": _vm.filterable },
  32487. model: {
  32488. value: _vm.checked,
  32489. callback: function($$v) {
  32490. _vm.checked = $$v
  32491. },
  32492. expression: "checked"
  32493. }
  32494. },
  32495. _vm._l(_vm.filteredData, function(item) {
  32496. return _c(
  32497. "el-checkbox",
  32498. {
  32499. key: item[_vm.keyProp],
  32500. staticClass: "el-transfer-panel__item",
  32501. attrs: {
  32502. label: item[_vm.keyProp],
  32503. disabled: item[_vm.disabledProp]
  32504. }
  32505. },
  32506. [_c("option-content", { attrs: { option: item } })],
  32507. 1
  32508. )
  32509. }),
  32510. 1
  32511. ),
  32512. _c(
  32513. "p",
  32514. {
  32515. directives: [
  32516. {
  32517. name: "show",
  32518. rawName: "v-show",
  32519. value: _vm.hasNoMatch,
  32520. expression: "hasNoMatch"
  32521. }
  32522. ],
  32523. staticClass: "el-transfer-panel__empty"
  32524. },
  32525. [_vm._v(_vm._s(_vm.t("el.transfer.noMatch")))]
  32526. ),
  32527. _c(
  32528. "p",
  32529. {
  32530. directives: [
  32531. {
  32532. name: "show",
  32533. rawName: "v-show",
  32534. value: _vm.data.length === 0 && !_vm.hasNoMatch,
  32535. expression: "data.length === 0 && !hasNoMatch"
  32536. }
  32537. ],
  32538. staticClass: "el-transfer-panel__empty"
  32539. },
  32540. [_vm._v(_vm._s(_vm.t("el.transfer.noData")))]
  32541. )
  32542. ],
  32543. 1
  32544. ),
  32545. _vm.hasFooter
  32546. ? _c(
  32547. "p",
  32548. { staticClass: "el-transfer-panel__footer" },
  32549. [_vm._t("default")],
  32550. 2
  32551. )
  32552. : _vm._e()
  32553. ])
  32554. }
  32555. var transfer_panelvue_type_template_id_2ddab8bd_staticRenderFns = []
  32556. transfer_panelvue_type_template_id_2ddab8bd_render._withStripped = true
  32557. // CONCATENATED MODULE: ./packages/transfer/src/transfer-panel.vue?vue&type=template&id=2ddab8bd&
  32558. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/transfer/src/transfer-panel.vue?vue&type=script&lang=js&
  32559. //
  32560. //
  32561. //
  32562. //
  32563. //
  32564. //
  32565. //
  32566. //
  32567. //
  32568. //
  32569. //
  32570. //
  32571. //
  32572. //
  32573. //
  32574. //
  32575. //
  32576. //
  32577. //
  32578. //
  32579. //
  32580. //
  32581. //
  32582. //
  32583. //
  32584. //
  32585. //
  32586. //
  32587. //
  32588. //
  32589. //
  32590. //
  32591. //
  32592. //
  32593. //
  32594. //
  32595. //
  32596. //
  32597. //
  32598. //
  32599. //
  32600. //
  32601. //
  32602. //
  32603. //
  32604. //
  32605. //
  32606. //
  32607. //
  32608. //
  32609. //
  32610. //
  32611. //
  32612. /* harmony default export */ var transfer_panelvue_type_script_lang_js_ = ({
  32613. mixins: [locale_default.a],
  32614. name: 'ElTransferPanel',
  32615. componentName: 'ElTransferPanel',
  32616. components: {
  32617. ElCheckboxGroup: checkbox_group_default.a,
  32618. ElCheckbox: checkbox_default.a,
  32619. ElInput: input_default.a,
  32620. OptionContent: {
  32621. props: {
  32622. option: Object
  32623. },
  32624. render: function render(h) {
  32625. var getParent = function getParent(vm) {
  32626. if (vm.$options.componentName === 'ElTransferPanel') {
  32627. return vm;
  32628. } else if (vm.$parent) {
  32629. return getParent(vm.$parent);
  32630. } else {
  32631. return vm;
  32632. }
  32633. };
  32634. var panel = getParent(this);
  32635. var transfer = panel.$parent || panel;
  32636. return panel.renderContent ? panel.renderContent(h, this.option) : transfer.$scopedSlots.default ? transfer.$scopedSlots.default({ option: this.option }) : h('span', [this.option[panel.labelProp] || this.option[panel.keyProp]]);
  32637. }
  32638. }
  32639. },
  32640. props: {
  32641. data: {
  32642. type: Array,
  32643. default: function _default() {
  32644. return [];
  32645. }
  32646. },
  32647. renderContent: Function,
  32648. placeholder: String,
  32649. title: String,
  32650. filterable: Boolean,
  32651. format: Object,
  32652. filterMethod: Function,
  32653. defaultChecked: Array,
  32654. props: Object
  32655. },
  32656. data: function data() {
  32657. return {
  32658. checked: [],
  32659. allChecked: false,
  32660. query: '',
  32661. inputHover: false,
  32662. checkChangeByUser: true
  32663. };
  32664. },
  32665. watch: {
  32666. checked: function checked(val, oldVal) {
  32667. this.updateAllChecked();
  32668. if (this.checkChangeByUser) {
  32669. var movedKeys = val.concat(oldVal).filter(function (v) {
  32670. return val.indexOf(v) === -1 || oldVal.indexOf(v) === -1;
  32671. });
  32672. this.$emit('checked-change', val, movedKeys);
  32673. } else {
  32674. this.$emit('checked-change', val);
  32675. this.checkChangeByUser = true;
  32676. }
  32677. },
  32678. data: function data() {
  32679. var _this = this;
  32680. var checked = [];
  32681. var filteredDataKeys = this.filteredData.map(function (item) {
  32682. return item[_this.keyProp];
  32683. });
  32684. this.checked.forEach(function (item) {
  32685. if (filteredDataKeys.indexOf(item) > -1) {
  32686. checked.push(item);
  32687. }
  32688. });
  32689. this.checkChangeByUser = false;
  32690. this.checked = checked;
  32691. },
  32692. checkableData: function checkableData() {
  32693. this.updateAllChecked();
  32694. },
  32695. defaultChecked: {
  32696. immediate: true,
  32697. handler: function handler(val, oldVal) {
  32698. var _this2 = this;
  32699. if (oldVal && val.length === oldVal.length && val.every(function (item) {
  32700. return oldVal.indexOf(item) > -1;
  32701. })) return;
  32702. var checked = [];
  32703. var checkableDataKeys = this.checkableData.map(function (item) {
  32704. return item[_this2.keyProp];
  32705. });
  32706. val.forEach(function (item) {
  32707. if (checkableDataKeys.indexOf(item) > -1) {
  32708. checked.push(item);
  32709. }
  32710. });
  32711. this.checkChangeByUser = false;
  32712. this.checked = checked;
  32713. }
  32714. }
  32715. },
  32716. computed: {
  32717. filteredData: function filteredData() {
  32718. var _this3 = this;
  32719. return this.data.filter(function (item) {
  32720. if (typeof _this3.filterMethod === 'function') {
  32721. return _this3.filterMethod(_this3.query, item);
  32722. } else {
  32723. var label = item[_this3.labelProp] || item[_this3.keyProp].toString();
  32724. return label.toLowerCase().indexOf(_this3.query.toLowerCase()) > -1;
  32725. }
  32726. });
  32727. },
  32728. checkableData: function checkableData() {
  32729. var _this4 = this;
  32730. return this.filteredData.filter(function (item) {
  32731. return !item[_this4.disabledProp];
  32732. });
  32733. },
  32734. checkedSummary: function checkedSummary() {
  32735. var checkedLength = this.checked.length;
  32736. var dataLength = this.data.length;
  32737. var _format = this.format,
  32738. noChecked = _format.noChecked,
  32739. hasChecked = _format.hasChecked;
  32740. if (noChecked && hasChecked) {
  32741. return checkedLength > 0 ? hasChecked.replace(/\${checked}/g, checkedLength).replace(/\${total}/g, dataLength) : noChecked.replace(/\${total}/g, dataLength);
  32742. } else {
  32743. return checkedLength + '/' + dataLength;
  32744. }
  32745. },
  32746. isIndeterminate: function isIndeterminate() {
  32747. var checkedLength = this.checked.length;
  32748. return checkedLength > 0 && checkedLength < this.checkableData.length;
  32749. },
  32750. hasNoMatch: function hasNoMatch() {
  32751. return this.query.length > 0 && this.filteredData.length === 0;
  32752. },
  32753. inputIcon: function inputIcon() {
  32754. return this.query.length > 0 && this.inputHover ? 'circle-close' : 'search';
  32755. },
  32756. labelProp: function labelProp() {
  32757. return this.props.label || 'label';
  32758. },
  32759. keyProp: function keyProp() {
  32760. return this.props.key || 'key';
  32761. },
  32762. disabledProp: function disabledProp() {
  32763. return this.props.disabled || 'disabled';
  32764. },
  32765. hasFooter: function hasFooter() {
  32766. return !!this.$slots.default;
  32767. }
  32768. },
  32769. methods: {
  32770. updateAllChecked: function updateAllChecked() {
  32771. var _this5 = this;
  32772. var checkableDataKeys = this.checkableData.map(function (item) {
  32773. return item[_this5.keyProp];
  32774. });
  32775. this.allChecked = checkableDataKeys.length > 0 && checkableDataKeys.every(function (item) {
  32776. return _this5.checked.indexOf(item) > -1;
  32777. });
  32778. },
  32779. handleAllCheckedChange: function handleAllCheckedChange(value) {
  32780. var _this6 = this;
  32781. this.checked = value ? this.checkableData.map(function (item) {
  32782. return item[_this6.keyProp];
  32783. }) : [];
  32784. },
  32785. clearQuery: function clearQuery() {
  32786. if (this.inputIcon === 'circle-close') {
  32787. this.query = '';
  32788. }
  32789. }
  32790. }
  32791. });
  32792. // CONCATENATED MODULE: ./packages/transfer/src/transfer-panel.vue?vue&type=script&lang=js&
  32793. /* harmony default export */ var src_transfer_panelvue_type_script_lang_js_ = (transfer_panelvue_type_script_lang_js_);
  32794. // CONCATENATED MODULE: ./packages/transfer/src/transfer-panel.vue
  32795. /* normalize component */
  32796. var transfer_panel_component = normalizeComponent(
  32797. src_transfer_panelvue_type_script_lang_js_,
  32798. transfer_panelvue_type_template_id_2ddab8bd_render,
  32799. transfer_panelvue_type_template_id_2ddab8bd_staticRenderFns,
  32800. false,
  32801. null,
  32802. null,
  32803. null
  32804. )
  32805. /* hot reload */
  32806. if (false) { var transfer_panel_api; }
  32807. transfer_panel_component.options.__file = "packages/transfer/src/transfer-panel.vue"
  32808. /* harmony default export */ var transfer_panel = (transfer_panel_component.exports);
  32809. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/transfer/src/main.vue?vue&type=script&lang=js&
  32810. //
  32811. //
  32812. //
  32813. //
  32814. //
  32815. //
  32816. //
  32817. //
  32818. //
  32819. //
  32820. //
  32821. //
  32822. //
  32823. //
  32824. //
  32825. //
  32826. //
  32827. //
  32828. //
  32829. //
  32830. //
  32831. //
  32832. //
  32833. //
  32834. //
  32835. //
  32836. //
  32837. //
  32838. //
  32839. //
  32840. //
  32841. //
  32842. //
  32843. //
  32844. //
  32845. //
  32846. //
  32847. //
  32848. //
  32849. //
  32850. //
  32851. //
  32852. //
  32853. /* harmony default export */ var transfer_src_mainvue_type_script_lang_js_ = ({
  32854. name: 'ElTransfer',
  32855. mixins: [emitter_default.a, locale_default.a, migrating_default.a],
  32856. components: {
  32857. TransferPanel: transfer_panel,
  32858. ElButton: button_default.a
  32859. },
  32860. props: {
  32861. data: {
  32862. type: Array,
  32863. default: function _default() {
  32864. return [];
  32865. }
  32866. },
  32867. titles: {
  32868. type: Array,
  32869. default: function _default() {
  32870. return [];
  32871. }
  32872. },
  32873. buttonTexts: {
  32874. type: Array,
  32875. default: function _default() {
  32876. return [];
  32877. }
  32878. },
  32879. filterPlaceholder: {
  32880. type: String,
  32881. default: ''
  32882. },
  32883. filterMethod: Function,
  32884. leftDefaultChecked: {
  32885. type: Array,
  32886. default: function _default() {
  32887. return [];
  32888. }
  32889. },
  32890. rightDefaultChecked: {
  32891. type: Array,
  32892. default: function _default() {
  32893. return [];
  32894. }
  32895. },
  32896. renderContent: Function,
  32897. value: {
  32898. type: Array,
  32899. default: function _default() {
  32900. return [];
  32901. }
  32902. },
  32903. format: {
  32904. type: Object,
  32905. default: function _default() {
  32906. return {};
  32907. }
  32908. },
  32909. filterable: Boolean,
  32910. props: {
  32911. type: Object,
  32912. default: function _default() {
  32913. return {
  32914. label: 'label',
  32915. key: 'key',
  32916. disabled: 'disabled'
  32917. };
  32918. }
  32919. },
  32920. targetOrder: {
  32921. type: String,
  32922. default: 'original'
  32923. }
  32924. },
  32925. data: function data() {
  32926. return {
  32927. leftChecked: [],
  32928. rightChecked: []
  32929. };
  32930. },
  32931. computed: {
  32932. dataObj: function dataObj() {
  32933. var key = this.props.key;
  32934. return this.data.reduce(function (o, cur) {
  32935. return (o[cur[key]] = cur) && o;
  32936. }, {});
  32937. },
  32938. sourceData: function sourceData() {
  32939. var _this = this;
  32940. return this.data.filter(function (item) {
  32941. return _this.value.indexOf(item[_this.props.key]) === -1;
  32942. });
  32943. },
  32944. targetData: function targetData() {
  32945. var _this2 = this;
  32946. if (this.targetOrder === 'original') {
  32947. return this.data.filter(function (item) {
  32948. return _this2.value.indexOf(item[_this2.props.key]) > -1;
  32949. });
  32950. } else {
  32951. return this.value.reduce(function (arr, cur) {
  32952. var val = _this2.dataObj[cur];
  32953. if (val) {
  32954. arr.push(val);
  32955. }
  32956. return arr;
  32957. }, []);
  32958. }
  32959. },
  32960. hasButtonTexts: function hasButtonTexts() {
  32961. return this.buttonTexts.length === 2;
  32962. }
  32963. },
  32964. watch: {
  32965. value: function value(val) {
  32966. this.dispatch('ElFormItem', 'el.form.change', val);
  32967. }
  32968. },
  32969. methods: {
  32970. getMigratingConfig: function getMigratingConfig() {
  32971. return {
  32972. props: {
  32973. 'footer-format': 'footer-format is renamed to format.'
  32974. }
  32975. };
  32976. },
  32977. onSourceCheckedChange: function onSourceCheckedChange(val, movedKeys) {
  32978. this.leftChecked = val;
  32979. if (movedKeys === undefined) return;
  32980. this.$emit('left-check-change', val, movedKeys);
  32981. },
  32982. onTargetCheckedChange: function onTargetCheckedChange(val, movedKeys) {
  32983. this.rightChecked = val;
  32984. if (movedKeys === undefined) return;
  32985. this.$emit('right-check-change', val, movedKeys);
  32986. },
  32987. addToLeft: function addToLeft() {
  32988. var currentValue = this.value.slice();
  32989. this.rightChecked.forEach(function (item) {
  32990. var index = currentValue.indexOf(item);
  32991. if (index > -1) {
  32992. currentValue.splice(index, 1);
  32993. }
  32994. });
  32995. this.$emit('input', currentValue);
  32996. this.$emit('change', currentValue, 'left', this.rightChecked);
  32997. },
  32998. addToRight: function addToRight() {
  32999. var _this3 = this;
  33000. var currentValue = this.value.slice();
  33001. var itemsToBeMoved = [];
  33002. var key = this.props.key;
  33003. this.data.forEach(function (item) {
  33004. var itemKey = item[key];
  33005. if (_this3.leftChecked.indexOf(itemKey) > -1 && _this3.value.indexOf(itemKey) === -1) {
  33006. itemsToBeMoved.push(itemKey);
  33007. }
  33008. });
  33009. currentValue = this.targetOrder === 'unshift' ? itemsToBeMoved.concat(currentValue) : currentValue.concat(itemsToBeMoved);
  33010. this.$emit('input', currentValue);
  33011. this.$emit('change', currentValue, 'right', this.leftChecked);
  33012. },
  33013. clearQuery: function clearQuery(which) {
  33014. if (which === 'left') {
  33015. this.$refs.leftPanel.query = '';
  33016. } else if (which === 'right') {
  33017. this.$refs.rightPanel.query = '';
  33018. }
  33019. }
  33020. }
  33021. });
  33022. // CONCATENATED MODULE: ./packages/transfer/src/main.vue?vue&type=script&lang=js&
  33023. /* harmony default export */ var packages_transfer_src_mainvue_type_script_lang_js_ = (transfer_src_mainvue_type_script_lang_js_);
  33024. // CONCATENATED MODULE: ./packages/transfer/src/main.vue
  33025. /* normalize component */
  33026. var transfer_src_main_component = normalizeComponent(
  33027. packages_transfer_src_mainvue_type_script_lang_js_,
  33028. mainvue_type_template_id_5c654dd8_render,
  33029. mainvue_type_template_id_5c654dd8_staticRenderFns,
  33030. false,
  33031. null,
  33032. null,
  33033. null
  33034. )
  33035. /* hot reload */
  33036. if (false) { var transfer_src_main_api; }
  33037. transfer_src_main_component.options.__file = "packages/transfer/src/main.vue"
  33038. /* harmony default export */ var transfer_src_main = (transfer_src_main_component.exports);
  33039. // CONCATENATED MODULE: ./packages/transfer/index.js
  33040. /* istanbul ignore next */
  33041. transfer_src_main.install = function (Vue) {
  33042. Vue.component(transfer_src_main.name, transfer_src_main);
  33043. };
  33044. /* harmony default export */ var transfer = (transfer_src_main);
  33045. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/container/src/main.vue?vue&type=template&id=5bf181d4&
  33046. var mainvue_type_template_id_5bf181d4_render = function() {
  33047. var _vm = this
  33048. var _h = _vm.$createElement
  33049. var _c = _vm._self._c || _h
  33050. return _c(
  33051. "section",
  33052. { staticClass: "el-container", class: { "is-vertical": _vm.isVertical } },
  33053. [_vm._t("default")],
  33054. 2
  33055. )
  33056. }
  33057. var mainvue_type_template_id_5bf181d4_staticRenderFns = []
  33058. mainvue_type_template_id_5bf181d4_render._withStripped = true
  33059. // CONCATENATED MODULE: ./packages/container/src/main.vue?vue&type=template&id=5bf181d4&
  33060. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/container/src/main.vue?vue&type=script&lang=js&
  33061. //
  33062. //
  33063. //
  33064. //
  33065. //
  33066. //
  33067. /* harmony default export */ var container_src_mainvue_type_script_lang_js_ = ({
  33068. name: 'ElContainer',
  33069. componentName: 'ElContainer',
  33070. props: {
  33071. direction: String
  33072. },
  33073. computed: {
  33074. isVertical: function isVertical() {
  33075. if (this.direction === 'vertical') {
  33076. return true;
  33077. } else if (this.direction === 'horizontal') {
  33078. return false;
  33079. }
  33080. return this.$slots && this.$slots.default ? this.$slots.default.some(function (vnode) {
  33081. var tag = vnode.componentOptions && vnode.componentOptions.tag;
  33082. return tag === 'el-header' || tag === 'el-footer';
  33083. }) : false;
  33084. }
  33085. }
  33086. });
  33087. // CONCATENATED MODULE: ./packages/container/src/main.vue?vue&type=script&lang=js&
  33088. /* harmony default export */ var packages_container_src_mainvue_type_script_lang_js_ = (container_src_mainvue_type_script_lang_js_);
  33089. // CONCATENATED MODULE: ./packages/container/src/main.vue
  33090. /* normalize component */
  33091. var container_src_main_component = normalizeComponent(
  33092. packages_container_src_mainvue_type_script_lang_js_,
  33093. mainvue_type_template_id_5bf181d4_render,
  33094. mainvue_type_template_id_5bf181d4_staticRenderFns,
  33095. false,
  33096. null,
  33097. null,
  33098. null
  33099. )
  33100. /* hot reload */
  33101. if (false) { var container_src_main_api; }
  33102. container_src_main_component.options.__file = "packages/container/src/main.vue"
  33103. /* harmony default export */ var container_src_main = (container_src_main_component.exports);
  33104. // CONCATENATED MODULE: ./packages/container/index.js
  33105. /* istanbul ignore next */
  33106. container_src_main.install = function (Vue) {
  33107. Vue.component(container_src_main.name, container_src_main);
  33108. };
  33109. /* harmony default export */ var packages_container = (container_src_main);
  33110. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/header/src/main.vue?vue&type=template&id=2b296ab2&
  33111. var mainvue_type_template_id_2b296ab2_render = function() {
  33112. var _vm = this
  33113. var _h = _vm.$createElement
  33114. var _c = _vm._self._c || _h
  33115. return _c(
  33116. "header",
  33117. { staticClass: "el-header", style: { height: _vm.height } },
  33118. [_vm._t("default")],
  33119. 2
  33120. )
  33121. }
  33122. var mainvue_type_template_id_2b296ab2_staticRenderFns = []
  33123. mainvue_type_template_id_2b296ab2_render._withStripped = true
  33124. // CONCATENATED MODULE: ./packages/header/src/main.vue?vue&type=template&id=2b296ab2&
  33125. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/header/src/main.vue?vue&type=script&lang=js&
  33126. //
  33127. //
  33128. //
  33129. //
  33130. //
  33131. //
  33132. /* harmony default export */ var header_src_mainvue_type_script_lang_js_ = ({
  33133. name: 'ElHeader',
  33134. componentName: 'ElHeader',
  33135. props: {
  33136. height: {
  33137. type: String,
  33138. default: '60px'
  33139. }
  33140. }
  33141. });
  33142. // CONCATENATED MODULE: ./packages/header/src/main.vue?vue&type=script&lang=js&
  33143. /* harmony default export */ var packages_header_src_mainvue_type_script_lang_js_ = (header_src_mainvue_type_script_lang_js_);
  33144. // CONCATENATED MODULE: ./packages/header/src/main.vue
  33145. /* normalize component */
  33146. var header_src_main_component = normalizeComponent(
  33147. packages_header_src_mainvue_type_script_lang_js_,
  33148. mainvue_type_template_id_2b296ab2_render,
  33149. mainvue_type_template_id_2b296ab2_staticRenderFns,
  33150. false,
  33151. null,
  33152. null,
  33153. null
  33154. )
  33155. /* hot reload */
  33156. if (false) { var header_src_main_api; }
  33157. header_src_main_component.options.__file = "packages/header/src/main.vue"
  33158. /* harmony default export */ var header_src_main = (header_src_main_component.exports);
  33159. // CONCATENATED MODULE: ./packages/header/index.js
  33160. /* istanbul ignore next */
  33161. header_src_main.install = function (Vue) {
  33162. Vue.component(header_src_main.name, header_src_main);
  33163. };
  33164. /* harmony default export */ var header = (header_src_main);
  33165. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/aside/src/main.vue?vue&type=template&id=03411dbf&
  33166. var mainvue_type_template_id_03411dbf_render = function() {
  33167. var _vm = this
  33168. var _h = _vm.$createElement
  33169. var _c = _vm._self._c || _h
  33170. return _c(
  33171. "aside",
  33172. { staticClass: "el-aside", style: { width: _vm.width } },
  33173. [_vm._t("default")],
  33174. 2
  33175. )
  33176. }
  33177. var mainvue_type_template_id_03411dbf_staticRenderFns = []
  33178. mainvue_type_template_id_03411dbf_render._withStripped = true
  33179. // CONCATENATED MODULE: ./packages/aside/src/main.vue?vue&type=template&id=03411dbf&
  33180. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/aside/src/main.vue?vue&type=script&lang=js&
  33181. //
  33182. //
  33183. //
  33184. //
  33185. //
  33186. //
  33187. /* harmony default export */ var aside_src_mainvue_type_script_lang_js_ = ({
  33188. name: 'ElAside',
  33189. componentName: 'ElAside',
  33190. props: {
  33191. width: {
  33192. type: String,
  33193. default: '300px'
  33194. }
  33195. }
  33196. });
  33197. // CONCATENATED MODULE: ./packages/aside/src/main.vue?vue&type=script&lang=js&
  33198. /* harmony default export */ var packages_aside_src_mainvue_type_script_lang_js_ = (aside_src_mainvue_type_script_lang_js_);
  33199. // CONCATENATED MODULE: ./packages/aside/src/main.vue
  33200. /* normalize component */
  33201. var aside_src_main_component = normalizeComponent(
  33202. packages_aside_src_mainvue_type_script_lang_js_,
  33203. mainvue_type_template_id_03411dbf_render,
  33204. mainvue_type_template_id_03411dbf_staticRenderFns,
  33205. false,
  33206. null,
  33207. null,
  33208. null
  33209. )
  33210. /* hot reload */
  33211. if (false) { var aside_src_main_api; }
  33212. aside_src_main_component.options.__file = "packages/aside/src/main.vue"
  33213. /* harmony default export */ var aside_src_main = (aside_src_main_component.exports);
  33214. // CONCATENATED MODULE: ./packages/aside/index.js
  33215. /* istanbul ignore next */
  33216. aside_src_main.install = function (Vue) {
  33217. Vue.component(aside_src_main.name, aside_src_main);
  33218. };
  33219. /* harmony default export */ var aside = (aside_src_main);
  33220. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/main/src/main.vue?vue&type=template&id=2a3a7406&
  33221. var mainvue_type_template_id_2a3a7406_render = function() {
  33222. var _vm = this
  33223. var _h = _vm.$createElement
  33224. var _c = _vm._self._c || _h
  33225. return _c("main", { staticClass: "el-main" }, [_vm._t("default")], 2)
  33226. }
  33227. var mainvue_type_template_id_2a3a7406_staticRenderFns = []
  33228. mainvue_type_template_id_2a3a7406_render._withStripped = true
  33229. // CONCATENATED MODULE: ./packages/main/src/main.vue?vue&type=template&id=2a3a7406&
  33230. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/main/src/main.vue?vue&type=script&lang=js&
  33231. //
  33232. //
  33233. //
  33234. //
  33235. //
  33236. //
  33237. /* harmony default export */ var main_src_mainvue_type_script_lang_js_ = ({
  33238. name: 'ElMain',
  33239. componentName: 'ElMain'
  33240. });
  33241. // CONCATENATED MODULE: ./packages/main/src/main.vue?vue&type=script&lang=js&
  33242. /* harmony default export */ var packages_main_src_mainvue_type_script_lang_js_ = (main_src_mainvue_type_script_lang_js_);
  33243. // CONCATENATED MODULE: ./packages/main/src/main.vue
  33244. /* normalize component */
  33245. var main_src_main_component = normalizeComponent(
  33246. packages_main_src_mainvue_type_script_lang_js_,
  33247. mainvue_type_template_id_2a3a7406_render,
  33248. mainvue_type_template_id_2a3a7406_staticRenderFns,
  33249. false,
  33250. null,
  33251. null,
  33252. null
  33253. )
  33254. /* hot reload */
  33255. if (false) { var main_src_main_api; }
  33256. main_src_main_component.options.__file = "packages/main/src/main.vue"
  33257. /* harmony default export */ var main_src_main = (main_src_main_component.exports);
  33258. // CONCATENATED MODULE: ./packages/main/index.js
  33259. /* istanbul ignore next */
  33260. main_src_main.install = function (Vue) {
  33261. Vue.component(main_src_main.name, main_src_main);
  33262. };
  33263. /* harmony default export */ var packages_main = (main_src_main);
  33264. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/footer/src/main.vue?vue&type=template&id=80210338&
  33265. var mainvue_type_template_id_80210338_render = function() {
  33266. var _vm = this
  33267. var _h = _vm.$createElement
  33268. var _c = _vm._self._c || _h
  33269. return _c(
  33270. "footer",
  33271. { staticClass: "el-footer", style: { height: _vm.height } },
  33272. [_vm._t("default")],
  33273. 2
  33274. )
  33275. }
  33276. var mainvue_type_template_id_80210338_staticRenderFns = []
  33277. mainvue_type_template_id_80210338_render._withStripped = true
  33278. // CONCATENATED MODULE: ./packages/footer/src/main.vue?vue&type=template&id=80210338&
  33279. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/footer/src/main.vue?vue&type=script&lang=js&
  33280. //
  33281. //
  33282. //
  33283. //
  33284. //
  33285. //
  33286. /* harmony default export */ var footer_src_mainvue_type_script_lang_js_ = ({
  33287. name: 'ElFooter',
  33288. componentName: 'ElFooter',
  33289. props: {
  33290. height: {
  33291. type: String,
  33292. default: '60px'
  33293. }
  33294. }
  33295. });
  33296. // CONCATENATED MODULE: ./packages/footer/src/main.vue?vue&type=script&lang=js&
  33297. /* harmony default export */ var packages_footer_src_mainvue_type_script_lang_js_ = (footer_src_mainvue_type_script_lang_js_);
  33298. // CONCATENATED MODULE: ./packages/footer/src/main.vue
  33299. /* normalize component */
  33300. var footer_src_main_component = normalizeComponent(
  33301. packages_footer_src_mainvue_type_script_lang_js_,
  33302. mainvue_type_template_id_80210338_render,
  33303. mainvue_type_template_id_80210338_staticRenderFns,
  33304. false,
  33305. null,
  33306. null,
  33307. null
  33308. )
  33309. /* hot reload */
  33310. if (false) { var footer_src_main_api; }
  33311. footer_src_main_component.options.__file = "packages/footer/src/main.vue"
  33312. /* harmony default export */ var footer_src_main = (footer_src_main_component.exports);
  33313. // CONCATENATED MODULE: ./packages/footer/index.js
  33314. /* istanbul ignore next */
  33315. footer_src_main.install = function (Vue) {
  33316. Vue.component(footer_src_main.name, footer_src_main);
  33317. };
  33318. /* harmony default export */ var footer = (footer_src_main);
  33319. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/timeline/src/main.vue?vue&type=script&lang=js&
  33320. /* harmony default export */ var timeline_src_mainvue_type_script_lang_js_ = ({
  33321. name: 'ElTimeline',
  33322. props: {
  33323. reverse: {
  33324. type: Boolean,
  33325. default: false
  33326. }
  33327. },
  33328. provide: function provide() {
  33329. return {
  33330. timeline: this
  33331. };
  33332. },
  33333. render: function render() {
  33334. var h = arguments[0];
  33335. var reverse = this.reverse;
  33336. var classes = {
  33337. 'el-timeline': true,
  33338. 'is-reverse': reverse
  33339. };
  33340. var slots = this.$slots.default || [];
  33341. if (reverse) {
  33342. slots = slots.reverse();
  33343. }
  33344. return h(
  33345. 'ul',
  33346. { 'class': classes },
  33347. [slots]
  33348. );
  33349. }
  33350. });
  33351. // CONCATENATED MODULE: ./packages/timeline/src/main.vue?vue&type=script&lang=js&
  33352. /* harmony default export */ var packages_timeline_src_mainvue_type_script_lang_js_ = (timeline_src_mainvue_type_script_lang_js_);
  33353. // CONCATENATED MODULE: ./packages/timeline/src/main.vue
  33354. var main_render, main_staticRenderFns
  33355. /* normalize component */
  33356. var timeline_src_main_component = normalizeComponent(
  33357. packages_timeline_src_mainvue_type_script_lang_js_,
  33358. main_render,
  33359. main_staticRenderFns,
  33360. false,
  33361. null,
  33362. null,
  33363. null
  33364. )
  33365. /* hot reload */
  33366. if (false) { var timeline_src_main_api; }
  33367. timeline_src_main_component.options.__file = "packages/timeline/src/main.vue"
  33368. /* harmony default export */ var timeline_src_main = (timeline_src_main_component.exports);
  33369. // CONCATENATED MODULE: ./packages/timeline/index.js
  33370. /* istanbul ignore next */
  33371. timeline_src_main.install = function (Vue) {
  33372. Vue.component(timeline_src_main.name, timeline_src_main);
  33373. };
  33374. /* harmony default export */ var timeline = (timeline_src_main);
  33375. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/timeline/src/item.vue?vue&type=template&id=61a69e50&
  33376. var itemvue_type_template_id_61a69e50_render = function() {
  33377. var _vm = this
  33378. var _h = _vm.$createElement
  33379. var _c = _vm._self._c || _h
  33380. return _c("li", { staticClass: "el-timeline-item" }, [
  33381. _c("div", { staticClass: "el-timeline-item__tail" }),
  33382. !_vm.$slots.dot
  33383. ? _c(
  33384. "div",
  33385. {
  33386. staticClass: "el-timeline-item__node",
  33387. class: [
  33388. "el-timeline-item__node--" + (_vm.size || ""),
  33389. "el-timeline-item__node--" + (_vm.type || "")
  33390. ],
  33391. style: {
  33392. backgroundColor: _vm.color
  33393. }
  33394. },
  33395. [
  33396. _vm.icon
  33397. ? _c("i", {
  33398. staticClass: "el-timeline-item__icon",
  33399. class: _vm.icon
  33400. })
  33401. : _vm._e()
  33402. ]
  33403. )
  33404. : _vm._e(),
  33405. _vm.$slots.dot
  33406. ? _c("div", { staticClass: "el-timeline-item__dot" }, [_vm._t("dot")], 2)
  33407. : _vm._e(),
  33408. _c("div", { staticClass: "el-timeline-item__wrapper" }, [
  33409. !_vm.hideTimestamp && _vm.placement === "top"
  33410. ? _c("div", { staticClass: "el-timeline-item__timestamp is-top" }, [
  33411. _vm._v("\n " + _vm._s(_vm.timestamp) + "\n ")
  33412. ])
  33413. : _vm._e(),
  33414. _c(
  33415. "div",
  33416. { staticClass: "el-timeline-item__content" },
  33417. [_vm._t("default")],
  33418. 2
  33419. ),
  33420. !_vm.hideTimestamp && _vm.placement === "bottom"
  33421. ? _c("div", { staticClass: "el-timeline-item__timestamp is-bottom" }, [
  33422. _vm._v("\n " + _vm._s(_vm.timestamp) + "\n ")
  33423. ])
  33424. : _vm._e()
  33425. ])
  33426. ])
  33427. }
  33428. var itemvue_type_template_id_61a69e50_staticRenderFns = []
  33429. itemvue_type_template_id_61a69e50_render._withStripped = true
  33430. // CONCATENATED MODULE: ./packages/timeline/src/item.vue?vue&type=template&id=61a69e50&
  33431. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/timeline/src/item.vue?vue&type=script&lang=js&
  33432. //
  33433. //
  33434. //
  33435. //
  33436. //
  33437. //
  33438. //
  33439. //
  33440. //
  33441. //
  33442. //
  33443. //
  33444. //
  33445. //
  33446. //
  33447. //
  33448. //
  33449. //
  33450. //
  33451. //
  33452. //
  33453. //
  33454. //
  33455. //
  33456. //
  33457. //
  33458. //
  33459. //
  33460. //
  33461. //
  33462. //
  33463. //
  33464. //
  33465. //
  33466. //
  33467. //
  33468. //
  33469. //
  33470. //
  33471. //
  33472. //
  33473. /* harmony default export */ var timeline_src_itemvue_type_script_lang_js_ = ({
  33474. name: 'ElTimelineItem',
  33475. inject: ['timeline'],
  33476. props: {
  33477. timestamp: String,
  33478. hideTimestamp: {
  33479. type: Boolean,
  33480. default: false
  33481. },
  33482. placement: {
  33483. type: String,
  33484. default: 'bottom'
  33485. },
  33486. type: String,
  33487. color: String,
  33488. size: {
  33489. type: String,
  33490. default: 'normal'
  33491. },
  33492. icon: String
  33493. }
  33494. });
  33495. // CONCATENATED MODULE: ./packages/timeline/src/item.vue?vue&type=script&lang=js&
  33496. /* harmony default export */ var packages_timeline_src_itemvue_type_script_lang_js_ = (timeline_src_itemvue_type_script_lang_js_);
  33497. // CONCATENATED MODULE: ./packages/timeline/src/item.vue
  33498. /* normalize component */
  33499. var src_item_component = normalizeComponent(
  33500. packages_timeline_src_itemvue_type_script_lang_js_,
  33501. itemvue_type_template_id_61a69e50_render,
  33502. itemvue_type_template_id_61a69e50_staticRenderFns,
  33503. false,
  33504. null,
  33505. null,
  33506. null
  33507. )
  33508. /* hot reload */
  33509. if (false) { var src_item_api; }
  33510. src_item_component.options.__file = "packages/timeline/src/item.vue"
  33511. /* harmony default export */ var timeline_src_item = (src_item_component.exports);
  33512. // CONCATENATED MODULE: ./packages/timeline-item/index.js
  33513. /* istanbul ignore next */
  33514. timeline_src_item.install = function (Vue) {
  33515. Vue.component(timeline_src_item.name, timeline_src_item);
  33516. };
  33517. /* harmony default export */ var timeline_item = (timeline_src_item);
  33518. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/link/src/main.vue?vue&type=template&id=01cf3b65&
  33519. var mainvue_type_template_id_01cf3b65_render = function() {
  33520. var _vm = this
  33521. var _h = _vm.$createElement
  33522. var _c = _vm._self._c || _h
  33523. return _c(
  33524. "a",
  33525. _vm._b(
  33526. {
  33527. class: [
  33528. "el-link",
  33529. _vm.type ? "el-link--" + _vm.type : "",
  33530. _vm.disabled && "is-disabled",
  33531. _vm.underline && !_vm.disabled && "is-underline"
  33532. ],
  33533. attrs: { href: _vm.disabled ? null : _vm.href },
  33534. on: { click: _vm.handleClick }
  33535. },
  33536. "a",
  33537. _vm.$attrs,
  33538. false
  33539. ),
  33540. [
  33541. _vm.icon ? _c("i", { class: _vm.icon }) : _vm._e(),
  33542. _vm.$slots.default
  33543. ? _c("span", { staticClass: "el-link--inner" }, [_vm._t("default")], 2)
  33544. : _vm._e(),
  33545. _vm.$slots.icon ? [_vm.$slots.icon ? _vm._t("icon") : _vm._e()] : _vm._e()
  33546. ],
  33547. 2
  33548. )
  33549. }
  33550. var mainvue_type_template_id_01cf3b65_staticRenderFns = []
  33551. mainvue_type_template_id_01cf3b65_render._withStripped = true
  33552. // CONCATENATED MODULE: ./packages/link/src/main.vue?vue&type=template&id=01cf3b65&
  33553. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/link/src/main.vue?vue&type=script&lang=js&
  33554. //
  33555. //
  33556. //
  33557. //
  33558. //
  33559. //
  33560. //
  33561. //
  33562. //
  33563. //
  33564. //
  33565. //
  33566. //
  33567. //
  33568. //
  33569. //
  33570. //
  33571. //
  33572. //
  33573. //
  33574. //
  33575. //
  33576. //
  33577. /* harmony default export */ var link_src_mainvue_type_script_lang_js_ = ({
  33578. name: 'ElLink',
  33579. props: {
  33580. type: {
  33581. type: String,
  33582. default: 'default'
  33583. },
  33584. underline: {
  33585. type: Boolean,
  33586. default: true
  33587. },
  33588. disabled: Boolean,
  33589. href: String,
  33590. icon: String
  33591. },
  33592. methods: {
  33593. handleClick: function handleClick(event) {
  33594. if (!this.disabled) {
  33595. if (!this.href) {
  33596. this.$emit('click', event);
  33597. }
  33598. }
  33599. }
  33600. }
  33601. });
  33602. // CONCATENATED MODULE: ./packages/link/src/main.vue?vue&type=script&lang=js&
  33603. /* harmony default export */ var packages_link_src_mainvue_type_script_lang_js_ = (link_src_mainvue_type_script_lang_js_);
  33604. // CONCATENATED MODULE: ./packages/link/src/main.vue
  33605. /* normalize component */
  33606. var link_src_main_component = normalizeComponent(
  33607. packages_link_src_mainvue_type_script_lang_js_,
  33608. mainvue_type_template_id_01cf3b65_render,
  33609. mainvue_type_template_id_01cf3b65_staticRenderFns,
  33610. false,
  33611. null,
  33612. null,
  33613. null
  33614. )
  33615. /* hot reload */
  33616. if (false) { var link_src_main_api; }
  33617. link_src_main_component.options.__file = "packages/link/src/main.vue"
  33618. /* harmony default export */ var link_src_main = (link_src_main_component.exports);
  33619. // CONCATENATED MODULE: ./packages/link/index.js
  33620. /* istanbul ignore next */
  33621. link_src_main.install = function (Vue) {
  33622. Vue.component(link_src_main.name, link_src_main);
  33623. };
  33624. /* harmony default export */ var packages_link = (link_src_main);
  33625. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/divider/src/main.vue?vue&type=template&id=7fa02a7e&functional=true&
  33626. var mainvue_type_template_id_7fa02a7e_functional_true_render = function(_h, _vm) {
  33627. var _c = _vm._c
  33628. return _c(
  33629. "div",
  33630. _vm._g(
  33631. _vm._b(
  33632. {
  33633. class: [
  33634. _vm.data.staticClass,
  33635. "el-divider",
  33636. "el-divider--" + _vm.props.direction
  33637. ]
  33638. },
  33639. "div",
  33640. _vm.data.attrs,
  33641. false
  33642. ),
  33643. _vm.listeners
  33644. ),
  33645. [
  33646. _vm.slots().default && _vm.props.direction !== "vertical"
  33647. ? _c(
  33648. "div",
  33649. { class: ["el-divider__text", "is-" + _vm.props.contentPosition] },
  33650. [_vm._t("default")],
  33651. 2
  33652. )
  33653. : _vm._e()
  33654. ]
  33655. )
  33656. }
  33657. var mainvue_type_template_id_7fa02a7e_functional_true_staticRenderFns = []
  33658. mainvue_type_template_id_7fa02a7e_functional_true_render._withStripped = true
  33659. // CONCATENATED MODULE: ./packages/divider/src/main.vue?vue&type=template&id=7fa02a7e&functional=true&
  33660. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/divider/src/main.vue?vue&type=script&lang=js&
  33661. //
  33662. //
  33663. //
  33664. //
  33665. //
  33666. //
  33667. //
  33668. //
  33669. //
  33670. //
  33671. //
  33672. //
  33673. //
  33674. //
  33675. //
  33676. /* harmony default export */ var divider_src_mainvue_type_script_lang_js_ = ({
  33677. name: 'ElDivider',
  33678. props: {
  33679. direction: {
  33680. type: String,
  33681. default: 'horizontal',
  33682. validator: function validator(val) {
  33683. return ['horizontal', 'vertical'].indexOf(val) !== -1;
  33684. }
  33685. },
  33686. contentPosition: {
  33687. type: String,
  33688. default: 'center',
  33689. validator: function validator(val) {
  33690. return ['left', 'center', 'right'].indexOf(val) !== -1;
  33691. }
  33692. }
  33693. }
  33694. });
  33695. // CONCATENATED MODULE: ./packages/divider/src/main.vue?vue&type=script&lang=js&
  33696. /* harmony default export */ var packages_divider_src_mainvue_type_script_lang_js_ = (divider_src_mainvue_type_script_lang_js_);
  33697. // CONCATENATED MODULE: ./packages/divider/src/main.vue
  33698. /* normalize component */
  33699. var divider_src_main_component = normalizeComponent(
  33700. packages_divider_src_mainvue_type_script_lang_js_,
  33701. mainvue_type_template_id_7fa02a7e_functional_true_render,
  33702. mainvue_type_template_id_7fa02a7e_functional_true_staticRenderFns,
  33703. true,
  33704. null,
  33705. null,
  33706. null
  33707. )
  33708. /* hot reload */
  33709. if (false) { var divider_src_main_api; }
  33710. divider_src_main_component.options.__file = "packages/divider/src/main.vue"
  33711. /* harmony default export */ var divider_src_main = (divider_src_main_component.exports);
  33712. // CONCATENATED MODULE: ./packages/divider/index.js
  33713. /* istanbul ignore next */
  33714. divider_src_main.install = function (Vue) {
  33715. Vue.component(divider_src_main.name, divider_src_main);
  33716. };
  33717. /* harmony default export */ var divider = (divider_src_main);
  33718. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/image/src/main.vue?vue&type=template&id=44d84a7c&
  33719. var mainvue_type_template_id_44d84a7c_render = function() {
  33720. var _vm = this
  33721. var _h = _vm.$createElement
  33722. var _c = _vm._self._c || _h
  33723. return _c(
  33724. "div",
  33725. { staticClass: "el-image" },
  33726. [
  33727. _vm.loading
  33728. ? _vm._t("placeholder", [
  33729. _c("div", { staticClass: "el-image__placeholder" })
  33730. ])
  33731. : _vm.error
  33732. ? _vm._t("error", [
  33733. _c("div", { staticClass: "el-image__error" }, [
  33734. _vm._v(_vm._s(_vm.t("el.image.error")))
  33735. ])
  33736. ])
  33737. : _c(
  33738. "img",
  33739. _vm._g(
  33740. _vm._b(
  33741. {
  33742. staticClass: "el-image__inner",
  33743. class: {
  33744. "el-image__inner--center": _vm.alignCenter,
  33745. "el-image__preview": _vm.preview
  33746. },
  33747. style: _vm.imageStyle,
  33748. attrs: { src: _vm.src },
  33749. on: { click: _vm.clickHandler }
  33750. },
  33751. "img",
  33752. _vm.$attrs,
  33753. false
  33754. ),
  33755. _vm.$listeners
  33756. )
  33757. ),
  33758. _vm.preview
  33759. ? [
  33760. _vm.showViewer
  33761. ? _c("image-viewer", {
  33762. attrs: {
  33763. "z-index": _vm.zIndex,
  33764. "initial-index": _vm.imageIndex,
  33765. "on-close": _vm.closeViewer,
  33766. "url-list": _vm.previewSrcList
  33767. }
  33768. })
  33769. : _vm._e()
  33770. ]
  33771. : _vm._e()
  33772. ],
  33773. 2
  33774. )
  33775. }
  33776. var mainvue_type_template_id_44d84a7c_staticRenderFns = []
  33777. mainvue_type_template_id_44d84a7c_render._withStripped = true
  33778. // CONCATENATED MODULE: ./packages/image/src/main.vue?vue&type=template&id=44d84a7c&
  33779. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/image/src/image-viewer.vue?vue&type=template&id=5e73b307&
  33780. var image_viewervue_type_template_id_5e73b307_render = function() {
  33781. var _vm = this
  33782. var _h = _vm.$createElement
  33783. var _c = _vm._self._c || _h
  33784. return _c("transition", { attrs: { name: "viewer-fade" } }, [
  33785. _c(
  33786. "div",
  33787. {
  33788. ref: "el-image-viewer__wrapper",
  33789. staticClass: "el-image-viewer__wrapper",
  33790. style: { "z-index": _vm.viewerZIndex },
  33791. attrs: { tabindex: "-1" }
  33792. },
  33793. [
  33794. _c("div", {
  33795. staticClass: "el-image-viewer__mask",
  33796. on: {
  33797. click: function($event) {
  33798. if ($event.target !== $event.currentTarget) {
  33799. return null
  33800. }
  33801. return _vm.handleMaskClick($event)
  33802. }
  33803. }
  33804. }),
  33805. _c(
  33806. "span",
  33807. {
  33808. staticClass: "el-image-viewer__btn el-image-viewer__close",
  33809. on: { click: _vm.hide }
  33810. },
  33811. [_c("i", { staticClass: "el-icon-close" })]
  33812. ),
  33813. !_vm.isSingle
  33814. ? [
  33815. _c(
  33816. "span",
  33817. {
  33818. staticClass: "el-image-viewer__btn el-image-viewer__prev",
  33819. class: { "is-disabled": !_vm.infinite && _vm.isFirst },
  33820. on: { click: _vm.prev }
  33821. },
  33822. [_c("i", { staticClass: "el-icon-arrow-left" })]
  33823. ),
  33824. _c(
  33825. "span",
  33826. {
  33827. staticClass: "el-image-viewer__btn el-image-viewer__next",
  33828. class: { "is-disabled": !_vm.infinite && _vm.isLast },
  33829. on: { click: _vm.next }
  33830. },
  33831. [_c("i", { staticClass: "el-icon-arrow-right" })]
  33832. )
  33833. ]
  33834. : _vm._e(),
  33835. _c(
  33836. "div",
  33837. { staticClass: "el-image-viewer__btn el-image-viewer__actions" },
  33838. [
  33839. _c("div", { staticClass: "el-image-viewer__actions__inner" }, [
  33840. _c("i", {
  33841. staticClass: "el-icon-zoom-out",
  33842. on: {
  33843. click: function($event) {
  33844. _vm.handleActions("zoomOut")
  33845. }
  33846. }
  33847. }),
  33848. _c("i", {
  33849. staticClass: "el-icon-zoom-in",
  33850. on: {
  33851. click: function($event) {
  33852. _vm.handleActions("zoomIn")
  33853. }
  33854. }
  33855. }),
  33856. _c("i", { staticClass: "el-image-viewer__actions__divider" }),
  33857. _c("i", { class: _vm.mode.icon, on: { click: _vm.toggleMode } }),
  33858. _c("i", { staticClass: "el-image-viewer__actions__divider" }),
  33859. _c("i", {
  33860. staticClass: "el-icon-refresh-left",
  33861. on: {
  33862. click: function($event) {
  33863. _vm.handleActions("anticlocelise")
  33864. }
  33865. }
  33866. }),
  33867. _c("i", {
  33868. staticClass: "el-icon-refresh-right",
  33869. on: {
  33870. click: function($event) {
  33871. _vm.handleActions("clocelise")
  33872. }
  33873. }
  33874. })
  33875. ])
  33876. ]
  33877. ),
  33878. _c(
  33879. "div",
  33880. { staticClass: "el-image-viewer__canvas" },
  33881. _vm._l(_vm.urlList, function(url, i) {
  33882. return i === _vm.index
  33883. ? _c("img", {
  33884. key: url,
  33885. ref: "img",
  33886. refInFor: true,
  33887. staticClass: "el-image-viewer__img",
  33888. style: _vm.imgStyle,
  33889. attrs: { src: _vm.currentImg },
  33890. on: {
  33891. load: _vm.handleImgLoad,
  33892. error: _vm.handleImgError,
  33893. mousedown: _vm.handleMouseDown
  33894. }
  33895. })
  33896. : _vm._e()
  33897. }),
  33898. 0
  33899. )
  33900. ],
  33901. 2
  33902. )
  33903. ])
  33904. }
  33905. var image_viewervue_type_template_id_5e73b307_staticRenderFns = []
  33906. image_viewervue_type_template_id_5e73b307_render._withStripped = true
  33907. // CONCATENATED MODULE: ./packages/image/src/image-viewer.vue?vue&type=template&id=5e73b307&
  33908. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/image/src/image-viewer.vue?vue&type=script&lang=js&
  33909. var image_viewervue_type_script_lang_js_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; };
  33910. //
  33911. //
  33912. //
  33913. //
  33914. //
  33915. //
  33916. //
  33917. //
  33918. //
  33919. //
  33920. //
  33921. //
  33922. //
  33923. //
  33924. //
  33925. //
  33926. //
  33927. //
  33928. //
  33929. //
  33930. //
  33931. //
  33932. //
  33933. //
  33934. //
  33935. //
  33936. //
  33937. //
  33938. //
  33939. //
  33940. //
  33941. //
  33942. //
  33943. //
  33944. //
  33945. //
  33946. //
  33947. //
  33948. //
  33949. //
  33950. //
  33951. //
  33952. //
  33953. //
  33954. //
  33955. //
  33956. //
  33957. //
  33958. //
  33959. //
  33960. //
  33961. //
  33962. //
  33963. var Mode = {
  33964. CONTAIN: {
  33965. name: 'contain',
  33966. icon: 'el-icon-full-screen'
  33967. },
  33968. ORIGINAL: {
  33969. name: 'original',
  33970. icon: 'el-icon-c-scale-to-original'
  33971. }
  33972. };
  33973. var mousewheelEventName = Object(util_["isFirefox"])() ? 'DOMMouseScroll' : 'mousewheel';
  33974. /* harmony default export */ var image_viewervue_type_script_lang_js_ = ({
  33975. name: 'elImageViewer',
  33976. props: {
  33977. urlList: {
  33978. type: Array,
  33979. default: function _default() {
  33980. return [];
  33981. }
  33982. },
  33983. zIndex: {
  33984. type: Number,
  33985. default: 2000
  33986. },
  33987. onSwitch: {
  33988. type: Function,
  33989. default: function _default() {}
  33990. },
  33991. onClose: {
  33992. type: Function,
  33993. default: function _default() {}
  33994. },
  33995. initialIndex: {
  33996. type: Number,
  33997. default: 0
  33998. },
  33999. appendToBody: {
  34000. type: Boolean,
  34001. default: true
  34002. },
  34003. maskClosable: {
  34004. type: Boolean,
  34005. default: true
  34006. }
  34007. },
  34008. data: function data() {
  34009. return {
  34010. index: this.initialIndex,
  34011. isShow: false,
  34012. infinite: true,
  34013. loading: false,
  34014. mode: Mode.CONTAIN,
  34015. transform: {
  34016. scale: 1,
  34017. deg: 0,
  34018. offsetX: 0,
  34019. offsetY: 0,
  34020. enableTransition: false
  34021. }
  34022. };
  34023. },
  34024. computed: {
  34025. isSingle: function isSingle() {
  34026. return this.urlList.length <= 1;
  34027. },
  34028. isFirst: function isFirst() {
  34029. return this.index === 0;
  34030. },
  34031. isLast: function isLast() {
  34032. return this.index === this.urlList.length - 1;
  34033. },
  34034. currentImg: function currentImg() {
  34035. return this.urlList[this.index];
  34036. },
  34037. imgStyle: function imgStyle() {
  34038. var _transform = this.transform,
  34039. scale = _transform.scale,
  34040. deg = _transform.deg,
  34041. offsetX = _transform.offsetX,
  34042. offsetY = _transform.offsetY,
  34043. enableTransition = _transform.enableTransition;
  34044. var style = {
  34045. transform: 'scale(' + scale + ') rotate(' + deg + 'deg)',
  34046. transition: enableTransition ? 'transform .3s' : '',
  34047. 'margin-left': offsetX + 'px',
  34048. 'margin-top': offsetY + 'px'
  34049. };
  34050. if (this.mode === Mode.CONTAIN) {
  34051. style.maxWidth = style.maxHeight = '100%';
  34052. }
  34053. return style;
  34054. },
  34055. viewerZIndex: function viewerZIndex() {
  34056. var nextZIndex = popup_["PopupManager"].nextZIndex();
  34057. return this.zIndex > nextZIndex ? this.zIndex : nextZIndex;
  34058. }
  34059. },
  34060. watch: {
  34061. index: {
  34062. handler: function handler(val) {
  34063. this.reset();
  34064. this.onSwitch(val);
  34065. }
  34066. },
  34067. currentImg: function currentImg(val) {
  34068. var _this = this;
  34069. this.$nextTick(function (_) {
  34070. var $img = _this.$refs.img[0];
  34071. if (!$img.complete) {
  34072. _this.loading = true;
  34073. }
  34074. });
  34075. }
  34076. },
  34077. methods: {
  34078. hide: function hide() {
  34079. this.deviceSupportUninstall();
  34080. this.onClose();
  34081. },
  34082. deviceSupportInstall: function deviceSupportInstall() {
  34083. var _this2 = this;
  34084. this._keyDownHandler = function (e) {
  34085. e.stopPropagation();
  34086. var keyCode = e.keyCode;
  34087. switch (keyCode) {
  34088. // ESC
  34089. case 27:
  34090. _this2.hide();
  34091. break;
  34092. // SPACE
  34093. case 32:
  34094. _this2.toggleMode();
  34095. break;
  34096. // LEFT_ARROW
  34097. case 37:
  34098. _this2.prev();
  34099. break;
  34100. // UP_ARROW
  34101. case 38:
  34102. _this2.handleActions('zoomIn');
  34103. break;
  34104. // RIGHT_ARROW
  34105. case 39:
  34106. _this2.next();
  34107. break;
  34108. // DOWN_ARROW
  34109. case 40:
  34110. _this2.handleActions('zoomOut');
  34111. break;
  34112. }
  34113. };
  34114. this._mouseWheelHandler = Object(util_["rafThrottle"])(function (e) {
  34115. var delta = e.wheelDelta ? e.wheelDelta : -e.detail;
  34116. if (delta > 0) {
  34117. _this2.handleActions('zoomIn', {
  34118. zoomRate: 0.015,
  34119. enableTransition: false
  34120. });
  34121. } else {
  34122. _this2.handleActions('zoomOut', {
  34123. zoomRate: 0.015,
  34124. enableTransition: false
  34125. });
  34126. }
  34127. });
  34128. Object(dom_["on"])(document, 'keydown', this._keyDownHandler);
  34129. Object(dom_["on"])(document, mousewheelEventName, this._mouseWheelHandler);
  34130. },
  34131. deviceSupportUninstall: function deviceSupportUninstall() {
  34132. Object(dom_["off"])(document, 'keydown', this._keyDownHandler);
  34133. Object(dom_["off"])(document, mousewheelEventName, this._mouseWheelHandler);
  34134. this._keyDownHandler = null;
  34135. this._mouseWheelHandler = null;
  34136. },
  34137. handleImgLoad: function handleImgLoad(e) {
  34138. this.loading = false;
  34139. },
  34140. handleImgError: function handleImgError(e) {
  34141. this.loading = false;
  34142. e.target.alt = '加载失败';
  34143. },
  34144. handleMouseDown: function handleMouseDown(e) {
  34145. var _this3 = this;
  34146. if (this.loading || e.button !== 0) return;
  34147. var _transform2 = this.transform,
  34148. offsetX = _transform2.offsetX,
  34149. offsetY = _transform2.offsetY;
  34150. var startX = e.pageX;
  34151. var startY = e.pageY;
  34152. this._dragHandler = Object(util_["rafThrottle"])(function (ev) {
  34153. _this3.transform.offsetX = offsetX + ev.pageX - startX;
  34154. _this3.transform.offsetY = offsetY + ev.pageY - startY;
  34155. });
  34156. Object(dom_["on"])(document, 'mousemove', this._dragHandler);
  34157. Object(dom_["on"])(document, 'mouseup', function (ev) {
  34158. Object(dom_["off"])(document, 'mousemove', _this3._dragHandler);
  34159. });
  34160. e.preventDefault();
  34161. },
  34162. handleMaskClick: function handleMaskClick() {
  34163. if (this.maskClosable) {
  34164. this.hide();
  34165. }
  34166. },
  34167. reset: function reset() {
  34168. this.transform = {
  34169. scale: 1,
  34170. deg: 0,
  34171. offsetX: 0,
  34172. offsetY: 0,
  34173. enableTransition: false
  34174. };
  34175. },
  34176. toggleMode: function toggleMode() {
  34177. if (this.loading) return;
  34178. var modeNames = Object.keys(Mode);
  34179. var modeValues = Object.values(Mode);
  34180. var index = modeValues.indexOf(this.mode);
  34181. var nextIndex = (index + 1) % modeNames.length;
  34182. this.mode = Mode[modeNames[nextIndex]];
  34183. this.reset();
  34184. },
  34185. prev: function prev() {
  34186. if (this.isFirst && !this.infinite) return;
  34187. var len = this.urlList.length;
  34188. this.index = (this.index - 1 + len) % len;
  34189. },
  34190. next: function next() {
  34191. if (this.isLast && !this.infinite) return;
  34192. var len = this.urlList.length;
  34193. this.index = (this.index + 1) % len;
  34194. },
  34195. handleActions: function handleActions(action) {
  34196. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  34197. if (this.loading) return;
  34198. var _zoomRate$rotateDeg$e = image_viewervue_type_script_lang_js_extends({
  34199. zoomRate: 0.2,
  34200. rotateDeg: 90,
  34201. enableTransition: true
  34202. }, options),
  34203. zoomRate = _zoomRate$rotateDeg$e.zoomRate,
  34204. rotateDeg = _zoomRate$rotateDeg$e.rotateDeg,
  34205. enableTransition = _zoomRate$rotateDeg$e.enableTransition;
  34206. var transform = this.transform;
  34207. switch (action) {
  34208. case 'zoomOut':
  34209. if (transform.scale > 0.2) {
  34210. transform.scale = parseFloat((transform.scale - zoomRate).toFixed(3));
  34211. }
  34212. break;
  34213. case 'zoomIn':
  34214. transform.scale = parseFloat((transform.scale + zoomRate).toFixed(3));
  34215. break;
  34216. case 'clocelise':
  34217. transform.deg += rotateDeg;
  34218. break;
  34219. case 'anticlocelise':
  34220. transform.deg -= rotateDeg;
  34221. break;
  34222. }
  34223. transform.enableTransition = enableTransition;
  34224. }
  34225. },
  34226. mounted: function mounted() {
  34227. this.deviceSupportInstall();
  34228. if (this.appendToBody) {
  34229. document.body.appendChild(this.$el);
  34230. }
  34231. // add tabindex then wrapper can be focusable via Javascript
  34232. // focus wrapper so arrow key can't cause inner scroll behavior underneath
  34233. this.$refs['el-image-viewer__wrapper'].focus();
  34234. },
  34235. destroyed: function destroyed() {
  34236. // if appendToBody is true, remove DOM node after destroy
  34237. if (this.appendToBody && this.$el && this.$el.parentNode) {
  34238. this.$el.parentNode.removeChild(this.$el);
  34239. }
  34240. }
  34241. });
  34242. // CONCATENATED MODULE: ./packages/image/src/image-viewer.vue?vue&type=script&lang=js&
  34243. /* harmony default export */ var src_image_viewervue_type_script_lang_js_ = (image_viewervue_type_script_lang_js_);
  34244. // CONCATENATED MODULE: ./packages/image/src/image-viewer.vue
  34245. /* normalize component */
  34246. var image_viewer_component = normalizeComponent(
  34247. src_image_viewervue_type_script_lang_js_,
  34248. image_viewervue_type_template_id_5e73b307_render,
  34249. image_viewervue_type_template_id_5e73b307_staticRenderFns,
  34250. false,
  34251. null,
  34252. null,
  34253. null
  34254. )
  34255. /* hot reload */
  34256. if (false) { var image_viewer_api; }
  34257. image_viewer_component.options.__file = "packages/image/src/image-viewer.vue"
  34258. /* harmony default export */ var image_viewer = (image_viewer_component.exports);
  34259. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/image/src/main.vue?vue&type=script&lang=js&
  34260. //
  34261. //
  34262. //
  34263. //
  34264. //
  34265. //
  34266. //
  34267. //
  34268. //
  34269. //
  34270. //
  34271. //
  34272. //
  34273. //
  34274. //
  34275. //
  34276. //
  34277. //
  34278. //
  34279. //
  34280. //
  34281. //
  34282. //
  34283. var isSupportObjectFit = function isSupportObjectFit() {
  34284. return document.documentElement.style.objectFit !== undefined;
  34285. };
  34286. var ObjectFit = {
  34287. NONE: 'none',
  34288. CONTAIN: 'contain',
  34289. COVER: 'cover',
  34290. FILL: 'fill',
  34291. SCALE_DOWN: 'scale-down'
  34292. };
  34293. var prevOverflow = '';
  34294. /* harmony default export */ var image_src_mainvue_type_script_lang_js_ = ({
  34295. name: 'ElImage',
  34296. mixins: [locale_default.a],
  34297. inheritAttrs: false,
  34298. components: {
  34299. ImageViewer: image_viewer
  34300. },
  34301. props: {
  34302. src: String,
  34303. fit: String,
  34304. lazy: Boolean,
  34305. scrollContainer: {},
  34306. previewSrcList: {
  34307. type: Array,
  34308. default: function _default() {
  34309. return [];
  34310. }
  34311. },
  34312. zIndex: {
  34313. type: Number,
  34314. default: 2000
  34315. },
  34316. initialIndex: Number
  34317. },
  34318. data: function data() {
  34319. return {
  34320. loading: true,
  34321. error: false,
  34322. show: !this.lazy,
  34323. imageWidth: 0,
  34324. imageHeight: 0,
  34325. showViewer: false
  34326. };
  34327. },
  34328. computed: {
  34329. imageStyle: function imageStyle() {
  34330. var fit = this.fit;
  34331. if (!this.$isServer && fit) {
  34332. return isSupportObjectFit() ? { 'object-fit': fit } : this.getImageStyle(fit);
  34333. }
  34334. return {};
  34335. },
  34336. alignCenter: function alignCenter() {
  34337. return !this.$isServer && !isSupportObjectFit() && this.fit !== ObjectFit.FILL;
  34338. },
  34339. preview: function preview() {
  34340. var previewSrcList = this.previewSrcList;
  34341. return Array.isArray(previewSrcList) && previewSrcList.length > 0;
  34342. },
  34343. imageIndex: function imageIndex() {
  34344. var previewIndex = 0;
  34345. var initialIndex = this.initialIndex;
  34346. if (initialIndex >= 0) {
  34347. previewIndex = initialIndex;
  34348. return previewIndex;
  34349. }
  34350. var srcIndex = this.previewSrcList.indexOf(this.src);
  34351. if (srcIndex >= 0) {
  34352. previewIndex = srcIndex;
  34353. return previewIndex;
  34354. }
  34355. return previewIndex;
  34356. }
  34357. },
  34358. watch: {
  34359. src: function src(val) {
  34360. this.show && this.loadImage();
  34361. },
  34362. show: function show(val) {
  34363. val && this.loadImage();
  34364. }
  34365. },
  34366. mounted: function mounted() {
  34367. if (this.lazy) {
  34368. this.addLazyLoadListener();
  34369. } else {
  34370. this.loadImage();
  34371. }
  34372. },
  34373. beforeDestroy: function beforeDestroy() {
  34374. this.lazy && this.removeLazyLoadListener();
  34375. },
  34376. methods: {
  34377. loadImage: function loadImage() {
  34378. var _this = this;
  34379. if (this.$isServer) return;
  34380. // reset status
  34381. this.loading = true;
  34382. this.error = false;
  34383. var img = new Image();
  34384. img.onload = function (e) {
  34385. return _this.handleLoad(e, img);
  34386. };
  34387. img.onerror = this.handleError.bind(this);
  34388. // bind html attrs
  34389. // so it can behave consistently
  34390. Object.keys(this.$attrs).forEach(function (key) {
  34391. var value = _this.$attrs[key];
  34392. img.setAttribute(key, value);
  34393. });
  34394. img.src = this.src;
  34395. },
  34396. handleLoad: function handleLoad(e, img) {
  34397. this.imageWidth = img.width;
  34398. this.imageHeight = img.height;
  34399. this.loading = false;
  34400. this.error = false;
  34401. },
  34402. handleError: function handleError(e) {
  34403. this.loading = false;
  34404. this.error = true;
  34405. this.$emit('error', e);
  34406. },
  34407. handleLazyLoad: function handleLazyLoad() {
  34408. if (Object(dom_["isInContainer"])(this.$el, this._scrollContainer)) {
  34409. this.show = true;
  34410. this.removeLazyLoadListener();
  34411. }
  34412. },
  34413. addLazyLoadListener: function addLazyLoadListener() {
  34414. if (this.$isServer) return;
  34415. var scrollContainer = this.scrollContainer;
  34416. var _scrollContainer = null;
  34417. if (Object(types_["isHtmlElement"])(scrollContainer)) {
  34418. _scrollContainer = scrollContainer;
  34419. } else if (Object(types_["isString"])(scrollContainer)) {
  34420. _scrollContainer = document.querySelector(scrollContainer);
  34421. } else {
  34422. _scrollContainer = Object(dom_["getScrollContainer"])(this.$el);
  34423. }
  34424. if (_scrollContainer) {
  34425. this._scrollContainer = _scrollContainer;
  34426. this._lazyLoadHandler = throttle_default()(200, this.handleLazyLoad);
  34427. Object(dom_["on"])(_scrollContainer, 'scroll', this._lazyLoadHandler);
  34428. this.handleLazyLoad();
  34429. }
  34430. },
  34431. removeLazyLoadListener: function removeLazyLoadListener() {
  34432. var _scrollContainer = this._scrollContainer,
  34433. _lazyLoadHandler = this._lazyLoadHandler;
  34434. if (this.$isServer || !_scrollContainer || !_lazyLoadHandler) return;
  34435. Object(dom_["off"])(_scrollContainer, 'scroll', _lazyLoadHandler);
  34436. this._scrollContainer = null;
  34437. this._lazyLoadHandler = null;
  34438. },
  34439. /**
  34440. * simulate object-fit behavior to compatible with IE11 and other browsers which not support object-fit
  34441. */
  34442. getImageStyle: function getImageStyle(fit) {
  34443. var imageWidth = this.imageWidth,
  34444. imageHeight = this.imageHeight;
  34445. var _$el = this.$el,
  34446. containerWidth = _$el.clientWidth,
  34447. containerHeight = _$el.clientHeight;
  34448. if (!imageWidth || !imageHeight || !containerWidth || !containerHeight) return {};
  34449. var imageAspectRatio = imageWidth / imageHeight;
  34450. var containerAspectRatio = containerWidth / containerHeight;
  34451. if (fit === ObjectFit.SCALE_DOWN) {
  34452. var isSmaller = imageWidth < containerWidth && imageHeight < containerHeight;
  34453. fit = isSmaller ? ObjectFit.NONE : ObjectFit.CONTAIN;
  34454. }
  34455. switch (fit) {
  34456. case ObjectFit.NONE:
  34457. return { width: 'auto', height: 'auto' };
  34458. case ObjectFit.CONTAIN:
  34459. return imageAspectRatio < containerAspectRatio ? { width: 'auto' } : { height: 'auto' };
  34460. case ObjectFit.COVER:
  34461. return imageAspectRatio < containerAspectRatio ? { height: 'auto' } : { width: 'auto' };
  34462. default:
  34463. return {};
  34464. }
  34465. },
  34466. clickHandler: function clickHandler() {
  34467. // don't show viewer when preview is false
  34468. if (!this.preview) {
  34469. return;
  34470. }
  34471. // prevent body scroll
  34472. prevOverflow = document.body.style.overflow;
  34473. document.body.style.overflow = 'hidden';
  34474. this.showViewer = true;
  34475. },
  34476. closeViewer: function closeViewer() {
  34477. document.body.style.overflow = prevOverflow;
  34478. this.showViewer = false;
  34479. }
  34480. }
  34481. });
  34482. // CONCATENATED MODULE: ./packages/image/src/main.vue?vue&type=script&lang=js&
  34483. /* harmony default export */ var packages_image_src_mainvue_type_script_lang_js_ = (image_src_mainvue_type_script_lang_js_);
  34484. // CONCATENATED MODULE: ./packages/image/src/main.vue
  34485. /* normalize component */
  34486. var image_src_main_component = normalizeComponent(
  34487. packages_image_src_mainvue_type_script_lang_js_,
  34488. mainvue_type_template_id_44d84a7c_render,
  34489. mainvue_type_template_id_44d84a7c_staticRenderFns,
  34490. false,
  34491. null,
  34492. null,
  34493. null
  34494. )
  34495. /* hot reload */
  34496. if (false) { var image_src_main_api; }
  34497. image_src_main_component.options.__file = "packages/image/src/main.vue"
  34498. /* harmony default export */ var image_src_main = (image_src_main_component.exports);
  34499. // CONCATENATED MODULE: ./packages/image/index.js
  34500. /* istanbul ignore next */
  34501. image_src_main.install = function (Vue) {
  34502. Vue.component(image_src_main.name, image_src_main);
  34503. };
  34504. /* harmony default export */ var packages_image = (image_src_main);
  34505. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/calendar/src/main.vue?vue&type=template&id=6d9756be&
  34506. var mainvue_type_template_id_6d9756be_render = function() {
  34507. var _vm = this
  34508. var _h = _vm.$createElement
  34509. var _c = _vm._self._c || _h
  34510. return _c("div", { staticClass: "el-calendar" }, [
  34511. _c("div", { staticClass: "el-calendar__header" }, [
  34512. _c("div", { staticClass: "el-calendar__title" }, [
  34513. _vm._v("\n " + _vm._s(_vm.i18nDate) + "\n ")
  34514. ]),
  34515. _vm.validatedRange.length === 0
  34516. ? _c(
  34517. "div",
  34518. { staticClass: "el-calendar__button-group" },
  34519. [
  34520. _c(
  34521. "el-button-group",
  34522. [
  34523. _c(
  34524. "el-button",
  34525. {
  34526. attrs: { type: "plain", size: "mini" },
  34527. on: {
  34528. click: function($event) {
  34529. _vm.selectDate("prev-month")
  34530. }
  34531. }
  34532. },
  34533. [
  34534. _vm._v(
  34535. "\n " +
  34536. _vm._s(_vm.t("el.datepicker.prevMonth")) +
  34537. "\n "
  34538. )
  34539. ]
  34540. ),
  34541. _c(
  34542. "el-button",
  34543. {
  34544. attrs: { type: "plain", size: "mini" },
  34545. on: {
  34546. click: function($event) {
  34547. _vm.selectDate("today")
  34548. }
  34549. }
  34550. },
  34551. [
  34552. _vm._v(
  34553. "\n " +
  34554. _vm._s(_vm.t("el.datepicker.today")) +
  34555. "\n "
  34556. )
  34557. ]
  34558. ),
  34559. _c(
  34560. "el-button",
  34561. {
  34562. attrs: { type: "plain", size: "mini" },
  34563. on: {
  34564. click: function($event) {
  34565. _vm.selectDate("next-month")
  34566. }
  34567. }
  34568. },
  34569. [
  34570. _vm._v(
  34571. "\n " +
  34572. _vm._s(_vm.t("el.datepicker.nextMonth")) +
  34573. "\n "
  34574. )
  34575. ]
  34576. )
  34577. ],
  34578. 1
  34579. )
  34580. ],
  34581. 1
  34582. )
  34583. : _vm._e()
  34584. ]),
  34585. _vm.validatedRange.length === 0
  34586. ? _c(
  34587. "div",
  34588. { key: "no-range", staticClass: "el-calendar__body" },
  34589. [
  34590. _c("date-table", {
  34591. attrs: {
  34592. date: _vm.date,
  34593. "selected-day": _vm.realSelectedDay,
  34594. "first-day-of-week": _vm.realFirstDayOfWeek
  34595. },
  34596. on: { pick: _vm.pickDay }
  34597. })
  34598. ],
  34599. 1
  34600. )
  34601. : _c(
  34602. "div",
  34603. { key: "has-range", staticClass: "el-calendar__body" },
  34604. _vm._l(_vm.validatedRange, function(range, index) {
  34605. return _c("date-table", {
  34606. key: index,
  34607. attrs: {
  34608. date: range[0],
  34609. "selected-day": _vm.realSelectedDay,
  34610. range: range,
  34611. "hide-header": index !== 0,
  34612. "first-day-of-week": _vm.realFirstDayOfWeek
  34613. },
  34614. on: { pick: _vm.pickDay }
  34615. })
  34616. }),
  34617. 1
  34618. )
  34619. ])
  34620. }
  34621. var mainvue_type_template_id_6d9756be_staticRenderFns = []
  34622. mainvue_type_template_id_6d9756be_render._withStripped = true
  34623. // CONCATENATED MODULE: ./packages/calendar/src/main.vue?vue&type=template&id=6d9756be&
  34624. // EXTERNAL MODULE: external "element-ui/lib/utils/date"
  34625. var date_ = __webpack_require__(20);
  34626. var date_default = /*#__PURE__*/__webpack_require__.n(date_);
  34627. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/calendar/src/date-table.vue?vue&type=script&lang=js&
  34628. /* harmony default export */ var src_date_tablevue_type_script_lang_js_ = ({
  34629. props: {
  34630. selectedDay: String, // formated date yyyy-MM-dd
  34631. range: {
  34632. type: Array,
  34633. validator: function validator(val) {
  34634. if (!(val && val.length)) return true;
  34635. var start = val[0],
  34636. end = val[1];
  34637. return Object(date_util_["validateRangeInOneMonth"])(start, end);
  34638. }
  34639. },
  34640. date: Date,
  34641. hideHeader: Boolean,
  34642. firstDayOfWeek: Number
  34643. },
  34644. inject: ['elCalendar'],
  34645. methods: {
  34646. toNestedArr: function toNestedArr(days) {
  34647. return Object(date_util_["range"])(days.length / 7).map(function (_, index) {
  34648. var start = index * 7;
  34649. return days.slice(start, start + 7);
  34650. });
  34651. },
  34652. getFormateDate: function getFormateDate(day, type) {
  34653. if (!day || ['prev', 'current', 'next'].indexOf(type) === -1) {
  34654. throw new Error('invalid day or type');
  34655. }
  34656. var prefix = this.curMonthDatePrefix;
  34657. if (type === 'prev') {
  34658. prefix = this.prevMonthDatePrefix;
  34659. } else if (type === 'next') {
  34660. prefix = this.nextMonthDatePrefix;
  34661. }
  34662. day = ('00' + day).slice(-2);
  34663. return prefix + '-' + day;
  34664. },
  34665. getCellClass: function getCellClass(_ref) {
  34666. var text = _ref.text,
  34667. type = _ref.type;
  34668. var classes = [type];
  34669. if (type === 'current') {
  34670. var date = this.getFormateDate(text, type);
  34671. if (date === this.selectedDay) {
  34672. classes.push('is-selected');
  34673. }
  34674. if (date === this.formatedToday) {
  34675. classes.push('is-today');
  34676. }
  34677. }
  34678. return classes;
  34679. },
  34680. pickDay: function pickDay(_ref2) {
  34681. var text = _ref2.text,
  34682. type = _ref2.type;
  34683. var date = this.getFormateDate(text, type);
  34684. this.$emit('pick', date);
  34685. },
  34686. cellRenderProxy: function cellRenderProxy(_ref3) {
  34687. var text = _ref3.text,
  34688. type = _ref3.type;
  34689. var h = this.$createElement;
  34690. var render = this.elCalendar.$scopedSlots.dateCell;
  34691. if (!render) return h('span', [text]);
  34692. var day = this.getFormateDate(text, type);
  34693. var date = new Date(day);
  34694. var data = {
  34695. isSelected: this.selectedDay === day,
  34696. type: type + '-month',
  34697. day: day
  34698. };
  34699. return render({ date: date, data: data });
  34700. }
  34701. },
  34702. computed: {
  34703. WEEK_DAYS: function WEEK_DAYS() {
  34704. return Object(date_util_["getI18nSettings"])().dayNames;
  34705. },
  34706. prevMonthDatePrefix: function prevMonthDatePrefix() {
  34707. var temp = new Date(this.date.getTime());
  34708. temp.setDate(0);
  34709. return date_default.a.format(temp, 'yyyy-MM');
  34710. },
  34711. curMonthDatePrefix: function curMonthDatePrefix() {
  34712. return date_default.a.format(this.date, 'yyyy-MM');
  34713. },
  34714. nextMonthDatePrefix: function nextMonthDatePrefix() {
  34715. var temp = new Date(this.date.getFullYear(), this.date.getMonth() + 1, 1);
  34716. return date_default.a.format(temp, 'yyyy-MM');
  34717. },
  34718. formatedToday: function formatedToday() {
  34719. return this.elCalendar.formatedToday;
  34720. },
  34721. isInRange: function isInRange() {
  34722. return this.range && this.range.length;
  34723. },
  34724. rows: function rows() {
  34725. var days = [];
  34726. // if range exists, should render days in range.
  34727. if (this.isInRange) {
  34728. var _range = this.range,
  34729. start = _range[0],
  34730. end = _range[1];
  34731. var currentMonthRange = Object(date_util_["range"])(end.getDate() - start.getDate() + 1).map(function (_, index) {
  34732. return {
  34733. text: start.getDate() + index,
  34734. type: 'current'
  34735. };
  34736. });
  34737. var remaining = currentMonthRange.length % 7;
  34738. remaining = remaining === 0 ? 0 : 7 - remaining;
  34739. var nextMonthRange = Object(date_util_["range"])(remaining).map(function (_, index) {
  34740. return {
  34741. text: index + 1,
  34742. type: 'next'
  34743. };
  34744. });
  34745. days = currentMonthRange.concat(nextMonthRange);
  34746. } else {
  34747. var date = this.date;
  34748. var firstDay = Object(date_util_["getFirstDayOfMonth"])(date);
  34749. firstDay = firstDay === 0 ? 7 : firstDay;
  34750. var firstDayOfWeek = typeof this.firstDayOfWeek === 'number' ? this.firstDayOfWeek : 1;
  34751. var offset = (7 + firstDay - firstDayOfWeek) % 7;
  34752. var prevMonthDays = Object(date_util_["getPrevMonthLastDays"])(date, offset).map(function (day) {
  34753. return {
  34754. text: day,
  34755. type: 'prev'
  34756. };
  34757. });
  34758. var currentMonthDays = Object(date_util_["getMonthDays"])(date).map(function (day) {
  34759. return {
  34760. text: day,
  34761. type: 'current'
  34762. };
  34763. });
  34764. days = [].concat(prevMonthDays, currentMonthDays);
  34765. var nextMonthDays = Object(date_util_["range"])(42 - days.length).map(function (_, index) {
  34766. return {
  34767. text: index + 1,
  34768. type: 'next'
  34769. };
  34770. });
  34771. days = days.concat(nextMonthDays);
  34772. }
  34773. return this.toNestedArr(days);
  34774. },
  34775. weekDays: function weekDays() {
  34776. var start = this.firstDayOfWeek;
  34777. var WEEK_DAYS = this.WEEK_DAYS;
  34778. if (typeof start !== 'number' || start === 0) {
  34779. return WEEK_DAYS.slice();
  34780. } else {
  34781. return WEEK_DAYS.slice(start).concat(WEEK_DAYS.slice(0, start));
  34782. }
  34783. }
  34784. },
  34785. render: function render() {
  34786. var _this = this;
  34787. var h = arguments[0];
  34788. var thead = this.hideHeader ? null : h('thead', [this.weekDays.map(function (day) {
  34789. return h(
  34790. 'th',
  34791. { key: day },
  34792. [day]
  34793. );
  34794. })]);
  34795. return h(
  34796. 'table',
  34797. {
  34798. 'class': {
  34799. 'el-calendar-table': true,
  34800. 'is-range': this.isInRange
  34801. },
  34802. attrs: { cellspacing: '0',
  34803. cellpadding: '0' }
  34804. },
  34805. [thead, h('tbody', [this.rows.map(function (row, index) {
  34806. return h(
  34807. 'tr',
  34808. {
  34809. 'class': {
  34810. 'el-calendar-table__row': true,
  34811. 'el-calendar-table__row--hide-border': index === 0 && _this.hideHeader
  34812. },
  34813. key: index },
  34814. [row.map(function (cell, key) {
  34815. return h(
  34816. 'td',
  34817. { key: key,
  34818. 'class': _this.getCellClass(cell),
  34819. on: {
  34820. 'click': _this.pickDay.bind(_this, cell)
  34821. }
  34822. },
  34823. [h(
  34824. 'div',
  34825. { 'class': 'el-calendar-day' },
  34826. [_this.cellRenderProxy(cell)]
  34827. )]
  34828. );
  34829. })]
  34830. );
  34831. })])]
  34832. );
  34833. }
  34834. });
  34835. // CONCATENATED MODULE: ./packages/calendar/src/date-table.vue?vue&type=script&lang=js&
  34836. /* harmony default export */ var calendar_src_date_tablevue_type_script_lang_js_ = (src_date_tablevue_type_script_lang_js_);
  34837. // CONCATENATED MODULE: ./packages/calendar/src/date-table.vue
  34838. var date_table_render, date_table_staticRenderFns
  34839. /* normalize component */
  34840. var src_date_table_component = normalizeComponent(
  34841. calendar_src_date_tablevue_type_script_lang_js_,
  34842. date_table_render,
  34843. date_table_staticRenderFns,
  34844. false,
  34845. null,
  34846. null,
  34847. null
  34848. )
  34849. /* hot reload */
  34850. if (false) { var src_date_table_api; }
  34851. src_date_table_component.options.__file = "packages/calendar/src/date-table.vue"
  34852. /* harmony default export */ var src_date_table = (src_date_table_component.exports);
  34853. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/calendar/src/main.vue?vue&type=script&lang=js&
  34854. //
  34855. //
  34856. //
  34857. //
  34858. //
  34859. //
  34860. //
  34861. //
  34862. //
  34863. //
  34864. //
  34865. //
  34866. //
  34867. //
  34868. //
  34869. //
  34870. //
  34871. //
  34872. //
  34873. //
  34874. //
  34875. //
  34876. //
  34877. //
  34878. //
  34879. //
  34880. //
  34881. //
  34882. //
  34883. //
  34884. //
  34885. //
  34886. //
  34887. //
  34888. //
  34889. //
  34890. //
  34891. //
  34892. //
  34893. //
  34894. //
  34895. //
  34896. //
  34897. //
  34898. //
  34899. //
  34900. //
  34901. //
  34902. //
  34903. //
  34904. //
  34905. //
  34906. //
  34907. //
  34908. //
  34909. //
  34910. //
  34911. //
  34912. var validTypes = ['prev-month', 'today', 'next-month'];
  34913. var weekDays = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
  34914. var oneDay = 86400000;
  34915. /* harmony default export */ var calendar_src_mainvue_type_script_lang_js_ = ({
  34916. name: 'ElCalendar',
  34917. mixins: [locale_default.a],
  34918. components: {
  34919. DateTable: src_date_table,
  34920. ElButton: button_default.a,
  34921. ElButtonGroup: button_group_default.a
  34922. },
  34923. props: {
  34924. value: [Date, String, Number],
  34925. range: {
  34926. type: Array,
  34927. validator: function validator(range) {
  34928. if (Array.isArray(range)) {
  34929. return range.length === 2 && range.every(function (item) {
  34930. return typeof item === 'string' || typeof item === 'number' || item instanceof Date;
  34931. });
  34932. } else {
  34933. return true;
  34934. }
  34935. }
  34936. },
  34937. firstDayOfWeek: {
  34938. type: Number,
  34939. default: 1
  34940. }
  34941. },
  34942. provide: function provide() {
  34943. return {
  34944. elCalendar: this
  34945. };
  34946. },
  34947. methods: {
  34948. pickDay: function pickDay(day) {
  34949. this.realSelectedDay = day;
  34950. },
  34951. selectDate: function selectDate(type) {
  34952. if (validTypes.indexOf(type) === -1) {
  34953. throw new Error('invalid type ' + type);
  34954. }
  34955. var day = '';
  34956. if (type === 'prev-month') {
  34957. day = this.prevMonthDatePrefix + '-01';
  34958. } else if (type === 'next-month') {
  34959. day = this.nextMonthDatePrefix + '-01';
  34960. } else {
  34961. day = this.formatedToday;
  34962. }
  34963. if (day === this.formatedDate) return;
  34964. this.pickDay(day);
  34965. },
  34966. toDate: function toDate(val) {
  34967. if (!val) {
  34968. throw new Error('invalid val');
  34969. }
  34970. return val instanceof Date ? val : new Date(val);
  34971. },
  34972. rangeValidator: function rangeValidator(date, isStart) {
  34973. var firstDayOfWeek = this.realFirstDayOfWeek;
  34974. var expected = isStart ? firstDayOfWeek : firstDayOfWeek === 0 ? 6 : firstDayOfWeek - 1;
  34975. var message = (isStart ? 'start' : 'end') + ' of range should be ' + weekDays[expected] + '.';
  34976. if (date.getDay() !== expected) {
  34977. console.warn('[ElementCalendar]', message, 'Invalid range will be ignored.');
  34978. return false;
  34979. }
  34980. return true;
  34981. }
  34982. },
  34983. computed: {
  34984. prevMonthDatePrefix: function prevMonthDatePrefix() {
  34985. var temp = new Date(this.date.getTime());
  34986. temp.setDate(0);
  34987. return date_default.a.format(temp, 'yyyy-MM');
  34988. },
  34989. curMonthDatePrefix: function curMonthDatePrefix() {
  34990. return date_default.a.format(this.date, 'yyyy-MM');
  34991. },
  34992. nextMonthDatePrefix: function nextMonthDatePrefix() {
  34993. var temp = new Date(this.date.getFullYear(), this.date.getMonth() + 1, 1);
  34994. return date_default.a.format(temp, 'yyyy-MM');
  34995. },
  34996. formatedDate: function formatedDate() {
  34997. return date_default.a.format(this.date, 'yyyy-MM-dd');
  34998. },
  34999. i18nDate: function i18nDate() {
  35000. var year = this.date.getFullYear();
  35001. var month = this.date.getMonth() + 1;
  35002. return year + ' ' + this.t('el.datepicker.year') + ' ' + this.t('el.datepicker.month' + month);
  35003. },
  35004. formatedToday: function formatedToday() {
  35005. return date_default.a.format(this.now, 'yyyy-MM-dd');
  35006. },
  35007. realSelectedDay: {
  35008. get: function get() {
  35009. if (!this.value) return this.selectedDay;
  35010. return this.formatedDate;
  35011. },
  35012. set: function set(val) {
  35013. this.selectedDay = val;
  35014. var date = new Date(val);
  35015. this.$emit('input', date);
  35016. }
  35017. },
  35018. date: function date() {
  35019. if (!this.value) {
  35020. if (this.realSelectedDay) {
  35021. var d = this.selectedDay.split('-');
  35022. return new Date(d[0], d[1] - 1, d[2]);
  35023. } else if (this.validatedRange.length) {
  35024. return this.validatedRange[0][0];
  35025. }
  35026. return this.now;
  35027. } else {
  35028. return this.toDate(this.value);
  35029. }
  35030. },
  35031. // if range is valid, we get a two-digit array
  35032. validatedRange: function validatedRange() {
  35033. var _this = this;
  35034. var range = this.range;
  35035. if (!range) return [];
  35036. range = range.reduce(function (prev, val, index) {
  35037. var date = _this.toDate(val);
  35038. if (_this.rangeValidator(date, index === 0)) {
  35039. prev = prev.concat(date);
  35040. }
  35041. return prev;
  35042. }, []);
  35043. if (range.length === 2) {
  35044. var _range = range,
  35045. start = _range[0],
  35046. end = _range[1];
  35047. if (start > end) {
  35048. console.warn('[ElementCalendar]end time should be greater than start time');
  35049. return [];
  35050. }
  35051. // start time and end time in one month
  35052. if (Object(date_util_["validateRangeInOneMonth"])(start, end)) {
  35053. return [[start, end]];
  35054. }
  35055. var data = [];
  35056. var startDay = new Date(start.getFullYear(), start.getMonth() + 1, 1);
  35057. var lastDay = this.toDate(startDay.getTime() - oneDay);
  35058. if (!Object(date_util_["validateRangeInOneMonth"])(startDay, end)) {
  35059. console.warn('[ElementCalendar]start time and end time interval must not exceed two months');
  35060. return [];
  35061. }
  35062. // 第一个月的时间范围
  35063. data.push([start, lastDay]);
  35064. // 下一月的时间范围,需要计算一下该月的第一个周起始日
  35065. var firstDayOfWeek = this.realFirstDayOfWeek;
  35066. var nextMontFirstDay = startDay.getDay();
  35067. var interval = 0;
  35068. if (nextMontFirstDay !== firstDayOfWeek) {
  35069. if (firstDayOfWeek === 0) {
  35070. interval = 7 - nextMontFirstDay;
  35071. } else {
  35072. interval = firstDayOfWeek - nextMontFirstDay;
  35073. interval = interval > 0 ? interval : 7 + interval;
  35074. }
  35075. }
  35076. startDay = this.toDate(startDay.getTime() + interval * oneDay);
  35077. if (startDay.getDate() < end.getDate()) {
  35078. data.push([startDay, end]);
  35079. }
  35080. return data;
  35081. }
  35082. return [];
  35083. },
  35084. realFirstDayOfWeek: function realFirstDayOfWeek() {
  35085. if (this.firstDayOfWeek < 1 || this.firstDayOfWeek > 6) {
  35086. return 0;
  35087. }
  35088. return Math.floor(this.firstDayOfWeek);
  35089. }
  35090. },
  35091. data: function data() {
  35092. return {
  35093. selectedDay: '',
  35094. now: new Date()
  35095. };
  35096. }
  35097. });
  35098. // CONCATENATED MODULE: ./packages/calendar/src/main.vue?vue&type=script&lang=js&
  35099. /* harmony default export */ var packages_calendar_src_mainvue_type_script_lang_js_ = (calendar_src_mainvue_type_script_lang_js_);
  35100. // CONCATENATED MODULE: ./packages/calendar/src/main.vue
  35101. /* normalize component */
  35102. var calendar_src_main_component = normalizeComponent(
  35103. packages_calendar_src_mainvue_type_script_lang_js_,
  35104. mainvue_type_template_id_6d9756be_render,
  35105. mainvue_type_template_id_6d9756be_staticRenderFns,
  35106. false,
  35107. null,
  35108. null,
  35109. null
  35110. )
  35111. /* hot reload */
  35112. if (false) { var calendar_src_main_api; }
  35113. calendar_src_main_component.options.__file = "packages/calendar/src/main.vue"
  35114. /* harmony default export */ var calendar_src_main = (calendar_src_main_component.exports);
  35115. // CONCATENATED MODULE: ./packages/calendar/index.js
  35116. /* istanbul ignore next */
  35117. calendar_src_main.install = function (Vue) {
  35118. Vue.component(calendar_src_main.name, calendar_src_main);
  35119. };
  35120. /* harmony default export */ var calendar = (calendar_src_main);
  35121. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/backtop/src/main.vue?vue&type=template&id=257dd4a9&
  35122. var mainvue_type_template_id_257dd4a9_render = function() {
  35123. var _vm = this
  35124. var _h = _vm.$createElement
  35125. var _c = _vm._self._c || _h
  35126. return _c("transition", { attrs: { name: "el-fade-in" } }, [
  35127. _vm.visible
  35128. ? _c(
  35129. "div",
  35130. {
  35131. staticClass: "el-backtop",
  35132. style: {
  35133. right: _vm.styleRight,
  35134. bottom: _vm.styleBottom
  35135. },
  35136. on: {
  35137. click: function($event) {
  35138. $event.stopPropagation()
  35139. return _vm.handleClick($event)
  35140. }
  35141. }
  35142. },
  35143. [
  35144. _vm._t("default", [_c("el-icon", { attrs: { name: "caret-top" } })])
  35145. ],
  35146. 2
  35147. )
  35148. : _vm._e()
  35149. ])
  35150. }
  35151. var mainvue_type_template_id_257dd4a9_staticRenderFns = []
  35152. mainvue_type_template_id_257dd4a9_render._withStripped = true
  35153. // CONCATENATED MODULE: ./packages/backtop/src/main.vue?vue&type=template&id=257dd4a9&
  35154. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/backtop/src/main.vue?vue&type=script&lang=js&
  35155. //
  35156. //
  35157. //
  35158. //
  35159. //
  35160. //
  35161. //
  35162. //
  35163. //
  35164. //
  35165. //
  35166. //
  35167. //
  35168. //
  35169. //
  35170. //
  35171. //
  35172. var cubic = function cubic(value) {
  35173. return Math.pow(value, 3);
  35174. };
  35175. var easeInOutCubic = function easeInOutCubic(value) {
  35176. return value < 0.5 ? cubic(value * 2) / 2 : 1 - cubic((1 - value) * 2) / 2;
  35177. };
  35178. /* harmony default export */ var backtop_src_mainvue_type_script_lang_js_ = ({
  35179. name: 'ElBacktop',
  35180. props: {
  35181. visibilityHeight: {
  35182. type: Number,
  35183. default: 200
  35184. },
  35185. target: [String],
  35186. right: {
  35187. type: Number,
  35188. default: 40
  35189. },
  35190. bottom: {
  35191. type: Number,
  35192. default: 40
  35193. }
  35194. },
  35195. data: function data() {
  35196. return {
  35197. el: null,
  35198. container: null,
  35199. visible: false
  35200. };
  35201. },
  35202. computed: {
  35203. styleBottom: function styleBottom() {
  35204. return this.bottom + 'px';
  35205. },
  35206. styleRight: function styleRight() {
  35207. return this.right + 'px';
  35208. }
  35209. },
  35210. mounted: function mounted() {
  35211. this.init();
  35212. this.throttledScrollHandler = throttle_default()(300, this.onScroll);
  35213. this.container.addEventListener('scroll', this.throttledScrollHandler);
  35214. },
  35215. methods: {
  35216. init: function init() {
  35217. this.container = document;
  35218. this.el = document.documentElement;
  35219. if (this.target) {
  35220. this.el = document.querySelector(this.target);
  35221. if (!this.el) {
  35222. throw new Error('target is not existed: ' + this.target);
  35223. }
  35224. this.container = this.el;
  35225. }
  35226. },
  35227. onScroll: function onScroll() {
  35228. var scrollTop = this.el.scrollTop;
  35229. this.visible = scrollTop >= this.visibilityHeight;
  35230. },
  35231. handleClick: function handleClick(e) {
  35232. this.scrollToTop();
  35233. this.$emit('click', e);
  35234. },
  35235. scrollToTop: function scrollToTop() {
  35236. var el = this.el;
  35237. var beginTime = Date.now();
  35238. var beginValue = el.scrollTop;
  35239. var rAF = window.requestAnimationFrame || function (func) {
  35240. return setTimeout(func, 16);
  35241. };
  35242. var frameFunc = function frameFunc() {
  35243. var progress = (Date.now() - beginTime) / 500;
  35244. if (progress < 1) {
  35245. el.scrollTop = beginValue * (1 - easeInOutCubic(progress));
  35246. rAF(frameFunc);
  35247. } else {
  35248. el.scrollTop = 0;
  35249. }
  35250. };
  35251. rAF(frameFunc);
  35252. }
  35253. },
  35254. beforeDestroy: function beforeDestroy() {
  35255. this.container.removeEventListener('scroll', this.throttledScrollHandler);
  35256. }
  35257. });
  35258. // CONCATENATED MODULE: ./packages/backtop/src/main.vue?vue&type=script&lang=js&
  35259. /* harmony default export */ var packages_backtop_src_mainvue_type_script_lang_js_ = (backtop_src_mainvue_type_script_lang_js_);
  35260. // CONCATENATED MODULE: ./packages/backtop/src/main.vue
  35261. /* normalize component */
  35262. var backtop_src_main_component = normalizeComponent(
  35263. packages_backtop_src_mainvue_type_script_lang_js_,
  35264. mainvue_type_template_id_257dd4a9_render,
  35265. mainvue_type_template_id_257dd4a9_staticRenderFns,
  35266. false,
  35267. null,
  35268. null,
  35269. null
  35270. )
  35271. /* hot reload */
  35272. if (false) { var backtop_src_main_api; }
  35273. backtop_src_main_component.options.__file = "packages/backtop/src/main.vue"
  35274. /* harmony default export */ var backtop_src_main = (backtop_src_main_component.exports);
  35275. // CONCATENATED MODULE: ./packages/backtop/index.js
  35276. /* istanbul ignore next */
  35277. backtop_src_main.install = function (Vue) {
  35278. Vue.component(backtop_src_main.name, backtop_src_main);
  35279. };
  35280. /* harmony default export */ var backtop = (backtop_src_main);
  35281. // CONCATENATED MODULE: ./packages/infinite-scroll/src/main.js
  35282. var getStyleComputedProperty = function getStyleComputedProperty(element, property) {
  35283. if (element === window) {
  35284. element = document.documentElement;
  35285. }
  35286. if (element.nodeType !== 1) {
  35287. return [];
  35288. }
  35289. // NOTE: 1 DOM access here
  35290. var css = window.getComputedStyle(element, null);
  35291. return property ? css[property] : css;
  35292. };
  35293. var entries = function entries(obj) {
  35294. return Object.keys(obj || {}).map(function (key) {
  35295. return [key, obj[key]];
  35296. });
  35297. };
  35298. var getPositionSize = function getPositionSize(el, prop) {
  35299. return el === window || el === document ? document.documentElement[prop] : el[prop];
  35300. };
  35301. var getOffsetHeight = function getOffsetHeight(el) {
  35302. return getPositionSize(el, 'offsetHeight');
  35303. };
  35304. var getClientHeight = function getClientHeight(el) {
  35305. return getPositionSize(el, 'clientHeight');
  35306. };
  35307. var scope = 'ElInfiniteScroll';
  35308. var attributes = {
  35309. delay: {
  35310. type: Number,
  35311. default: 200
  35312. },
  35313. distance: {
  35314. type: Number,
  35315. default: 0
  35316. },
  35317. disabled: {
  35318. type: Boolean,
  35319. default: false
  35320. },
  35321. immediate: {
  35322. type: Boolean,
  35323. default: true
  35324. }
  35325. };
  35326. var main_getScrollOptions = function getScrollOptions(el, vm) {
  35327. if (!Object(types_["isHtmlElement"])(el)) return {};
  35328. return entries(attributes).reduce(function (map, _ref) {
  35329. var key = _ref[0],
  35330. option = _ref[1];
  35331. var type = option.type,
  35332. defaultValue = option.default;
  35333. var value = el.getAttribute('infinite-scroll-' + key);
  35334. value = Object(types_["isUndefined"])(vm[value]) ? value : vm[value];
  35335. switch (type) {
  35336. case Number:
  35337. value = Number(value);
  35338. value = Number.isNaN(value) ? defaultValue : value;
  35339. break;
  35340. case Boolean:
  35341. value = Object(types_["isDefined"])(value) ? value === 'false' ? false : Boolean(value) : defaultValue;
  35342. break;
  35343. default:
  35344. value = type(value);
  35345. }
  35346. map[key] = value;
  35347. return map;
  35348. }, {});
  35349. };
  35350. var getElementTop = function getElementTop(el) {
  35351. return el.getBoundingClientRect().top;
  35352. };
  35353. var main_handleScroll = function handleScroll(cb) {
  35354. var _scope = this[scope],
  35355. el = _scope.el,
  35356. vm = _scope.vm,
  35357. container = _scope.container,
  35358. observer = _scope.observer;
  35359. var _getScrollOptions = main_getScrollOptions(el, vm),
  35360. distance = _getScrollOptions.distance,
  35361. disabled = _getScrollOptions.disabled;
  35362. if (disabled) return;
  35363. var containerInfo = container.getBoundingClientRect();
  35364. if (!containerInfo.width && !containerInfo.height) return;
  35365. var shouldTrigger = false;
  35366. if (container === el) {
  35367. // be aware of difference between clientHeight & offsetHeight & window.getComputedStyle().height
  35368. var scrollBottom = container.scrollTop + getClientHeight(container);
  35369. shouldTrigger = container.scrollHeight - scrollBottom <= distance;
  35370. } else {
  35371. var heightBelowTop = getOffsetHeight(el) + getElementTop(el) - getElementTop(container);
  35372. var offsetHeight = getOffsetHeight(container);
  35373. var borderBottom = Number.parseFloat(getStyleComputedProperty(container, 'borderBottomWidth'));
  35374. shouldTrigger = heightBelowTop - offsetHeight + borderBottom <= distance;
  35375. }
  35376. if (shouldTrigger && Object(types_["isFunction"])(cb)) {
  35377. cb.call(vm);
  35378. } else if (observer) {
  35379. observer.disconnect();
  35380. this[scope].observer = null;
  35381. }
  35382. };
  35383. /* harmony default export */ var infinite_scroll_src_main = ({
  35384. name: 'InfiniteScroll',
  35385. inserted: function inserted(el, binding, vnode) {
  35386. var cb = binding.value;
  35387. var vm = vnode.context;
  35388. // only include vertical scroll
  35389. var container = Object(dom_["getScrollContainer"])(el, true);
  35390. var _getScrollOptions2 = main_getScrollOptions(el, vm),
  35391. delay = _getScrollOptions2.delay,
  35392. immediate = _getScrollOptions2.immediate;
  35393. var onScroll = debounce_default()(delay, main_handleScroll.bind(el, cb));
  35394. el[scope] = { el: el, vm: vm, container: container, onScroll: onScroll };
  35395. if (container) {
  35396. container.addEventListener('scroll', onScroll);
  35397. if (immediate) {
  35398. var observer = el[scope].observer = new MutationObserver(onScroll);
  35399. observer.observe(container, { childList: true, subtree: true });
  35400. onScroll();
  35401. }
  35402. }
  35403. },
  35404. unbind: function unbind(el) {
  35405. var _el$scope = el[scope],
  35406. container = _el$scope.container,
  35407. onScroll = _el$scope.onScroll;
  35408. if (container) {
  35409. container.removeEventListener('scroll', onScroll);
  35410. }
  35411. }
  35412. });
  35413. // CONCATENATED MODULE: ./packages/infinite-scroll/index.js
  35414. /* istanbul ignore next */
  35415. infinite_scroll_src_main.install = function (Vue) {
  35416. Vue.directive(infinite_scroll_src_main.name, infinite_scroll_src_main);
  35417. };
  35418. /* harmony default export */ var infinite_scroll = (infinite_scroll_src_main);
  35419. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/page-header/src/main.vue?vue&type=template&id=5070954c&
  35420. var mainvue_type_template_id_5070954c_render = function() {
  35421. var _vm = this
  35422. var _h = _vm.$createElement
  35423. var _c = _vm._self._c || _h
  35424. return _c("div", { staticClass: "el-page-header" }, [
  35425. _c(
  35426. "div",
  35427. {
  35428. staticClass: "el-page-header__left",
  35429. on: {
  35430. click: function($event) {
  35431. _vm.$emit("back")
  35432. }
  35433. }
  35434. },
  35435. [
  35436. _c("i", { staticClass: "el-icon-back" }),
  35437. _c(
  35438. "div",
  35439. { staticClass: "el-page-header__title" },
  35440. [_vm._t("title", [_vm._v(_vm._s(_vm.title))])],
  35441. 2
  35442. )
  35443. ]
  35444. ),
  35445. _c(
  35446. "div",
  35447. { staticClass: "el-page-header__content" },
  35448. [_vm._t("content", [_vm._v(_vm._s(_vm.content))])],
  35449. 2
  35450. )
  35451. ])
  35452. }
  35453. var mainvue_type_template_id_5070954c_staticRenderFns = []
  35454. mainvue_type_template_id_5070954c_render._withStripped = true
  35455. // CONCATENATED MODULE: ./packages/page-header/src/main.vue?vue&type=template&id=5070954c&
  35456. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/page-header/src/main.vue?vue&type=script&lang=js&
  35457. //
  35458. //
  35459. //
  35460. //
  35461. //
  35462. //
  35463. //
  35464. //
  35465. //
  35466. //
  35467. //
  35468. //
  35469. //
  35470. //
  35471. /* harmony default export */ var page_header_src_mainvue_type_script_lang_js_ = ({
  35472. name: 'ElPageHeader',
  35473. props: {
  35474. title: {
  35475. type: String,
  35476. default: function _default() {
  35477. return Object(lib_locale_["t"])('el.pageHeader.title');
  35478. }
  35479. },
  35480. content: String
  35481. }
  35482. });
  35483. // CONCATENATED MODULE: ./packages/page-header/src/main.vue?vue&type=script&lang=js&
  35484. /* harmony default export */ var packages_page_header_src_mainvue_type_script_lang_js_ = (page_header_src_mainvue_type_script_lang_js_);
  35485. // CONCATENATED MODULE: ./packages/page-header/src/main.vue
  35486. /* normalize component */
  35487. var page_header_src_main_component = normalizeComponent(
  35488. packages_page_header_src_mainvue_type_script_lang_js_,
  35489. mainvue_type_template_id_5070954c_render,
  35490. mainvue_type_template_id_5070954c_staticRenderFns,
  35491. false,
  35492. null,
  35493. null,
  35494. null
  35495. )
  35496. /* hot reload */
  35497. if (false) { var page_header_src_main_api; }
  35498. page_header_src_main_component.options.__file = "packages/page-header/src/main.vue"
  35499. /* harmony default export */ var page_header_src_main = (page_header_src_main_component.exports);
  35500. // CONCATENATED MODULE: ./packages/page-header/index.js
  35501. /* istanbul ignore next */
  35502. page_header_src_main.install = function (Vue) {
  35503. Vue.component(page_header_src_main.name, page_header_src_main);
  35504. };
  35505. /* harmony default export */ var page_header = (page_header_src_main);
  35506. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/cascader-panel/src/cascader-panel.vue?vue&type=template&id=34932346&
  35507. var cascader_panelvue_type_template_id_34932346_render = function() {
  35508. var _vm = this
  35509. var _h = _vm.$createElement
  35510. var _c = _vm._self._c || _h
  35511. return _c(
  35512. "div",
  35513. {
  35514. class: ["el-cascader-panel", _vm.border && "is-bordered"],
  35515. on: { keydown: _vm.handleKeyDown }
  35516. },
  35517. _vm._l(_vm.menus, function(menu, index) {
  35518. return _c("cascader-menu", {
  35519. key: index,
  35520. ref: "menu",
  35521. refInFor: true,
  35522. attrs: { index: index, nodes: menu }
  35523. })
  35524. }),
  35525. 1
  35526. )
  35527. }
  35528. var cascader_panelvue_type_template_id_34932346_staticRenderFns = []
  35529. cascader_panelvue_type_template_id_34932346_render._withStripped = true
  35530. // CONCATENATED MODULE: ./packages/cascader-panel/src/cascader-panel.vue?vue&type=template&id=34932346&
  35531. // EXTERNAL MODULE: external "element-ui/lib/radio"
  35532. var radio_ = __webpack_require__(44);
  35533. var radio_default = /*#__PURE__*/__webpack_require__.n(radio_);
  35534. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/cascader-panel/src/cascader-node.vue?vue&type=script&lang=js&
  35535. var stopPropagation = function stopPropagation(e) {
  35536. return e.stopPropagation();
  35537. };
  35538. /* harmony default export */ var cascader_nodevue_type_script_lang_js_ = ({
  35539. inject: ['panel'],
  35540. components: {
  35541. ElCheckbox: checkbox_default.a,
  35542. ElRadio: radio_default.a
  35543. },
  35544. props: {
  35545. node: {
  35546. required: true
  35547. },
  35548. nodeId: String
  35549. },
  35550. computed: {
  35551. config: function config() {
  35552. return this.panel.config;
  35553. },
  35554. isLeaf: function isLeaf() {
  35555. return this.node.isLeaf;
  35556. },
  35557. isDisabled: function isDisabled() {
  35558. return this.node.isDisabled;
  35559. },
  35560. checkedValue: function checkedValue() {
  35561. return this.panel.checkedValue;
  35562. },
  35563. isChecked: function isChecked() {
  35564. return this.node.isSameNode(this.checkedValue);
  35565. },
  35566. inActivePath: function inActivePath() {
  35567. return this.isInPath(this.panel.activePath);
  35568. },
  35569. inCheckedPath: function inCheckedPath() {
  35570. var _this = this;
  35571. if (!this.config.checkStrictly) return false;
  35572. return this.panel.checkedNodePaths.some(function (checkedPath) {
  35573. return _this.isInPath(checkedPath);
  35574. });
  35575. },
  35576. value: function value() {
  35577. return this.node.getValueByOption();
  35578. }
  35579. },
  35580. methods: {
  35581. handleExpand: function handleExpand() {
  35582. var _this2 = this;
  35583. var panel = this.panel,
  35584. node = this.node,
  35585. isDisabled = this.isDisabled,
  35586. config = this.config;
  35587. var multiple = config.multiple,
  35588. checkStrictly = config.checkStrictly;
  35589. if (!checkStrictly && isDisabled || node.loading) return;
  35590. if (config.lazy && !node.loaded) {
  35591. panel.lazyLoad(node, function () {
  35592. // do not use cached leaf value here, invoke this.isLeaf to get new value.
  35593. var isLeaf = _this2.isLeaf;
  35594. if (!isLeaf) _this2.handleExpand();
  35595. if (multiple) {
  35596. // if leaf sync checked state, else clear checked state
  35597. var checked = isLeaf ? node.checked : false;
  35598. _this2.handleMultiCheckChange(checked);
  35599. }
  35600. });
  35601. } else {
  35602. panel.handleExpand(node);
  35603. }
  35604. },
  35605. handleCheckChange: function handleCheckChange() {
  35606. var panel = this.panel,
  35607. value = this.value,
  35608. node = this.node;
  35609. panel.handleCheckChange(value);
  35610. panel.handleExpand(node);
  35611. },
  35612. handleMultiCheckChange: function handleMultiCheckChange(checked) {
  35613. this.node.doCheck(checked);
  35614. this.panel.calculateMultiCheckedValue();
  35615. },
  35616. isInPath: function isInPath(pathNodes) {
  35617. var node = this.node;
  35618. var selectedPathNode = pathNodes[node.level - 1] || {};
  35619. return selectedPathNode.uid === node.uid;
  35620. },
  35621. renderPrefix: function renderPrefix(h) {
  35622. var isLeaf = this.isLeaf,
  35623. isChecked = this.isChecked,
  35624. config = this.config;
  35625. var checkStrictly = config.checkStrictly,
  35626. multiple = config.multiple;
  35627. if (multiple) {
  35628. return this.renderCheckbox(h);
  35629. } else if (checkStrictly) {
  35630. return this.renderRadio(h);
  35631. } else if (isLeaf && isChecked) {
  35632. return this.renderCheckIcon(h);
  35633. }
  35634. return null;
  35635. },
  35636. renderPostfix: function renderPostfix(h) {
  35637. var node = this.node,
  35638. isLeaf = this.isLeaf;
  35639. if (node.loading) {
  35640. return this.renderLoadingIcon(h);
  35641. } else if (!isLeaf) {
  35642. return this.renderExpandIcon(h);
  35643. }
  35644. return null;
  35645. },
  35646. renderCheckbox: function renderCheckbox(h) {
  35647. var node = this.node,
  35648. config = this.config,
  35649. isDisabled = this.isDisabled;
  35650. var events = {
  35651. on: { change: this.handleMultiCheckChange },
  35652. nativeOn: {}
  35653. };
  35654. if (config.checkStrictly) {
  35655. // when every node is selectable, click event should not trigger expand event.
  35656. events.nativeOn.click = stopPropagation;
  35657. }
  35658. return h('el-checkbox', external_babel_helper_vue_jsx_merge_props_default()([{
  35659. attrs: {
  35660. value: node.checked,
  35661. indeterminate: node.indeterminate,
  35662. disabled: isDisabled
  35663. }
  35664. }, events]));
  35665. },
  35666. renderRadio: function renderRadio(h) {
  35667. var checkedValue = this.checkedValue,
  35668. value = this.value,
  35669. isDisabled = this.isDisabled;
  35670. // to keep same reference if value cause radio's checked state is calculated by reference comparision;
  35671. if (Object(util_["isEqual"])(value, checkedValue)) {
  35672. value = checkedValue;
  35673. }
  35674. return h(
  35675. 'el-radio',
  35676. {
  35677. attrs: {
  35678. value: checkedValue,
  35679. label: value,
  35680. disabled: isDisabled
  35681. },
  35682. on: {
  35683. 'change': this.handleCheckChange
  35684. },
  35685. nativeOn: {
  35686. 'click': stopPropagation
  35687. }
  35688. },
  35689. [h('span')]
  35690. );
  35691. },
  35692. renderCheckIcon: function renderCheckIcon(h) {
  35693. return h('i', { 'class': 'el-icon-check el-cascader-node__prefix' });
  35694. },
  35695. renderLoadingIcon: function renderLoadingIcon(h) {
  35696. return h('i', { 'class': 'el-icon-loading el-cascader-node__postfix' });
  35697. },
  35698. renderExpandIcon: function renderExpandIcon(h) {
  35699. return h('i', { 'class': 'el-icon-arrow-right el-cascader-node__postfix' });
  35700. },
  35701. renderContent: function renderContent(h) {
  35702. var panel = this.panel,
  35703. node = this.node;
  35704. var render = panel.renderLabelFn;
  35705. var vnode = render ? render({ node: node, data: node.data }) : null;
  35706. return h(
  35707. 'span',
  35708. { 'class': 'el-cascader-node__label' },
  35709. [vnode || node.label]
  35710. );
  35711. }
  35712. },
  35713. render: function render(h) {
  35714. var _this3 = this;
  35715. var inActivePath = this.inActivePath,
  35716. inCheckedPath = this.inCheckedPath,
  35717. isChecked = this.isChecked,
  35718. isLeaf = this.isLeaf,
  35719. isDisabled = this.isDisabled,
  35720. config = this.config,
  35721. nodeId = this.nodeId;
  35722. var expandTrigger = config.expandTrigger,
  35723. checkStrictly = config.checkStrictly,
  35724. multiple = config.multiple;
  35725. var disabled = !checkStrictly && isDisabled;
  35726. var events = { on: {} };
  35727. if (expandTrigger === 'click') {
  35728. events.on.click = this.handleExpand;
  35729. } else {
  35730. events.on.mouseenter = function (e) {
  35731. _this3.handleExpand();
  35732. _this3.$emit('expand', e);
  35733. };
  35734. events.on.focus = function (e) {
  35735. _this3.handleExpand();
  35736. _this3.$emit('expand', e);
  35737. };
  35738. }
  35739. if (isLeaf && !isDisabled && !checkStrictly && !multiple) {
  35740. events.on.click = this.handleCheckChange;
  35741. }
  35742. return h(
  35743. 'li',
  35744. external_babel_helper_vue_jsx_merge_props_default()([{
  35745. attrs: {
  35746. role: 'menuitem',
  35747. id: nodeId,
  35748. 'aria-expanded': inActivePath,
  35749. tabindex: disabled ? null : -1
  35750. },
  35751. 'class': {
  35752. 'el-cascader-node': true,
  35753. 'is-selectable': checkStrictly,
  35754. 'in-active-path': inActivePath,
  35755. 'in-checked-path': inCheckedPath,
  35756. 'is-active': isChecked,
  35757. 'is-disabled': disabled
  35758. }
  35759. }, events]),
  35760. [this.renderPrefix(h), this.renderContent(h), this.renderPostfix(h)]
  35761. );
  35762. }
  35763. });
  35764. // CONCATENATED MODULE: ./packages/cascader-panel/src/cascader-node.vue?vue&type=script&lang=js&
  35765. /* harmony default export */ var src_cascader_nodevue_type_script_lang_js_ = (cascader_nodevue_type_script_lang_js_);
  35766. // CONCATENATED MODULE: ./packages/cascader-panel/src/cascader-node.vue
  35767. var cascader_node_render, cascader_node_staticRenderFns
  35768. /* normalize component */
  35769. var cascader_node_component = normalizeComponent(
  35770. src_cascader_nodevue_type_script_lang_js_,
  35771. cascader_node_render,
  35772. cascader_node_staticRenderFns,
  35773. false,
  35774. null,
  35775. null,
  35776. null
  35777. )
  35778. /* hot reload */
  35779. if (false) { var cascader_node_api; }
  35780. cascader_node_component.options.__file = "packages/cascader-panel/src/cascader-node.vue"
  35781. /* harmony default export */ var cascader_node = (cascader_node_component.exports);
  35782. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/cascader-panel/src/cascader-menu.vue?vue&type=script&lang=js&
  35783. /* harmony default export */ var cascader_menuvue_type_script_lang_js_ = ({
  35784. name: 'ElCascaderMenu',
  35785. mixins: [locale_default.a],
  35786. inject: ['panel'],
  35787. components: {
  35788. ElScrollbar: scrollbar_default.a,
  35789. CascaderNode: cascader_node
  35790. },
  35791. props: {
  35792. nodes: {
  35793. type: Array,
  35794. required: true
  35795. },
  35796. index: Number
  35797. },
  35798. data: function data() {
  35799. return {
  35800. activeNode: null,
  35801. hoverTimer: null,
  35802. id: Object(util_["generateId"])()
  35803. };
  35804. },
  35805. computed: {
  35806. isEmpty: function isEmpty() {
  35807. return !this.nodes.length;
  35808. },
  35809. menuId: function menuId() {
  35810. return 'cascader-menu-' + this.id + '-' + this.index;
  35811. }
  35812. },
  35813. methods: {
  35814. handleExpand: function handleExpand(e) {
  35815. this.activeNode = e.target;
  35816. },
  35817. handleMouseMove: function handleMouseMove(e) {
  35818. var activeNode = this.activeNode,
  35819. hoverTimer = this.hoverTimer;
  35820. var hoverZone = this.$refs.hoverZone;
  35821. if (!activeNode || !hoverZone) return;
  35822. if (activeNode.contains(e.target)) {
  35823. clearTimeout(hoverTimer);
  35824. var _$el$getBoundingClien = this.$el.getBoundingClientRect(),
  35825. left = _$el$getBoundingClien.left;
  35826. var startX = e.clientX - left;
  35827. var _$el = this.$el,
  35828. offsetWidth = _$el.offsetWidth,
  35829. offsetHeight = _$el.offsetHeight;
  35830. var top = activeNode.offsetTop;
  35831. var bottom = top + activeNode.offsetHeight;
  35832. hoverZone.innerHTML = '\n <path style="pointer-events: auto;" fill="transparent" d="M' + startX + ' ' + top + ' L' + offsetWidth + ' 0 V' + top + ' Z" />\n <path style="pointer-events: auto;" fill="transparent" d="M' + startX + ' ' + bottom + ' L' + offsetWidth + ' ' + offsetHeight + ' V' + bottom + ' Z" />\n ';
  35833. } else if (!hoverTimer) {
  35834. this.hoverTimer = setTimeout(this.clearHoverZone, this.panel.config.hoverThreshold);
  35835. }
  35836. },
  35837. clearHoverZone: function clearHoverZone() {
  35838. var hoverZone = this.$refs.hoverZone;
  35839. if (!hoverZone) return;
  35840. hoverZone.innerHTML = '';
  35841. },
  35842. renderEmptyText: function renderEmptyText(h) {
  35843. return h(
  35844. 'div',
  35845. { 'class': 'el-cascader-menu__empty-text' },
  35846. [this.t('el.cascader.noData')]
  35847. );
  35848. },
  35849. renderNodeList: function renderNodeList(h) {
  35850. var menuId = this.menuId;
  35851. var isHoverMenu = this.panel.isHoverMenu;
  35852. var events = { on: {} };
  35853. if (isHoverMenu) {
  35854. events.on.expand = this.handleExpand;
  35855. }
  35856. var nodes = this.nodes.map(function (node, index) {
  35857. var hasChildren = node.hasChildren;
  35858. return h('cascader-node', external_babel_helper_vue_jsx_merge_props_default()([{
  35859. key: node.uid,
  35860. attrs: { node: node,
  35861. 'node-id': menuId + '-' + index,
  35862. 'aria-haspopup': hasChildren,
  35863. 'aria-owns': hasChildren ? menuId : null
  35864. }
  35865. }, events]));
  35866. });
  35867. return [].concat(nodes, [isHoverMenu ? h('svg', { ref: 'hoverZone', 'class': 'el-cascader-menu__hover-zone' }) : null]);
  35868. }
  35869. },
  35870. render: function render(h) {
  35871. var isEmpty = this.isEmpty,
  35872. menuId = this.menuId;
  35873. var events = { nativeOn: {} };
  35874. // optimize hover to expand experience (#8010)
  35875. if (this.panel.isHoverMenu) {
  35876. events.nativeOn.mousemove = this.handleMouseMove;
  35877. // events.nativeOn.mouseleave = this.clearHoverZone;
  35878. }
  35879. return h(
  35880. 'el-scrollbar',
  35881. external_babel_helper_vue_jsx_merge_props_default()([{
  35882. attrs: {
  35883. tag: 'ul',
  35884. role: 'menu',
  35885. id: menuId,
  35886. 'wrap-class': 'el-cascader-menu__wrap',
  35887. 'view-class': {
  35888. 'el-cascader-menu__list': true,
  35889. 'is-empty': isEmpty
  35890. }
  35891. },
  35892. 'class': 'el-cascader-menu' }, events]),
  35893. [isEmpty ? this.renderEmptyText(h) : this.renderNodeList(h)]
  35894. );
  35895. }
  35896. });
  35897. // CONCATENATED MODULE: ./packages/cascader-panel/src/cascader-menu.vue?vue&type=script&lang=js&
  35898. /* harmony default export */ var src_cascader_menuvue_type_script_lang_js_ = (cascader_menuvue_type_script_lang_js_);
  35899. // CONCATENATED MODULE: ./packages/cascader-panel/src/cascader-menu.vue
  35900. var cascader_menu_render, cascader_menu_staticRenderFns
  35901. /* normalize component */
  35902. var cascader_menu_component = normalizeComponent(
  35903. src_cascader_menuvue_type_script_lang_js_,
  35904. cascader_menu_render,
  35905. cascader_menu_staticRenderFns,
  35906. false,
  35907. null,
  35908. null,
  35909. null
  35910. )
  35911. /* hot reload */
  35912. if (false) { var cascader_menu_api; }
  35913. cascader_menu_component.options.__file = "packages/cascader-panel/src/cascader-menu.vue"
  35914. /* harmony default export */ var cascader_menu = (cascader_menu_component.exports);
  35915. // CONCATENATED MODULE: ./packages/cascader-panel/src/node.js
  35916. var node_createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  35917. function src_node_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35918. var uid = 0;
  35919. var src_node_Node = function () {
  35920. function Node(data, config, parentNode) {
  35921. src_node_classCallCheck(this, Node);
  35922. this.data = data;
  35923. this.config = config;
  35924. this.parent = parentNode || null;
  35925. this.level = !this.parent ? 1 : this.parent.level + 1;
  35926. this.uid = uid++;
  35927. this.initState();
  35928. this.initChildren();
  35929. }
  35930. Node.prototype.initState = function initState() {
  35931. var _config = this.config,
  35932. valueKey = _config.value,
  35933. labelKey = _config.label;
  35934. this.value = this.data[valueKey];
  35935. this.label = this.data[labelKey];
  35936. this.pathNodes = this.calculatePathNodes();
  35937. this.path = this.pathNodes.map(function (node) {
  35938. return node.value;
  35939. });
  35940. this.pathLabels = this.pathNodes.map(function (node) {
  35941. return node.label;
  35942. });
  35943. // lazy load
  35944. this.loading = false;
  35945. this.loaded = false;
  35946. };
  35947. Node.prototype.initChildren = function initChildren() {
  35948. var _this = this;
  35949. var config = this.config;
  35950. var childrenKey = config.children;
  35951. var childrenData = this.data[childrenKey];
  35952. this.hasChildren = Array.isArray(childrenData);
  35953. this.children = (childrenData || []).map(function (child) {
  35954. return new Node(child, config, _this);
  35955. });
  35956. };
  35957. Node.prototype.calculatePathNodes = function calculatePathNodes() {
  35958. var nodes = [this];
  35959. var parent = this.parent;
  35960. while (parent) {
  35961. nodes.unshift(parent);
  35962. parent = parent.parent;
  35963. }
  35964. return nodes;
  35965. };
  35966. Node.prototype.getPath = function getPath() {
  35967. return this.path;
  35968. };
  35969. Node.prototype.getValue = function getValue() {
  35970. return this.value;
  35971. };
  35972. Node.prototype.getValueByOption = function getValueByOption() {
  35973. return this.config.emitPath ? this.getPath() : this.getValue();
  35974. };
  35975. Node.prototype.getText = function getText(allLevels, separator) {
  35976. return allLevels ? this.pathLabels.join(separator) : this.label;
  35977. };
  35978. Node.prototype.isSameNode = function isSameNode(checkedValue) {
  35979. var value = this.getValueByOption();
  35980. return this.config.multiple && Array.isArray(checkedValue) ? checkedValue.some(function (val) {
  35981. return Object(util_["isEqual"])(val, value);
  35982. }) : Object(util_["isEqual"])(checkedValue, value);
  35983. };
  35984. Node.prototype.broadcast = function broadcast(event) {
  35985. for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  35986. args[_key - 1] = arguments[_key];
  35987. }
  35988. var handlerName = 'onParent' + Object(util_["capitalize"])(event);
  35989. this.children.forEach(function (child) {
  35990. if (child) {
  35991. // bottom up
  35992. child.broadcast.apply(child, [event].concat(args));
  35993. child[handlerName] && child[handlerName].apply(child, args);
  35994. }
  35995. });
  35996. };
  35997. Node.prototype.emit = function emit(event) {
  35998. var parent = this.parent;
  35999. var handlerName = 'onChild' + Object(util_["capitalize"])(event);
  36000. if (parent) {
  36001. for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  36002. args[_key2 - 1] = arguments[_key2];
  36003. }
  36004. parent[handlerName] && parent[handlerName].apply(parent, args);
  36005. parent.emit.apply(parent, [event].concat(args));
  36006. }
  36007. };
  36008. Node.prototype.onParentCheck = function onParentCheck(checked) {
  36009. if (!this.isDisabled) {
  36010. this.setCheckState(checked);
  36011. }
  36012. };
  36013. Node.prototype.onChildCheck = function onChildCheck() {
  36014. var children = this.children;
  36015. var validChildren = children.filter(function (child) {
  36016. return !child.isDisabled;
  36017. });
  36018. var checked = validChildren.length ? validChildren.every(function (child) {
  36019. return child.checked;
  36020. }) : false;
  36021. this.setCheckState(checked);
  36022. };
  36023. Node.prototype.setCheckState = function setCheckState(checked) {
  36024. var totalNum = this.children.length;
  36025. var checkedNum = this.children.reduce(function (c, p) {
  36026. var num = p.checked ? 1 : p.indeterminate ? 0.5 : 0;
  36027. return c + num;
  36028. }, 0);
  36029. this.checked = checked;
  36030. this.indeterminate = checkedNum !== totalNum && checkedNum > 0;
  36031. };
  36032. Node.prototype.syncCheckState = function syncCheckState(checkedValue) {
  36033. var value = this.getValueByOption();
  36034. var checked = this.isSameNode(checkedValue, value);
  36035. this.doCheck(checked);
  36036. };
  36037. Node.prototype.doCheck = function doCheck(checked) {
  36038. if (this.checked !== checked) {
  36039. if (this.config.checkStrictly) {
  36040. this.checked = checked;
  36041. } else {
  36042. // bottom up to unify the calculation of the indeterminate state
  36043. this.broadcast('check', checked);
  36044. this.setCheckState(checked);
  36045. this.emit('check');
  36046. }
  36047. }
  36048. };
  36049. node_createClass(Node, [{
  36050. key: 'isDisabled',
  36051. get: function get() {
  36052. var data = this.data,
  36053. parent = this.parent,
  36054. config = this.config;
  36055. var disabledKey = config.disabled;
  36056. var checkStrictly = config.checkStrictly;
  36057. return data[disabledKey] || !checkStrictly && parent && parent.isDisabled;
  36058. }
  36059. }, {
  36060. key: 'isLeaf',
  36061. get: function get() {
  36062. var data = this.data,
  36063. loaded = this.loaded,
  36064. hasChildren = this.hasChildren,
  36065. children = this.children;
  36066. var _config2 = this.config,
  36067. lazy = _config2.lazy,
  36068. leafKey = _config2.leaf;
  36069. if (lazy) {
  36070. var isLeaf = Object(shared_["isDef"])(data[leafKey]) ? data[leafKey] : loaded ? !children.length : false;
  36071. this.hasChildren = !isLeaf;
  36072. return isLeaf;
  36073. }
  36074. return !hasChildren;
  36075. }
  36076. }]);
  36077. return Node;
  36078. }();
  36079. /* harmony default export */ var src_node = (src_node_Node);
  36080. // CONCATENATED MODULE: ./packages/cascader-panel/src/store.js
  36081. function store_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36082. var flatNodes = function flatNodes(data, leafOnly) {
  36083. return data.reduce(function (res, node) {
  36084. if (node.isLeaf) {
  36085. res.push(node);
  36086. } else {
  36087. !leafOnly && res.push(node);
  36088. res = res.concat(flatNodes(node.children, leafOnly));
  36089. }
  36090. return res;
  36091. }, []);
  36092. };
  36093. var store_Store = function () {
  36094. function Store(data, config) {
  36095. store_classCallCheck(this, Store);
  36096. this.config = config;
  36097. this.initNodes(data);
  36098. }
  36099. Store.prototype.initNodes = function initNodes(data) {
  36100. var _this = this;
  36101. data = Object(util_["coerceTruthyValueToArray"])(data);
  36102. this.nodes = data.map(function (nodeData) {
  36103. return new src_node(nodeData, _this.config);
  36104. });
  36105. this.flattedNodes = this.getFlattedNodes(false, false);
  36106. this.leafNodes = this.getFlattedNodes(true, false);
  36107. };
  36108. Store.prototype.appendNode = function appendNode(nodeData, parentNode) {
  36109. var node = new src_node(nodeData, this.config, parentNode);
  36110. var children = parentNode ? parentNode.children : this.nodes;
  36111. children.push(node);
  36112. };
  36113. Store.prototype.appendNodes = function appendNodes(nodeDataList, parentNode) {
  36114. var _this2 = this;
  36115. nodeDataList = Object(util_["coerceTruthyValueToArray"])(nodeDataList);
  36116. nodeDataList.forEach(function (nodeData) {
  36117. return _this2.appendNode(nodeData, parentNode);
  36118. });
  36119. };
  36120. Store.prototype.getNodes = function getNodes() {
  36121. return this.nodes;
  36122. };
  36123. Store.prototype.getFlattedNodes = function getFlattedNodes(leafOnly) {
  36124. var cached = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  36125. var cachedNodes = leafOnly ? this.leafNodes : this.flattedNodes;
  36126. return cached ? cachedNodes : flatNodes(this.nodes, leafOnly);
  36127. };
  36128. Store.prototype.getNodeByValue = function getNodeByValue(value) {
  36129. var nodes = this.getFlattedNodes(false, !this.config.lazy).filter(function (node) {
  36130. return Object(util_["valueEquals"])(node.path, value) || node.value === value;
  36131. });
  36132. return nodes && nodes.length ? nodes[0] : null;
  36133. };
  36134. return Store;
  36135. }();
  36136. /* harmony default export */ var cascader_panel_src_store = (store_Store);
  36137. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/cascader-panel/src/cascader-panel.vue?vue&type=script&lang=js&
  36138. var cascader_panelvue_type_script_lang_js_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; };
  36139. //
  36140. //
  36141. //
  36142. //
  36143. //
  36144. //
  36145. //
  36146. //
  36147. //
  36148. //
  36149. //
  36150. //
  36151. //
  36152. //
  36153. //
  36154. //
  36155. var cascader_panelvue_type_script_lang_js_KeyCode = aria_utils_default.a.keys;
  36156. var DefaultProps = {
  36157. expandTrigger: 'click', // or hover
  36158. multiple: false,
  36159. checkStrictly: false, // whether all nodes can be selected
  36160. emitPath: true, // wether to emit an array of all levels value in which node is located
  36161. lazy: false,
  36162. lazyLoad: util_["noop"],
  36163. value: 'value',
  36164. label: 'label',
  36165. children: 'children',
  36166. leaf: 'leaf',
  36167. disabled: 'disabled',
  36168. hoverThreshold: 500
  36169. };
  36170. var cascader_panelvue_type_script_lang_js_isLeaf = function isLeaf(el) {
  36171. return !el.getAttribute('aria-owns');
  36172. };
  36173. var getSibling = function getSibling(el, distance) {
  36174. var parentNode = el.parentNode;
  36175. if (parentNode) {
  36176. var siblings = parentNode.querySelectorAll('.el-cascader-node[tabindex="-1"]');
  36177. var index = Array.prototype.indexOf.call(siblings, el);
  36178. return siblings[index + distance] || null;
  36179. }
  36180. return null;
  36181. };
  36182. var getMenuIndex = function getMenuIndex(el, distance) {
  36183. if (!el) return;
  36184. var pieces = el.id.split('-');
  36185. return Number(pieces[pieces.length - 2]);
  36186. };
  36187. var focusNode = function focusNode(el) {
  36188. if (!el) return;
  36189. el.focus();
  36190. !cascader_panelvue_type_script_lang_js_isLeaf(el) && el.click();
  36191. };
  36192. var checkNode = function checkNode(el) {
  36193. if (!el) return;
  36194. var input = el.querySelector('input');
  36195. if (input) {
  36196. input.click();
  36197. } else if (cascader_panelvue_type_script_lang_js_isLeaf(el)) {
  36198. el.click();
  36199. }
  36200. };
  36201. /* harmony default export */ var cascader_panelvue_type_script_lang_js_ = ({
  36202. name: 'ElCascaderPanel',
  36203. components: {
  36204. CascaderMenu: cascader_menu
  36205. },
  36206. props: {
  36207. value: {},
  36208. options: Array,
  36209. props: Object,
  36210. border: {
  36211. type: Boolean,
  36212. default: true
  36213. },
  36214. renderLabel: Function
  36215. },
  36216. provide: function provide() {
  36217. return {
  36218. panel: this
  36219. };
  36220. },
  36221. data: function data() {
  36222. return {
  36223. checkedValue: null,
  36224. checkedNodePaths: [],
  36225. store: [],
  36226. menus: [],
  36227. activePath: [],
  36228. loadCount: 0
  36229. };
  36230. },
  36231. computed: {
  36232. config: function config() {
  36233. return merge_default()(cascader_panelvue_type_script_lang_js_extends({}, DefaultProps), this.props || {});
  36234. },
  36235. multiple: function multiple() {
  36236. return this.config.multiple;
  36237. },
  36238. checkStrictly: function checkStrictly() {
  36239. return this.config.checkStrictly;
  36240. },
  36241. leafOnly: function leafOnly() {
  36242. return !this.checkStrictly;
  36243. },
  36244. isHoverMenu: function isHoverMenu() {
  36245. return this.config.expandTrigger === 'hover';
  36246. },
  36247. renderLabelFn: function renderLabelFn() {
  36248. return this.renderLabel || this.$scopedSlots.default;
  36249. }
  36250. },
  36251. watch: {
  36252. value: function value() {
  36253. this.syncCheckedValue();
  36254. this.checkStrictly && this.calculateCheckedNodePaths();
  36255. },
  36256. options: {
  36257. handler: function handler() {
  36258. this.initStore();
  36259. },
  36260. immediate: true,
  36261. deep: true
  36262. },
  36263. checkedValue: function checkedValue(val) {
  36264. if (!Object(util_["isEqual"])(val, this.value)) {
  36265. this.checkStrictly && this.calculateCheckedNodePaths();
  36266. this.$emit('input', val);
  36267. this.$emit('change', val);
  36268. }
  36269. }
  36270. },
  36271. mounted: function mounted() {
  36272. if (!this.isEmptyValue(this.value)) {
  36273. this.syncCheckedValue();
  36274. }
  36275. },
  36276. methods: {
  36277. initStore: function initStore() {
  36278. var config = this.config,
  36279. options = this.options;
  36280. if (config.lazy && Object(util_["isEmpty"])(options)) {
  36281. this.lazyLoad();
  36282. } else {
  36283. this.store = new cascader_panel_src_store(options, config);
  36284. this.menus = [this.store.getNodes()];
  36285. this.syncMenuState();
  36286. }
  36287. },
  36288. syncCheckedValue: function syncCheckedValue() {
  36289. var value = this.value,
  36290. checkedValue = this.checkedValue;
  36291. if (!Object(util_["isEqual"])(value, checkedValue)) {
  36292. this.activePath = [];
  36293. this.checkedValue = value;
  36294. this.syncMenuState();
  36295. }
  36296. },
  36297. syncMenuState: function syncMenuState() {
  36298. var multiple = this.multiple,
  36299. checkStrictly = this.checkStrictly;
  36300. this.syncActivePath();
  36301. multiple && this.syncMultiCheckState();
  36302. checkStrictly && this.calculateCheckedNodePaths();
  36303. this.$nextTick(this.scrollIntoView);
  36304. },
  36305. syncMultiCheckState: function syncMultiCheckState() {
  36306. var _this = this;
  36307. var nodes = this.getFlattedNodes(this.leafOnly);
  36308. nodes.forEach(function (node) {
  36309. node.syncCheckState(_this.checkedValue);
  36310. });
  36311. },
  36312. isEmptyValue: function isEmptyValue(val) {
  36313. var multiple = this.multiple,
  36314. config = this.config;
  36315. var emitPath = config.emitPath;
  36316. if (multiple || emitPath) {
  36317. return Object(util_["isEmpty"])(val);
  36318. }
  36319. return false;
  36320. },
  36321. syncActivePath: function syncActivePath() {
  36322. var _this2 = this;
  36323. var store = this.store,
  36324. multiple = this.multiple,
  36325. activePath = this.activePath,
  36326. checkedValue = this.checkedValue;
  36327. if (!Object(util_["isEmpty"])(activePath)) {
  36328. var nodes = activePath.map(function (node) {
  36329. return _this2.getNodeByValue(node.getValue());
  36330. });
  36331. this.expandNodes(nodes);
  36332. } else if (!this.isEmptyValue(checkedValue)) {
  36333. var value = multiple ? checkedValue[0] : checkedValue;
  36334. var checkedNode = this.getNodeByValue(value) || {};
  36335. var _nodes = (checkedNode.pathNodes || []).slice(0, -1);
  36336. this.expandNodes(_nodes);
  36337. } else {
  36338. this.activePath = [];
  36339. this.menus = [store.getNodes()];
  36340. }
  36341. },
  36342. expandNodes: function expandNodes(nodes) {
  36343. var _this3 = this;
  36344. nodes.forEach(function (node) {
  36345. return _this3.handleExpand(node, true /* silent */);
  36346. });
  36347. },
  36348. calculateCheckedNodePaths: function calculateCheckedNodePaths() {
  36349. var _this4 = this;
  36350. var checkedValue = this.checkedValue,
  36351. multiple = this.multiple;
  36352. var checkedValues = multiple ? Object(util_["coerceTruthyValueToArray"])(checkedValue) : [checkedValue];
  36353. this.checkedNodePaths = checkedValues.map(function (v) {
  36354. var checkedNode = _this4.getNodeByValue(v);
  36355. return checkedNode ? checkedNode.pathNodes : [];
  36356. });
  36357. },
  36358. handleKeyDown: function handleKeyDown(e) {
  36359. var target = e.target,
  36360. keyCode = e.keyCode;
  36361. switch (keyCode) {
  36362. case cascader_panelvue_type_script_lang_js_KeyCode.up:
  36363. var prev = getSibling(target, -1);
  36364. focusNode(prev);
  36365. break;
  36366. case cascader_panelvue_type_script_lang_js_KeyCode.down:
  36367. var next = getSibling(target, 1);
  36368. focusNode(next);
  36369. break;
  36370. case cascader_panelvue_type_script_lang_js_KeyCode.left:
  36371. var preMenu = this.$refs.menu[getMenuIndex(target) - 1];
  36372. if (preMenu) {
  36373. var expandedNode = preMenu.$el.querySelector('.el-cascader-node[aria-expanded="true"]');
  36374. focusNode(expandedNode);
  36375. }
  36376. break;
  36377. case cascader_panelvue_type_script_lang_js_KeyCode.right:
  36378. var nextMenu = this.$refs.menu[getMenuIndex(target) + 1];
  36379. if (nextMenu) {
  36380. var firstNode = nextMenu.$el.querySelector('.el-cascader-node[tabindex="-1"]');
  36381. focusNode(firstNode);
  36382. }
  36383. break;
  36384. case cascader_panelvue_type_script_lang_js_KeyCode.enter:
  36385. checkNode(target);
  36386. break;
  36387. case cascader_panelvue_type_script_lang_js_KeyCode.esc:
  36388. case cascader_panelvue_type_script_lang_js_KeyCode.tab:
  36389. this.$emit('close');
  36390. break;
  36391. default:
  36392. return;
  36393. }
  36394. },
  36395. handleExpand: function handleExpand(node, silent) {
  36396. var activePath = this.activePath;
  36397. var level = node.level;
  36398. var path = activePath.slice(0, level - 1);
  36399. var menus = this.menus.slice(0, level);
  36400. if (!node.isLeaf) {
  36401. path.push(node);
  36402. menus.push(node.children);
  36403. }
  36404. this.activePath = path;
  36405. this.menus = menus;
  36406. if (!silent) {
  36407. var pathValues = path.map(function (node) {
  36408. return node.getValue();
  36409. });
  36410. var activePathValues = activePath.map(function (node) {
  36411. return node.getValue();
  36412. });
  36413. if (!Object(util_["valueEquals"])(pathValues, activePathValues)) {
  36414. this.$emit('active-item-change', pathValues); // Deprecated
  36415. this.$emit('expand-change', pathValues);
  36416. }
  36417. }
  36418. },
  36419. handleCheckChange: function handleCheckChange(value) {
  36420. this.checkedValue = value;
  36421. },
  36422. lazyLoad: function lazyLoad(node, onFullfiled) {
  36423. var _this5 = this;
  36424. var config = this.config;
  36425. if (!node) {
  36426. node = node || { root: true, level: 0 };
  36427. this.store = new cascader_panel_src_store([], config);
  36428. this.menus = [this.store.getNodes()];
  36429. }
  36430. node.loading = true;
  36431. var resolve = function resolve(dataList) {
  36432. var parent = node.root ? null : node;
  36433. dataList && dataList.length && _this5.store.appendNodes(dataList, parent);
  36434. node.loading = false;
  36435. node.loaded = true;
  36436. // dispose default value on lazy load mode
  36437. if (Array.isArray(_this5.checkedValue)) {
  36438. var nodeValue = _this5.checkedValue[_this5.loadCount++];
  36439. var valueKey = _this5.config.value;
  36440. var leafKey = _this5.config.leaf;
  36441. if (Array.isArray(dataList) && dataList.filter(function (item) {
  36442. return item[valueKey] === nodeValue;
  36443. }).length > 0) {
  36444. var checkedNode = _this5.store.getNodeByValue(nodeValue);
  36445. if (!checkedNode.data[leafKey]) {
  36446. _this5.lazyLoad(checkedNode, function () {
  36447. _this5.handleExpand(checkedNode);
  36448. });
  36449. }
  36450. if (_this5.loadCount === _this5.checkedValue.length) {
  36451. _this5.$parent.computePresentText();
  36452. }
  36453. }
  36454. }
  36455. onFullfiled && onFullfiled(dataList);
  36456. };
  36457. config.lazyLoad(node, resolve);
  36458. },
  36459. /**
  36460. * public methods
  36461. */
  36462. calculateMultiCheckedValue: function calculateMultiCheckedValue() {
  36463. this.checkedValue = this.getCheckedNodes(this.leafOnly).map(function (node) {
  36464. return node.getValueByOption();
  36465. });
  36466. },
  36467. scrollIntoView: function scrollIntoView() {
  36468. if (this.$isServer) return;
  36469. var menus = this.$refs.menu || [];
  36470. menus.forEach(function (menu) {
  36471. var menuElement = menu.$el;
  36472. if (menuElement) {
  36473. var container = menuElement.querySelector('.el-scrollbar__wrap');
  36474. var activeNode = menuElement.querySelector('.el-cascader-node.is-active') || menuElement.querySelector('.el-cascader-node.in-active-path');
  36475. scroll_into_view_default()(container, activeNode);
  36476. }
  36477. });
  36478. },
  36479. getNodeByValue: function getNodeByValue(val) {
  36480. return this.store.getNodeByValue(val);
  36481. },
  36482. getFlattedNodes: function getFlattedNodes(leafOnly) {
  36483. var cached = !this.config.lazy;
  36484. return this.store.getFlattedNodes(leafOnly, cached);
  36485. },
  36486. getCheckedNodes: function getCheckedNodes(leafOnly) {
  36487. var checkedValue = this.checkedValue,
  36488. multiple = this.multiple;
  36489. if (multiple) {
  36490. var nodes = this.getFlattedNodes(leafOnly);
  36491. return nodes.filter(function (node) {
  36492. return node.checked;
  36493. });
  36494. } else {
  36495. return this.isEmptyValue(checkedValue) ? [] : [this.getNodeByValue(checkedValue)];
  36496. }
  36497. },
  36498. clearCheckedNodes: function clearCheckedNodes() {
  36499. var config = this.config,
  36500. leafOnly = this.leafOnly;
  36501. var multiple = config.multiple,
  36502. emitPath = config.emitPath;
  36503. if (multiple) {
  36504. this.getCheckedNodes(leafOnly).filter(function (node) {
  36505. return !node.isDisabled;
  36506. }).forEach(function (node) {
  36507. return node.doCheck(false);
  36508. });
  36509. this.calculateMultiCheckedValue();
  36510. } else {
  36511. this.checkedValue = emitPath ? [] : null;
  36512. }
  36513. }
  36514. }
  36515. });
  36516. // CONCATENATED MODULE: ./packages/cascader-panel/src/cascader-panel.vue?vue&type=script&lang=js&
  36517. /* harmony default export */ var src_cascader_panelvue_type_script_lang_js_ = (cascader_panelvue_type_script_lang_js_);
  36518. // CONCATENATED MODULE: ./packages/cascader-panel/src/cascader-panel.vue
  36519. /* normalize component */
  36520. var cascader_panel_component = normalizeComponent(
  36521. src_cascader_panelvue_type_script_lang_js_,
  36522. cascader_panelvue_type_template_id_34932346_render,
  36523. cascader_panelvue_type_template_id_34932346_staticRenderFns,
  36524. false,
  36525. null,
  36526. null,
  36527. null
  36528. )
  36529. /* hot reload */
  36530. if (false) { var cascader_panel_api; }
  36531. cascader_panel_component.options.__file = "packages/cascader-panel/src/cascader-panel.vue"
  36532. /* harmony default export */ var cascader_panel = (cascader_panel_component.exports);
  36533. // CONCATENATED MODULE: ./packages/cascader-panel/index.js
  36534. /* istanbul ignore next */
  36535. cascader_panel.install = function (Vue) {
  36536. Vue.component(cascader_panel.name, cascader_panel);
  36537. };
  36538. /* harmony default export */ var packages_cascader_panel = (cascader_panel);
  36539. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/avatar/src/main.vue?vue&type=script&lang=js&
  36540. /* harmony default export */ var avatar_src_mainvue_type_script_lang_js_ = ({
  36541. name: 'ElAvatar',
  36542. props: {
  36543. size: {
  36544. type: [Number, String],
  36545. validator: function validator(val) {
  36546. if (typeof val === 'string') {
  36547. return ['large', 'medium', 'small'].includes(val);
  36548. }
  36549. return typeof val === 'number';
  36550. }
  36551. },
  36552. shape: {
  36553. type: String,
  36554. default: 'circle',
  36555. validator: function validator(val) {
  36556. return ['circle', 'square'].includes(val);
  36557. }
  36558. },
  36559. icon: String,
  36560. src: String,
  36561. alt: String,
  36562. srcSet: String,
  36563. error: Function,
  36564. fit: {
  36565. type: String,
  36566. default: 'cover'
  36567. }
  36568. },
  36569. data: function data() {
  36570. return {
  36571. isImageExist: true
  36572. };
  36573. },
  36574. computed: {
  36575. avatarClass: function avatarClass() {
  36576. var size = this.size,
  36577. icon = this.icon,
  36578. shape = this.shape;
  36579. var classList = ['el-avatar'];
  36580. if (size && typeof size === 'string') {
  36581. classList.push('el-avatar--' + size);
  36582. }
  36583. if (icon) {
  36584. classList.push('el-avatar--icon');
  36585. }
  36586. if (shape) {
  36587. classList.push('el-avatar--' + shape);
  36588. }
  36589. return classList.join(' ');
  36590. }
  36591. },
  36592. methods: {
  36593. handleError: function handleError() {
  36594. var error = this.error;
  36595. var errorFlag = error ? error() : undefined;
  36596. if (errorFlag !== false) {
  36597. this.isImageExist = false;
  36598. }
  36599. },
  36600. renderAvatar: function renderAvatar() {
  36601. var h = this.$createElement;
  36602. var icon = this.icon,
  36603. src = this.src,
  36604. alt = this.alt,
  36605. isImageExist = this.isImageExist,
  36606. srcSet = this.srcSet,
  36607. fit = this.fit;
  36608. if (isImageExist && src) {
  36609. return h('img', {
  36610. attrs: {
  36611. src: src,
  36612. alt: alt,
  36613. srcSet: srcSet
  36614. },
  36615. on: {
  36616. 'error': this.handleError
  36617. },
  36618. style: { 'object-fit': fit } });
  36619. }
  36620. if (icon) {
  36621. return h('i', { 'class': icon });
  36622. }
  36623. return this.$slots.default;
  36624. }
  36625. },
  36626. render: function render() {
  36627. var h = arguments[0];
  36628. var avatarClass = this.avatarClass,
  36629. size = this.size;
  36630. var sizeStyle = typeof size === 'number' ? {
  36631. height: size + 'px',
  36632. width: size + 'px',
  36633. lineHeight: size + 'px'
  36634. } : {};
  36635. return h(
  36636. 'span',
  36637. { 'class': avatarClass, style: sizeStyle },
  36638. [this.renderAvatar()]
  36639. );
  36640. }
  36641. });
  36642. // CONCATENATED MODULE: ./packages/avatar/src/main.vue?vue&type=script&lang=js&
  36643. /* harmony default export */ var packages_avatar_src_mainvue_type_script_lang_js_ = (avatar_src_mainvue_type_script_lang_js_);
  36644. // CONCATENATED MODULE: ./packages/avatar/src/main.vue
  36645. var src_main_render, src_main_staticRenderFns
  36646. /* normalize component */
  36647. var avatar_src_main_component = normalizeComponent(
  36648. packages_avatar_src_mainvue_type_script_lang_js_,
  36649. src_main_render,
  36650. src_main_staticRenderFns,
  36651. false,
  36652. null,
  36653. null,
  36654. null
  36655. )
  36656. /* hot reload */
  36657. if (false) { var avatar_src_main_api; }
  36658. avatar_src_main_component.options.__file = "packages/avatar/src/main.vue"
  36659. /* harmony default export */ var avatar_src_main = (avatar_src_main_component.exports);
  36660. // CONCATENATED MODULE: ./packages/avatar/index.js
  36661. /* istanbul ignore next */
  36662. avatar_src_main.install = function (Vue) {
  36663. Vue.component(avatar_src_main.name, avatar_src_main);
  36664. };
  36665. /* harmony default export */ var avatar = (avatar_src_main);
  36666. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/drawer/src/main.vue?vue&type=template&id=a4885264&
  36667. var mainvue_type_template_id_a4885264_render = function() {
  36668. var _vm = this
  36669. var _h = _vm.$createElement
  36670. var _c = _vm._self._c || _h
  36671. return _c(
  36672. "transition",
  36673. {
  36674. attrs: { name: "el-drawer-fade" },
  36675. on: { "after-enter": _vm.afterEnter, "after-leave": _vm.afterLeave }
  36676. },
  36677. [
  36678. _c(
  36679. "div",
  36680. {
  36681. directives: [
  36682. {
  36683. name: "show",
  36684. rawName: "v-show",
  36685. value: _vm.visible,
  36686. expression: "visible"
  36687. }
  36688. ],
  36689. staticClass: "el-drawer__wrapper",
  36690. attrs: { tabindex: "-1" }
  36691. },
  36692. [
  36693. _c(
  36694. "div",
  36695. {
  36696. staticClass: "el-drawer__container",
  36697. class: _vm.visible && "el-drawer__open",
  36698. attrs: { role: "document", tabindex: "-1" },
  36699. on: {
  36700. click: function($event) {
  36701. if ($event.target !== $event.currentTarget) {
  36702. return null
  36703. }
  36704. return _vm.handleWrapperClick($event)
  36705. }
  36706. }
  36707. },
  36708. [
  36709. _c(
  36710. "div",
  36711. {
  36712. ref: "drawer",
  36713. staticClass: "el-drawer",
  36714. class: [_vm.direction, _vm.customClass],
  36715. style: _vm.isHorizontal
  36716. ? "width: " + _vm.drawerSize
  36717. : "height: " + _vm.drawerSize,
  36718. attrs: {
  36719. "aria-modal": "true",
  36720. "aria-labelledby": "el-drawer__title",
  36721. "aria-label": _vm.title,
  36722. role: "dialog",
  36723. tabindex: "-1"
  36724. }
  36725. },
  36726. [
  36727. _vm.withHeader
  36728. ? _c(
  36729. "header",
  36730. {
  36731. staticClass: "el-drawer__header",
  36732. attrs: { id: "el-drawer__title" }
  36733. },
  36734. [
  36735. _vm._t("title", [
  36736. _c(
  36737. "span",
  36738. { attrs: { role: "heading", title: _vm.title } },
  36739. [_vm._v(_vm._s(_vm.title))]
  36740. )
  36741. ]),
  36742. _vm.showClose
  36743. ? _c(
  36744. "button",
  36745. {
  36746. staticClass: "el-drawer__close-btn",
  36747. attrs: {
  36748. "aria-label":
  36749. "close " + (_vm.title || "drawer"),
  36750. type: "button"
  36751. },
  36752. on: { click: _vm.closeDrawer }
  36753. },
  36754. [
  36755. _c("i", {
  36756. staticClass:
  36757. "el-dialog__close el-icon el-icon-close"
  36758. })
  36759. ]
  36760. )
  36761. : _vm._e()
  36762. ],
  36763. 2
  36764. )
  36765. : _vm._e(),
  36766. _vm.rendered
  36767. ? _c(
  36768. "section",
  36769. { staticClass: "el-drawer__body" },
  36770. [_vm._t("default")],
  36771. 2
  36772. )
  36773. : _vm._e()
  36774. ]
  36775. )
  36776. ]
  36777. )
  36778. ]
  36779. )
  36780. ]
  36781. )
  36782. }
  36783. var mainvue_type_template_id_a4885264_staticRenderFns = []
  36784. mainvue_type_template_id_a4885264_render._withStripped = true
  36785. // CONCATENATED MODULE: ./packages/drawer/src/main.vue?vue&type=template&id=a4885264&
  36786. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/drawer/src/main.vue?vue&type=script&lang=js&
  36787. //
  36788. //
  36789. //
  36790. //
  36791. //
  36792. //
  36793. //
  36794. //
  36795. //
  36796. //
  36797. //
  36798. //
  36799. //
  36800. //
  36801. //
  36802. //
  36803. //
  36804. //
  36805. //
  36806. //
  36807. //
  36808. //
  36809. //
  36810. //
  36811. //
  36812. //
  36813. //
  36814. //
  36815. //
  36816. //
  36817. //
  36818. //
  36819. //
  36820. //
  36821. //
  36822. //
  36823. //
  36824. //
  36825. //
  36826. //
  36827. //
  36828. //
  36829. //
  36830. //
  36831. //
  36832. //
  36833. //
  36834. //
  36835. /* harmony default export */ var drawer_src_mainvue_type_script_lang_js_ = ({
  36836. name: 'ElDrawer',
  36837. mixins: [popup_default.a, emitter_default.a],
  36838. props: {
  36839. appendToBody: {
  36840. type: Boolean,
  36841. default: false
  36842. },
  36843. beforeClose: {
  36844. type: Function
  36845. },
  36846. customClass: {
  36847. type: String,
  36848. default: ''
  36849. },
  36850. closeOnPressEscape: {
  36851. type: Boolean,
  36852. default: true
  36853. },
  36854. destroyOnClose: {
  36855. type: Boolean,
  36856. default: false
  36857. },
  36858. modal: {
  36859. type: Boolean,
  36860. default: true
  36861. },
  36862. direction: {
  36863. type: String,
  36864. default: 'rtl',
  36865. validator: function validator(val) {
  36866. return ['ltr', 'rtl', 'ttb', 'btt'].indexOf(val) !== -1;
  36867. }
  36868. },
  36869. modalAppendToBody: {
  36870. type: Boolean,
  36871. default: true
  36872. },
  36873. showClose: {
  36874. type: Boolean,
  36875. default: true
  36876. },
  36877. size: {
  36878. type: [Number, String],
  36879. default: '30%'
  36880. },
  36881. title: {
  36882. type: String,
  36883. default: ''
  36884. },
  36885. visible: {
  36886. type: Boolean
  36887. },
  36888. wrapperClosable: {
  36889. type: Boolean,
  36890. default: true
  36891. },
  36892. withHeader: {
  36893. type: Boolean,
  36894. default: true
  36895. }
  36896. },
  36897. computed: {
  36898. isHorizontal: function isHorizontal() {
  36899. return this.direction === 'rtl' || this.direction === 'ltr';
  36900. },
  36901. drawerSize: function drawerSize() {
  36902. return typeof this.size === 'number' ? this.size + 'px' : this.size;
  36903. }
  36904. },
  36905. data: function data() {
  36906. return {
  36907. closed: false,
  36908. prevActiveElement: null
  36909. };
  36910. },
  36911. watch: {
  36912. visible: function visible(val) {
  36913. var _this = this;
  36914. if (val) {
  36915. this.closed = false;
  36916. this.$emit('open');
  36917. if (this.appendToBody) {
  36918. document.body.appendChild(this.$el);
  36919. }
  36920. this.prevActiveElement = document.activeElement;
  36921. } else {
  36922. if (!this.closed) {
  36923. this.$emit('close');
  36924. if (this.destroyOnClose === true) {
  36925. this.rendered = false;
  36926. }
  36927. }
  36928. this.$nextTick(function () {
  36929. if (_this.prevActiveElement) {
  36930. _this.prevActiveElement.focus();
  36931. }
  36932. });
  36933. }
  36934. }
  36935. },
  36936. methods: {
  36937. afterEnter: function afterEnter() {
  36938. this.$emit('opened');
  36939. },
  36940. afterLeave: function afterLeave() {
  36941. this.$emit('closed');
  36942. },
  36943. hide: function hide(cancel) {
  36944. if (cancel !== false) {
  36945. this.$emit('update:visible', false);
  36946. this.$emit('close');
  36947. if (this.destroyOnClose === true) {
  36948. this.rendered = false;
  36949. }
  36950. this.closed = true;
  36951. }
  36952. },
  36953. handleWrapperClick: function handleWrapperClick() {
  36954. if (this.wrapperClosable) {
  36955. this.closeDrawer();
  36956. }
  36957. },
  36958. closeDrawer: function closeDrawer() {
  36959. if (typeof this.beforeClose === 'function') {
  36960. this.beforeClose(this.hide);
  36961. } else {
  36962. this.hide();
  36963. }
  36964. },
  36965. handleClose: function handleClose() {
  36966. // This method here will be called by PopupManger, when the `closeOnPressEscape` was set to true
  36967. // pressing `ESC` will call this method, and also close the drawer.
  36968. // This method also calls `beforeClose` if there was one.
  36969. this.closeDrawer();
  36970. }
  36971. },
  36972. mounted: function mounted() {
  36973. if (this.visible) {
  36974. this.rendered = true;
  36975. this.open();
  36976. if (this.appendToBody) {
  36977. document.body.appendChild(this.$el);
  36978. }
  36979. }
  36980. },
  36981. destroyed: function destroyed() {
  36982. // if appendToBody is true, remove DOM node after destroy
  36983. if (this.appendToBody && this.$el && this.$el.parentNode) {
  36984. this.$el.parentNode.removeChild(this.$el);
  36985. }
  36986. }
  36987. });
  36988. // CONCATENATED MODULE: ./packages/drawer/src/main.vue?vue&type=script&lang=js&
  36989. /* harmony default export */ var packages_drawer_src_mainvue_type_script_lang_js_ = (drawer_src_mainvue_type_script_lang_js_);
  36990. // CONCATENATED MODULE: ./packages/drawer/src/main.vue
  36991. /* normalize component */
  36992. var drawer_src_main_component = normalizeComponent(
  36993. packages_drawer_src_mainvue_type_script_lang_js_,
  36994. mainvue_type_template_id_a4885264_render,
  36995. mainvue_type_template_id_a4885264_staticRenderFns,
  36996. false,
  36997. null,
  36998. null,
  36999. null
  37000. )
  37001. /* hot reload */
  37002. if (false) { var drawer_src_main_api; }
  37003. drawer_src_main_component.options.__file = "packages/drawer/src/main.vue"
  37004. /* harmony default export */ var drawer_src_main = (drawer_src_main_component.exports);
  37005. // CONCATENATED MODULE: ./packages/drawer/index.js
  37006. /* istanbul ignore next */
  37007. drawer_src_main.install = function (Vue) {
  37008. Vue.component(drawer_src_main.name, drawer_src_main);
  37009. };
  37010. /* harmony default export */ var drawer = (drawer_src_main);
  37011. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/statistic/src/main.vue?vue&type=template&id=76339aa7&
  37012. var mainvue_type_template_id_76339aa7_render = function() {
  37013. var _vm = this
  37014. var _h = _vm.$createElement
  37015. var _c = _vm._self._c || _h
  37016. return _c("div", { staticClass: "el-statistic" }, [
  37017. _vm.title || _vm.$slots.title
  37018. ? _c(
  37019. "div",
  37020. { staticClass: "head" },
  37021. [
  37022. _vm._t("title", [
  37023. _c("span", { staticClass: "title" }, [
  37024. _vm._v("\n " + _vm._s(_vm.title) + "\n ")
  37025. ])
  37026. ])
  37027. ],
  37028. 2
  37029. )
  37030. : _vm._e(),
  37031. _c("div", { staticClass: "con" }, [
  37032. _vm.prefix || _vm.$slots.prefix
  37033. ? _c(
  37034. "span",
  37035. { staticClass: "prefix" },
  37036. [
  37037. _vm._t("prefix", [
  37038. _vm._v("\n " + _vm._s(_vm.prefix) + "\n ")
  37039. ])
  37040. ],
  37041. 2
  37042. )
  37043. : _vm._e(),
  37044. _c(
  37045. "span",
  37046. { staticClass: "number", style: _vm.valueStyle },
  37047. [_vm._t("formatter", [_vm._v(" " + _vm._s(_vm.disposeValue))])],
  37048. 2
  37049. ),
  37050. _vm.suffix || _vm.$slots.suffix
  37051. ? _c(
  37052. "span",
  37053. { staticClass: "suffix" },
  37054. [
  37055. _vm._t("suffix", [
  37056. _vm._v("\n " + _vm._s(_vm.suffix) + "\n ")
  37057. ])
  37058. ],
  37059. 2
  37060. )
  37061. : _vm._e()
  37062. ])
  37063. ])
  37064. }
  37065. var mainvue_type_template_id_76339aa7_staticRenderFns = []
  37066. mainvue_type_template_id_76339aa7_render._withStripped = true
  37067. // CONCATENATED MODULE: ./packages/statistic/src/main.vue?vue&type=template&id=76339aa7&
  37068. // EXTERNAL MODULE: external "element-ui/lib/utils/lodash"
  37069. var lodash_ = __webpack_require__(28);
  37070. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/statistic/src/main.vue?vue&type=script&lang=js&
  37071. //
  37072. //
  37073. //
  37074. //
  37075. //
  37076. //
  37077. //
  37078. //
  37079. //
  37080. //
  37081. //
  37082. //
  37083. //
  37084. //
  37085. //
  37086. //
  37087. //
  37088. //
  37089. //
  37090. //
  37091. //
  37092. //
  37093. //
  37094. //
  37095. //
  37096. //
  37097. //
  37098. /* harmony default export */ var statistic_src_mainvue_type_script_lang_js_ = ({
  37099. name: 'ElStatistic',
  37100. data: function data() {
  37101. return {
  37102. disposeValue: '',
  37103. timeTask: null,
  37104. REFRESH_INTERVAL: 1000 / 30
  37105. };
  37106. },
  37107. props: {
  37108. decimalSeparator: {
  37109. type: String,
  37110. default: '.'
  37111. },
  37112. groupSeparator: {
  37113. type: String,
  37114. default: ''
  37115. },
  37116. precision: {
  37117. type: Number,
  37118. default: null
  37119. },
  37120. value: {
  37121. type: [String, Number, Date],
  37122. default: ''
  37123. },
  37124. prefix: {
  37125. type: String,
  37126. default: ''
  37127. },
  37128. suffix: {
  37129. type: String,
  37130. default: ''
  37131. },
  37132. title: {
  37133. type: [String, Number],
  37134. default: ''
  37135. },
  37136. timeIndices: {
  37137. type: Boolean,
  37138. default: false
  37139. },
  37140. valueStyle: {
  37141. type: Object,
  37142. default: function _default() {
  37143. return {};
  37144. }
  37145. },
  37146. format: {
  37147. type: String,
  37148. default: 'HH:mm:ss:SSS'
  37149. },
  37150. rate: {
  37151. type: Number,
  37152. default: 1000
  37153. }
  37154. },
  37155. created: function created() {
  37156. this.branch();
  37157. },
  37158. watch: {
  37159. value: function value() {
  37160. this.branch();
  37161. },
  37162. groupSeparator: function groupSeparator() {
  37163. this.dispose();
  37164. },
  37165. mulriple: function mulriple() {
  37166. this.dispose();
  37167. }
  37168. },
  37169. methods: {
  37170. branch: function branch() {
  37171. var timeIndices = this.timeIndices,
  37172. countDown = this.countDown,
  37173. dispose = this.dispose;
  37174. if (timeIndices) {
  37175. countDown(this.value.valueOf() || this.value);
  37176. } else {
  37177. dispose();
  37178. }
  37179. },
  37180. magnification: function magnification(num) {
  37181. var mulriple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;
  37182. var groupSeparator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ',';
  37183. // magnification factor
  37184. var level = String(mulriple).length;
  37185. return num.replace(new RegExp('(\\d)(?=(\\d{' + (level - 1) + '})+$)', 'g'), '$1' + groupSeparator);
  37186. },
  37187. dispose: function dispose() {
  37188. var value = this.value,
  37189. rate = this.rate,
  37190. groupSeparator = this.groupSeparator;
  37191. if (!Object(lodash_["isNumber"])(value)) return false;
  37192. if (this.precision) {
  37193. value = value.toFixed(this.precision);
  37194. }
  37195. var _String$split = String(value).split('.'),
  37196. integer = _String$split[0],
  37197. decimal = _String$split[1];
  37198. // 1000 multiplying power
  37199. if (groupSeparator) {
  37200. integer = this.magnification(integer, rate, groupSeparator);
  37201. }
  37202. var result = '' + integer + (decimal ? this.decimalSeparator + decimal : '');
  37203. this.disposeValue = result;
  37204. return result;
  37205. },
  37206. diffDate: function diffDate(minuend, subtrahend) {
  37207. return Math.max(minuend - subtrahend, 0);
  37208. },
  37209. suspend: function suspend(isStop) {
  37210. if (isStop) {
  37211. if (this.timeTask) {
  37212. clearInterval(this.timeTask);
  37213. this.timeTask = null;
  37214. }
  37215. } else {
  37216. this.branch();
  37217. }
  37218. return this.disposeValue;
  37219. },
  37220. formatTimeStr: function formatTimeStr(time) {
  37221. var format = this.format;
  37222. var escapeRegex = /\[[^\]]*]/g;
  37223. var keepList = (format.match(escapeRegex) || []).map(function (str) {
  37224. return str.slice(1, -1);
  37225. });
  37226. var timeUnits = [['Y', 1000 * 60 * 60 * 24 * 365], // years
  37227. ['M', 1000 * 60 * 60 * 24 * 30], // months
  37228. ['D', 1000 * 60 * 60 * 24], // days
  37229. ['H', 1000 * 60 * 60], // hours
  37230. ['m', 1000 * 60], // minutes
  37231. ['s', 1000], // seconds
  37232. ['S', 1] // million seconds
  37233. ];
  37234. var formatText = Object(lodash_["reduce"])(timeUnits, function (con, item) {
  37235. var name = item[0];
  37236. return con.replace(new RegExp(name + '+', 'g'), function (match) {
  37237. var sum = Object(lodash_["chain"])(time).divide(item[1]).floor(0).value();
  37238. time -= Object(lodash_["multiply"])(sum, item[1]);
  37239. return Object(lodash_["padStart"])(String(sum), String(match).length, 0);
  37240. });
  37241. }, format);
  37242. var index = 0;
  37243. return formatText.replace(escapeRegex, function () {
  37244. var match = keepList[index];
  37245. index += 1;
  37246. return match;
  37247. });
  37248. },
  37249. stopTime: function stopTime(time) {
  37250. var result = true; // stop
  37251. if (time) {
  37252. this.$emit('change', time);
  37253. result = false;
  37254. } else {
  37255. result = true;
  37256. this.suspend(true);
  37257. this.$emit('finish', true);
  37258. }
  37259. return result;
  37260. },
  37261. countDown: function countDown(timeVlaue) {
  37262. var REFRESH_INTERVAL = this.REFRESH_INTERVAL,
  37263. timeTask = this.timeTask,
  37264. diffDate = this.diffDate,
  37265. formatTimeStr = this.formatTimeStr,
  37266. stopTime = this.stopTime,
  37267. suspend = this.suspend;
  37268. if (timeTask) return;
  37269. var than = this;
  37270. this.timeTask = setInterval(function () {
  37271. var diffTiem = diffDate(timeVlaue, Date.now());
  37272. than.disposeValue = formatTimeStr(diffTiem);
  37273. stopTime(diffTiem);
  37274. }, REFRESH_INTERVAL);
  37275. this.$once('hook:beforeDestroy', function () {
  37276. suspend(true);
  37277. });
  37278. }
  37279. }
  37280. });
  37281. // CONCATENATED MODULE: ./packages/statistic/src/main.vue?vue&type=script&lang=js&
  37282. /* harmony default export */ var packages_statistic_src_mainvue_type_script_lang_js_ = (statistic_src_mainvue_type_script_lang_js_);
  37283. // CONCATENATED MODULE: ./packages/statistic/src/main.vue
  37284. /* normalize component */
  37285. var statistic_src_main_component = normalizeComponent(
  37286. packages_statistic_src_mainvue_type_script_lang_js_,
  37287. mainvue_type_template_id_76339aa7_render,
  37288. mainvue_type_template_id_76339aa7_staticRenderFns,
  37289. false,
  37290. null,
  37291. null,
  37292. null
  37293. )
  37294. /* hot reload */
  37295. if (false) { var statistic_src_main_api; }
  37296. statistic_src_main_component.options.__file = "packages/statistic/src/main.vue"
  37297. /* harmony default export */ var statistic_src_main = (statistic_src_main_component.exports);
  37298. // CONCATENATED MODULE: ./packages/statistic/index.js
  37299. /* istanbul ignore next */
  37300. statistic_src_main.install = function (Vue) {
  37301. Vue.component(statistic_src_main.name, statistic_src_main);
  37302. };
  37303. /* harmony default export */ var statistic = (statistic_src_main);
  37304. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/popconfirm/src/main.vue?vue&type=template&id=048de730&
  37305. var mainvue_type_template_id_048de730_render = function() {
  37306. var _vm = this
  37307. var _h = _vm.$createElement
  37308. var _c = _vm._self._c || _h
  37309. return _c(
  37310. "el-popover",
  37311. _vm._b(
  37312. {
  37313. attrs: { trigger: "click" },
  37314. model: {
  37315. value: _vm.visible,
  37316. callback: function($$v) {
  37317. _vm.visible = $$v
  37318. },
  37319. expression: "visible"
  37320. }
  37321. },
  37322. "el-popover",
  37323. _vm.$attrs,
  37324. false
  37325. ),
  37326. [
  37327. _c("div", { staticClass: "el-popconfirm" }, [
  37328. _c("p", { staticClass: "el-popconfirm__main" }, [
  37329. !_vm.hideIcon
  37330. ? _c("i", {
  37331. staticClass: "el-popconfirm__icon",
  37332. class: _vm.icon,
  37333. style: { color: _vm.iconColor }
  37334. })
  37335. : _vm._e(),
  37336. _vm._v("\n " + _vm._s(_vm.title) + "\n ")
  37337. ]),
  37338. _c(
  37339. "div",
  37340. { staticClass: "el-popconfirm__action" },
  37341. [
  37342. _c(
  37343. "el-button",
  37344. {
  37345. attrs: { size: "mini", type: _vm.cancelButtonType },
  37346. on: { click: _vm.cancel }
  37347. },
  37348. [
  37349. _vm._v(
  37350. "\n " +
  37351. _vm._s(_vm.displayCancelButtonText) +
  37352. "\n "
  37353. )
  37354. ]
  37355. ),
  37356. _c(
  37357. "el-button",
  37358. {
  37359. attrs: { size: "mini", type: _vm.confirmButtonType },
  37360. on: { click: _vm.confirm }
  37361. },
  37362. [
  37363. _vm._v(
  37364. "\n " +
  37365. _vm._s(_vm.displayConfirmButtonText) +
  37366. "\n "
  37367. )
  37368. ]
  37369. )
  37370. ],
  37371. 1
  37372. )
  37373. ]),
  37374. _vm._t("reference", null, { slot: "reference" })
  37375. ],
  37376. 2
  37377. )
  37378. }
  37379. var mainvue_type_template_id_048de730_staticRenderFns = []
  37380. mainvue_type_template_id_048de730_render._withStripped = true
  37381. // CONCATENATED MODULE: ./packages/popconfirm/src/main.vue?vue&type=template&id=048de730&
  37382. // EXTERNAL MODULE: external "element-ui/lib/popover"
  37383. var popover_ = __webpack_require__(45);
  37384. var popover_default = /*#__PURE__*/__webpack_require__.n(popover_);
  37385. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/popconfirm/src/main.vue?vue&type=script&lang=js&
  37386. //
  37387. //
  37388. //
  37389. //
  37390. //
  37391. //
  37392. //
  37393. //
  37394. //
  37395. //
  37396. //
  37397. //
  37398. //
  37399. //
  37400. //
  37401. //
  37402. //
  37403. //
  37404. //
  37405. //
  37406. //
  37407. //
  37408. //
  37409. //
  37410. //
  37411. //
  37412. //
  37413. //
  37414. //
  37415. //
  37416. //
  37417. //
  37418. //
  37419. //
  37420. //
  37421. //
  37422. //
  37423. /* harmony default export */ var popconfirm_src_mainvue_type_script_lang_js_ = ({
  37424. name: 'ElPopconfirm',
  37425. props: {
  37426. title: {
  37427. type: String
  37428. },
  37429. confirmButtonText: {
  37430. type: String
  37431. },
  37432. cancelButtonText: {
  37433. type: String
  37434. },
  37435. confirmButtonType: {
  37436. type: String,
  37437. default: 'primary'
  37438. },
  37439. cancelButtonType: {
  37440. type: String,
  37441. default: 'text'
  37442. },
  37443. icon: {
  37444. type: String,
  37445. default: 'el-icon-question'
  37446. },
  37447. iconColor: {
  37448. type: String,
  37449. default: '#f90'
  37450. },
  37451. hideIcon: {
  37452. type: Boolean,
  37453. default: false
  37454. }
  37455. },
  37456. components: {
  37457. ElPopover: popover_default.a,
  37458. ElButton: button_default.a
  37459. },
  37460. data: function data() {
  37461. return {
  37462. visible: false
  37463. };
  37464. },
  37465. computed: {
  37466. displayConfirmButtonText: function displayConfirmButtonText() {
  37467. return this.confirmButtonText || Object(lib_locale_["t"])('el.popconfirm.confirmButtonText');
  37468. },
  37469. displayCancelButtonText: function displayCancelButtonText() {
  37470. return this.cancelButtonText || Object(lib_locale_["t"])('el.popconfirm.cancelButtonText');
  37471. }
  37472. },
  37473. methods: {
  37474. confirm: function confirm() {
  37475. this.visible = false;
  37476. this.$emit('confirm');
  37477. },
  37478. cancel: function cancel() {
  37479. this.visible = false;
  37480. this.$emit('cancel');
  37481. }
  37482. }
  37483. });
  37484. // CONCATENATED MODULE: ./packages/popconfirm/src/main.vue?vue&type=script&lang=js&
  37485. /* harmony default export */ var packages_popconfirm_src_mainvue_type_script_lang_js_ = (popconfirm_src_mainvue_type_script_lang_js_);
  37486. // CONCATENATED MODULE: ./packages/popconfirm/src/main.vue
  37487. /* normalize component */
  37488. var popconfirm_src_main_component = normalizeComponent(
  37489. packages_popconfirm_src_mainvue_type_script_lang_js_,
  37490. mainvue_type_template_id_048de730_render,
  37491. mainvue_type_template_id_048de730_staticRenderFns,
  37492. false,
  37493. null,
  37494. null,
  37495. null
  37496. )
  37497. /* hot reload */
  37498. if (false) { var popconfirm_src_main_api; }
  37499. popconfirm_src_main_component.options.__file = "packages/popconfirm/src/main.vue"
  37500. /* harmony default export */ var popconfirm_src_main = (popconfirm_src_main_component.exports);
  37501. // CONCATENATED MODULE: ./packages/popconfirm/index.js
  37502. /* istanbul ignore next */
  37503. popconfirm_src_main.install = function (Vue) {
  37504. Vue.component(popconfirm_src_main.name, popconfirm_src_main);
  37505. };
  37506. /* harmony default export */ var popconfirm = (popconfirm_src_main);
  37507. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/skeleton/src/index.vue?vue&type=template&id=7f659269&
  37508. var srcvue_type_template_id_7f659269_render = function() {
  37509. var _vm = this
  37510. var _h = _vm.$createElement
  37511. var _c = _vm._self._c || _h
  37512. return _c(
  37513. "div",
  37514. [
  37515. _vm.uiLoading
  37516. ? [
  37517. _c(
  37518. "div",
  37519. _vm._b(
  37520. { class: ["el-skeleton", _vm.animated ? "is-animated" : ""] },
  37521. "div",
  37522. _vm.$attrs,
  37523. false
  37524. ),
  37525. [
  37526. _vm._l(_vm.count, function(i) {
  37527. return [
  37528. _vm.loading
  37529. ? _vm._t(
  37530. "template",
  37531. _vm._l(_vm.rows, function(item) {
  37532. return _c("el-skeleton-item", {
  37533. key: i + "-" + item,
  37534. class: {
  37535. "el-skeleton__paragraph": item !== 1,
  37536. "is-first": item === 1,
  37537. "is-last": item === _vm.rows && _vm.rows > 1
  37538. },
  37539. attrs: { variant: "p" }
  37540. })
  37541. })
  37542. )
  37543. : _vm._e()
  37544. ]
  37545. })
  37546. ],
  37547. 2
  37548. )
  37549. ]
  37550. : [_vm._t("default", null, null, _vm.$attrs)]
  37551. ],
  37552. 2
  37553. )
  37554. }
  37555. var srcvue_type_template_id_7f659269_staticRenderFns = []
  37556. srcvue_type_template_id_7f659269_render._withStripped = true
  37557. // CONCATENATED MODULE: ./packages/skeleton/src/index.vue?vue&type=template&id=7f659269&
  37558. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/skeleton/src/index.vue?vue&type=script&lang=js&
  37559. //
  37560. //
  37561. //
  37562. //
  37563. //
  37564. //
  37565. //
  37566. //
  37567. //
  37568. //
  37569. //
  37570. //
  37571. //
  37572. //
  37573. //
  37574. //
  37575. //
  37576. //
  37577. //
  37578. //
  37579. //
  37580. //
  37581. //
  37582. //
  37583. //
  37584. /* harmony default export */ var skeleton_srcvue_type_script_lang_js_ = ({
  37585. name: 'ElSkeleton',
  37586. props: {
  37587. animated: {
  37588. type: Boolean,
  37589. default: false
  37590. },
  37591. count: {
  37592. type: Number,
  37593. default: 1
  37594. },
  37595. rows: {
  37596. type: Number,
  37597. default: 4
  37598. },
  37599. loading: {
  37600. type: Boolean,
  37601. default: true
  37602. },
  37603. throttle: {
  37604. type: Number,
  37605. default: 0
  37606. }
  37607. },
  37608. watch: {
  37609. loading: {
  37610. handler: function handler(loading) {
  37611. var _this = this;
  37612. if (this.throttle <= 0) {
  37613. this.uiLoading = loading;
  37614. return;
  37615. }
  37616. if (loading) {
  37617. clearTimeout(this.timeoutHandle);
  37618. this.timeoutHandle = setTimeout(function () {
  37619. _this.uiLoading = _this.loading;
  37620. }, this.throttle);
  37621. } else {
  37622. this.uiLoading = loading;
  37623. }
  37624. },
  37625. immediate: true
  37626. }
  37627. },
  37628. data: function data() {
  37629. return {
  37630. uiLoading: this.throttle <= 0 ? this.loading : false
  37631. };
  37632. }
  37633. });
  37634. // CONCATENATED MODULE: ./packages/skeleton/src/index.vue?vue&type=script&lang=js&
  37635. /* harmony default export */ var packages_skeleton_srcvue_type_script_lang_js_ = (skeleton_srcvue_type_script_lang_js_);
  37636. // CONCATENATED MODULE: ./packages/skeleton/src/index.vue
  37637. /* normalize component */
  37638. var skeleton_src_component = normalizeComponent(
  37639. packages_skeleton_srcvue_type_script_lang_js_,
  37640. srcvue_type_template_id_7f659269_render,
  37641. srcvue_type_template_id_7f659269_staticRenderFns,
  37642. false,
  37643. null,
  37644. null,
  37645. null
  37646. )
  37647. /* hot reload */
  37648. if (false) { var skeleton_src_api; }
  37649. skeleton_src_component.options.__file = "packages/skeleton/src/index.vue"
  37650. /* harmony default export */ var skeleton_src = (skeleton_src_component.exports);
  37651. // CONCATENATED MODULE: ./packages/skeleton/index.js
  37652. /* istanbul ignore next */
  37653. skeleton_src.install = function (Vue) {
  37654. Vue.component(skeleton_src.name, skeleton_src);
  37655. };
  37656. /* harmony default export */ var skeleton = (skeleton_src);
  37657. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/skeleton/src/item.vue?vue&type=template&id=4bc8804c&
  37658. var itemvue_type_template_id_4bc8804c_render = function() {
  37659. var _vm = this
  37660. var _h = _vm.$createElement
  37661. var _c = _vm._self._c || _h
  37662. return _c(
  37663. "div",
  37664. { class: ["el-skeleton__item", "el-skeleton__" + _vm.variant] },
  37665. [_vm.variant === "image" ? _c("img-placeholder") : _vm._e()],
  37666. 1
  37667. )
  37668. }
  37669. var itemvue_type_template_id_4bc8804c_staticRenderFns = []
  37670. itemvue_type_template_id_4bc8804c_render._withStripped = true
  37671. // CONCATENATED MODULE: ./packages/skeleton/src/item.vue?vue&type=template&id=4bc8804c&
  37672. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/skeleton/src/img-placeholder.vue?vue&type=template&id=1b2cb5c0&
  37673. var img_placeholdervue_type_template_id_1b2cb5c0_render = function() {
  37674. var _vm = this
  37675. var _h = _vm.$createElement
  37676. var _c = _vm._self._c || _h
  37677. return _c(
  37678. "svg",
  37679. {
  37680. attrs: { viewBox: "0 0 1024 1024", xmlns: "http://www.w3.org/2000/svg" }
  37681. },
  37682. [
  37683. _c("path", {
  37684. attrs: {
  37685. d:
  37686. "M64 896V128h896v768H64z m64-128l192-192 116.352 116.352L640 448l256 307.2V192H128v576z m224-480a96 96 0 1 1-0.064 192.064A96 96 0 0 1 352 288z"
  37687. }
  37688. })
  37689. ]
  37690. )
  37691. }
  37692. var img_placeholdervue_type_template_id_1b2cb5c0_staticRenderFns = []
  37693. img_placeholdervue_type_template_id_1b2cb5c0_render._withStripped = true
  37694. // CONCATENATED MODULE: ./packages/skeleton/src/img-placeholder.vue?vue&type=template&id=1b2cb5c0&
  37695. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/skeleton/src/img-placeholder.vue?vue&type=script&lang=js&
  37696. //
  37697. //
  37698. //
  37699. //
  37700. //
  37701. //
  37702. //
  37703. //
  37704. //
  37705. //
  37706. //
  37707. /* harmony default export */ var img_placeholdervue_type_script_lang_js_ = ({
  37708. name: 'ImgPlaceholder'
  37709. });
  37710. // CONCATENATED MODULE: ./packages/skeleton/src/img-placeholder.vue?vue&type=script&lang=js&
  37711. /* harmony default export */ var src_img_placeholdervue_type_script_lang_js_ = (img_placeholdervue_type_script_lang_js_);
  37712. // CONCATENATED MODULE: ./packages/skeleton/src/img-placeholder.vue
  37713. /* normalize component */
  37714. var img_placeholder_component = normalizeComponent(
  37715. src_img_placeholdervue_type_script_lang_js_,
  37716. img_placeholdervue_type_template_id_1b2cb5c0_render,
  37717. img_placeholdervue_type_template_id_1b2cb5c0_staticRenderFns,
  37718. false,
  37719. null,
  37720. null,
  37721. null
  37722. )
  37723. /* hot reload */
  37724. if (false) { var img_placeholder_api; }
  37725. img_placeholder_component.options.__file = "packages/skeleton/src/img-placeholder.vue"
  37726. /* harmony default export */ var img_placeholder = (img_placeholder_component.exports);
  37727. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/skeleton/src/item.vue?vue&type=script&lang=js&
  37728. var _components;
  37729. //
  37730. //
  37731. //
  37732. //
  37733. //
  37734. //
  37735. /* harmony default export */ var skeleton_src_itemvue_type_script_lang_js_ = ({
  37736. name: 'ElSkeletonItem',
  37737. props: {
  37738. variant: {
  37739. type: String,
  37740. default: 'text'
  37741. }
  37742. },
  37743. components: (_components = {}, _components[img_placeholder.name] = img_placeholder, _components)
  37744. });
  37745. // CONCATENATED MODULE: ./packages/skeleton/src/item.vue?vue&type=script&lang=js&
  37746. /* harmony default export */ var packages_skeleton_src_itemvue_type_script_lang_js_ = (skeleton_src_itemvue_type_script_lang_js_);
  37747. // CONCATENATED MODULE: ./packages/skeleton/src/item.vue
  37748. /* normalize component */
  37749. var skeleton_src_item_component = normalizeComponent(
  37750. packages_skeleton_src_itemvue_type_script_lang_js_,
  37751. itemvue_type_template_id_4bc8804c_render,
  37752. itemvue_type_template_id_4bc8804c_staticRenderFns,
  37753. false,
  37754. null,
  37755. null,
  37756. null
  37757. )
  37758. /* hot reload */
  37759. if (false) { var skeleton_src_item_api; }
  37760. skeleton_src_item_component.options.__file = "packages/skeleton/src/item.vue"
  37761. /* harmony default export */ var skeleton_src_item = (skeleton_src_item_component.exports);
  37762. // CONCATENATED MODULE: ./packages/skeleton-item/index.js
  37763. /* istanbul ignore next */
  37764. skeleton_src_item.install = function (Vue) {
  37765. Vue.component(skeleton_src_item.name, skeleton_src_item);
  37766. };
  37767. /* harmony default export */ var skeleton_item = (skeleton_src_item);
  37768. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/empty/src/index.vue?vue&type=template&id=347ced91&
  37769. var srcvue_type_template_id_347ced91_render = function() {
  37770. var _vm = this
  37771. var _h = _vm.$createElement
  37772. var _c = _vm._self._c || _h
  37773. return _c("div", { staticClass: "el-empty" }, [
  37774. _c(
  37775. "div",
  37776. { staticClass: "el-empty__image", style: _vm.imageStyle },
  37777. [
  37778. _vm.image
  37779. ? _c("img", {
  37780. attrs: { src: _vm.image, ondragstart: "return false" }
  37781. })
  37782. : _vm._t("image", [_c("img-empty")])
  37783. ],
  37784. 2
  37785. ),
  37786. _c(
  37787. "div",
  37788. { staticClass: "el-empty__description" },
  37789. [
  37790. _vm.$slots.description
  37791. ? _vm._t("description")
  37792. : _c("p", [_vm._v(_vm._s(_vm.emptyDescription))])
  37793. ],
  37794. 2
  37795. ),
  37796. _vm.$slots.default
  37797. ? _c("div", { staticClass: "el-empty__bottom" }, [_vm._t("default")], 2)
  37798. : _vm._e()
  37799. ])
  37800. }
  37801. var srcvue_type_template_id_347ced91_staticRenderFns = []
  37802. srcvue_type_template_id_347ced91_render._withStripped = true
  37803. // CONCATENATED MODULE: ./packages/empty/src/index.vue?vue&type=template&id=347ced91&
  37804. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/empty/src/img-empty.vue?vue&type=template&id=42918b82&
  37805. var img_emptyvue_type_template_id_42918b82_render = function() {
  37806. var _vm = this
  37807. var _h = _vm.$createElement
  37808. var _c = _vm._self._c || _h
  37809. return _c(
  37810. "svg",
  37811. {
  37812. attrs: {
  37813. viewBox: "0 0 79 86",
  37814. version: "1.1",
  37815. xmlns: "http://www.w3.org/2000/svg",
  37816. "xmlns:xlink": "http://www.w3.org/1999/xlink"
  37817. }
  37818. },
  37819. [
  37820. _c(
  37821. "defs",
  37822. [
  37823. _c(
  37824. "linearGradient",
  37825. {
  37826. attrs: {
  37827. id: "linearGradient-1-" + _vm.id,
  37828. x1: "38.8503086%",
  37829. y1: "0%",
  37830. x2: "61.1496914%",
  37831. y2: "100%"
  37832. }
  37833. },
  37834. [
  37835. _c("stop", { attrs: { "stop-color": "#FCFCFD", offset: "0%" } }),
  37836. _c("stop", { attrs: { "stop-color": "#EEEFF3", offset: "100%" } })
  37837. ],
  37838. 1
  37839. ),
  37840. _c(
  37841. "linearGradient",
  37842. {
  37843. attrs: {
  37844. id: "linearGradient-2-" + _vm.id,
  37845. x1: "0%",
  37846. y1: "9.5%",
  37847. x2: "100%",
  37848. y2: "90.5%"
  37849. }
  37850. },
  37851. [
  37852. _c("stop", { attrs: { "stop-color": "#FCFCFD", offset: "0%" } }),
  37853. _c("stop", { attrs: { "stop-color": "#E9EBEF", offset: "100%" } })
  37854. ],
  37855. 1
  37856. ),
  37857. _c("rect", {
  37858. attrs: {
  37859. id: "path-3-" + _vm.id,
  37860. x: "0",
  37861. y: "0",
  37862. width: "17",
  37863. height: "36"
  37864. }
  37865. })
  37866. ],
  37867. 1
  37868. ),
  37869. _c(
  37870. "g",
  37871. {
  37872. attrs: {
  37873. id: "Illustrations",
  37874. stroke: "none",
  37875. "stroke-width": "1",
  37876. fill: "none",
  37877. "fill-rule": "evenodd"
  37878. }
  37879. },
  37880. [
  37881. _c(
  37882. "g",
  37883. {
  37884. attrs: {
  37885. id: "B-type",
  37886. transform: "translate(-1268.000000, -535.000000)"
  37887. }
  37888. },
  37889. [
  37890. _c(
  37891. "g",
  37892. {
  37893. attrs: {
  37894. id: "Group-2",
  37895. transform: "translate(1268.000000, 535.000000)"
  37896. }
  37897. },
  37898. [
  37899. _c("path", {
  37900. attrs: {
  37901. id: "Oval-Copy-2",
  37902. d:
  37903. "M39.5,86 C61.3152476,86 79,83.9106622 79,81.3333333 C79,78.7560045 57.3152476,78 35.5,78 C13.6847524,78 0,78.7560045 0,81.3333333 C0,83.9106622 17.6847524,86 39.5,86 Z",
  37904. fill: "#F7F8FC"
  37905. }
  37906. }),
  37907. _c("polygon", {
  37908. attrs: {
  37909. id: "Rectangle-Copy-14",
  37910. fill: "#E5E7E9",
  37911. transform:
  37912. "translate(27.500000, 51.500000) scale(1, -1) translate(-27.500000, -51.500000) ",
  37913. points: "13 58 53 58 42 45 2 45"
  37914. }
  37915. }),
  37916. _c(
  37917. "g",
  37918. {
  37919. attrs: {
  37920. id: "Group-Copy",
  37921. transform:
  37922. "translate(34.500000, 31.500000) scale(-1, 1) rotate(-25.000000) translate(-34.500000, -31.500000) translate(7.000000, 10.000000)"
  37923. }
  37924. },
  37925. [
  37926. _c("polygon", {
  37927. attrs: {
  37928. id: "Rectangle-Copy-10",
  37929. fill: "#E5E7E9",
  37930. transform:
  37931. "translate(11.500000, 5.000000) scale(1, -1) translate(-11.500000, -5.000000) ",
  37932. points: "2.84078316e-14 3 18 3 23 7 5 7"
  37933. }
  37934. }),
  37935. _c("polygon", {
  37936. attrs: {
  37937. id: "Rectangle-Copy-11",
  37938. fill: "#EDEEF2",
  37939. points:
  37940. "-3.69149156e-15 7 38 7 38 43 -3.69149156e-15 43"
  37941. }
  37942. }),
  37943. _c("rect", {
  37944. attrs: {
  37945. id: "Rectangle-Copy-12",
  37946. fill: "url(#linearGradient-1-" + _vm.id + ")",
  37947. transform:
  37948. "translate(46.500000, 25.000000) scale(-1, 1) translate(-46.500000, -25.000000) ",
  37949. x: "38",
  37950. y: "7",
  37951. width: "17",
  37952. height: "36"
  37953. }
  37954. }),
  37955. _c("polygon", {
  37956. attrs: {
  37957. id: "Rectangle-Copy-13",
  37958. fill: "#F8F9FB",
  37959. transform:
  37960. "translate(39.500000, 3.500000) scale(-1, 1) translate(-39.500000, -3.500000) ",
  37961. points:
  37962. "24 7 41 7 55 -3.63806207e-12 38 -3.63806207e-12"
  37963. }
  37964. })
  37965. ]
  37966. ),
  37967. _c("rect", {
  37968. attrs: {
  37969. id: "Rectangle-Copy-15",
  37970. fill: "url(#linearGradient-2-" + _vm.id + ")",
  37971. x: "13",
  37972. y: "45",
  37973. width: "40",
  37974. height: "36"
  37975. }
  37976. }),
  37977. _c(
  37978. "g",
  37979. {
  37980. attrs: {
  37981. id: "Rectangle-Copy-17",
  37982. transform: "translate(53.000000, 45.000000)"
  37983. }
  37984. },
  37985. [
  37986. _c(
  37987. "mask",
  37988. { attrs: { id: "mask-4-" + _vm.id, fill: "white" } },
  37989. [
  37990. _c("use", {
  37991. attrs: { "xlink:href": "#path-3-" + _vm.id }
  37992. })
  37993. ]
  37994. ),
  37995. _c("use", {
  37996. attrs: {
  37997. id: "Mask",
  37998. fill: "#E0E3E9",
  37999. transform:
  38000. "translate(8.500000, 18.000000) scale(-1, 1) translate(-8.500000, -18.000000) ",
  38001. "xlink:href": "#path-3-" + _vm.id
  38002. }
  38003. }),
  38004. _c("polygon", {
  38005. attrs: {
  38006. id: "Rectangle-Copy",
  38007. fill: "#D5D7DE",
  38008. mask: "url(#mask-4-" + _vm.id + ")",
  38009. transform:
  38010. "translate(12.000000, 9.000000) scale(-1, 1) translate(-12.000000, -9.000000) ",
  38011. points: "7 0 24 0 20 18 -1.70530257e-13 16"
  38012. }
  38013. })
  38014. ]
  38015. ),
  38016. _c("polygon", {
  38017. attrs: {
  38018. id: "Rectangle-Copy-18",
  38019. fill: "#F8F9FB",
  38020. transform:
  38021. "translate(66.000000, 51.500000) scale(-1, 1) translate(-66.000000, -51.500000) ",
  38022. points: "62 45 79 45 70 58 53 58"
  38023. }
  38024. })
  38025. ]
  38026. )
  38027. ]
  38028. )
  38029. ]
  38030. )
  38031. ]
  38032. )
  38033. }
  38034. var img_emptyvue_type_template_id_42918b82_staticRenderFns = []
  38035. img_emptyvue_type_template_id_42918b82_render._withStripped = true
  38036. // CONCATENATED MODULE: ./packages/empty/src/img-empty.vue?vue&type=template&id=42918b82&
  38037. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/empty/src/img-empty.vue?vue&type=script&lang=js&
  38038. //
  38039. //
  38040. //
  38041. //
  38042. //
  38043. //
  38044. //
  38045. //
  38046. //
  38047. //
  38048. //
  38049. //
  38050. //
  38051. //
  38052. //
  38053. //
  38054. //
  38055. //
  38056. //
  38057. //
  38058. //
  38059. //
  38060. //
  38061. //
  38062. //
  38063. //
  38064. //
  38065. //
  38066. //
  38067. //
  38068. //
  38069. //
  38070. //
  38071. //
  38072. //
  38073. //
  38074. //
  38075. //
  38076. //
  38077. //
  38078. //
  38079. //
  38080. //
  38081. //
  38082. //
  38083. //
  38084. //
  38085. //
  38086. //
  38087. //
  38088. //
  38089. //
  38090. //
  38091. //
  38092. //
  38093. //
  38094. //
  38095. //
  38096. //
  38097. //
  38098. //
  38099. //
  38100. //
  38101. //
  38102. //
  38103. //
  38104. //
  38105. //
  38106. //
  38107. //
  38108. //
  38109. //
  38110. //
  38111. //
  38112. //
  38113. //
  38114. //
  38115. //
  38116. //
  38117. //
  38118. //
  38119. //
  38120. //
  38121. //
  38122. //
  38123. //
  38124. //
  38125. //
  38126. //
  38127. //
  38128. //
  38129. //
  38130. //
  38131. //
  38132. //
  38133. //
  38134. //
  38135. //
  38136. //
  38137. //
  38138. //
  38139. //
  38140. //
  38141. //
  38142. //
  38143. //
  38144. //
  38145. //
  38146. //
  38147. //
  38148. //
  38149. //
  38150. //
  38151. //
  38152. //
  38153. //
  38154. //
  38155. //
  38156. //
  38157. //
  38158. //
  38159. var img_emptyvue_type_script_lang_js_id = 0;
  38160. /* harmony default export */ var img_emptyvue_type_script_lang_js_ = ({
  38161. name: 'ImgEmpty',
  38162. data: function data() {
  38163. return {
  38164. id: ++img_emptyvue_type_script_lang_js_id
  38165. };
  38166. }
  38167. });
  38168. // CONCATENATED MODULE: ./packages/empty/src/img-empty.vue?vue&type=script&lang=js&
  38169. /* harmony default export */ var src_img_emptyvue_type_script_lang_js_ = (img_emptyvue_type_script_lang_js_);
  38170. // CONCATENATED MODULE: ./packages/empty/src/img-empty.vue
  38171. /* normalize component */
  38172. var img_empty_component = normalizeComponent(
  38173. src_img_emptyvue_type_script_lang_js_,
  38174. img_emptyvue_type_template_id_42918b82_render,
  38175. img_emptyvue_type_template_id_42918b82_staticRenderFns,
  38176. false,
  38177. null,
  38178. null,
  38179. null
  38180. )
  38181. /* hot reload */
  38182. if (false) { var img_empty_api; }
  38183. img_empty_component.options.__file = "packages/empty/src/img-empty.vue"
  38184. /* harmony default export */ var img_empty = (img_empty_component.exports);
  38185. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/empty/src/index.vue?vue&type=script&lang=js&
  38186. var srcvue_type_script_lang_js_components;
  38187. //
  38188. //
  38189. //
  38190. //
  38191. //
  38192. //
  38193. //
  38194. //
  38195. //
  38196. //
  38197. //
  38198. //
  38199. //
  38200. //
  38201. //
  38202. //
  38203. //
  38204. //
  38205. /* harmony default export */ var empty_srcvue_type_script_lang_js_ = ({
  38206. name: 'ElEmpty',
  38207. components: (srcvue_type_script_lang_js_components = {}, srcvue_type_script_lang_js_components[img_empty.name] = img_empty, srcvue_type_script_lang_js_components),
  38208. props: {
  38209. image: {
  38210. type: String,
  38211. default: ''
  38212. },
  38213. imageSize: Number,
  38214. description: {
  38215. type: String,
  38216. default: ''
  38217. }
  38218. },
  38219. computed: {
  38220. emptyDescription: function emptyDescription() {
  38221. return this.description || Object(lib_locale_["t"])('el.empty.description');
  38222. },
  38223. imageStyle: function imageStyle() {
  38224. return {
  38225. width: this.imageSize ? this.imageSize + 'px' : ''
  38226. };
  38227. }
  38228. }
  38229. });
  38230. // CONCATENATED MODULE: ./packages/empty/src/index.vue?vue&type=script&lang=js&
  38231. /* harmony default export */ var packages_empty_srcvue_type_script_lang_js_ = (empty_srcvue_type_script_lang_js_);
  38232. // CONCATENATED MODULE: ./packages/empty/src/index.vue
  38233. /* normalize component */
  38234. var empty_src_component = normalizeComponent(
  38235. packages_empty_srcvue_type_script_lang_js_,
  38236. srcvue_type_template_id_347ced91_render,
  38237. srcvue_type_template_id_347ced91_staticRenderFns,
  38238. false,
  38239. null,
  38240. null,
  38241. null
  38242. )
  38243. /* hot reload */
  38244. if (false) { var empty_src_api; }
  38245. empty_src_component.options.__file = "packages/empty/src/index.vue"
  38246. /* harmony default export */ var empty_src = (empty_src_component.exports);
  38247. // CONCATENATED MODULE: ./packages/empty/index.js
  38248. empty_src.install = function (Vue) {
  38249. Vue.component(empty_src.name, empty_src);
  38250. };
  38251. /* harmony default export */ var empty = (empty_src);
  38252. // CONCATENATED MODULE: ./packages/descriptions/src/descriptions-row.js
  38253. var descriptions_row_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; };
  38254. /* harmony default export */ var descriptions_row = ({
  38255. name: 'ElDescriptionsRow',
  38256. props: {
  38257. row: {
  38258. type: Array
  38259. }
  38260. },
  38261. inject: ['elDescriptions'],
  38262. render: function render(h) {
  38263. var elDescriptions = this.elDescriptions;
  38264. var row = (this.row || []).map(function (item) {
  38265. return descriptions_row_extends({}, item, {
  38266. label: item.slots.label || item.props.label
  38267. }, ['labelClassName', 'contentClassName', 'labelStyle', 'contentStyle'].reduce(function (res, key) {
  38268. res[key] = item.props[key] || elDescriptions[key];
  38269. return res;
  38270. }, {}));
  38271. });
  38272. if (elDescriptions.direction === 'vertical') {
  38273. return h('tbody', [h(
  38274. 'tr',
  38275. { 'class': 'el-descriptions-row' },
  38276. [row.map(function (item) {
  38277. var _ref;
  38278. return h(
  38279. 'th',
  38280. {
  38281. 'class': (_ref = {
  38282. 'el-descriptions-item__cell': true,
  38283. 'el-descriptions-item__label': true,
  38284. 'has-colon': elDescriptions.border ? false : elDescriptions.colon,
  38285. 'is-bordered-label': elDescriptions.border
  38286. }, _ref[item.labelClassName] = true, _ref),
  38287. style: item.labelStyle,
  38288. attrs: { colSpan: item.props.span
  38289. }
  38290. },
  38291. [item.label]
  38292. );
  38293. })]
  38294. ), h(
  38295. 'tr',
  38296. { 'class': 'el-descriptions-row' },
  38297. [row.map(function (item) {
  38298. return h(
  38299. 'td',
  38300. {
  38301. 'class': ['el-descriptions-item__cell', 'el-descriptions-item__content', item.contentClassName],
  38302. style: item.contentStyle,
  38303. attrs: { colSpan: item.props.span
  38304. }
  38305. },
  38306. [item.slots.default]
  38307. );
  38308. })]
  38309. )]);
  38310. }
  38311. if (elDescriptions.border) {
  38312. return h('tbody', [h(
  38313. 'tr',
  38314. { 'class': 'el-descriptions-row' },
  38315. [row.map(function (item) {
  38316. var _ref2;
  38317. return [h(
  38318. 'th',
  38319. {
  38320. 'class': (_ref2 = {
  38321. 'el-descriptions-item__cell': true,
  38322. 'el-descriptions-item__label': true,
  38323. 'is-bordered-label': elDescriptions.border
  38324. }, _ref2[item.labelClassName] = true, _ref2),
  38325. style: item.labelStyle,
  38326. attrs: { colSpan: '1'
  38327. }
  38328. },
  38329. [item.label]
  38330. ), h(
  38331. 'td',
  38332. {
  38333. 'class': ['el-descriptions-item__cell', 'el-descriptions-item__content', item.contentClassName],
  38334. style: item.contentStyle,
  38335. attrs: { colSpan: item.props.span * 2 - 1
  38336. }
  38337. },
  38338. [item.slots.default]
  38339. )];
  38340. })]
  38341. )]);
  38342. }
  38343. return h('tbody', [h(
  38344. 'tr',
  38345. { 'class': 'el-descriptions-row' },
  38346. [row.map(function (item) {
  38347. var _ref3;
  38348. return h(
  38349. 'td',
  38350. { 'class': 'el-descriptions-item el-descriptions-item__cell', attrs: { colSpan: item.props.span }
  38351. },
  38352. [h(
  38353. 'div',
  38354. { 'class': 'el-descriptions-item__container' },
  38355. [h(
  38356. 'span',
  38357. {
  38358. 'class': (_ref3 = {
  38359. 'el-descriptions-item__label': true,
  38360. 'has-colon': elDescriptions.colon
  38361. }, _ref3[item.labelClassName] = true, _ref3),
  38362. style: item.labelStyle
  38363. },
  38364. [item.label]
  38365. ), h(
  38366. 'span',
  38367. {
  38368. 'class': ['el-descriptions-item__content', item.contentClassName],
  38369. style: item.contentStyle
  38370. },
  38371. [item.slots.default]
  38372. )]
  38373. )]
  38374. );
  38375. })]
  38376. )]);
  38377. }
  38378. });
  38379. // CONCATENATED MODULE: ./packages/descriptions/src/index.js
  38380. var src_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; };
  38381. var src_components;
  38382. /* harmony default export */ var descriptions_src = ({
  38383. name: 'ElDescriptions',
  38384. components: (src_components = {}, src_components[descriptions_row.name] = descriptions_row, src_components),
  38385. props: {
  38386. border: {
  38387. type: Boolean,
  38388. default: false
  38389. },
  38390. column: {
  38391. type: Number,
  38392. default: 3
  38393. },
  38394. direction: {
  38395. type: String,
  38396. default: 'horizontal'
  38397. },
  38398. size: {
  38399. type: String
  38400. // validator: isValidComponentSize,
  38401. },
  38402. title: {
  38403. type: String,
  38404. default: ''
  38405. },
  38406. extra: {
  38407. type: String,
  38408. default: ''
  38409. },
  38410. labelStyle: {
  38411. type: Object
  38412. },
  38413. contentStyle: {
  38414. type: Object
  38415. },
  38416. labelClassName: {
  38417. type: String,
  38418. default: ''
  38419. },
  38420. contentClassName: {
  38421. type: String,
  38422. default: ''
  38423. },
  38424. colon: {
  38425. type: Boolean,
  38426. default: true
  38427. }
  38428. },
  38429. computed: {
  38430. descriptionsSize: function descriptionsSize() {
  38431. return this.size || (this.$ELEMENT || {}).size;
  38432. }
  38433. },
  38434. provide: function provide() {
  38435. return {
  38436. elDescriptions: this
  38437. };
  38438. },
  38439. methods: {
  38440. getOptionProps: function getOptionProps(vnode) {
  38441. if (vnode.componentOptions) {
  38442. var componentOptions = vnode.componentOptions;
  38443. var _componentOptions$pro = componentOptions.propsData,
  38444. propsData = _componentOptions$pro === undefined ? {} : _componentOptions$pro,
  38445. _componentOptions$Cto = componentOptions.Ctor,
  38446. Ctor = _componentOptions$Cto === undefined ? {} : _componentOptions$Cto;
  38447. var props = (Ctor.options || {}).props || {};
  38448. var res = {};
  38449. for (var k in props) {
  38450. var v = props[k];
  38451. var defaultValue = v.default;
  38452. if (defaultValue !== undefined) {
  38453. res[k] = Object(types_["isFunction"])(defaultValue) ? defaultValue.call(vnode) : defaultValue;
  38454. }
  38455. }
  38456. return src_extends({}, res, propsData);
  38457. }
  38458. return {};
  38459. },
  38460. getSlots: function getSlots(vnode) {
  38461. var _this = this;
  38462. var componentOptions = vnode.componentOptions || {};
  38463. var children = vnode.children || componentOptions.children || [];
  38464. var slots = {};
  38465. children.forEach(function (child) {
  38466. if (!_this.isEmptyElement(child)) {
  38467. var name = child.data && child.data.slot || 'default';
  38468. slots[name] = slots[name] || [];
  38469. if (child.tag === 'template') {
  38470. slots[name].push(child.children);
  38471. } else {
  38472. slots[name].push(child);
  38473. }
  38474. }
  38475. });
  38476. return src_extends({}, slots);
  38477. },
  38478. isEmptyElement: function isEmptyElement(c) {
  38479. return !(c.tag || c.text && c.text.trim() !== '');
  38480. },
  38481. filledNode: function filledNode(node, span, count) {
  38482. var isLast = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  38483. if (!node.props) {
  38484. node.props = {};
  38485. }
  38486. if (span > count) {
  38487. node.props.span = count;
  38488. }
  38489. if (isLast) {
  38490. // set the max span, cause of the last td
  38491. node.props.span = count;
  38492. }
  38493. return node;
  38494. },
  38495. getRows: function getRows() {
  38496. var _this2 = this;
  38497. var children = (this.$slots.default || []).filter(function (vnode) {
  38498. return vnode.tag && vnode.componentOptions && vnode.componentOptions.Ctor.options.name === 'ElDescriptionsItem';
  38499. });
  38500. var nodes = children.map(function (vnode) {
  38501. return {
  38502. props: _this2.getOptionProps(vnode),
  38503. slots: _this2.getSlots(vnode),
  38504. vnode: vnode
  38505. };
  38506. });
  38507. var rows = [];
  38508. var temp = [];
  38509. var count = this.column;
  38510. nodes.forEach(function (node, index) {
  38511. var span = node.props.span || 1;
  38512. if (index === children.length - 1) {
  38513. temp.push(_this2.filledNode(node, span, count, true));
  38514. rows.push(temp);
  38515. return;
  38516. }
  38517. if (span < count) {
  38518. count -= span;
  38519. temp.push(node);
  38520. } else {
  38521. temp.push(_this2.filledNode(node, span, count));
  38522. rows.push(temp);
  38523. count = _this2.column;
  38524. temp = [];
  38525. }
  38526. });
  38527. return rows;
  38528. }
  38529. },
  38530. render: function render() {
  38531. var h = arguments[0];
  38532. var title = this.title,
  38533. extra = this.extra,
  38534. border = this.border,
  38535. descriptionsSize = this.descriptionsSize,
  38536. $slots = this.$slots;
  38537. var rows = this.getRows();
  38538. return h(
  38539. 'div',
  38540. { 'class': 'el-descriptions' },
  38541. [title || extra || $slots.title || $slots.extra ? h(
  38542. 'div',
  38543. { 'class': 'el-descriptions__header' },
  38544. [h(
  38545. 'div',
  38546. { 'class': 'el-descriptions__title' },
  38547. [$slots.title ? $slots.title : title]
  38548. ), h(
  38549. 'div',
  38550. { 'class': 'el-descriptions__extra' },
  38551. [$slots.extra ? $slots.extra : extra]
  38552. )]
  38553. ) : null, h(
  38554. 'div',
  38555. { 'class': 'el-descriptions__body' },
  38556. [h(
  38557. 'table',
  38558. { 'class': ['el-descriptions__table', { 'is-bordered': border }, descriptionsSize ? 'el-descriptions--' + descriptionsSize : ''] },
  38559. [rows.map(function (row) {
  38560. return h(descriptions_row, {
  38561. attrs: { row: row }
  38562. });
  38563. })]
  38564. )]
  38565. )]
  38566. );
  38567. }
  38568. });
  38569. // CONCATENATED MODULE: ./packages/descriptions/index.js
  38570. /* istanbul ignore next */
  38571. descriptions_src.install = function install(Vue) {
  38572. Vue.component(descriptions_src.name, descriptions_src);
  38573. };
  38574. /* harmony default export */ var descriptions = (descriptions_src);
  38575. // CONCATENATED MODULE: ./packages/descriptions/src/descriptions-item.js
  38576. /* harmony default export */ var descriptions_item = ({
  38577. name: 'ElDescriptionsItem',
  38578. props: {
  38579. label: {
  38580. type: String,
  38581. default: ''
  38582. },
  38583. span: {
  38584. type: Number,
  38585. default: 1
  38586. },
  38587. contentClassName: {
  38588. type: String,
  38589. default: ''
  38590. },
  38591. contentStyle: {
  38592. type: Object
  38593. },
  38594. labelClassName: {
  38595. type: String,
  38596. default: ''
  38597. },
  38598. labelStyle: {
  38599. type: Object
  38600. }
  38601. },
  38602. render: function render() {
  38603. return null;
  38604. }
  38605. });
  38606. // CONCATENATED MODULE: ./packages/descriptions-item/index.js
  38607. /* istanbul ignore next */
  38608. descriptions_item.install = function install(Vue) {
  38609. Vue.component(descriptions_item.name, descriptions_item);
  38610. };
  38611. /* harmony default export */ var packages_descriptions_item = (descriptions_item);
  38612. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/result/src/index.vue?vue&type=template&id=3408b139&
  38613. var srcvue_type_template_id_3408b139_render = function() {
  38614. var _vm = this
  38615. var _h = _vm.$createElement
  38616. var _c = _vm._self._c || _h
  38617. return _c("div", { staticClass: "el-result" }, [
  38618. _c(
  38619. "div",
  38620. { staticClass: "el-result__icon" },
  38621. [
  38622. _vm._t("icon", [
  38623. _c(_vm.iconElement, { tag: "component", class: _vm.iconElement })
  38624. ])
  38625. ],
  38626. 2
  38627. ),
  38628. _vm.title || _vm.$slots.title
  38629. ? _c(
  38630. "div",
  38631. { staticClass: "el-result__title" },
  38632. [_vm._t("title", [_c("p", [_vm._v(_vm._s(_vm.title))])])],
  38633. 2
  38634. )
  38635. : _vm._e(),
  38636. _vm.subTitle || _vm.$slots.subTitle
  38637. ? _c(
  38638. "div",
  38639. { staticClass: "el-result__subtitle" },
  38640. [_vm._t("subTitle", [_c("p", [_vm._v(_vm._s(_vm.subTitle))])])],
  38641. 2
  38642. )
  38643. : _vm._e(),
  38644. _vm.$slots.extra
  38645. ? _c("div", { staticClass: "el-result__extra" }, [_vm._t("extra")], 2)
  38646. : _vm._e()
  38647. ])
  38648. }
  38649. var srcvue_type_template_id_3408b139_staticRenderFns = []
  38650. srcvue_type_template_id_3408b139_render._withStripped = true
  38651. // CONCATENATED MODULE: ./packages/result/src/index.vue?vue&type=template&id=3408b139&
  38652. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/result/src/icon-success.vue?vue&type=template&id=18119418&
  38653. var icon_successvue_type_template_id_18119418_render = function() {
  38654. var _vm = this
  38655. var _h = _vm.$createElement
  38656. var _c = _vm._self._c || _h
  38657. return _c(
  38658. "svg",
  38659. { attrs: { viewBox: "0 0 48 48", xmlns: "http://www.w3.org/2000/svg" } },
  38660. [
  38661. _c("path", {
  38662. attrs: {
  38663. d:
  38664. "M24,4 C35.045695,4 44,12.954305 44,24 C44,35.045695 35.045695,44 24,44 C12.954305,44 4,35.045695 4,24 C4,12.954305 12.954305,4 24,4 Z M34.5548098,16.4485711 C33.9612228,15.8504763 32.9988282,15.8504763 32.4052412,16.4485711 L32.4052412,16.4485711 L21.413757,27.5805811 L21.413757,27.5805811 L21.4034642,27.590855 C21.0097542,27.9781674 20.3766105,27.9729811 19.9892981,27.5792711 L19.9892981,27.5792711 L15.5947588,23.1121428 C15.0011718,22.514048 14.0387772,22.514048 13.4451902,23.1121428 C12.8516033,23.7102376 12.8516033,24.6799409 13.4451902,25.2780357 L13.4451902,25.2780357 L19.6260786,31.5514289 C20.2196656,32.1495237 21.1820602,32.1495237 21.7756472,31.5514289 L21.7756472,31.5514289 L34.5548098,18.614464 C35.1483967,18.0163692 35.1483967,17.0466659 34.5548098,16.4485711 Z"
  38665. }
  38666. })
  38667. ]
  38668. )
  38669. }
  38670. var icon_successvue_type_template_id_18119418_staticRenderFns = []
  38671. icon_successvue_type_template_id_18119418_render._withStripped = true
  38672. // CONCATENATED MODULE: ./packages/result/src/icon-success.vue?vue&type=template&id=18119418&
  38673. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/result/src/icon-success.vue?vue&type=script&lang=js&
  38674. //
  38675. //
  38676. //
  38677. //
  38678. //
  38679. //
  38680. //
  38681. //
  38682. /* harmony default export */ var icon_successvue_type_script_lang_js_ = ({
  38683. name: 'IconSuccess'
  38684. });
  38685. // CONCATENATED MODULE: ./packages/result/src/icon-success.vue?vue&type=script&lang=js&
  38686. /* harmony default export */ var src_icon_successvue_type_script_lang_js_ = (icon_successvue_type_script_lang_js_);
  38687. // CONCATENATED MODULE: ./packages/result/src/icon-success.vue
  38688. /* normalize component */
  38689. var icon_success_component = normalizeComponent(
  38690. src_icon_successvue_type_script_lang_js_,
  38691. icon_successvue_type_template_id_18119418_render,
  38692. icon_successvue_type_template_id_18119418_staticRenderFns,
  38693. false,
  38694. null,
  38695. null,
  38696. null
  38697. )
  38698. /* hot reload */
  38699. if (false) { var icon_success_api; }
  38700. icon_success_component.options.__file = "packages/result/src/icon-success.vue"
  38701. /* harmony default export */ var icon_success = (icon_success_component.exports);
  38702. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/result/src/icon-error.vue?vue&type=template&id=21199246&
  38703. var icon_errorvue_type_template_id_21199246_render = function() {
  38704. var _vm = this
  38705. var _h = _vm.$createElement
  38706. var _c = _vm._self._c || _h
  38707. return _c(
  38708. "svg",
  38709. { attrs: { viewBox: "0 0 48 48", xmlns: "http://www.w3.org/2000/svg" } },
  38710. [
  38711. _c("path", {
  38712. attrs: {
  38713. d:
  38714. "M24,4 C35.045695,4 44,12.954305 44,24 C44,35.045695 35.045695,44 24,44 C12.954305,44 4,35.045695 4,24 C4,12.954305 12.954305,4 24,4 Z M32.57818,15.42182 C32.0157534,14.8593933 31.1038797,14.8593933 30.541453,15.42182 L30.541453,15.42182 L24.0006789,21.9625941 L17.458547,15.42182 C16.8961203,14.8593933 15.9842466,14.8593933 15.42182,15.42182 C14.8593933,15.9842466 14.8593933,16.8961203 15.42182,17.458547 L15.42182,17.458547 L21.9639519,23.9993211 L15.42182,30.541453 C14.8593933,31.1038797 14.8593933,32.0157534 15.42182,32.57818 C15.9842466,33.1406067 16.8961203,33.1406067 17.458547,32.57818 L17.458547,32.57818 L24.0006789,26.0360481 L30.541453,32.57818 C31.1038797,33.1406067 32.0157534,33.1406067 32.57818,32.57818 C33.1406067,32.0157534 33.1406067,31.1038797 32.57818,30.541453 L32.57818,30.541453 L26.0374059,23.9993211 L32.57818,17.458547 C33.1406067,16.8961203 33.1406067,15.9842466 32.57818,15.42182 Z"
  38715. }
  38716. })
  38717. ]
  38718. )
  38719. }
  38720. var icon_errorvue_type_template_id_21199246_staticRenderFns = []
  38721. icon_errorvue_type_template_id_21199246_render._withStripped = true
  38722. // CONCATENATED MODULE: ./packages/result/src/icon-error.vue?vue&type=template&id=21199246&
  38723. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/result/src/icon-error.vue?vue&type=script&lang=js&
  38724. //
  38725. //
  38726. //
  38727. //
  38728. //
  38729. //
  38730. //
  38731. //
  38732. /* harmony default export */ var icon_errorvue_type_script_lang_js_ = ({
  38733. name: 'IconError'
  38734. });
  38735. // CONCATENATED MODULE: ./packages/result/src/icon-error.vue?vue&type=script&lang=js&
  38736. /* harmony default export */ var src_icon_errorvue_type_script_lang_js_ = (icon_errorvue_type_script_lang_js_);
  38737. // CONCATENATED MODULE: ./packages/result/src/icon-error.vue
  38738. /* normalize component */
  38739. var icon_error_component = normalizeComponent(
  38740. src_icon_errorvue_type_script_lang_js_,
  38741. icon_errorvue_type_template_id_21199246_render,
  38742. icon_errorvue_type_template_id_21199246_staticRenderFns,
  38743. false,
  38744. null,
  38745. null,
  38746. null
  38747. )
  38748. /* hot reload */
  38749. if (false) { var icon_error_api; }
  38750. icon_error_component.options.__file = "packages/result/src/icon-error.vue"
  38751. /* harmony default export */ var icon_error = (icon_error_component.exports);
  38752. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/result/src/icon-warning.vue?vue&type=template&id=46fe8f31&
  38753. var icon_warningvue_type_template_id_46fe8f31_render = function() {
  38754. var _vm = this
  38755. var _h = _vm.$createElement
  38756. var _c = _vm._self._c || _h
  38757. return _c(
  38758. "svg",
  38759. { attrs: { viewBox: "0 0 48 48", xmlns: "http://www.w3.org/2000/svg" } },
  38760. [
  38761. _c("path", {
  38762. attrs: {
  38763. d:
  38764. "M24,4 C35.045695,4 44,12.954305 44,24 C44,35.045695 35.045695,44 24,44 C12.954305,44 4,35.045695 4,24 C4,12.954305 12.954305,4 24,4 Z M24,31 C22.8954305,31 22,31.8954305 22,33 C22,34.1045695 22.8954305,35 24,35 C25.1045695,35 26,34.1045695 26,33 C26,31.8954305 25.1045695,31 24,31 Z M24,14 C23.1715729,14 22.5,14.6715729 22.5,15.5 L22.5,15.5 L22.5,27.5 C22.5,28.3284271 23.1715729,29 24,29 C24.8284271,29 25.5,28.3284271 25.5,27.5 L25.5,27.5 L25.5,15.5 C25.5,14.6715729 24.8284271,14 24,14 Z"
  38765. }
  38766. })
  38767. ]
  38768. )
  38769. }
  38770. var icon_warningvue_type_template_id_46fe8f31_staticRenderFns = []
  38771. icon_warningvue_type_template_id_46fe8f31_render._withStripped = true
  38772. // CONCATENATED MODULE: ./packages/result/src/icon-warning.vue?vue&type=template&id=46fe8f31&
  38773. // CONCATENATED MODULE: ./node_modules/vue-loader/lib??vue-loader-options!./packages/result/src/icon-warning.vue?vue&type=script&lang=ts&
  38774. /* harmony default export */ var icon_warningvue_type_script_lang_ts_ = ({
  38775. name: 'IconWarning'
  38776. });
  38777. // CONCATENATED MODULE: ./packages/result/src/icon-warning.vue?vue&type=script&lang=ts&
  38778. /* harmony default export */ var src_icon_warningvue_type_script_lang_ts_ = (icon_warningvue_type_script_lang_ts_);
  38779. // CONCATENATED MODULE: ./packages/result/src/icon-warning.vue
  38780. /* normalize component */
  38781. var icon_warning_component = normalizeComponent(
  38782. src_icon_warningvue_type_script_lang_ts_,
  38783. icon_warningvue_type_template_id_46fe8f31_render,
  38784. icon_warningvue_type_template_id_46fe8f31_staticRenderFns,
  38785. false,
  38786. null,
  38787. null,
  38788. null
  38789. )
  38790. /* hot reload */
  38791. if (false) { var icon_warning_api; }
  38792. icon_warning_component.options.__file = "packages/result/src/icon-warning.vue"
  38793. /* harmony default export */ var icon_warning = (icon_warning_component.exports);
  38794. // CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/result/src/icon-info.vue?vue&type=template&id=19e3de69&
  38795. var icon_infovue_type_template_id_19e3de69_render = function() {
  38796. var _vm = this
  38797. var _h = _vm.$createElement
  38798. var _c = _vm._self._c || _h
  38799. return _c(
  38800. "svg",
  38801. { attrs: { viewBox: "0 0 48 48", xmlns: "http://www.w3.org/2000/svg" } },
  38802. [
  38803. _c("path", {
  38804. attrs: {
  38805. d:
  38806. "M24,4 C35.045695,4 44,12.954305 44,24 C44,35.045695 35.045695,44 24,44 C12.954305,44 4,35.045695 4,24 C4,12.954305 12.954305,4 24,4 Z M24,19 L21,19 C20.1715729,19 19.5,19.6715729 19.5,20.5 C19.5,21.3284271 20.1715729,22 21,22 L21,22 L22.5,22 L22.5,31 L21,31 C20.1715729,31 19.5,31.6715729 19.5,32.5 C19.5,33.3284271 20.1715729,34 21,34 L21,34 L27,34 C27.8284271,34 28.5,33.3284271 28.5,32.5 C28.5,31.6715729 27.8284271,31 27,31 L27,31 L25.5,31 L25.5,20.5 C25.5,19.6715729 24.8284271,19 24,19 L24,19 Z M24,13 C22.8954305,13 22,13.8954305 22,15 C22,16.1045695 22.8954305,17 24,17 C25.1045695,17 26,16.1045695 26,15 C26,13.8954305 25.1045695,13 24,13 Z"
  38807. }
  38808. })
  38809. ]
  38810. )
  38811. }
  38812. var icon_infovue_type_template_id_19e3de69_staticRenderFns = []
  38813. icon_infovue_type_template_id_19e3de69_render._withStripped = true
  38814. // CONCATENATED MODULE: ./packages/result/src/icon-info.vue?vue&type=template&id=19e3de69&
  38815. // CONCATENATED MODULE: ./node_modules/vue-loader/lib??vue-loader-options!./packages/result/src/icon-info.vue?vue&type=script&lang=ts&
  38816. /* harmony default export */ var icon_infovue_type_script_lang_ts_ = ({
  38817. name: 'IconInfo'
  38818. });
  38819. // CONCATENATED MODULE: ./packages/result/src/icon-info.vue?vue&type=script&lang=ts&
  38820. /* harmony default export */ var src_icon_infovue_type_script_lang_ts_ = (icon_infovue_type_script_lang_ts_);
  38821. // CONCATENATED MODULE: ./packages/result/src/icon-info.vue
  38822. /* normalize component */
  38823. var icon_info_component = normalizeComponent(
  38824. src_icon_infovue_type_script_lang_ts_,
  38825. icon_infovue_type_template_id_19e3de69_render,
  38826. icon_infovue_type_template_id_19e3de69_staticRenderFns,
  38827. false,
  38828. null,
  38829. null,
  38830. null
  38831. )
  38832. /* hot reload */
  38833. if (false) { var icon_info_api; }
  38834. icon_info_component.options.__file = "packages/result/src/icon-info.vue"
  38835. /* harmony default export */ var icon_info = (icon_info_component.exports);
  38836. // CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/result/src/index.vue?vue&type=script&lang=js&
  38837. var result_srcvue_type_script_lang_js_components;
  38838. //
  38839. //
  38840. //
  38841. //
  38842. //
  38843. //
  38844. //
  38845. //
  38846. //
  38847. //
  38848. //
  38849. //
  38850. //
  38851. //
  38852. //
  38853. //
  38854. //
  38855. //
  38856. //
  38857. //
  38858. //
  38859. //
  38860. var IconMap = {
  38861. success: 'icon-success',
  38862. warning: 'icon-warning',
  38863. error: 'icon-error',
  38864. info: 'icon-info'
  38865. };
  38866. /* harmony default export */ var result_srcvue_type_script_lang_js_ = ({
  38867. name: 'ElResult',
  38868. components: (result_srcvue_type_script_lang_js_components = {}, result_srcvue_type_script_lang_js_components[icon_success.name] = icon_success, result_srcvue_type_script_lang_js_components[icon_error.name] = icon_error, result_srcvue_type_script_lang_js_components[icon_warning.name] = icon_warning, result_srcvue_type_script_lang_js_components[icon_info.name] = icon_info, result_srcvue_type_script_lang_js_components),
  38869. props: {
  38870. title: {
  38871. type: String,
  38872. default: ''
  38873. },
  38874. subTitle: {
  38875. type: String,
  38876. default: ''
  38877. },
  38878. icon: {
  38879. type: String,
  38880. default: 'info'
  38881. }
  38882. },
  38883. computed: {
  38884. iconElement: function iconElement() {
  38885. var icon = this.icon;
  38886. return icon && IconMap[icon] ? IconMap[icon] : 'icon-info';
  38887. }
  38888. }
  38889. });
  38890. // CONCATENATED MODULE: ./packages/result/src/index.vue?vue&type=script&lang=js&
  38891. /* harmony default export */ var packages_result_srcvue_type_script_lang_js_ = (result_srcvue_type_script_lang_js_);
  38892. // CONCATENATED MODULE: ./packages/result/src/index.vue
  38893. /* normalize component */
  38894. var result_src_component = normalizeComponent(
  38895. packages_result_srcvue_type_script_lang_js_,
  38896. srcvue_type_template_id_3408b139_render,
  38897. srcvue_type_template_id_3408b139_staticRenderFns,
  38898. false,
  38899. null,
  38900. null,
  38901. null
  38902. )
  38903. /* hot reload */
  38904. if (false) { var result_src_api; }
  38905. result_src_component.options.__file = "packages/result/src/index.vue"
  38906. /* harmony default export */ var result_src = (result_src_component.exports);
  38907. // CONCATENATED MODULE: ./packages/result/index.js
  38908. /* istanbul ignore next */
  38909. result_src.install = function (Vue) {
  38910. Vue.component(result_src.name, result_src);
  38911. };
  38912. /* harmony default export */ var packages_result = (result_src);
  38913. // CONCATENATED MODULE: ./src/index.js
  38914. /* Automatically generated by './build/bin/build-entry.js' */
  38915. var components = [packages_pagination, dialog, packages_autocomplete, packages_dropdown, packages_dropdown_menu, packages_dropdown_item, packages_menu, packages_submenu, packages_menu_item, packages_menu_item_group, packages_input, packages_input_number, packages_radio, packages_radio_group, packages_radio_button, packages_checkbox, packages_checkbox_button, packages_checkbox_group, packages_switch, packages_select, packages_option, packages_option_group, packages_button, packages_button_group, packages_table, packages_table_column, packages_date_picker, packages_time_select, packages_time_picker, popover, packages_tooltip, packages_breadcrumb, packages_breadcrumb_item, packages_form, packages_form_item, packages_tabs, packages_tab_pane, packages_tag, packages_tree, packages_alert, slider, packages_icon, packages_row, packages_col, packages_upload, packages_progress, packages_spinner, badge, card, packages_rate, packages_steps, packages_step, carousel, scrollbar, carousel_item, packages_collapse, packages_collapse_item, packages_cascader, color_picker, transfer, packages_container, header, aside, packages_main, footer, timeline, timeline_item, packages_link, divider, packages_image, calendar, backtop, page_header, packages_cascader_panel, avatar, drawer, statistic, popconfirm, skeleton, skeleton_item, empty, descriptions, packages_descriptions_item, packages_result, collapse_transition_default.a];
  38916. var src_install = function install(Vue) {
  38917. var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  38918. lib_locale_default.a.use(opts.locale);
  38919. lib_locale_default.a.i18n(opts.i18n);
  38920. components.forEach(function (component) {
  38921. Vue.component(component.name, component);
  38922. });
  38923. Vue.use(infinite_scroll);
  38924. Vue.use(packages_loading.directive);
  38925. Vue.prototype.$ELEMENT = {
  38926. size: opts.size || '',
  38927. zIndex: opts.zIndex || 2000
  38928. };
  38929. Vue.prototype.$loading = packages_loading.service;
  38930. Vue.prototype.$msgbox = message_box;
  38931. Vue.prototype.$alert = message_box.alert;
  38932. Vue.prototype.$confirm = message_box.confirm;
  38933. Vue.prototype.$prompt = message_box.prompt;
  38934. Vue.prototype.$notify = notification;
  38935. Vue.prototype.$message = packages_message;
  38936. };
  38937. /* istanbul ignore if */
  38938. if (typeof window !== 'undefined' && window.Vue) {
  38939. src_install(window.Vue);
  38940. }
  38941. /* harmony default export */ var src_0 = __webpack_exports__["default"] = ({
  38942. version: '2.15.14',
  38943. locale: lib_locale_default.a.use,
  38944. i18n: lib_locale_default.a.i18n,
  38945. install: src_install,
  38946. CollapseTransition: collapse_transition_default.a,
  38947. Loading: packages_loading,
  38948. Pagination: packages_pagination,
  38949. Dialog: dialog,
  38950. Autocomplete: packages_autocomplete,
  38951. Dropdown: packages_dropdown,
  38952. DropdownMenu: packages_dropdown_menu,
  38953. DropdownItem: packages_dropdown_item,
  38954. Menu: packages_menu,
  38955. Submenu: packages_submenu,
  38956. MenuItem: packages_menu_item,
  38957. MenuItemGroup: packages_menu_item_group,
  38958. Input: packages_input,
  38959. InputNumber: packages_input_number,
  38960. Radio: packages_radio,
  38961. RadioGroup: packages_radio_group,
  38962. RadioButton: packages_radio_button,
  38963. Checkbox: packages_checkbox,
  38964. CheckboxButton: packages_checkbox_button,
  38965. CheckboxGroup: packages_checkbox_group,
  38966. Switch: packages_switch,
  38967. Select: packages_select,
  38968. Option: packages_option,
  38969. OptionGroup: packages_option_group,
  38970. Button: packages_button,
  38971. ButtonGroup: packages_button_group,
  38972. Table: packages_table,
  38973. TableColumn: packages_table_column,
  38974. DatePicker: packages_date_picker,
  38975. TimeSelect: packages_time_select,
  38976. TimePicker: packages_time_picker,
  38977. Popover: popover,
  38978. Tooltip: packages_tooltip,
  38979. MessageBox: message_box,
  38980. Breadcrumb: packages_breadcrumb,
  38981. BreadcrumbItem: packages_breadcrumb_item,
  38982. Form: packages_form,
  38983. FormItem: packages_form_item,
  38984. Tabs: packages_tabs,
  38985. TabPane: packages_tab_pane,
  38986. Tag: packages_tag,
  38987. Tree: packages_tree,
  38988. Alert: packages_alert,
  38989. Notification: notification,
  38990. Slider: slider,
  38991. Icon: packages_icon,
  38992. Row: packages_row,
  38993. Col: packages_col,
  38994. Upload: packages_upload,
  38995. Progress: packages_progress,
  38996. Spinner: packages_spinner,
  38997. Message: packages_message,
  38998. Badge: badge,
  38999. Card: card,
  39000. Rate: packages_rate,
  39001. Steps: packages_steps,
  39002. Step: packages_step,
  39003. Carousel: carousel,
  39004. Scrollbar: scrollbar,
  39005. CarouselItem: carousel_item,
  39006. Collapse: packages_collapse,
  39007. CollapseItem: packages_collapse_item,
  39008. Cascader: packages_cascader,
  39009. ColorPicker: color_picker,
  39010. Transfer: transfer,
  39011. Container: packages_container,
  39012. Header: header,
  39013. Aside: aside,
  39014. Main: packages_main,
  39015. Footer: footer,
  39016. Timeline: timeline,
  39017. TimelineItem: timeline_item,
  39018. Link: packages_link,
  39019. Divider: divider,
  39020. Image: packages_image,
  39021. Calendar: calendar,
  39022. Backtop: backtop,
  39023. InfiniteScroll: infinite_scroll,
  39024. PageHeader: page_header,
  39025. CascaderPanel: packages_cascader_panel,
  39026. Avatar: avatar,
  39027. Drawer: drawer,
  39028. Statistic: statistic,
  39029. Popconfirm: popconfirm,
  39030. Skeleton: skeleton,
  39031. SkeletonItem: skeleton_item,
  39032. Empty: empty,
  39033. Descriptions: descriptions,
  39034. DescriptionsItem: packages_descriptions_item,
  39035. Result: packages_result
  39036. });
  39037. /***/ })
  39038. /******/ ])["default"];