element-ui.common.js 1.2 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871
  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. // CONCATENATED MODULE: ./packages/table/src/store/expand.js
  9212. /* harmony default export */ var expand = ({
  9213. data: function data() {
  9214. return {
  9215. states: {
  9216. defaultExpandAll: false,
  9217. expandRows: []
  9218. }
  9219. };
  9220. },
  9221. methods: {
  9222. updateExpandRows: function updateExpandRows() {
  9223. var _states = this.states,
  9224. _states$data = _states.data,
  9225. data = _states$data === undefined ? [] : _states$data,
  9226. rowKey = _states.rowKey,
  9227. defaultExpandAll = _states.defaultExpandAll,
  9228. expandRows = _states.expandRows;
  9229. if (defaultExpandAll) {
  9230. this.states.expandRows = data.slice();
  9231. } else if (rowKey) {
  9232. // TODO:这里的代码可以优化
  9233. var expandRowsMap = getKeysMap(expandRows, rowKey);
  9234. this.states.expandRows = data.reduce(function (prev, row) {
  9235. var rowId = getRowIdentity(row, rowKey);
  9236. var rowInfo = expandRowsMap[rowId];
  9237. if (rowInfo) {
  9238. prev.push(row);
  9239. }
  9240. return prev;
  9241. }, []);
  9242. } else {
  9243. this.states.expandRows = [];
  9244. }
  9245. },
  9246. toggleRowExpansion: function toggleRowExpansion(row, expanded) {
  9247. var changed = toggleRowStatus(this.states.expandRows, row, expanded);
  9248. if (changed) {
  9249. this.table.$emit('expand-change', row, this.states.expandRows.slice());
  9250. this.scheduleLayout();
  9251. }
  9252. },
  9253. setExpandRowKeys: function setExpandRowKeys(rowKeys) {
  9254. this.assertRowKey();
  9255. // TODO:这里的代码可以优化
  9256. var _states2 = this.states,
  9257. data = _states2.data,
  9258. rowKey = _states2.rowKey;
  9259. var keysMap = getKeysMap(data, rowKey);
  9260. this.states.expandRows = rowKeys.reduce(function (prev, cur) {
  9261. var info = keysMap[cur];
  9262. if (info) {
  9263. prev.push(info.row);
  9264. }
  9265. return prev;
  9266. }, []);
  9267. },
  9268. isRowExpanded: function isRowExpanded(row) {
  9269. var _states3 = this.states,
  9270. _states3$expandRows = _states3.expandRows,
  9271. expandRows = _states3$expandRows === undefined ? [] : _states3$expandRows,
  9272. rowKey = _states3.rowKey;
  9273. if (rowKey) {
  9274. var expandMap = getKeysMap(expandRows, rowKey);
  9275. return !!expandMap[getRowIdentity(row, rowKey)];
  9276. }
  9277. return expandRows.indexOf(row) !== -1;
  9278. }
  9279. }
  9280. });
  9281. // CONCATENATED MODULE: ./packages/table/src/store/current.js
  9282. /* harmony default export */ var store_current = ({
  9283. data: function data() {
  9284. return {
  9285. states: {
  9286. // 不可响应的,设置 currentRowKey 时,data 不一定存在,也许无法算出正确的 currentRow
  9287. // 把该值缓存一下,当用户点击修改 currentRow 时,把该值重置为 null
  9288. _currentRowKey: null,
  9289. currentRow: null
  9290. }
  9291. };
  9292. },
  9293. methods: {
  9294. setCurrentRowKey: function setCurrentRowKey(key) {
  9295. this.assertRowKey();
  9296. this.states._currentRowKey = key;
  9297. this.setCurrentRowByKey(key);
  9298. },
  9299. restoreCurrentRowKey: function restoreCurrentRowKey() {
  9300. this.states._currentRowKey = null;
  9301. },
  9302. setCurrentRowByKey: function setCurrentRowByKey(key) {
  9303. var states = this.states;
  9304. var _states$data = states.data,
  9305. data = _states$data === undefined ? [] : _states$data,
  9306. rowKey = states.rowKey;
  9307. var currentRow = null;
  9308. if (rowKey) {
  9309. currentRow = Object(util_["arrayFind"])(data, function (item) {
  9310. return getRowIdentity(item, rowKey) === key;
  9311. });
  9312. }
  9313. states.currentRow = currentRow;
  9314. },
  9315. updateCurrentRow: function updateCurrentRow(currentRow) {
  9316. var states = this.states,
  9317. table = this.table;
  9318. var oldCurrentRow = states.currentRow;
  9319. if (currentRow && currentRow !== oldCurrentRow) {
  9320. states.currentRow = currentRow;
  9321. table.$emit('current-change', currentRow, oldCurrentRow);
  9322. return;
  9323. }
  9324. if (!currentRow && oldCurrentRow) {
  9325. states.currentRow = null;
  9326. table.$emit('current-change', null, oldCurrentRow);
  9327. }
  9328. },
  9329. updateCurrentRowData: function updateCurrentRowData() {
  9330. var states = this.states,
  9331. table = this.table;
  9332. var rowKey = states.rowKey,
  9333. _currentRowKey = states._currentRowKey;
  9334. // data 为 null 时,解构时的默认值会被忽略
  9335. var data = states.data || [];
  9336. var oldCurrentRow = states.currentRow;
  9337. // 当 currentRow 不在 data 中时尝试更新数据
  9338. if (data.indexOf(oldCurrentRow) === -1 && oldCurrentRow) {
  9339. if (rowKey) {
  9340. var currentRowKey = getRowIdentity(oldCurrentRow, rowKey);
  9341. this.setCurrentRowByKey(currentRowKey);
  9342. } else {
  9343. states.currentRow = null;
  9344. }
  9345. if (states.currentRow === null) {
  9346. table.$emit('current-change', null, oldCurrentRow);
  9347. }
  9348. } else if (_currentRowKey) {
  9349. // 把初始时下设置的 rowKey 转化成 rowData
  9350. this.setCurrentRowByKey(_currentRowKey);
  9351. this.restoreCurrentRowKey();
  9352. }
  9353. }
  9354. }
  9355. });
  9356. // CONCATENATED MODULE: ./packages/table/src/store/tree.js
  9357. 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; };
  9358. /* harmony default export */ var tree = ({
  9359. data: function data() {
  9360. return {
  9361. states: {
  9362. // defaultExpandAll 存在于 expand.js 中,这里不重复添加
  9363. // 在展开行中,expandRowKeys 会被转化成 expandRows,expandRowKeys 这个属性只是记录了 TreeTable 行的展开
  9364. // TODO: 拆分为独立的 TreeTable,统一用法
  9365. expandRowKeys: [],
  9366. treeData: {},
  9367. indent: 16,
  9368. lazy: false,
  9369. lazyTreeNodeMap: {},
  9370. lazyColumnIdentifier: 'hasChildren',
  9371. childrenColumnName: 'children'
  9372. }
  9373. };
  9374. },
  9375. computed: {
  9376. // 嵌入型的数据,watch 无法是检测到变化 https://github.com/ElemeFE/element/issues/14998
  9377. // TODO: 使用 computed 解决该问题,是否会造成性能问题?
  9378. // @return { id: { level, children } }
  9379. normalizedData: function normalizedData() {
  9380. if (!this.states.rowKey) return {};
  9381. var data = this.states.data || [];
  9382. return this.normalize(data);
  9383. },
  9384. // @return { id: { children } }
  9385. // 针对懒加载的情形,不处理嵌套数据
  9386. normalizedLazyNode: function normalizedLazyNode() {
  9387. var _states = this.states,
  9388. rowKey = _states.rowKey,
  9389. lazyTreeNodeMap = _states.lazyTreeNodeMap,
  9390. lazyColumnIdentifier = _states.lazyColumnIdentifier;
  9391. var keys = Object.keys(lazyTreeNodeMap);
  9392. var res = {};
  9393. if (!keys.length) return res;
  9394. keys.forEach(function (key) {
  9395. if (lazyTreeNodeMap[key].length) {
  9396. var item = { children: [] };
  9397. lazyTreeNodeMap[key].forEach(function (row) {
  9398. var currentRowKey = getRowIdentity(row, rowKey);
  9399. item.children.push(currentRowKey);
  9400. if (row[lazyColumnIdentifier] && !res[currentRowKey]) {
  9401. res[currentRowKey] = { children: [] };
  9402. }
  9403. });
  9404. res[key] = item;
  9405. }
  9406. });
  9407. return res;
  9408. }
  9409. },
  9410. watch: {
  9411. normalizedData: 'updateTreeData',
  9412. normalizedLazyNode: 'updateTreeData'
  9413. },
  9414. methods: {
  9415. normalize: function normalize(data) {
  9416. var _states2 = this.states,
  9417. childrenColumnName = _states2.childrenColumnName,
  9418. lazyColumnIdentifier = _states2.lazyColumnIdentifier,
  9419. rowKey = _states2.rowKey,
  9420. lazy = _states2.lazy;
  9421. var res = {};
  9422. walkTreeNode(data, function (parent, children, level) {
  9423. var parentId = getRowIdentity(parent, rowKey);
  9424. if (Array.isArray(children)) {
  9425. res[parentId] = {
  9426. children: children.map(function (row) {
  9427. return getRowIdentity(row, rowKey);
  9428. }),
  9429. level: level
  9430. };
  9431. } else if (lazy) {
  9432. // 当 children 不存在且 lazy 为 true,该节点即为懒加载的节点
  9433. res[parentId] = {
  9434. children: [],
  9435. lazy: true,
  9436. level: level
  9437. };
  9438. }
  9439. }, childrenColumnName, lazyColumnIdentifier);
  9440. return res;
  9441. },
  9442. updateTreeData: function updateTreeData() {
  9443. var nested = this.normalizedData;
  9444. var normalizedLazyNode = this.normalizedLazyNode;
  9445. var keys = Object.keys(nested);
  9446. var newTreeData = {};
  9447. if (keys.length) {
  9448. var _states3 = this.states,
  9449. oldTreeData = _states3.treeData,
  9450. defaultExpandAll = _states3.defaultExpandAll,
  9451. expandRowKeys = _states3.expandRowKeys,
  9452. lazy = _states3.lazy;
  9453. var rootLazyRowKeys = [];
  9454. var getExpanded = function getExpanded(oldValue, key) {
  9455. var included = defaultExpandAll || expandRowKeys && expandRowKeys.indexOf(key) !== -1;
  9456. return !!(oldValue && oldValue.expanded || included);
  9457. };
  9458. // 合并 expanded 与 display,确保数据刷新后,状态不变
  9459. keys.forEach(function (key) {
  9460. var oldValue = oldTreeData[key];
  9461. var newValue = _extends({}, nested[key]);
  9462. newValue.expanded = getExpanded(oldValue, key);
  9463. if (newValue.lazy) {
  9464. var _ref = oldValue || {},
  9465. _ref$loaded = _ref.loaded,
  9466. loaded = _ref$loaded === undefined ? false : _ref$loaded,
  9467. _ref$loading = _ref.loading,
  9468. loading = _ref$loading === undefined ? false : _ref$loading;
  9469. newValue.loaded = !!loaded;
  9470. newValue.loading = !!loading;
  9471. rootLazyRowKeys.push(key);
  9472. }
  9473. newTreeData[key] = newValue;
  9474. });
  9475. // 根据懒加载数据更新 treeData
  9476. var lazyKeys = Object.keys(normalizedLazyNode);
  9477. if (lazy && lazyKeys.length && rootLazyRowKeys.length) {
  9478. lazyKeys.forEach(function (key) {
  9479. var oldValue = oldTreeData[key];
  9480. var lazyNodeChildren = normalizedLazyNode[key].children;
  9481. if (rootLazyRowKeys.indexOf(key) !== -1) {
  9482. // 懒加载的 root 节点,更新一下原有的数据,原来的 children 一定是空数组
  9483. if (newTreeData[key].children.length !== 0) {
  9484. throw new Error('[ElTable]children must be an empty array.');
  9485. }
  9486. newTreeData[key].children = lazyNodeChildren;
  9487. } else {
  9488. var _ref2 = oldValue || {},
  9489. _ref2$loaded = _ref2.loaded,
  9490. loaded = _ref2$loaded === undefined ? false : _ref2$loaded,
  9491. _ref2$loading = _ref2.loading,
  9492. loading = _ref2$loading === undefined ? false : _ref2$loading;
  9493. newTreeData[key] = {
  9494. lazy: true,
  9495. loaded: !!loaded,
  9496. loading: !!loading,
  9497. expanded: getExpanded(oldValue, key),
  9498. children: lazyNodeChildren,
  9499. level: ''
  9500. };
  9501. }
  9502. });
  9503. }
  9504. }
  9505. this.states.treeData = newTreeData;
  9506. this.updateTableScrollY();
  9507. },
  9508. updateTreeExpandKeys: function updateTreeExpandKeys(value) {
  9509. this.states.expandRowKeys = value;
  9510. this.updateTreeData();
  9511. },
  9512. toggleTreeExpansion: function toggleTreeExpansion(row, expanded) {
  9513. this.assertRowKey();
  9514. var _states4 = this.states,
  9515. rowKey = _states4.rowKey,
  9516. treeData = _states4.treeData;
  9517. var id = getRowIdentity(row, rowKey);
  9518. var data = id && treeData[id];
  9519. if (id && data && 'expanded' in data) {
  9520. var oldExpanded = data.expanded;
  9521. expanded = typeof expanded === 'undefined' ? !data.expanded : expanded;
  9522. treeData[id].expanded = expanded;
  9523. if (oldExpanded !== expanded) {
  9524. this.table.$emit('expand-change', row, expanded);
  9525. }
  9526. this.updateTableScrollY();
  9527. }
  9528. },
  9529. loadOrToggle: function loadOrToggle(row) {
  9530. this.assertRowKey();
  9531. var _states5 = this.states,
  9532. lazy = _states5.lazy,
  9533. treeData = _states5.treeData,
  9534. rowKey = _states5.rowKey;
  9535. var id = getRowIdentity(row, rowKey);
  9536. var data = treeData[id];
  9537. if (lazy && data && 'loaded' in data && !data.loaded) {
  9538. this.loadData(row, id, data);
  9539. } else {
  9540. this.toggleTreeExpansion(row);
  9541. }
  9542. },
  9543. loadData: function loadData(row, key, treeNode) {
  9544. var _this = this;
  9545. var load = this.table.load;
  9546. var rawTreeData = this.states.treeData;
  9547. if (load && !rawTreeData[key].loaded) {
  9548. rawTreeData[key].loading = true;
  9549. load(row, treeNode, function (data) {
  9550. if (!Array.isArray(data)) {
  9551. throw new Error('[ElTable] data must be an array');
  9552. }
  9553. var _states6 = _this.states,
  9554. lazyTreeNodeMap = _states6.lazyTreeNodeMap,
  9555. treeData = _states6.treeData;
  9556. treeData[key].loading = false;
  9557. treeData[key].loaded = true;
  9558. treeData[key].expanded = true;
  9559. if (data.length) {
  9560. _this.$set(lazyTreeNodeMap, key, data);
  9561. }
  9562. _this.table.$emit('expand-change', row, true);
  9563. });
  9564. }
  9565. }
  9566. }
  9567. });
  9568. // CONCATENATED MODULE: ./packages/table/src/store/watcher.js
  9569. var watcher_sortData = function sortData(data, states) {
  9570. var sortingColumn = states.sortingColumn;
  9571. if (!sortingColumn || typeof sortingColumn.sortable === 'string') {
  9572. return data;
  9573. }
  9574. return util_orderBy(data, states.sortProp, states.sortOrder, sortingColumn.sortMethod, sortingColumn.sortBy);
  9575. };
  9576. var doFlattenColumns = function doFlattenColumns(columns) {
  9577. var result = [];
  9578. columns.forEach(function (column) {
  9579. if (column.children) {
  9580. result.push.apply(result, doFlattenColumns(column.children));
  9581. } else {
  9582. result.push(column);
  9583. }
  9584. });
  9585. return result;
  9586. };
  9587. /* harmony default export */ var watcher = (external_vue_default.a.extend({
  9588. data: function data() {
  9589. return {
  9590. states: {
  9591. // 3.0 版本后要求必须设置该属性
  9592. rowKey: null,
  9593. // 渲染的数据来源,是对 table 中的 data 过滤排序后的结果
  9594. data: [],
  9595. // 是否包含固定列
  9596. isComplex: false,
  9597. // 列
  9598. _columns: [], // 不可响应的
  9599. originColumns: [],
  9600. columns: [],
  9601. fixedColumns: [],
  9602. rightFixedColumns: [],
  9603. leafColumns: [],
  9604. fixedLeafColumns: [],
  9605. rightFixedLeafColumns: [],
  9606. leafColumnsLength: 0,
  9607. fixedLeafColumnsLength: 0,
  9608. rightFixedLeafColumnsLength: 0,
  9609. // 选择
  9610. isAllSelected: false,
  9611. selection: [],
  9612. reserveSelection: false,
  9613. selectOnIndeterminate: false,
  9614. selectable: null,
  9615. // 过滤
  9616. filters: {}, // 不可响应的
  9617. filteredData: null,
  9618. // 排序
  9619. sortingColumn: null,
  9620. sortProp: null,
  9621. sortOrder: null,
  9622. hoverRow: null
  9623. }
  9624. };
  9625. },
  9626. mixins: [expand, store_current, tree],
  9627. methods: {
  9628. // 检查 rowKey 是否存在
  9629. assertRowKey: function assertRowKey() {
  9630. var rowKey = this.states.rowKey;
  9631. if (!rowKey) throw new Error('[ElTable] prop row-key is required');
  9632. },
  9633. // 更新列
  9634. updateColumns: function updateColumns() {
  9635. var states = this.states;
  9636. var _columns = states._columns || [];
  9637. states.fixedColumns = _columns.filter(function (column) {
  9638. return column.fixed === true || column.fixed === 'left';
  9639. });
  9640. states.rightFixedColumns = _columns.filter(function (column) {
  9641. return column.fixed === 'right';
  9642. });
  9643. if (states.fixedColumns.length > 0 && _columns[0] && _columns[0].type === 'selection' && !_columns[0].fixed) {
  9644. _columns[0].fixed = true;
  9645. states.fixedColumns.unshift(_columns[0]);
  9646. }
  9647. var notFixedColumns = _columns.filter(function (column) {
  9648. return !column.fixed;
  9649. });
  9650. states.originColumns = [].concat(states.fixedColumns).concat(notFixedColumns).concat(states.rightFixedColumns);
  9651. var leafColumns = doFlattenColumns(notFixedColumns);
  9652. var fixedLeafColumns = doFlattenColumns(states.fixedColumns);
  9653. var rightFixedLeafColumns = doFlattenColumns(states.rightFixedColumns);
  9654. states.leafColumnsLength = leafColumns.length;
  9655. states.fixedLeafColumnsLength = fixedLeafColumns.length;
  9656. states.rightFixedLeafColumnsLength = rightFixedLeafColumns.length;
  9657. states.columns = [].concat(fixedLeafColumns).concat(leafColumns).concat(rightFixedLeafColumns);
  9658. states.isComplex = states.fixedColumns.length > 0 || states.rightFixedColumns.length > 0;
  9659. },
  9660. // 更新 DOM
  9661. scheduleLayout: function scheduleLayout(needUpdateColumns) {
  9662. if (needUpdateColumns) {
  9663. this.updateColumns();
  9664. }
  9665. this.table.debouncedUpdateLayout();
  9666. },
  9667. // 选择
  9668. isSelected: function isSelected(row) {
  9669. var _states$selection = this.states.selection,
  9670. selection = _states$selection === undefined ? [] : _states$selection;
  9671. return selection.indexOf(row) > -1;
  9672. },
  9673. clearSelection: function clearSelection() {
  9674. var states = this.states;
  9675. states.isAllSelected = false;
  9676. var oldSelection = states.selection;
  9677. if (oldSelection.length) {
  9678. states.selection = [];
  9679. this.table.$emit('selection-change', []);
  9680. }
  9681. },
  9682. cleanSelection: function cleanSelection() {
  9683. var states = this.states;
  9684. var data = states.data,
  9685. rowKey = states.rowKey,
  9686. selection = states.selection;
  9687. var deleted = void 0;
  9688. if (rowKey) {
  9689. deleted = [];
  9690. var selectedMap = getKeysMap(selection, rowKey);
  9691. var dataMap = getKeysMap(data, rowKey);
  9692. for (var key in selectedMap) {
  9693. if (selectedMap.hasOwnProperty(key) && !dataMap[key]) {
  9694. deleted.push(selectedMap[key].row);
  9695. }
  9696. }
  9697. } else {
  9698. deleted = selection.filter(function (item) {
  9699. return data.indexOf(item) === -1;
  9700. });
  9701. }
  9702. if (deleted.length) {
  9703. var newSelection = selection.filter(function (item) {
  9704. return deleted.indexOf(item) === -1;
  9705. });
  9706. states.selection = newSelection;
  9707. this.table.$emit('selection-change', newSelection.slice());
  9708. }
  9709. },
  9710. toggleRowSelection: function toggleRowSelection(row, selected) {
  9711. var emitChange = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  9712. var changed = toggleRowStatus(this.states.selection, row, selected);
  9713. if (changed) {
  9714. var newSelection = (this.states.selection || []).slice();
  9715. // 调用 API 修改选中值,不触发 select 事件
  9716. if (emitChange) {
  9717. this.table.$emit('select', newSelection, row);
  9718. }
  9719. this.table.$emit('selection-change', newSelection);
  9720. }
  9721. },
  9722. _toggleAllSelection: function _toggleAllSelection() {
  9723. var states = this.states;
  9724. var _states$data = states.data,
  9725. data = _states$data === undefined ? [] : _states$data,
  9726. selection = states.selection;
  9727. // when only some rows are selected (but not all), select or deselect all of them
  9728. // depending on the value of selectOnIndeterminate
  9729. var value = states.selectOnIndeterminate ? !states.isAllSelected : !(states.isAllSelected || selection.length);
  9730. states.isAllSelected = value;
  9731. var selectionChanged = false;
  9732. data.forEach(function (row, index) {
  9733. if (states.selectable) {
  9734. if (states.selectable.call(null, row, index) && toggleRowStatus(selection, row, value)) {
  9735. selectionChanged = true;
  9736. }
  9737. } else {
  9738. if (toggleRowStatus(selection, row, value)) {
  9739. selectionChanged = true;
  9740. }
  9741. }
  9742. });
  9743. if (selectionChanged) {
  9744. this.table.$emit('selection-change', selection ? selection.slice() : []);
  9745. }
  9746. this.table.$emit('select-all', selection);
  9747. },
  9748. updateSelectionByRowKey: function updateSelectionByRowKey() {
  9749. var states = this.states;
  9750. var selection = states.selection,
  9751. rowKey = states.rowKey,
  9752. data = states.data;
  9753. var selectedMap = getKeysMap(selection, rowKey);
  9754. data.forEach(function (row) {
  9755. var rowId = getRowIdentity(row, rowKey);
  9756. var rowInfo = selectedMap[rowId];
  9757. if (rowInfo) {
  9758. selection[rowInfo.index] = row;
  9759. }
  9760. });
  9761. },
  9762. updateAllSelected: function updateAllSelected() {
  9763. var states = this.states;
  9764. var selection = states.selection,
  9765. rowKey = states.rowKey,
  9766. selectable = states.selectable;
  9767. // data 为 null 时,解构时的默认值会被忽略
  9768. var data = states.data || [];
  9769. if (data.length === 0) {
  9770. states.isAllSelected = false;
  9771. return;
  9772. }
  9773. var selectedMap = void 0;
  9774. if (rowKey) {
  9775. selectedMap = getKeysMap(selection, rowKey);
  9776. }
  9777. var isSelected = function isSelected(row) {
  9778. if (selectedMap) {
  9779. return !!selectedMap[getRowIdentity(row, rowKey)];
  9780. } else {
  9781. return selection.indexOf(row) !== -1;
  9782. }
  9783. };
  9784. var isAllSelected = true;
  9785. var selectedCount = 0;
  9786. for (var i = 0, j = data.length; i < j; i++) {
  9787. var item = data[i];
  9788. var isRowSelectable = selectable && selectable.call(null, item, i);
  9789. if (!isSelected(item)) {
  9790. if (!selectable || isRowSelectable) {
  9791. isAllSelected = false;
  9792. break;
  9793. }
  9794. } else {
  9795. selectedCount++;
  9796. }
  9797. }
  9798. if (selectedCount === 0) isAllSelected = false;
  9799. states.isAllSelected = isAllSelected;
  9800. },
  9801. // 过滤与排序
  9802. updateFilters: function updateFilters(columns, values) {
  9803. if (!Array.isArray(columns)) {
  9804. columns = [columns];
  9805. }
  9806. var states = this.states;
  9807. var filters = {};
  9808. columns.forEach(function (col) {
  9809. states.filters[col.id] = values;
  9810. filters[col.columnKey || col.id] = values;
  9811. });
  9812. return filters;
  9813. },
  9814. updateSort: function updateSort(column, prop, order) {
  9815. if (this.states.sortingColumn && this.states.sortingColumn !== column) {
  9816. this.states.sortingColumn.order = null;
  9817. }
  9818. this.states.sortingColumn = column;
  9819. this.states.sortProp = prop;
  9820. this.states.sortOrder = order;
  9821. },
  9822. execFilter: function execFilter() {
  9823. var _this = this;
  9824. var states = this.states;
  9825. var _data = states._data,
  9826. filters = states.filters;
  9827. var data = _data;
  9828. Object.keys(filters).forEach(function (columnId) {
  9829. var values = states.filters[columnId];
  9830. if (!values || values.length === 0) return;
  9831. var column = getColumnById(_this.states, columnId);
  9832. if (column && column.filterMethod) {
  9833. data = data.filter(function (row) {
  9834. return values.some(function (value) {
  9835. return column.filterMethod.call(null, value, row, column);
  9836. });
  9837. });
  9838. }
  9839. });
  9840. states.filteredData = data;
  9841. },
  9842. execSort: function execSort() {
  9843. var states = this.states;
  9844. states.data = watcher_sortData(states.filteredData, states);
  9845. },
  9846. // 根据 filters 与 sort 去过滤 data
  9847. execQuery: function execQuery(ignore) {
  9848. if (!(ignore && ignore.filter)) {
  9849. this.execFilter();
  9850. }
  9851. this.execSort();
  9852. },
  9853. clearFilter: function clearFilter(columnKeys) {
  9854. var states = this.states;
  9855. var _table$$refs = this.table.$refs,
  9856. tableHeader = _table$$refs.tableHeader,
  9857. fixedTableHeader = _table$$refs.fixedTableHeader,
  9858. rightFixedTableHeader = _table$$refs.rightFixedTableHeader;
  9859. var panels = {};
  9860. if (tableHeader) panels = merge_default()(panels, tableHeader.filterPanels);
  9861. if (fixedTableHeader) panels = merge_default()(panels, fixedTableHeader.filterPanels);
  9862. if (rightFixedTableHeader) panels = merge_default()(panels, rightFixedTableHeader.filterPanels);
  9863. var keys = Object.keys(panels);
  9864. if (!keys.length) return;
  9865. if (typeof columnKeys === 'string') {
  9866. columnKeys = [columnKeys];
  9867. }
  9868. if (Array.isArray(columnKeys)) {
  9869. var columns = columnKeys.map(function (key) {
  9870. return getColumnByKey(states, key);
  9871. });
  9872. keys.forEach(function (key) {
  9873. var column = columns.find(function (col) {
  9874. return col.id === key;
  9875. });
  9876. if (column) {
  9877. // TODO: 优化这里的代码
  9878. panels[key].filteredValue = [];
  9879. }
  9880. });
  9881. this.commit('filterChange', {
  9882. column: columns,
  9883. values: [],
  9884. silent: true,
  9885. multi: true
  9886. });
  9887. } else {
  9888. keys.forEach(function (key) {
  9889. // TODO: 优化这里的代码
  9890. panels[key].filteredValue = [];
  9891. });
  9892. states.filters = {};
  9893. this.commit('filterChange', {
  9894. column: {},
  9895. values: [],
  9896. silent: true
  9897. });
  9898. }
  9899. },
  9900. clearSort: function clearSort() {
  9901. var states = this.states;
  9902. if (!states.sortingColumn) return;
  9903. this.updateSort(null, null, null);
  9904. this.commit('changeSortCondition', {
  9905. silent: true
  9906. });
  9907. },
  9908. // 适配层,expand-row-keys 在 Expand 与 TreeTable 中都有使用
  9909. setExpandRowKeysAdapter: function setExpandRowKeysAdapter(val) {
  9910. // 这里会触发额外的计算,但为了兼容性,暂时这么做
  9911. this.setExpandRowKeys(val);
  9912. this.updateTreeExpandKeys(val);
  9913. },
  9914. // 展开行与 TreeTable 都要使用
  9915. toggleRowExpansionAdapter: function toggleRowExpansionAdapter(row, expanded) {
  9916. var hasExpandColumn = this.states.columns.some(function (_ref) {
  9917. var type = _ref.type;
  9918. return type === 'expand';
  9919. });
  9920. if (hasExpandColumn) {
  9921. this.toggleRowExpansion(row, expanded);
  9922. } else {
  9923. this.toggleTreeExpansion(row, expanded);
  9924. }
  9925. }
  9926. }
  9927. }));
  9928. // CONCATENATED MODULE: ./packages/table/src/store/index.js
  9929. watcher.prototype.mutations = {
  9930. setData: function setData(states, data) {
  9931. var dataInstanceChanged = states._data !== data;
  9932. states._data = data;
  9933. this.execQuery();
  9934. // 数据变化,更新部分数据。
  9935. // 没有使用 computed,而是手动更新部分数据 https://github.com/vuejs/vue/issues/6660#issuecomment-331417140
  9936. this.updateCurrentRowData();
  9937. this.updateExpandRows();
  9938. if (states.reserveSelection) {
  9939. this.assertRowKey();
  9940. this.updateSelectionByRowKey();
  9941. } else {
  9942. if (dataInstanceChanged) {
  9943. this.clearSelection();
  9944. } else {
  9945. this.cleanSelection();
  9946. }
  9947. }
  9948. this.updateAllSelected();
  9949. this.updateTableScrollY();
  9950. },
  9951. insertColumn: function insertColumn(states, column, index, parent) {
  9952. var array = states._columns;
  9953. if (parent) {
  9954. array = parent.children;
  9955. if (!array) array = parent.children = [];
  9956. }
  9957. if (typeof index !== 'undefined') {
  9958. array.splice(index, 0, column);
  9959. } else {
  9960. array.push(column);
  9961. }
  9962. if (column.type === 'selection') {
  9963. states.selectable = column.selectable;
  9964. states.reserveSelection = column.reserveSelection;
  9965. }
  9966. if (this.table.$ready) {
  9967. this.updateColumns(); // hack for dynamics insert column
  9968. this.scheduleLayout();
  9969. }
  9970. },
  9971. removeColumn: function removeColumn(states, column, parent) {
  9972. var array = states._columns;
  9973. if (parent) {
  9974. array = parent.children;
  9975. if (!array) array = parent.children = [];
  9976. }
  9977. if (array) {
  9978. array.splice(array.indexOf(column), 1);
  9979. }
  9980. if (this.table.$ready) {
  9981. this.updateColumns(); // hack for dynamics remove column
  9982. this.scheduleLayout();
  9983. }
  9984. },
  9985. sort: function sort(states, options) {
  9986. var prop = options.prop,
  9987. order = options.order,
  9988. init = options.init;
  9989. if (prop) {
  9990. var column = Object(util_["arrayFind"])(states.columns, function (column) {
  9991. return column.property === prop;
  9992. });
  9993. if (column) {
  9994. column.order = order;
  9995. this.updateSort(column, prop, order);
  9996. this.commit('changeSortCondition', { init: init });
  9997. }
  9998. }
  9999. },
  10000. changeSortCondition: function changeSortCondition(states, options) {
  10001. // 修复 pr https://github.com/ElemeFE/element/pull/15012 导致的 bug
  10002. var column = states.sortingColumn,
  10003. prop = states.sortProp,
  10004. order = states.sortOrder;
  10005. if (order === null) {
  10006. states.sortingColumn = null;
  10007. states.sortProp = null;
  10008. }
  10009. var ingore = { filter: true };
  10010. this.execQuery(ingore);
  10011. if (!options || !(options.silent || options.init)) {
  10012. this.table.$emit('sort-change', {
  10013. column: column,
  10014. prop: prop,
  10015. order: order
  10016. });
  10017. }
  10018. this.updateTableScrollY();
  10019. },
  10020. filterChange: function filterChange(states, options) {
  10021. var column = options.column,
  10022. values = options.values,
  10023. silent = options.silent;
  10024. var newFilters = this.updateFilters(column, values);
  10025. this.execQuery();
  10026. if (!silent) {
  10027. this.table.$emit('filter-change', newFilters);
  10028. }
  10029. this.updateTableScrollY();
  10030. },
  10031. toggleAllSelection: function toggleAllSelection() {
  10032. this.toggleAllSelection();
  10033. },
  10034. rowSelectedChanged: function rowSelectedChanged(states, row) {
  10035. this.toggleRowSelection(row);
  10036. this.updateAllSelected();
  10037. },
  10038. setHoverRow: function setHoverRow(states, row) {
  10039. states.hoverRow = row;
  10040. },
  10041. setCurrentRow: function setCurrentRow(states, row) {
  10042. this.updateCurrentRow(row);
  10043. }
  10044. };
  10045. watcher.prototype.commit = function (name) {
  10046. var mutations = this.mutations;
  10047. if (mutations[name]) {
  10048. for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  10049. args[_key - 1] = arguments[_key];
  10050. }
  10051. mutations[name].apply(this, [this.states].concat(args));
  10052. } else {
  10053. throw new Error('Action not found: ' + name);
  10054. }
  10055. };
  10056. watcher.prototype.updateTableScrollY = function () {
  10057. external_vue_default.a.nextTick(this.table.updateScrollY);
  10058. };
  10059. /* harmony default export */ var src_store = (watcher);
  10060. // CONCATENATED MODULE: ./packages/table/src/store/helper.js
  10061. function createStore(table) {
  10062. var initialState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  10063. if (!table) {
  10064. throw new Error('Table is required.');
  10065. }
  10066. var store = new src_store();
  10067. store.table = table;
  10068. // fix https://github.com/ElemeFE/element/issues/14075
  10069. // related pr https://github.com/ElemeFE/element/pull/14146
  10070. store.toggleAllSelection = debounce_default()(10, store._toggleAllSelection);
  10071. Object.keys(initialState).forEach(function (key) {
  10072. store.states[key] = initialState[key];
  10073. });
  10074. return store;
  10075. }
  10076. function mapStates(mapper) {
  10077. var res = {};
  10078. Object.keys(mapper).forEach(function (key) {
  10079. var value = mapper[key];
  10080. var fn = void 0;
  10081. if (typeof value === 'string') {
  10082. fn = function fn() {
  10083. return this.store.states[value];
  10084. };
  10085. } else if (typeof value === 'function') {
  10086. fn = function fn() {
  10087. return value.call(this, this.store.states);
  10088. };
  10089. } else {
  10090. console.error('invalid value type');
  10091. }
  10092. if (fn) {
  10093. res[key] = fn;
  10094. }
  10095. });
  10096. return res;
  10097. };
  10098. // EXTERNAL MODULE: external "element-ui/lib/utils/scrollbar-width"
  10099. var scrollbar_width_ = __webpack_require__(31);
  10100. var scrollbar_width_default = /*#__PURE__*/__webpack_require__.n(scrollbar_width_);
  10101. // CONCATENATED MODULE: ./packages/table/src/table-layout.js
  10102. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10103. var table_layout_TableLayout = function () {
  10104. function TableLayout(options) {
  10105. _classCallCheck(this, TableLayout);
  10106. this.observers = [];
  10107. this.table = null;
  10108. this.store = null;
  10109. this.columns = null;
  10110. this.fit = true;
  10111. this.showHeader = true;
  10112. this.height = null;
  10113. this.scrollX = false;
  10114. this.scrollY = false;
  10115. this.bodyWidth = null;
  10116. this.fixedWidth = null;
  10117. this.rightFixedWidth = null;
  10118. this.tableHeight = null;
  10119. this.headerHeight = 44; // Table Header Height
  10120. this.appendHeight = 0; // Append Slot Height
  10121. this.footerHeight = 44; // Table Footer Height
  10122. this.viewportHeight = null; // Table Height - Scroll Bar Height
  10123. this.bodyHeight = null; // Table Height - Table Header Height
  10124. this.fixedBodyHeight = null; // Table Height - Table Header Height - Scroll Bar Height
  10125. this.gutterWidth = scrollbar_width_default()();
  10126. for (var name in options) {
  10127. if (options.hasOwnProperty(name)) {
  10128. this[name] = options[name];
  10129. }
  10130. }
  10131. if (!this.table) {
  10132. throw new Error('table is required for Table Layout');
  10133. }
  10134. if (!this.store) {
  10135. throw new Error('store is required for Table Layout');
  10136. }
  10137. }
  10138. TableLayout.prototype.updateScrollY = function updateScrollY() {
  10139. var height = this.height;
  10140. if (height === null) return false;
  10141. var bodyWrapper = this.table.bodyWrapper;
  10142. if (this.table.$el && bodyWrapper) {
  10143. var body = bodyWrapper.querySelector('.el-table__body');
  10144. var prevScrollY = this.scrollY;
  10145. var scrollY = body.offsetHeight > this.bodyHeight;
  10146. this.scrollY = scrollY;
  10147. return prevScrollY !== scrollY;
  10148. }
  10149. return false;
  10150. };
  10151. TableLayout.prototype.setHeight = function setHeight(value) {
  10152. var _this = this;
  10153. var prop = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'height';
  10154. if (external_vue_default.a.prototype.$isServer) return;
  10155. var el = this.table.$el;
  10156. value = parseHeight(value);
  10157. this.height = value;
  10158. if (!el && (value || value === 0)) return external_vue_default.a.nextTick(function () {
  10159. return _this.setHeight(value, prop);
  10160. });
  10161. if (typeof value === 'number') {
  10162. el.style[prop] = value + 'px';
  10163. this.updateElsHeight();
  10164. } else if (typeof value === 'string') {
  10165. el.style[prop] = value;
  10166. this.updateElsHeight();
  10167. }
  10168. };
  10169. TableLayout.prototype.setMaxHeight = function setMaxHeight(value) {
  10170. this.setHeight(value, 'max-height');
  10171. };
  10172. TableLayout.prototype.getFlattenColumns = function getFlattenColumns() {
  10173. var flattenColumns = [];
  10174. var columns = this.table.columns;
  10175. columns.forEach(function (column) {
  10176. if (column.isColumnGroup) {
  10177. flattenColumns.push.apply(flattenColumns, column.columns);
  10178. } else {
  10179. flattenColumns.push(column);
  10180. }
  10181. });
  10182. return flattenColumns;
  10183. };
  10184. TableLayout.prototype.updateElsHeight = function updateElsHeight() {
  10185. var _this2 = this;
  10186. if (!this.table.$ready) return external_vue_default.a.nextTick(function () {
  10187. return _this2.updateElsHeight();
  10188. });
  10189. var _table$$refs = this.table.$refs,
  10190. headerWrapper = _table$$refs.headerWrapper,
  10191. appendWrapper = _table$$refs.appendWrapper,
  10192. footerWrapper = _table$$refs.footerWrapper;
  10193. this.appendHeight = appendWrapper ? appendWrapper.offsetHeight : 0;
  10194. if (this.showHeader && !headerWrapper) return;
  10195. // fix issue (https://github.com/ElemeFE/element/pull/16956)
  10196. var headerTrElm = headerWrapper ? headerWrapper.querySelector('.el-table__header tr') : null;
  10197. var noneHeader = this.headerDisplayNone(headerTrElm);
  10198. var headerHeight = this.headerHeight = !this.showHeader ? 0 : headerWrapper.offsetHeight;
  10199. if (this.showHeader && !noneHeader && headerWrapper.offsetWidth > 0 && (this.table.columns || []).length > 0 && headerHeight < 2) {
  10200. return external_vue_default.a.nextTick(function () {
  10201. return _this2.updateElsHeight();
  10202. });
  10203. }
  10204. var tableHeight = this.tableHeight = this.table.$el.clientHeight;
  10205. var footerHeight = this.footerHeight = footerWrapper ? footerWrapper.offsetHeight : 0;
  10206. if (this.height !== null) {
  10207. this.bodyHeight = tableHeight - headerHeight - footerHeight + (footerWrapper ? 1 : 0);
  10208. }
  10209. this.fixedBodyHeight = this.scrollX ? this.bodyHeight - this.gutterWidth : this.bodyHeight;
  10210. var noData = !(this.store.states.data && this.store.states.data.length);
  10211. this.viewportHeight = this.scrollX ? tableHeight - (noData ? 0 : this.gutterWidth) : tableHeight;
  10212. this.updateScrollY();
  10213. this.notifyObservers('scrollable');
  10214. };
  10215. TableLayout.prototype.headerDisplayNone = function headerDisplayNone(elm) {
  10216. if (!elm) return true;
  10217. var headerChild = elm;
  10218. while (headerChild.tagName !== 'DIV') {
  10219. if (getComputedStyle(headerChild).display === 'none') {
  10220. return true;
  10221. }
  10222. headerChild = headerChild.parentElement;
  10223. }
  10224. return false;
  10225. };
  10226. TableLayout.prototype.updateColumnsWidth = function updateColumnsWidth() {
  10227. if (external_vue_default.a.prototype.$isServer) return;
  10228. var fit = this.fit;
  10229. var bodyWidth = this.table.$el.clientWidth;
  10230. var bodyMinWidth = 0;
  10231. var flattenColumns = this.getFlattenColumns();
  10232. var flexColumns = flattenColumns.filter(function (column) {
  10233. return typeof column.width !== 'number';
  10234. });
  10235. flattenColumns.forEach(function (column) {
  10236. // Clean those columns whose width changed from flex to unflex
  10237. if (typeof column.width === 'number' && column.realWidth) column.realWidth = null;
  10238. });
  10239. if (flexColumns.length > 0 && fit) {
  10240. flattenColumns.forEach(function (column) {
  10241. bodyMinWidth += column.width || column.minWidth || 80;
  10242. });
  10243. var scrollYWidth = this.scrollY ? this.gutterWidth : 0;
  10244. if (bodyMinWidth <= bodyWidth - scrollYWidth) {
  10245. // DON'T HAVE SCROLL BAR
  10246. this.scrollX = false;
  10247. var totalFlexWidth = bodyWidth - scrollYWidth - bodyMinWidth;
  10248. if (flexColumns.length === 1) {
  10249. flexColumns[0].realWidth = (flexColumns[0].minWidth || 80) + totalFlexWidth;
  10250. } else {
  10251. var allColumnsWidth = flexColumns.reduce(function (prev, column) {
  10252. return prev + (column.minWidth || 80);
  10253. }, 0);
  10254. var flexWidthPerPixel = totalFlexWidth / allColumnsWidth;
  10255. var noneFirstWidth = 0;
  10256. flexColumns.forEach(function (column, index) {
  10257. if (index === 0) return;
  10258. var flexWidth = Math.floor((column.minWidth || 80) * flexWidthPerPixel);
  10259. noneFirstWidth += flexWidth;
  10260. column.realWidth = (column.minWidth || 80) + flexWidth;
  10261. });
  10262. flexColumns[0].realWidth = (flexColumns[0].minWidth || 80) + totalFlexWidth - noneFirstWidth;
  10263. }
  10264. } else {
  10265. // HAVE HORIZONTAL SCROLL BAR
  10266. this.scrollX = true;
  10267. flexColumns.forEach(function (column) {
  10268. column.realWidth = column.minWidth;
  10269. });
  10270. }
  10271. this.bodyWidth = Math.max(bodyMinWidth, bodyWidth);
  10272. this.table.resizeState.width = this.bodyWidth;
  10273. } else {
  10274. flattenColumns.forEach(function (column) {
  10275. if (!column.width && !column.minWidth) {
  10276. column.realWidth = 80;
  10277. } else {
  10278. column.realWidth = column.width || column.minWidth;
  10279. }
  10280. bodyMinWidth += column.realWidth;
  10281. });
  10282. this.scrollX = bodyMinWidth > bodyWidth;
  10283. this.bodyWidth = bodyMinWidth;
  10284. }
  10285. var fixedColumns = this.store.states.fixedColumns;
  10286. if (fixedColumns.length > 0) {
  10287. var fixedWidth = 0;
  10288. fixedColumns.forEach(function (column) {
  10289. fixedWidth += column.realWidth || column.width;
  10290. });
  10291. this.fixedWidth = fixedWidth;
  10292. }
  10293. var rightFixedColumns = this.store.states.rightFixedColumns;
  10294. if (rightFixedColumns.length > 0) {
  10295. var rightFixedWidth = 0;
  10296. rightFixedColumns.forEach(function (column) {
  10297. rightFixedWidth += column.realWidth || column.width;
  10298. });
  10299. this.rightFixedWidth = rightFixedWidth;
  10300. }
  10301. this.notifyObservers('columns');
  10302. };
  10303. TableLayout.prototype.addObserver = function addObserver(observer) {
  10304. this.observers.push(observer);
  10305. };
  10306. TableLayout.prototype.removeObserver = function removeObserver(observer) {
  10307. var index = this.observers.indexOf(observer);
  10308. if (index !== -1) {
  10309. this.observers.splice(index, 1);
  10310. }
  10311. };
  10312. TableLayout.prototype.notifyObservers = function notifyObservers(event) {
  10313. var _this3 = this;
  10314. var observers = this.observers;
  10315. observers.forEach(function (observer) {
  10316. switch (event) {
  10317. case 'columns':
  10318. observer.onColumnsChange(_this3);
  10319. break;
  10320. case 'scrollable':
  10321. observer.onScrollableChange(_this3);
  10322. break;
  10323. default:
  10324. throw new Error('Table Layout don\'t have event ' + event + '.');
  10325. }
  10326. });
  10327. };
  10328. return TableLayout;
  10329. }();
  10330. /* harmony default export */ var table_layout = (table_layout_TableLayout);
  10331. // CONCATENATED MODULE: ./packages/table/src/layout-observer.js
  10332. /* harmony default export */ var layout_observer = ({
  10333. created: function created() {
  10334. this.tableLayout.addObserver(this);
  10335. },
  10336. destroyed: function destroyed() {
  10337. this.tableLayout.removeObserver(this);
  10338. },
  10339. computed: {
  10340. tableLayout: function tableLayout() {
  10341. var layout = this.layout;
  10342. if (!layout && this.table) {
  10343. layout = this.table.layout;
  10344. }
  10345. if (!layout) {
  10346. throw new Error('Can not find table layout.');
  10347. }
  10348. return layout;
  10349. }
  10350. },
  10351. mounted: function mounted() {
  10352. this.onColumnsChange(this.tableLayout);
  10353. this.onScrollableChange(this.tableLayout);
  10354. },
  10355. updated: function updated() {
  10356. if (this.__updated__) return;
  10357. this.onColumnsChange(this.tableLayout);
  10358. this.onScrollableChange(this.tableLayout);
  10359. this.__updated__ = true;
  10360. },
  10361. methods: {
  10362. onColumnsChange: function onColumnsChange(layout) {
  10363. var cols = this.$el.querySelectorAll('colgroup > col');
  10364. if (!cols.length) return;
  10365. var flattenColumns = layout.getFlattenColumns();
  10366. var columnsMap = {};
  10367. flattenColumns.forEach(function (column) {
  10368. columnsMap[column.id] = column;
  10369. });
  10370. for (var i = 0, j = cols.length; i < j; i++) {
  10371. var col = cols[i];
  10372. var name = col.getAttribute('name');
  10373. var column = columnsMap[name];
  10374. if (column) {
  10375. col.setAttribute('width', column.realWidth || column.width);
  10376. }
  10377. }
  10378. },
  10379. onScrollableChange: function onScrollableChange(layout) {
  10380. var cols = this.$el.querySelectorAll('colgroup > col[name=gutter]');
  10381. for (var i = 0, j = cols.length; i < j; i++) {
  10382. var col = cols[i];
  10383. col.setAttribute('width', layout.scrollY ? layout.gutterWidth : '0');
  10384. }
  10385. var ths = this.$el.querySelectorAll('th.gutter');
  10386. for (var _i = 0, _j = ths.length; _i < _j; _i++) {
  10387. var th = ths[_i];
  10388. th.style.width = layout.scrollY ? layout.gutterWidth + 'px' : '0';
  10389. th.style.display = layout.scrollY ? '' : 'none';
  10390. }
  10391. }
  10392. }
  10393. });
  10394. // CONCATENATED MODULE: ./packages/table/src/table-row.js
  10395. 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; };
  10396. /* harmony default export */ var table_row = ({
  10397. name: 'ElTableRow',
  10398. props: ['columns', 'row', 'index', 'isSelected', 'isExpanded', 'store', 'context', 'firstDefaultColumnIndex', 'treeRowData', 'treeIndent', 'columnsHidden', 'getSpan', 'getColspanRealWidth', 'getCellStyle', 'getCellClass', 'handleCellMouseLeave', 'handleCellMouseEnter', 'fixed'],
  10399. components: {
  10400. ElCheckbox: checkbox_default.a
  10401. },
  10402. render: function render() {
  10403. var _this = this;
  10404. var h = arguments[0];
  10405. var columns = this.columns,
  10406. row = this.row,
  10407. $index = this.index,
  10408. store = this.store,
  10409. context = this.context,
  10410. firstDefaultColumnIndex = this.firstDefaultColumnIndex,
  10411. treeRowData = this.treeRowData,
  10412. treeIndent = this.treeIndent,
  10413. _columnsHidden = this.columnsHidden,
  10414. columnsHidden = _columnsHidden === undefined ? [] : _columnsHidden,
  10415. isSelected = this.isSelected,
  10416. isExpanded = this.isExpanded;
  10417. return h('tr', [columns.map(function (column, cellIndex) {
  10418. var _getSpan = _this.getSpan(row, column, $index, cellIndex),
  10419. rowspan = _getSpan.rowspan,
  10420. colspan = _getSpan.colspan;
  10421. if (!rowspan || !colspan) {
  10422. return null;
  10423. }
  10424. var columnData = table_row_extends({}, column);
  10425. columnData.realWidth = _this.getColspanRealWidth(columns, colspan, cellIndex);
  10426. var data = {
  10427. store: store,
  10428. isSelected: isSelected,
  10429. isExpanded: isExpanded,
  10430. _self: context,
  10431. column: columnData,
  10432. row: row,
  10433. $index: $index
  10434. };
  10435. if (cellIndex === firstDefaultColumnIndex && treeRowData) {
  10436. data.treeNode = {
  10437. indent: treeRowData.level * treeIndent,
  10438. level: treeRowData.level
  10439. };
  10440. if (typeof treeRowData.expanded === 'boolean') {
  10441. data.treeNode.expanded = treeRowData.expanded;
  10442. // 表明是懒加载
  10443. if ('loading' in treeRowData) {
  10444. data.treeNode.loading = treeRowData.loading;
  10445. }
  10446. if ('noLazyChildren' in treeRowData) {
  10447. data.treeNode.noLazyChildren = treeRowData.noLazyChildren;
  10448. }
  10449. }
  10450. }
  10451. return h(
  10452. 'td',
  10453. {
  10454. style: _this.getCellStyle($index, cellIndex, row, column),
  10455. 'class': _this.getCellClass($index, cellIndex, row, column),
  10456. attrs: { rowspan: rowspan,
  10457. colspan: colspan
  10458. },
  10459. on: {
  10460. 'mouseenter': function mouseenter($event) {
  10461. return _this.handleCellMouseEnter($event, row);
  10462. },
  10463. 'mouseleave': _this.handleCellMouseLeave
  10464. }
  10465. },
  10466. [column.renderCell.call(_this._renderProxy, _this.$createElement, data, columnsHidden[cellIndex])]
  10467. );
  10468. })]);
  10469. }
  10470. });
  10471. // CONCATENATED MODULE: ./packages/table/src/table-body.js
  10472. 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; };
  10473. 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; };
  10474. /* harmony default export */ var table_body = ({
  10475. name: 'ElTableBody',
  10476. mixins: [layout_observer],
  10477. components: {
  10478. ElCheckbox: checkbox_default.a,
  10479. ElTooltip: tooltip_default.a,
  10480. TableRow: table_row
  10481. },
  10482. props: {
  10483. store: {
  10484. required: true
  10485. },
  10486. stripe: Boolean,
  10487. context: {},
  10488. rowClassName: [String, Function],
  10489. rowStyle: [Object, Function],
  10490. fixed: String,
  10491. highlight: Boolean
  10492. },
  10493. render: function render(h) {
  10494. var _this = this;
  10495. var data = this.data || [];
  10496. return h(
  10497. 'table',
  10498. {
  10499. 'class': 'el-table__body',
  10500. attrs: { cellspacing: '0',
  10501. cellpadding: '0',
  10502. border: '0' }
  10503. },
  10504. [h('colgroup', [this.columns.map(function (column) {
  10505. return h('col', {
  10506. attrs: { name: column.id },
  10507. key: column.id });
  10508. })]), h('tbody', [data.reduce(function (acc, row) {
  10509. return acc.concat(_this.wrappedRowRender(row, acc.length));
  10510. }, []), h('el-tooltip', {
  10511. attrs: { effect: this.table.tooltipEffect, placement: 'top', content: this.tooltipContent },
  10512. ref: 'tooltip' })])]
  10513. );
  10514. },
  10515. computed: table_body_extends({
  10516. table: function table() {
  10517. return this.$parent;
  10518. }
  10519. }, mapStates({
  10520. data: 'data',
  10521. columns: 'columns',
  10522. treeIndent: 'indent',
  10523. leftFixedLeafCount: 'fixedLeafColumnsLength',
  10524. rightFixedLeafCount: 'rightFixedLeafColumnsLength',
  10525. columnsCount: function columnsCount(states) {
  10526. return states.columns.length;
  10527. },
  10528. leftFixedCount: function leftFixedCount(states) {
  10529. return states.fixedColumns.length;
  10530. },
  10531. rightFixedCount: function rightFixedCount(states) {
  10532. return states.rightFixedColumns.length;
  10533. },
  10534. hasExpandColumn: function hasExpandColumn(states) {
  10535. return states.columns.some(function (_ref) {
  10536. var type = _ref.type;
  10537. return type === 'expand';
  10538. });
  10539. }
  10540. }), {
  10541. columnsHidden: function columnsHidden() {
  10542. var _this2 = this;
  10543. return this.columns.map(function (column, index) {
  10544. return _this2.isColumnHidden(index);
  10545. });
  10546. },
  10547. firstDefaultColumnIndex: function firstDefaultColumnIndex() {
  10548. return Object(util_["arrayFindIndex"])(this.columns, function (_ref2) {
  10549. var type = _ref2.type;
  10550. return type === 'default';
  10551. });
  10552. }
  10553. }),
  10554. watch: {
  10555. // don't trigger getter of currentRow in getCellClass. see https://jsfiddle.net/oe2b4hqt/
  10556. // update DOM manually. see https://github.com/ElemeFE/element/pull/13954/files#diff-9b450c00d0a9dec0ffad5a3176972e40
  10557. 'store.states.hoverRow': function storeStatesHoverRow(newVal, oldVal) {
  10558. var _this3 = this;
  10559. if (!this.store.states.isComplex || this.$isServer) return;
  10560. var raf = window.requestAnimationFrame;
  10561. if (!raf) {
  10562. raf = function raf(fn) {
  10563. return setTimeout(fn, 16);
  10564. };
  10565. }
  10566. raf(function () {
  10567. var rows = _this3.$el.querySelectorAll('.el-table__row');
  10568. var oldRow = rows[oldVal];
  10569. var newRow = rows[newVal];
  10570. if (oldRow) {
  10571. Object(dom_["removeClass"])(oldRow, 'hover-row');
  10572. }
  10573. if (newRow) {
  10574. Object(dom_["addClass"])(newRow, 'hover-row');
  10575. }
  10576. });
  10577. }
  10578. },
  10579. data: function data() {
  10580. return {
  10581. tooltipContent: ''
  10582. };
  10583. },
  10584. created: function created() {
  10585. this.activateTooltip = debounce_default()(50, function (tooltip) {
  10586. return tooltip.handleShowPopper();
  10587. });
  10588. },
  10589. methods: {
  10590. getKeyOfRow: function getKeyOfRow(row, index) {
  10591. var rowKey = this.table.rowKey;
  10592. if (rowKey) {
  10593. return getRowIdentity(row, rowKey);
  10594. }
  10595. return index;
  10596. },
  10597. isColumnHidden: function isColumnHidden(index) {
  10598. if (this.fixed === true || this.fixed === 'left') {
  10599. return index >= this.leftFixedLeafCount;
  10600. } else if (this.fixed === 'right') {
  10601. return index < this.columnsCount - this.rightFixedLeafCount;
  10602. } else {
  10603. return index < this.leftFixedLeafCount || index >= this.columnsCount - this.rightFixedLeafCount;
  10604. }
  10605. },
  10606. getSpan: function getSpan(row, column, rowIndex, columnIndex) {
  10607. var rowspan = 1;
  10608. var colspan = 1;
  10609. var fn = this.table.spanMethod;
  10610. if (typeof fn === 'function') {
  10611. var result = fn({
  10612. row: row,
  10613. column: column,
  10614. rowIndex: rowIndex,
  10615. columnIndex: columnIndex
  10616. });
  10617. if (Array.isArray(result)) {
  10618. rowspan = result[0];
  10619. colspan = result[1];
  10620. } else if ((typeof result === 'undefined' ? 'undefined' : table_body_typeof(result)) === 'object') {
  10621. rowspan = result.rowspan;
  10622. colspan = result.colspan;
  10623. }
  10624. }
  10625. return { rowspan: rowspan, colspan: colspan };
  10626. },
  10627. getRowStyle: function getRowStyle(row, rowIndex) {
  10628. var rowStyle = this.table.rowStyle;
  10629. if (typeof rowStyle === 'function') {
  10630. return rowStyle.call(null, {
  10631. row: row,
  10632. rowIndex: rowIndex
  10633. });
  10634. }
  10635. return rowStyle || null;
  10636. },
  10637. getRowClass: function getRowClass(row, rowIndex) {
  10638. var classes = ['el-table__row'];
  10639. if (this.table.highlightCurrentRow && row === this.store.states.currentRow) {
  10640. classes.push('current-row');
  10641. }
  10642. if (this.stripe && rowIndex % 2 === 1) {
  10643. classes.push('el-table__row--striped');
  10644. }
  10645. var rowClassName = this.table.rowClassName;
  10646. if (typeof rowClassName === 'string') {
  10647. classes.push(rowClassName);
  10648. } else if (typeof rowClassName === 'function') {
  10649. classes.push(rowClassName.call(null, {
  10650. row: row,
  10651. rowIndex: rowIndex
  10652. }));
  10653. }
  10654. if (this.store.states.expandRows.indexOf(row) > -1) {
  10655. classes.push('expanded');
  10656. }
  10657. return classes;
  10658. },
  10659. getCellStyle: function getCellStyle(rowIndex, columnIndex, row, column) {
  10660. var cellStyle = this.table.cellStyle;
  10661. if (typeof cellStyle === 'function') {
  10662. return cellStyle.call(null, {
  10663. rowIndex: rowIndex,
  10664. columnIndex: columnIndex,
  10665. row: row,
  10666. column: column
  10667. });
  10668. }
  10669. return cellStyle;
  10670. },
  10671. getCellClass: function getCellClass(rowIndex, columnIndex, row, column) {
  10672. var classes = [column.id, column.align, column.className];
  10673. if (this.isColumnHidden(columnIndex)) {
  10674. classes.push('is-hidden');
  10675. }
  10676. var cellClassName = this.table.cellClassName;
  10677. if (typeof cellClassName === 'string') {
  10678. classes.push(cellClassName);
  10679. } else if (typeof cellClassName === 'function') {
  10680. classes.push(cellClassName.call(null, {
  10681. rowIndex: rowIndex,
  10682. columnIndex: columnIndex,
  10683. row: row,
  10684. column: column
  10685. }));
  10686. }
  10687. classes.push('el-table__cell');
  10688. return classes.join(' ');
  10689. },
  10690. getColspanRealWidth: function getColspanRealWidth(columns, colspan, index) {
  10691. if (colspan < 1) {
  10692. return columns[index].realWidth;
  10693. }
  10694. var widthArr = columns.map(function (_ref3) {
  10695. var realWidth = _ref3.realWidth;
  10696. return realWidth;
  10697. }).slice(index, index + colspan);
  10698. return widthArr.reduce(function (acc, width) {
  10699. return acc + width;
  10700. }, -1);
  10701. },
  10702. handleCellMouseEnter: function handleCellMouseEnter(event, row) {
  10703. var table = this.table;
  10704. var cell = getCell(event);
  10705. if (cell) {
  10706. var column = getColumnByCell(table, cell);
  10707. var hoverState = table.hoverState = { cell: cell, column: column, row: row };
  10708. table.$emit('cell-mouse-enter', hoverState.row, hoverState.column, hoverState.cell, event);
  10709. }
  10710. // 判断是否text-overflow, 如果是就显示tooltip
  10711. var cellChild = event.target.querySelector('.cell');
  10712. if (!(Object(dom_["hasClass"])(cellChild, 'el-tooltip') && cellChild.childNodes.length)) {
  10713. return;
  10714. }
  10715. // use range width instead of scrollWidth to determine whether the text is overflowing
  10716. // to address a potential FireFox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1074543#c3
  10717. var range = document.createRange();
  10718. range.setStart(cellChild, 0);
  10719. range.setEnd(cellChild, cellChild.childNodes.length);
  10720. var rangeWidth = range.getBoundingClientRect().width;
  10721. var padding = (parseInt(Object(dom_["getStyle"])(cellChild, 'paddingLeft'), 10) || 0) + (parseInt(Object(dom_["getStyle"])(cellChild, 'paddingRight'), 10) || 0);
  10722. if ((rangeWidth + padding > cellChild.offsetWidth || cellChild.scrollWidth > cellChild.offsetWidth) && this.$refs.tooltip) {
  10723. var tooltip = this.$refs.tooltip;
  10724. // TODO 会引起整个 Table 的重新渲染,需要优化
  10725. this.tooltipContent = cell.innerText || cell.textContent;
  10726. tooltip.referenceElm = cell;
  10727. tooltip.$refs.popper && (tooltip.$refs.popper.style.display = 'none');
  10728. tooltip.doDestroy();
  10729. tooltip.setExpectedState(true);
  10730. this.activateTooltip(tooltip);
  10731. }
  10732. },
  10733. handleCellMouseLeave: function handleCellMouseLeave(event) {
  10734. var tooltip = this.$refs.tooltip;
  10735. if (tooltip) {
  10736. tooltip.setExpectedState(false);
  10737. tooltip.handleClosePopper();
  10738. }
  10739. var cell = getCell(event);
  10740. if (!cell) return;
  10741. var oldHoverState = this.table.hoverState || {};
  10742. this.table.$emit('cell-mouse-leave', oldHoverState.row, oldHoverState.column, oldHoverState.cell, event);
  10743. },
  10744. handleMouseEnter: debounce_default()(30, function (index) {
  10745. this.store.commit('setHoverRow', index);
  10746. }),
  10747. handleMouseLeave: debounce_default()(30, function () {
  10748. this.store.commit('setHoverRow', null);
  10749. }),
  10750. handleContextMenu: function handleContextMenu(event, row) {
  10751. this.handleEvent(event, row, 'contextmenu');
  10752. },
  10753. handleDoubleClick: function handleDoubleClick(event, row) {
  10754. this.handleEvent(event, row, 'dblclick');
  10755. },
  10756. handleClick: function handleClick(event, row) {
  10757. this.store.commit('setCurrentRow', row);
  10758. this.handleEvent(event, row, 'click');
  10759. },
  10760. handleEvent: function handleEvent(event, row, name) {
  10761. var table = this.table;
  10762. var cell = getCell(event);
  10763. var column = void 0;
  10764. if (cell) {
  10765. column = getColumnByCell(table, cell);
  10766. if (column) {
  10767. table.$emit('cell-' + name, row, column, cell, event);
  10768. }
  10769. }
  10770. table.$emit('row-' + name, row, column, event);
  10771. },
  10772. rowRender: function rowRender(row, $index, treeRowData) {
  10773. var _this4 = this;
  10774. var h = this.$createElement;
  10775. var treeIndent = this.treeIndent,
  10776. columns = this.columns,
  10777. firstDefaultColumnIndex = this.firstDefaultColumnIndex;
  10778. var rowClasses = this.getRowClass(row, $index);
  10779. var display = true;
  10780. if (treeRowData) {
  10781. rowClasses.push('el-table__row--level-' + treeRowData.level);
  10782. display = treeRowData.display;
  10783. }
  10784. // 指令 v-show 会覆盖 row-style 中 display
  10785. // 使用 :style 代替 v-show https://github.com/ElemeFE/element/issues/16995
  10786. var displayStyle = display ? null : {
  10787. display: 'none'
  10788. };
  10789. return h(table_row, {
  10790. style: [displayStyle, this.getRowStyle(row, $index)],
  10791. 'class': rowClasses,
  10792. key: this.getKeyOfRow(row, $index),
  10793. nativeOn: {
  10794. 'dblclick': function dblclick($event) {
  10795. return _this4.handleDoubleClick($event, row);
  10796. },
  10797. 'click': function click($event) {
  10798. return _this4.handleClick($event, row);
  10799. },
  10800. 'contextmenu': function contextmenu($event) {
  10801. return _this4.handleContextMenu($event, row);
  10802. },
  10803. 'mouseenter': function mouseenter(_) {
  10804. return _this4.handleMouseEnter($index);
  10805. },
  10806. 'mouseleave': this.handleMouseLeave
  10807. },
  10808. attrs: {
  10809. columns: columns,
  10810. row: row,
  10811. index: $index,
  10812. store: this.store,
  10813. context: this.context || this.table.$vnode.context,
  10814. firstDefaultColumnIndex: firstDefaultColumnIndex,
  10815. treeRowData: treeRowData,
  10816. treeIndent: treeIndent,
  10817. columnsHidden: this.columnsHidden,
  10818. getSpan: this.getSpan,
  10819. getColspanRealWidth: this.getColspanRealWidth,
  10820. getCellStyle: this.getCellStyle,
  10821. getCellClass: this.getCellClass,
  10822. handleCellMouseEnter: this.handleCellMouseEnter,
  10823. handleCellMouseLeave: this.handleCellMouseLeave,
  10824. isSelected: this.store.isSelected(row),
  10825. isExpanded: this.store.states.expandRows.indexOf(row) > -1,
  10826. fixed: this.fixed
  10827. }
  10828. });
  10829. },
  10830. wrappedRowRender: function wrappedRowRender(row, $index) {
  10831. var _this5 = this;
  10832. var h = this.$createElement;
  10833. var store = this.store;
  10834. var isRowExpanded = store.isRowExpanded,
  10835. assertRowKey = store.assertRowKey;
  10836. var _store$states = store.states,
  10837. treeData = _store$states.treeData,
  10838. lazyTreeNodeMap = _store$states.lazyTreeNodeMap,
  10839. childrenColumnName = _store$states.childrenColumnName,
  10840. rowKey = _store$states.rowKey;
  10841. if (this.hasExpandColumn && isRowExpanded(row)) {
  10842. var renderExpanded = this.table.renderExpanded;
  10843. var tr = this.rowRender(row, $index);
  10844. if (!renderExpanded) {
  10845. console.error('[Element Error]renderExpanded is required.');
  10846. return tr;
  10847. }
  10848. // 使用二维数组,避免修改 $index
  10849. return [[tr, h(
  10850. 'tr',
  10851. { key: 'expanded-row__' + tr.key },
  10852. [h(
  10853. 'td',
  10854. {
  10855. attrs: { colspan: this.columnsCount },
  10856. 'class': 'el-table__cell el-table__expanded-cell' },
  10857. [renderExpanded(this.$createElement, { row: row, $index: $index, store: this.store })]
  10858. )]
  10859. )]];
  10860. } else if (Object.keys(treeData).length) {
  10861. assertRowKey();
  10862. // TreeTable 时,rowKey 必须由用户设定,不使用 getKeyOfRow 计算
  10863. // 在调用 rowRender 函数时,仍然会计算 rowKey,不太好的操作
  10864. var key = getRowIdentity(row, rowKey);
  10865. var cur = treeData[key];
  10866. var treeRowData = null;
  10867. if (cur) {
  10868. treeRowData = {
  10869. expanded: cur.expanded,
  10870. level: cur.level,
  10871. display: true
  10872. };
  10873. if (typeof cur.lazy === 'boolean') {
  10874. if (typeof cur.loaded === 'boolean' && cur.loaded) {
  10875. treeRowData.noLazyChildren = !(cur.children && cur.children.length);
  10876. }
  10877. treeRowData.loading = cur.loading;
  10878. }
  10879. }
  10880. var tmp = [this.rowRender(row, $index, treeRowData)];
  10881. // 渲染嵌套数据
  10882. if (cur) {
  10883. // currentRow 记录的是 index,所以还需主动增加 TreeTable 的 index
  10884. var i = 0;
  10885. var traverse = function traverse(children, parent) {
  10886. if (!(children && children.length && parent)) return;
  10887. children.forEach(function (node) {
  10888. // 父节点的 display 状态影响子节点的显示状态
  10889. var innerTreeRowData = {
  10890. display: parent.display && parent.expanded,
  10891. level: parent.level + 1
  10892. };
  10893. var childKey = getRowIdentity(node, rowKey);
  10894. if (childKey === undefined || childKey === null) {
  10895. throw new Error('for nested data item, row-key is required.');
  10896. }
  10897. cur = table_body_extends({}, treeData[childKey]);
  10898. // 对于当前节点,分成有无子节点两种情况。
  10899. // 如果包含子节点的,设置 expanded 属性。
  10900. // 对于它子节点的 display 属性由它本身的 expanded 与 display 共同决定。
  10901. if (cur) {
  10902. innerTreeRowData.expanded = cur.expanded;
  10903. // 懒加载的某些节点,level 未知
  10904. cur.level = cur.level || innerTreeRowData.level;
  10905. cur.display = !!(cur.expanded && innerTreeRowData.display);
  10906. if (typeof cur.lazy === 'boolean') {
  10907. if (typeof cur.loaded === 'boolean' && cur.loaded) {
  10908. innerTreeRowData.noLazyChildren = !(cur.children && cur.children.length);
  10909. }
  10910. innerTreeRowData.loading = cur.loading;
  10911. }
  10912. }
  10913. i++;
  10914. tmp.push(_this5.rowRender(node, $index + i, innerTreeRowData));
  10915. if (cur) {
  10916. var _nodes = lazyTreeNodeMap[childKey] || node[childrenColumnName];
  10917. traverse(_nodes, cur);
  10918. }
  10919. });
  10920. };
  10921. // 对于 root 节点,display 一定为 true
  10922. cur.display = true;
  10923. var nodes = lazyTreeNodeMap[key] || row[childrenColumnName];
  10924. traverse(nodes, cur);
  10925. }
  10926. return tmp;
  10927. } else {
  10928. return this.rowRender(row, $index);
  10929. }
  10930. }
  10931. }
  10932. });
  10933. // 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&
  10934. var filter_panelvue_type_template_id_7f2c919f_render = function() {
  10935. var _vm = this
  10936. var _h = _vm.$createElement
  10937. var _c = _vm._self._c || _h
  10938. return _c("transition", { attrs: { name: "el-zoom-in-top" } }, [
  10939. _vm.multiple
  10940. ? _c(
  10941. "div",
  10942. {
  10943. directives: [
  10944. {
  10945. name: "clickoutside",
  10946. rawName: "v-clickoutside",
  10947. value: _vm.handleOutsideClick,
  10948. expression: "handleOutsideClick"
  10949. },
  10950. {
  10951. name: "show",
  10952. rawName: "v-show",
  10953. value: _vm.showPopper,
  10954. expression: "showPopper"
  10955. }
  10956. ],
  10957. staticClass: "el-table-filter"
  10958. },
  10959. [
  10960. _c(
  10961. "div",
  10962. { staticClass: "el-table-filter__content" },
  10963. [
  10964. _c(
  10965. "el-scrollbar",
  10966. { attrs: { "wrap-class": "el-table-filter__wrap" } },
  10967. [
  10968. _c(
  10969. "el-checkbox-group",
  10970. {
  10971. staticClass: "el-table-filter__checkbox-group",
  10972. model: {
  10973. value: _vm.filteredValue,
  10974. callback: function($$v) {
  10975. _vm.filteredValue = $$v
  10976. },
  10977. expression: "filteredValue"
  10978. }
  10979. },
  10980. _vm._l(_vm.filters, function(filter) {
  10981. return _c(
  10982. "el-checkbox",
  10983. { key: filter.value, attrs: { label: filter.value } },
  10984. [_vm._v(_vm._s(filter.text))]
  10985. )
  10986. }),
  10987. 1
  10988. )
  10989. ],
  10990. 1
  10991. )
  10992. ],
  10993. 1
  10994. ),
  10995. _c("div", { staticClass: "el-table-filter__bottom" }, [
  10996. _c(
  10997. "button",
  10998. {
  10999. class: { "is-disabled": _vm.filteredValue.length === 0 },
  11000. attrs: { disabled: _vm.filteredValue.length === 0 },
  11001. on: { click: _vm.handleConfirm }
  11002. },
  11003. [_vm._v(_vm._s(_vm.t("el.table.confirmFilter")))]
  11004. ),
  11005. _c("button", { on: { click: _vm.handleReset } }, [
  11006. _vm._v(_vm._s(_vm.t("el.table.resetFilter")))
  11007. ])
  11008. ])
  11009. ]
  11010. )
  11011. : _c(
  11012. "div",
  11013. {
  11014. directives: [
  11015. {
  11016. name: "clickoutside",
  11017. rawName: "v-clickoutside",
  11018. value: _vm.handleOutsideClick,
  11019. expression: "handleOutsideClick"
  11020. },
  11021. {
  11022. name: "show",
  11023. rawName: "v-show",
  11024. value: _vm.showPopper,
  11025. expression: "showPopper"
  11026. }
  11027. ],
  11028. staticClass: "el-table-filter"
  11029. },
  11030. [
  11031. _c(
  11032. "ul",
  11033. { staticClass: "el-table-filter__list" },
  11034. [
  11035. _c(
  11036. "li",
  11037. {
  11038. staticClass: "el-table-filter__list-item",
  11039. class: {
  11040. "is-active":
  11041. _vm.filterValue === undefined ||
  11042. _vm.filterValue === null
  11043. },
  11044. on: {
  11045. click: function($event) {
  11046. _vm.handleSelect(null)
  11047. }
  11048. }
  11049. },
  11050. [_vm._v(_vm._s(_vm.t("el.table.clearFilter")))]
  11051. ),
  11052. _vm._l(_vm.filters, function(filter) {
  11053. return _c(
  11054. "li",
  11055. {
  11056. key: filter.value,
  11057. staticClass: "el-table-filter__list-item",
  11058. class: { "is-active": _vm.isActive(filter) },
  11059. attrs: { label: filter.value },
  11060. on: {
  11061. click: function($event) {
  11062. _vm.handleSelect(filter.value)
  11063. }
  11064. }
  11065. },
  11066. [_vm._v(_vm._s(filter.text))]
  11067. )
  11068. })
  11069. ],
  11070. 2
  11071. )
  11072. ]
  11073. )
  11074. ])
  11075. }
  11076. var filter_panelvue_type_template_id_7f2c919f_staticRenderFns = []
  11077. filter_panelvue_type_template_id_7f2c919f_render._withStripped = true
  11078. // CONCATENATED MODULE: ./packages/table/src/filter-panel.vue?vue&type=template&id=7f2c919f&
  11079. // CONCATENATED MODULE: ./packages/table/src/dropdown.js
  11080. var dropdowns = [];
  11081. !external_vue_default.a.prototype.$isServer && document.addEventListener('click', function (event) {
  11082. dropdowns.forEach(function (dropdown) {
  11083. var target = event.target;
  11084. if (!dropdown || !dropdown.$el) return;
  11085. if (target === dropdown.$el || dropdown.$el.contains(target)) {
  11086. return;
  11087. }
  11088. dropdown.handleOutsideClick && dropdown.handleOutsideClick(event);
  11089. });
  11090. });
  11091. /* harmony default export */ var src_dropdown = ({
  11092. open: function open(instance) {
  11093. if (instance) {
  11094. dropdowns.push(instance);
  11095. }
  11096. },
  11097. close: function close(instance) {
  11098. var index = dropdowns.indexOf(instance);
  11099. if (index !== -1) {
  11100. dropdowns.splice(instance, 1);
  11101. }
  11102. }
  11103. });
  11104. // EXTERNAL MODULE: external "element-ui/lib/checkbox-group"
  11105. var checkbox_group_ = __webpack_require__(32);
  11106. var checkbox_group_default = /*#__PURE__*/__webpack_require__.n(checkbox_group_);
  11107. // 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&
  11108. //
  11109. //
  11110. //
  11111. //
  11112. //
  11113. //
  11114. //
  11115. //
  11116. //
  11117. //
  11118. //
  11119. //
  11120. //
  11121. //
  11122. //
  11123. //
  11124. //
  11125. //
  11126. //
  11127. //
  11128. //
  11129. //
  11130. //
  11131. //
  11132. //
  11133. //
  11134. //
  11135. //
  11136. //
  11137. //
  11138. //
  11139. //
  11140. //
  11141. //
  11142. //
  11143. //
  11144. //
  11145. //
  11146. //
  11147. //
  11148. //
  11149. //
  11150. //
  11151. //
  11152. /* harmony default export */ var filter_panelvue_type_script_lang_js_ = ({
  11153. name: 'ElTableFilterPanel',
  11154. mixins: [vue_popper_default.a, locale_default.a],
  11155. directives: {
  11156. Clickoutside: clickoutside_default.a
  11157. },
  11158. components: {
  11159. ElCheckbox: checkbox_default.a,
  11160. ElCheckboxGroup: checkbox_group_default.a,
  11161. ElScrollbar: scrollbar_default.a
  11162. },
  11163. props: {
  11164. placement: {
  11165. type: String,
  11166. default: 'bottom-end'
  11167. }
  11168. },
  11169. methods: {
  11170. isActive: function isActive(filter) {
  11171. return filter.value === this.filterValue;
  11172. },
  11173. handleOutsideClick: function handleOutsideClick() {
  11174. var _this = this;
  11175. setTimeout(function () {
  11176. _this.showPopper = false;
  11177. }, 16);
  11178. },
  11179. handleConfirm: function handleConfirm() {
  11180. this.confirmFilter(this.filteredValue);
  11181. this.handleOutsideClick();
  11182. },
  11183. handleReset: function handleReset() {
  11184. this.filteredValue = [];
  11185. this.confirmFilter(this.filteredValue);
  11186. this.handleOutsideClick();
  11187. },
  11188. handleSelect: function handleSelect(filterValue) {
  11189. this.filterValue = filterValue;
  11190. if (typeof filterValue !== 'undefined' && filterValue !== null) {
  11191. this.confirmFilter(this.filteredValue);
  11192. } else {
  11193. this.confirmFilter([]);
  11194. }
  11195. this.handleOutsideClick();
  11196. },
  11197. confirmFilter: function confirmFilter(filteredValue) {
  11198. this.table.store.commit('filterChange', {
  11199. column: this.column,
  11200. values: filteredValue
  11201. });
  11202. this.table.store.updateAllSelected();
  11203. }
  11204. },
  11205. data: function data() {
  11206. return {
  11207. table: null,
  11208. cell: null,
  11209. column: null
  11210. };
  11211. },
  11212. computed: {
  11213. filters: function filters() {
  11214. return this.column && this.column.filters;
  11215. },
  11216. filterValue: {
  11217. get: function get() {
  11218. return (this.column.filteredValue || [])[0];
  11219. },
  11220. set: function set(value) {
  11221. if (this.filteredValue) {
  11222. if (typeof value !== 'undefined' && value !== null) {
  11223. this.filteredValue.splice(0, 1, value);
  11224. } else {
  11225. this.filteredValue.splice(0, 1);
  11226. }
  11227. }
  11228. }
  11229. },
  11230. filteredValue: {
  11231. get: function get() {
  11232. if (this.column) {
  11233. return this.column.filteredValue || [];
  11234. }
  11235. return [];
  11236. },
  11237. set: function set(value) {
  11238. if (this.column) {
  11239. this.column.filteredValue = value;
  11240. }
  11241. }
  11242. },
  11243. multiple: function multiple() {
  11244. if (this.column) {
  11245. return this.column.filterMultiple;
  11246. }
  11247. return true;
  11248. }
  11249. },
  11250. mounted: function mounted() {
  11251. var _this2 = this;
  11252. this.popperElm = this.$el;
  11253. this.referenceElm = this.cell;
  11254. this.table.bodyWrapper.addEventListener('scroll', function () {
  11255. _this2.updatePopper();
  11256. });
  11257. this.$watch('showPopper', function (value) {
  11258. if (_this2.column) _this2.column.filterOpened = value;
  11259. if (value) {
  11260. src_dropdown.open(_this2);
  11261. } else {
  11262. src_dropdown.close(_this2);
  11263. }
  11264. });
  11265. },
  11266. watch: {
  11267. showPopper: function showPopper(val) {
  11268. if (val === true && parseInt(this.popperJS._popper.style.zIndex, 10) < popup_["PopupManager"].zIndex) {
  11269. this.popperJS._popper.style.zIndex = popup_["PopupManager"].nextZIndex();
  11270. }
  11271. }
  11272. }
  11273. });
  11274. // CONCATENATED MODULE: ./packages/table/src/filter-panel.vue?vue&type=script&lang=js&
  11275. /* harmony default export */ var src_filter_panelvue_type_script_lang_js_ = (filter_panelvue_type_script_lang_js_);
  11276. // CONCATENATED MODULE: ./packages/table/src/filter-panel.vue
  11277. /* normalize component */
  11278. var filter_panel_component = normalizeComponent(
  11279. src_filter_panelvue_type_script_lang_js_,
  11280. filter_panelvue_type_template_id_7f2c919f_render,
  11281. filter_panelvue_type_template_id_7f2c919f_staticRenderFns,
  11282. false,
  11283. null,
  11284. null,
  11285. null
  11286. )
  11287. /* hot reload */
  11288. if (false) { var filter_panel_api; }
  11289. filter_panel_component.options.__file = "packages/table/src/filter-panel.vue"
  11290. /* harmony default export */ var filter_panel = (filter_panel_component.exports);
  11291. // CONCATENATED MODULE: ./packages/table/src/table-header.js
  11292. 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; };
  11293. var getAllColumns = function getAllColumns(columns) {
  11294. var result = [];
  11295. columns.forEach(function (column) {
  11296. if (column.children) {
  11297. result.push(column);
  11298. result.push.apply(result, getAllColumns(column.children));
  11299. } else {
  11300. result.push(column);
  11301. }
  11302. });
  11303. return result;
  11304. };
  11305. var convertToRows = function convertToRows(originColumns) {
  11306. var maxLevel = 1;
  11307. var traverse = function traverse(column, parent) {
  11308. if (parent) {
  11309. column.level = parent.level + 1;
  11310. if (maxLevel < column.level) {
  11311. maxLevel = column.level;
  11312. }
  11313. }
  11314. if (column.children) {
  11315. var colSpan = 0;
  11316. column.children.forEach(function (subColumn) {
  11317. traverse(subColumn, column);
  11318. colSpan += subColumn.colSpan;
  11319. });
  11320. column.colSpan = colSpan;
  11321. } else {
  11322. column.colSpan = 1;
  11323. }
  11324. };
  11325. originColumns.forEach(function (column) {
  11326. column.level = 1;
  11327. traverse(column);
  11328. });
  11329. var rows = [];
  11330. for (var i = 0; i < maxLevel; i++) {
  11331. rows.push([]);
  11332. }
  11333. var allColumns = getAllColumns(originColumns);
  11334. allColumns.forEach(function (column) {
  11335. if (!column.children) {
  11336. column.rowSpan = maxLevel - column.level + 1;
  11337. } else {
  11338. column.rowSpan = 1;
  11339. }
  11340. rows[column.level - 1].push(column);
  11341. });
  11342. return rows;
  11343. };
  11344. /* harmony default export */ var table_header = ({
  11345. name: 'ElTableHeader',
  11346. mixins: [layout_observer],
  11347. render: function render(h) {
  11348. var _this = this;
  11349. var originColumns = this.store.states.originColumns;
  11350. var columnRows = convertToRows(originColumns, this.columns);
  11351. // 是否拥有多级表头
  11352. var isGroup = columnRows.length > 1;
  11353. if (isGroup) this.$parent.isGroup = true;
  11354. return h(
  11355. 'table',
  11356. {
  11357. 'class': 'el-table__header',
  11358. attrs: { cellspacing: '0',
  11359. cellpadding: '0',
  11360. border: '0' }
  11361. },
  11362. [h('colgroup', [this.columns.map(function (column) {
  11363. return h('col', {
  11364. attrs: { name: column.id },
  11365. key: column.id });
  11366. }), this.hasGutter ? h('col', {
  11367. attrs: { name: 'gutter' }
  11368. }) : '']), h(
  11369. 'thead',
  11370. { 'class': [{ 'is-group': isGroup, 'has-gutter': this.hasGutter }] },
  11371. [this._l(columnRows, function (columns, rowIndex) {
  11372. return h(
  11373. 'tr',
  11374. {
  11375. style: _this.getHeaderRowStyle(rowIndex),
  11376. 'class': _this.getHeaderRowClass(rowIndex)
  11377. },
  11378. [columns.map(function (column, cellIndex) {
  11379. return h(
  11380. 'th',
  11381. {
  11382. attrs: {
  11383. colspan: column.colSpan,
  11384. rowspan: column.rowSpan
  11385. },
  11386. on: {
  11387. 'mousemove': function mousemove($event) {
  11388. return _this.handleMouseMove($event, column);
  11389. },
  11390. 'mouseout': _this.handleMouseOut,
  11391. 'mousedown': function mousedown($event) {
  11392. return _this.handleMouseDown($event, column);
  11393. },
  11394. 'click': function click($event) {
  11395. return _this.handleHeaderClick($event, column);
  11396. },
  11397. 'contextmenu': function contextmenu($event) {
  11398. return _this.handleHeaderContextMenu($event, column);
  11399. }
  11400. },
  11401. style: _this.getHeaderCellStyle(rowIndex, cellIndex, columns, column),
  11402. 'class': _this.getHeaderCellClass(rowIndex, cellIndex, columns, column),
  11403. key: column.id },
  11404. [h(
  11405. 'div',
  11406. { 'class': ['cell', column.filteredValue && column.filteredValue.length > 0 ? 'highlight' : '', column.labelClassName] },
  11407. [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(
  11408. 'span',
  11409. {
  11410. 'class': 'caret-wrapper',
  11411. on: {
  11412. 'click': function click($event) {
  11413. return _this.handleSortClick($event, column);
  11414. }
  11415. }
  11416. },
  11417. [h('i', { 'class': 'sort-caret ascending',
  11418. on: {
  11419. 'click': function click($event) {
  11420. return _this.handleSortClick($event, column, 'ascending');
  11421. }
  11422. }
  11423. }), h('i', { 'class': 'sort-caret descending',
  11424. on: {
  11425. 'click': function click($event) {
  11426. return _this.handleSortClick($event, column, 'descending');
  11427. }
  11428. }
  11429. })]
  11430. ) : '', column.filterable ? h(
  11431. 'span',
  11432. {
  11433. 'class': 'el-table__column-filter-trigger',
  11434. on: {
  11435. 'click': function click($event) {
  11436. return _this.handleFilterClick($event, column);
  11437. }
  11438. }
  11439. },
  11440. [h('i', { 'class': ['el-icon-arrow-down', column.filterOpened ? 'el-icon-arrow-up' : ''] })]
  11441. ) : '']
  11442. )]
  11443. );
  11444. }), _this.hasGutter ? h('th', { 'class': 'el-table__cell gutter' }) : '']
  11445. );
  11446. })]
  11447. )]
  11448. );
  11449. },
  11450. props: {
  11451. fixed: String,
  11452. store: {
  11453. required: true
  11454. },
  11455. border: Boolean,
  11456. defaultSort: {
  11457. type: Object,
  11458. default: function _default() {
  11459. return {
  11460. prop: '',
  11461. order: ''
  11462. };
  11463. }
  11464. }
  11465. },
  11466. components: {
  11467. ElCheckbox: checkbox_default.a
  11468. },
  11469. computed: table_header_extends({
  11470. table: function table() {
  11471. return this.$parent;
  11472. },
  11473. hasGutter: function hasGutter() {
  11474. return !this.fixed && this.tableLayout.gutterWidth;
  11475. }
  11476. }, mapStates({
  11477. columns: 'columns',
  11478. isAllSelected: 'isAllSelected',
  11479. leftFixedLeafCount: 'fixedLeafColumnsLength',
  11480. rightFixedLeafCount: 'rightFixedLeafColumnsLength',
  11481. columnsCount: function columnsCount(states) {
  11482. return states.columns.length;
  11483. },
  11484. leftFixedCount: function leftFixedCount(states) {
  11485. return states.fixedColumns.length;
  11486. },
  11487. rightFixedCount: function rightFixedCount(states) {
  11488. return states.rightFixedColumns.length;
  11489. }
  11490. })),
  11491. created: function created() {
  11492. this.filterPanels = {};
  11493. },
  11494. mounted: function mounted() {
  11495. var _this2 = this;
  11496. // nextTick 是有必要的 https://github.com/ElemeFE/element/pull/11311
  11497. this.$nextTick(function () {
  11498. var _defaultSort = _this2.defaultSort,
  11499. prop = _defaultSort.prop,
  11500. order = _defaultSort.order;
  11501. var init = true;
  11502. _this2.store.commit('sort', { prop: prop, order: order, init: init });
  11503. });
  11504. },
  11505. beforeDestroy: function beforeDestroy() {
  11506. var panels = this.filterPanels;
  11507. for (var prop in panels) {
  11508. if (panels.hasOwnProperty(prop) && panels[prop]) {
  11509. panels[prop].$destroy(true);
  11510. }
  11511. }
  11512. },
  11513. methods: {
  11514. isCellHidden: function isCellHidden(index, columns) {
  11515. var start = 0;
  11516. for (var i = 0; i < index; i++) {
  11517. start += columns[i].colSpan;
  11518. }
  11519. var after = start + columns[index].colSpan - 1;
  11520. if (this.fixed === true || this.fixed === 'left') {
  11521. return after >= this.leftFixedLeafCount;
  11522. } else if (this.fixed === 'right') {
  11523. return start < this.columnsCount - this.rightFixedLeafCount;
  11524. } else {
  11525. return after < this.leftFixedLeafCount || start >= this.columnsCount - this.rightFixedLeafCount;
  11526. }
  11527. },
  11528. getHeaderRowStyle: function getHeaderRowStyle(rowIndex) {
  11529. var headerRowStyle = this.table.headerRowStyle;
  11530. if (typeof headerRowStyle === 'function') {
  11531. return headerRowStyle.call(null, { rowIndex: rowIndex });
  11532. }
  11533. return headerRowStyle;
  11534. },
  11535. getHeaderRowClass: function getHeaderRowClass(rowIndex) {
  11536. var classes = [];
  11537. var headerRowClassName = this.table.headerRowClassName;
  11538. if (typeof headerRowClassName === 'string') {
  11539. classes.push(headerRowClassName);
  11540. } else if (typeof headerRowClassName === 'function') {
  11541. classes.push(headerRowClassName.call(null, { rowIndex: rowIndex }));
  11542. }
  11543. return classes.join(' ');
  11544. },
  11545. getHeaderCellStyle: function getHeaderCellStyle(rowIndex, columnIndex, row, column) {
  11546. var headerCellStyle = this.table.headerCellStyle;
  11547. if (typeof headerCellStyle === 'function') {
  11548. return headerCellStyle.call(null, {
  11549. rowIndex: rowIndex,
  11550. columnIndex: columnIndex,
  11551. row: row,
  11552. column: column
  11553. });
  11554. }
  11555. return headerCellStyle;
  11556. },
  11557. getHeaderCellClass: function getHeaderCellClass(rowIndex, columnIndex, row, column) {
  11558. var classes = [column.id, column.order, column.headerAlign, column.className, column.labelClassName];
  11559. if (rowIndex === 0 && this.isCellHidden(columnIndex, row)) {
  11560. classes.push('is-hidden');
  11561. }
  11562. if (!column.children) {
  11563. classes.push('is-leaf');
  11564. }
  11565. if (column.sortable) {
  11566. classes.push('is-sortable');
  11567. }
  11568. var headerCellClassName = this.table.headerCellClassName;
  11569. if (typeof headerCellClassName === 'string') {
  11570. classes.push(headerCellClassName);
  11571. } else if (typeof headerCellClassName === 'function') {
  11572. classes.push(headerCellClassName.call(null, {
  11573. rowIndex: rowIndex,
  11574. columnIndex: columnIndex,
  11575. row: row,
  11576. column: column
  11577. }));
  11578. }
  11579. classes.push('el-table__cell');
  11580. return classes.join(' ');
  11581. },
  11582. toggleAllSelection: function toggleAllSelection() {
  11583. this.store.commit('toggleAllSelection');
  11584. },
  11585. handleFilterClick: function handleFilterClick(event, column) {
  11586. event.stopPropagation();
  11587. var target = event.target;
  11588. var cell = target.tagName === 'TH' ? target : target.parentNode;
  11589. if (Object(dom_["hasClass"])(cell, 'noclick')) return;
  11590. cell = cell.querySelector('.el-table__column-filter-trigger') || cell;
  11591. var table = this.$parent;
  11592. var filterPanel = this.filterPanels[column.id];
  11593. if (filterPanel && column.filterOpened) {
  11594. filterPanel.showPopper = false;
  11595. return;
  11596. }
  11597. if (!filterPanel) {
  11598. filterPanel = new external_vue_default.a(filter_panel);
  11599. this.filterPanels[column.id] = filterPanel;
  11600. if (column.filterPlacement) {
  11601. filterPanel.placement = column.filterPlacement;
  11602. }
  11603. filterPanel.table = table;
  11604. filterPanel.cell = cell;
  11605. filterPanel.column = column;
  11606. !this.$isServer && filterPanel.$mount(document.createElement('div'));
  11607. }
  11608. setTimeout(function () {
  11609. filterPanel.showPopper = true;
  11610. }, 16);
  11611. },
  11612. handleHeaderClick: function handleHeaderClick(event, column) {
  11613. if (!column.filters && column.sortable) {
  11614. this.handleSortClick(event, column);
  11615. } else if (column.filterable && !column.sortable) {
  11616. this.handleFilterClick(event, column);
  11617. }
  11618. this.$parent.$emit('header-click', column, event);
  11619. },
  11620. handleHeaderContextMenu: function handleHeaderContextMenu(event, column) {
  11621. this.$parent.$emit('header-contextmenu', column, event);
  11622. },
  11623. handleMouseDown: function handleMouseDown(event, column) {
  11624. var _this3 = this;
  11625. if (this.$isServer) return;
  11626. if (column.children && column.children.length > 0) return;
  11627. /* istanbul ignore if */
  11628. if (this.draggingColumn && this.border) {
  11629. this.dragging = true;
  11630. this.$parent.resizeProxyVisible = true;
  11631. var table = this.$parent;
  11632. var tableEl = table.$el;
  11633. var tableLeft = tableEl.getBoundingClientRect().left;
  11634. var columnEl = this.$el.querySelector('th.' + column.id);
  11635. var columnRect = columnEl.getBoundingClientRect();
  11636. var minLeft = columnRect.left - tableLeft + 30;
  11637. Object(dom_["addClass"])(columnEl, 'noclick');
  11638. this.dragState = {
  11639. startMouseLeft: event.clientX,
  11640. startLeft: columnRect.right - tableLeft,
  11641. startColumnLeft: columnRect.left - tableLeft,
  11642. tableLeft: tableLeft
  11643. };
  11644. var resizeProxy = table.$refs.resizeProxy;
  11645. resizeProxy.style.left = this.dragState.startLeft + 'px';
  11646. document.onselectstart = function () {
  11647. return false;
  11648. };
  11649. document.ondragstart = function () {
  11650. return false;
  11651. };
  11652. var handleMouseMove = function handleMouseMove(event) {
  11653. var deltaLeft = event.clientX - _this3.dragState.startMouseLeft;
  11654. var proxyLeft = _this3.dragState.startLeft + deltaLeft;
  11655. resizeProxy.style.left = Math.max(minLeft, proxyLeft) + 'px';
  11656. };
  11657. var handleMouseUp = function handleMouseUp() {
  11658. if (_this3.dragging) {
  11659. var _dragState = _this3.dragState,
  11660. startColumnLeft = _dragState.startColumnLeft,
  11661. startLeft = _dragState.startLeft;
  11662. var finalLeft = parseInt(resizeProxy.style.left, 10);
  11663. var columnWidth = finalLeft - startColumnLeft;
  11664. column.width = column.realWidth = columnWidth;
  11665. table.$emit('header-dragend', column.width, startLeft - startColumnLeft, column, event);
  11666. _this3.store.scheduleLayout();
  11667. document.body.style.cursor = '';
  11668. _this3.dragging = false;
  11669. _this3.draggingColumn = null;
  11670. _this3.dragState = {};
  11671. table.resizeProxyVisible = false;
  11672. }
  11673. document.removeEventListener('mousemove', handleMouseMove);
  11674. document.removeEventListener('mouseup', handleMouseUp);
  11675. document.onselectstart = null;
  11676. document.ondragstart = null;
  11677. setTimeout(function () {
  11678. Object(dom_["removeClass"])(columnEl, 'noclick');
  11679. }, 0);
  11680. };
  11681. document.addEventListener('mousemove', handleMouseMove);
  11682. document.addEventListener('mouseup', handleMouseUp);
  11683. }
  11684. },
  11685. handleMouseMove: function handleMouseMove(event, column) {
  11686. if (column.children && column.children.length > 0) return;
  11687. var target = event.target;
  11688. while (target && target.tagName !== 'TH') {
  11689. target = target.parentNode;
  11690. }
  11691. if (!column || !column.resizable) return;
  11692. if (!this.dragging && this.border) {
  11693. var rect = target.getBoundingClientRect();
  11694. var bodyStyle = document.body.style;
  11695. if (rect.width > 12 && rect.right - event.pageX < 8) {
  11696. bodyStyle.cursor = 'col-resize';
  11697. if (Object(dom_["hasClass"])(target, 'is-sortable')) {
  11698. target.style.cursor = 'col-resize';
  11699. }
  11700. this.draggingColumn = column;
  11701. } else if (!this.dragging) {
  11702. bodyStyle.cursor = '';
  11703. if (Object(dom_["hasClass"])(target, 'is-sortable')) {
  11704. target.style.cursor = 'pointer';
  11705. }
  11706. this.draggingColumn = null;
  11707. }
  11708. }
  11709. },
  11710. handleMouseOut: function handleMouseOut() {
  11711. if (this.$isServer) return;
  11712. document.body.style.cursor = '';
  11713. },
  11714. toggleOrder: function toggleOrder(_ref) {
  11715. var order = _ref.order,
  11716. sortOrders = _ref.sortOrders;
  11717. if (order === '') return sortOrders[0];
  11718. var index = sortOrders.indexOf(order || null);
  11719. return sortOrders[index > sortOrders.length - 2 ? 0 : index + 1];
  11720. },
  11721. handleSortClick: function handleSortClick(event, column, givenOrder) {
  11722. event.stopPropagation();
  11723. var order = column.order === givenOrder ? null : givenOrder || this.toggleOrder(column);
  11724. var target = event.target;
  11725. while (target && target.tagName !== 'TH') {
  11726. target = target.parentNode;
  11727. }
  11728. if (target && target.tagName === 'TH') {
  11729. if (Object(dom_["hasClass"])(target, 'noclick')) {
  11730. Object(dom_["removeClass"])(target, 'noclick');
  11731. return;
  11732. }
  11733. }
  11734. if (!column.sortable) return;
  11735. var states = this.store.states;
  11736. var sortProp = states.sortProp;
  11737. var sortOrder = void 0;
  11738. var sortingColumn = states.sortingColumn;
  11739. if (sortingColumn !== column || sortingColumn === column && sortingColumn.order === null) {
  11740. if (sortingColumn) {
  11741. sortingColumn.order = null;
  11742. }
  11743. states.sortingColumn = column;
  11744. sortProp = column.property;
  11745. }
  11746. if (!order) {
  11747. sortOrder = column.order = null;
  11748. } else {
  11749. sortOrder = column.order = order;
  11750. }
  11751. states.sortProp = sortProp;
  11752. states.sortOrder = sortOrder;
  11753. this.store.commit('changeSortCondition');
  11754. }
  11755. },
  11756. data: function data() {
  11757. return {
  11758. draggingColumn: null,
  11759. dragging: false,
  11760. dragState: {}
  11761. };
  11762. }
  11763. });
  11764. // CONCATENATED MODULE: ./packages/table/src/table-footer.js
  11765. 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; };
  11766. /* harmony default export */ var table_footer = ({
  11767. name: 'ElTableFooter',
  11768. mixins: [layout_observer],
  11769. render: function render(h) {
  11770. var _this = this;
  11771. var sums = [];
  11772. if (this.summaryMethod) {
  11773. sums = this.summaryMethod({ columns: this.columns, data: this.store.states.data });
  11774. } else {
  11775. this.columns.forEach(function (column, index) {
  11776. if (index === 0) {
  11777. sums[index] = _this.sumText;
  11778. return;
  11779. }
  11780. var values = _this.store.states.data.map(function (item) {
  11781. return Number(item[column.property]);
  11782. });
  11783. var precisions = [];
  11784. var notNumber = true;
  11785. values.forEach(function (value) {
  11786. if (!isNaN(value)) {
  11787. notNumber = false;
  11788. var decimal = ('' + value).split('.')[1];
  11789. precisions.push(decimal ? decimal.length : 0);
  11790. }
  11791. });
  11792. var precision = Math.max.apply(null, precisions);
  11793. if (!notNumber) {
  11794. sums[index] = values.reduce(function (prev, curr) {
  11795. var value = Number(curr);
  11796. if (!isNaN(value)) {
  11797. return parseFloat((prev + curr).toFixed(Math.min(precision, 20)));
  11798. } else {
  11799. return prev;
  11800. }
  11801. }, 0);
  11802. } else {
  11803. sums[index] = '';
  11804. }
  11805. });
  11806. }
  11807. return h(
  11808. 'table',
  11809. {
  11810. 'class': 'el-table__footer',
  11811. attrs: { cellspacing: '0',
  11812. cellpadding: '0',
  11813. border: '0' }
  11814. },
  11815. [h('colgroup', [this.columns.map(function (column) {
  11816. return h('col', {
  11817. attrs: { name: column.id },
  11818. key: column.id });
  11819. }), this.hasGutter ? h('col', {
  11820. attrs: { name: 'gutter' }
  11821. }) : '']), h(
  11822. 'tbody',
  11823. { 'class': [{ 'has-gutter': this.hasGutter }] },
  11824. [h('tr', [this.columns.map(function (column, cellIndex) {
  11825. return h(
  11826. 'td',
  11827. {
  11828. key: cellIndex,
  11829. attrs: { colspan: column.colSpan,
  11830. rowspan: column.rowSpan
  11831. },
  11832. 'class': [].concat(_this.getRowClasses(column, cellIndex), ['el-table__cell']) },
  11833. [h(
  11834. 'div',
  11835. { 'class': ['cell', column.labelClassName] },
  11836. [sums[cellIndex]]
  11837. )]
  11838. );
  11839. }), this.hasGutter ? h('th', { 'class': 'el-table__cell gutter' }) : ''])]
  11840. )]
  11841. );
  11842. },
  11843. props: {
  11844. fixed: String,
  11845. store: {
  11846. required: true
  11847. },
  11848. summaryMethod: Function,
  11849. sumText: String,
  11850. border: Boolean,
  11851. defaultSort: {
  11852. type: Object,
  11853. default: function _default() {
  11854. return {
  11855. prop: '',
  11856. order: ''
  11857. };
  11858. }
  11859. }
  11860. },
  11861. computed: table_footer_extends({
  11862. table: function table() {
  11863. return this.$parent;
  11864. },
  11865. hasGutter: function hasGutter() {
  11866. return !this.fixed && this.tableLayout.gutterWidth;
  11867. }
  11868. }, mapStates({
  11869. columns: 'columns',
  11870. isAllSelected: 'isAllSelected',
  11871. leftFixedLeafCount: 'fixedLeafColumnsLength',
  11872. rightFixedLeafCount: 'rightFixedLeafColumnsLength',
  11873. columnsCount: function columnsCount(states) {
  11874. return states.columns.length;
  11875. },
  11876. leftFixedCount: function leftFixedCount(states) {
  11877. return states.fixedColumns.length;
  11878. },
  11879. rightFixedCount: function rightFixedCount(states) {
  11880. return states.rightFixedColumns.length;
  11881. }
  11882. })),
  11883. methods: {
  11884. isCellHidden: function isCellHidden(index, columns, column) {
  11885. if (this.fixed === true || this.fixed === 'left') {
  11886. return index >= this.leftFixedLeafCount;
  11887. } else if (this.fixed === 'right') {
  11888. var before = 0;
  11889. for (var i = 0; i < index; i++) {
  11890. before += columns[i].colSpan;
  11891. }
  11892. return before < this.columnsCount - this.rightFixedLeafCount;
  11893. } else if (!this.fixed && column.fixed) {
  11894. // hide cell when footer instance is not fixed and column is fixed
  11895. return true;
  11896. } else {
  11897. return index < this.leftFixedCount || index >= this.columnsCount - this.rightFixedCount;
  11898. }
  11899. },
  11900. getRowClasses: function getRowClasses(column, cellIndex) {
  11901. var classes = [column.id, column.align, column.labelClassName];
  11902. if (column.className) {
  11903. classes.push(column.className);
  11904. }
  11905. if (this.isCellHidden(cellIndex, this.columns, column)) {
  11906. classes.push('is-hidden');
  11907. }
  11908. if (!column.children) {
  11909. classes.push('is-leaf');
  11910. }
  11911. return classes;
  11912. }
  11913. }
  11914. });
  11915. // 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&
  11916. 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; };
  11917. //
  11918. //
  11919. //
  11920. //
  11921. //
  11922. //
  11923. //
  11924. //
  11925. //
  11926. //
  11927. //
  11928. //
  11929. //
  11930. //
  11931. //
  11932. //
  11933. //
  11934. //
  11935. //
  11936. //
  11937. //
  11938. //
  11939. //
  11940. //
  11941. //
  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. var tableIdSeed = 1;
  12132. /* harmony default export */ var tablevue_type_script_lang_js_ = ({
  12133. name: 'ElTable',
  12134. mixins: [locale_default.a, migrating_default.a],
  12135. directives: {
  12136. Mousewheel: directives_mousewheel
  12137. },
  12138. props: {
  12139. data: {
  12140. type: Array,
  12141. default: function _default() {
  12142. return [];
  12143. }
  12144. },
  12145. size: String,
  12146. width: [String, Number],
  12147. height: [String, Number],
  12148. maxHeight: [String, Number],
  12149. fit: {
  12150. type: Boolean,
  12151. default: true
  12152. },
  12153. stripe: Boolean,
  12154. border: Boolean,
  12155. rowKey: [String, Function],
  12156. context: {},
  12157. showHeader: {
  12158. type: Boolean,
  12159. default: true
  12160. },
  12161. showSummary: Boolean,
  12162. sumText: String,
  12163. summaryMethod: Function,
  12164. rowClassName: [String, Function],
  12165. rowStyle: [Object, Function],
  12166. cellClassName: [String, Function],
  12167. cellStyle: [Object, Function],
  12168. headerRowClassName: [String, Function],
  12169. headerRowStyle: [Object, Function],
  12170. headerCellClassName: [String, Function],
  12171. headerCellStyle: [Object, Function],
  12172. highlightCurrentRow: Boolean,
  12173. currentRowKey: [String, Number],
  12174. emptyText: String,
  12175. expandRowKeys: Array,
  12176. defaultExpandAll: Boolean,
  12177. defaultSort: Object,
  12178. tooltipEffect: String,
  12179. spanMethod: Function,
  12180. selectOnIndeterminate: {
  12181. type: Boolean,
  12182. default: true
  12183. },
  12184. indent: {
  12185. type: Number,
  12186. default: 16
  12187. },
  12188. treeProps: {
  12189. type: Object,
  12190. default: function _default() {
  12191. return {
  12192. hasChildren: 'hasChildren',
  12193. children: 'children'
  12194. };
  12195. }
  12196. },
  12197. lazy: Boolean,
  12198. load: Function
  12199. },
  12200. components: {
  12201. TableHeader: table_header,
  12202. TableFooter: table_footer,
  12203. TableBody: table_body,
  12204. ElCheckbox: checkbox_default.a
  12205. },
  12206. methods: {
  12207. getMigratingConfig: function getMigratingConfig() {
  12208. return {
  12209. events: {
  12210. expand: 'expand is renamed to expand-change'
  12211. }
  12212. };
  12213. },
  12214. setCurrentRow: function setCurrentRow(row) {
  12215. this.store.commit('setCurrentRow', row);
  12216. },
  12217. toggleRowSelection: function toggleRowSelection(row, selected) {
  12218. this.store.toggleRowSelection(row, selected, false);
  12219. this.store.updateAllSelected();
  12220. },
  12221. toggleRowExpansion: function toggleRowExpansion(row, expanded) {
  12222. this.store.toggleRowExpansionAdapter(row, expanded);
  12223. },
  12224. clearSelection: function clearSelection() {
  12225. this.store.clearSelection();
  12226. },
  12227. clearFilter: function clearFilter(columnKeys) {
  12228. this.store.clearFilter(columnKeys);
  12229. },
  12230. clearSort: function clearSort() {
  12231. this.store.clearSort();
  12232. },
  12233. handleMouseLeave: function handleMouseLeave() {
  12234. this.store.commit('setHoverRow', null);
  12235. if (this.hoverState) this.hoverState = null;
  12236. },
  12237. updateScrollY: function updateScrollY() {
  12238. var changed = this.layout.updateScrollY();
  12239. if (changed) {
  12240. this.layout.notifyObservers('scrollable');
  12241. this.layout.updateColumnsWidth();
  12242. }
  12243. },
  12244. handleFixedMousewheel: function handleFixedMousewheel(event, data) {
  12245. var bodyWrapper = this.bodyWrapper;
  12246. if (Math.abs(data.spinY) > 0) {
  12247. var currentScrollTop = bodyWrapper.scrollTop;
  12248. if (data.pixelY < 0 && currentScrollTop !== 0) {
  12249. event.preventDefault();
  12250. }
  12251. if (data.pixelY > 0 && bodyWrapper.scrollHeight - bodyWrapper.clientHeight > currentScrollTop) {
  12252. event.preventDefault();
  12253. }
  12254. bodyWrapper.scrollTop += Math.ceil(data.pixelY / 5);
  12255. } else {
  12256. bodyWrapper.scrollLeft += Math.ceil(data.pixelX / 5);
  12257. }
  12258. },
  12259. handleHeaderFooterMousewheel: function handleHeaderFooterMousewheel(event, data) {
  12260. var pixelX = data.pixelX,
  12261. pixelY = data.pixelY;
  12262. if (Math.abs(pixelX) >= Math.abs(pixelY)) {
  12263. this.bodyWrapper.scrollLeft += data.pixelX / 5;
  12264. }
  12265. },
  12266. // TODO 使用 CSS transform
  12267. syncPostion: function syncPostion() {
  12268. var _bodyWrapper = this.bodyWrapper,
  12269. scrollLeft = _bodyWrapper.scrollLeft,
  12270. scrollTop = _bodyWrapper.scrollTop,
  12271. offsetWidth = _bodyWrapper.offsetWidth,
  12272. scrollWidth = _bodyWrapper.scrollWidth;
  12273. var _$refs = this.$refs,
  12274. headerWrapper = _$refs.headerWrapper,
  12275. footerWrapper = _$refs.footerWrapper,
  12276. fixedBodyWrapper = _$refs.fixedBodyWrapper,
  12277. rightFixedBodyWrapper = _$refs.rightFixedBodyWrapper;
  12278. if (headerWrapper) headerWrapper.scrollLeft = scrollLeft;
  12279. if (footerWrapper) footerWrapper.scrollLeft = scrollLeft;
  12280. if (fixedBodyWrapper) fixedBodyWrapper.scrollTop = scrollTop;
  12281. if (rightFixedBodyWrapper) rightFixedBodyWrapper.scrollTop = scrollTop;
  12282. var maxScrollLeftPosition = scrollWidth - offsetWidth - 1;
  12283. if (scrollLeft >= maxScrollLeftPosition) {
  12284. this.scrollPosition = 'right';
  12285. } else if (scrollLeft === 0) {
  12286. this.scrollPosition = 'left';
  12287. } else {
  12288. this.scrollPosition = 'middle';
  12289. }
  12290. },
  12291. throttleSyncPostion: Object(external_throttle_debounce_["throttle"])(16, function () {
  12292. this.syncPostion();
  12293. }),
  12294. onScroll: function onScroll(evt) {
  12295. var raf = window.requestAnimationFrame;
  12296. if (!raf) {
  12297. this.throttleSyncPostion();
  12298. } else {
  12299. raf(this.syncPostion);
  12300. }
  12301. },
  12302. bindEvents: function bindEvents() {
  12303. this.bodyWrapper.addEventListener('scroll', this.onScroll, { passive: true });
  12304. if (this.fit) {
  12305. Object(resize_event_["addResizeListener"])(this.$el, this.resizeListener);
  12306. }
  12307. },
  12308. unbindEvents: function unbindEvents() {
  12309. this.bodyWrapper.removeEventListener('scroll', this.onScroll, { passive: true });
  12310. if (this.fit) {
  12311. Object(resize_event_["removeResizeListener"])(this.$el, this.resizeListener);
  12312. }
  12313. },
  12314. resizeListener: function resizeListener() {
  12315. if (!this.$ready) return;
  12316. var shouldUpdateLayout = false;
  12317. var el = this.$el;
  12318. var _resizeState = this.resizeState,
  12319. oldWidth = _resizeState.width,
  12320. oldHeight = _resizeState.height;
  12321. var width = el.offsetWidth;
  12322. if (oldWidth !== width) {
  12323. shouldUpdateLayout = true;
  12324. }
  12325. var height = el.offsetHeight;
  12326. if ((this.height || this.shouldUpdateHeight) && oldHeight !== height) {
  12327. shouldUpdateLayout = true;
  12328. }
  12329. if (shouldUpdateLayout) {
  12330. this.resizeState.width = width;
  12331. this.resizeState.height = height;
  12332. this.doLayout();
  12333. }
  12334. },
  12335. doLayout: function doLayout() {
  12336. if (this.shouldUpdateHeight) {
  12337. this.layout.updateElsHeight();
  12338. }
  12339. this.layout.updateColumnsWidth();
  12340. },
  12341. sort: function sort(prop, order) {
  12342. this.store.commit('sort', { prop: prop, order: order });
  12343. },
  12344. toggleAllSelection: function toggleAllSelection() {
  12345. this.store.commit('toggleAllSelection');
  12346. }
  12347. },
  12348. computed: tablevue_type_script_lang_js_extends({
  12349. tableSize: function tableSize() {
  12350. return this.size || (this.$ELEMENT || {}).size;
  12351. },
  12352. bodyWrapper: function bodyWrapper() {
  12353. return this.$refs.bodyWrapper;
  12354. },
  12355. shouldUpdateHeight: function shouldUpdateHeight() {
  12356. return this.height || this.maxHeight || this.fixedColumns.length > 0 || this.rightFixedColumns.length > 0;
  12357. },
  12358. bodyWidth: function bodyWidth() {
  12359. var _layout = this.layout,
  12360. bodyWidth = _layout.bodyWidth,
  12361. scrollY = _layout.scrollY,
  12362. gutterWidth = _layout.gutterWidth;
  12363. return bodyWidth ? bodyWidth - (scrollY ? gutterWidth : 0) + 'px' : '';
  12364. },
  12365. bodyHeight: function bodyHeight() {
  12366. var _layout2 = this.layout,
  12367. _layout2$headerHeight = _layout2.headerHeight,
  12368. headerHeight = _layout2$headerHeight === undefined ? 0 : _layout2$headerHeight,
  12369. bodyHeight = _layout2.bodyHeight,
  12370. _layout2$footerHeight = _layout2.footerHeight,
  12371. footerHeight = _layout2$footerHeight === undefined ? 0 : _layout2$footerHeight;
  12372. if (this.height) {
  12373. return {
  12374. height: bodyHeight ? bodyHeight + 'px' : ''
  12375. };
  12376. } else if (this.maxHeight) {
  12377. var maxHeight = parseHeight(this.maxHeight);
  12378. if (typeof maxHeight === 'number') {
  12379. return {
  12380. 'max-height': maxHeight - footerHeight - (this.showHeader ? headerHeight : 0) + 'px'
  12381. };
  12382. }
  12383. }
  12384. return {};
  12385. },
  12386. fixedBodyHeight: function fixedBodyHeight() {
  12387. if (this.height) {
  12388. return {
  12389. height: this.layout.fixedBodyHeight ? this.layout.fixedBodyHeight + 'px' : ''
  12390. };
  12391. } else if (this.maxHeight) {
  12392. var maxHeight = parseHeight(this.maxHeight);
  12393. if (typeof maxHeight === 'number') {
  12394. maxHeight = this.layout.scrollX ? maxHeight - this.layout.gutterWidth : maxHeight;
  12395. if (this.showHeader) {
  12396. maxHeight -= this.layout.headerHeight;
  12397. }
  12398. maxHeight -= this.layout.footerHeight;
  12399. return {
  12400. 'max-height': maxHeight + 'px'
  12401. };
  12402. }
  12403. }
  12404. return {};
  12405. },
  12406. fixedHeight: function fixedHeight() {
  12407. if (this.maxHeight) {
  12408. if (this.showSummary) {
  12409. return {
  12410. bottom: 0
  12411. };
  12412. }
  12413. return {
  12414. bottom: this.layout.scrollX && this.data.length ? this.layout.gutterWidth + 'px' : ''
  12415. };
  12416. } else {
  12417. if (this.showSummary) {
  12418. return {
  12419. height: this.layout.tableHeight ? this.layout.tableHeight + 'px' : ''
  12420. };
  12421. }
  12422. return {
  12423. height: this.layout.viewportHeight ? this.layout.viewportHeight + 'px' : ''
  12424. };
  12425. }
  12426. },
  12427. emptyBlockStyle: function emptyBlockStyle() {
  12428. if (this.data && this.data.length) return null;
  12429. var height = '100%';
  12430. if (this.layout.appendHeight) {
  12431. height = 'calc(100% - ' + this.layout.appendHeight + 'px)';
  12432. }
  12433. return {
  12434. width: this.bodyWidth,
  12435. height: height
  12436. };
  12437. }
  12438. }, mapStates({
  12439. selection: 'selection',
  12440. columns: 'columns',
  12441. tableData: 'data',
  12442. fixedColumns: 'fixedColumns',
  12443. rightFixedColumns: 'rightFixedColumns'
  12444. })),
  12445. watch: {
  12446. height: {
  12447. immediate: true,
  12448. handler: function handler(value) {
  12449. this.layout.setHeight(value);
  12450. }
  12451. },
  12452. maxHeight: {
  12453. immediate: true,
  12454. handler: function handler(value) {
  12455. this.layout.setMaxHeight(value);
  12456. }
  12457. },
  12458. currentRowKey: {
  12459. immediate: true,
  12460. handler: function handler(value) {
  12461. if (!this.rowKey) return;
  12462. this.store.setCurrentRowKey(value);
  12463. }
  12464. },
  12465. data: {
  12466. immediate: true,
  12467. handler: function handler(value) {
  12468. this.store.commit('setData', value);
  12469. }
  12470. },
  12471. expandRowKeys: {
  12472. immediate: true,
  12473. handler: function handler(newVal) {
  12474. if (newVal) {
  12475. this.store.setExpandRowKeysAdapter(newVal);
  12476. }
  12477. }
  12478. }
  12479. },
  12480. created: function created() {
  12481. var _this = this;
  12482. this.tableId = 'el-table_' + tableIdSeed++;
  12483. this.debouncedUpdateLayout = Object(external_throttle_debounce_["debounce"])(50, function () {
  12484. return _this.doLayout();
  12485. });
  12486. },
  12487. mounted: function mounted() {
  12488. var _this2 = this;
  12489. this.bindEvents();
  12490. this.store.updateColumns();
  12491. this.doLayout();
  12492. this.resizeState = {
  12493. width: this.$el.offsetWidth,
  12494. height: this.$el.offsetHeight
  12495. };
  12496. // init filters
  12497. this.store.states.columns.forEach(function (column) {
  12498. if (column.filteredValue && column.filteredValue.length) {
  12499. _this2.store.commit('filterChange', {
  12500. column: column,
  12501. values: column.filteredValue,
  12502. silent: true
  12503. });
  12504. }
  12505. });
  12506. this.$ready = true;
  12507. },
  12508. destroyed: function destroyed() {
  12509. this.unbindEvents();
  12510. },
  12511. data: function data() {
  12512. var _treeProps = this.treeProps,
  12513. _treeProps$hasChildre = _treeProps.hasChildren,
  12514. hasChildren = _treeProps$hasChildre === undefined ? 'hasChildren' : _treeProps$hasChildre,
  12515. _treeProps$children = _treeProps.children,
  12516. children = _treeProps$children === undefined ? 'children' : _treeProps$children;
  12517. this.store = createStore(this, {
  12518. rowKey: this.rowKey,
  12519. defaultExpandAll: this.defaultExpandAll,
  12520. selectOnIndeterminate: this.selectOnIndeterminate,
  12521. // TreeTable 的相关配置
  12522. indent: this.indent,
  12523. lazy: this.lazy,
  12524. lazyColumnIdentifier: hasChildren,
  12525. childrenColumnName: children
  12526. });
  12527. var layout = new table_layout({
  12528. store: this.store,
  12529. table: this,
  12530. fit: this.fit,
  12531. showHeader: this.showHeader
  12532. });
  12533. return {
  12534. layout: layout,
  12535. isHidden: false,
  12536. renderExpanded: null,
  12537. resizeProxyVisible: false,
  12538. resizeState: {
  12539. width: null,
  12540. height: null
  12541. },
  12542. // 是否拥有多级表头
  12543. isGroup: false,
  12544. scrollPosition: 'left'
  12545. };
  12546. }
  12547. });
  12548. // CONCATENATED MODULE: ./packages/table/src/table.vue?vue&type=script&lang=js&
  12549. /* harmony default export */ var src_tablevue_type_script_lang_js_ = (tablevue_type_script_lang_js_);
  12550. // CONCATENATED MODULE: ./packages/table/src/table.vue
  12551. /* normalize component */
  12552. var table_component = normalizeComponent(
  12553. src_tablevue_type_script_lang_js_,
  12554. tablevue_type_template_id_493fe34e_render,
  12555. tablevue_type_template_id_493fe34e_staticRenderFns,
  12556. false,
  12557. null,
  12558. null,
  12559. null
  12560. )
  12561. /* hot reload */
  12562. if (false) { var table_api; }
  12563. table_component.options.__file = "packages/table/src/table.vue"
  12564. /* harmony default export */ var src_table = (table_component.exports);
  12565. // CONCATENATED MODULE: ./packages/table/index.js
  12566. /* istanbul ignore next */
  12567. src_table.install = function (Vue) {
  12568. Vue.component(src_table.name, src_table);
  12569. };
  12570. /* harmony default export */ var packages_table = (src_table);
  12571. // CONCATENATED MODULE: ./packages/table/src/config.js
  12572. var cellStarts = {
  12573. default: {
  12574. order: ''
  12575. },
  12576. selection: {
  12577. width: 48,
  12578. minWidth: 48,
  12579. realWidth: 48,
  12580. order: '',
  12581. className: 'el-table-column--selection'
  12582. },
  12583. expand: {
  12584. width: 48,
  12585. minWidth: 48,
  12586. realWidth: 48,
  12587. order: ''
  12588. },
  12589. index: {
  12590. width: 48,
  12591. minWidth: 48,
  12592. realWidth: 48,
  12593. order: ''
  12594. }
  12595. };
  12596. // 这些选项不应该被覆盖
  12597. var cellForced = {
  12598. selection: {
  12599. renderHeader: function renderHeader(h, _ref) {
  12600. var store = _ref.store;
  12601. return h('el-checkbox', {
  12602. attrs: {
  12603. disabled: store.states.data && store.states.data.length === 0,
  12604. indeterminate: store.states.selection.length > 0 && !this.isAllSelected,
  12605. value: this.isAllSelected },
  12606. on: {
  12607. 'input': this.toggleAllSelection
  12608. }
  12609. });
  12610. },
  12611. renderCell: function renderCell(h, _ref2) {
  12612. var row = _ref2.row,
  12613. column = _ref2.column,
  12614. isSelected = _ref2.isSelected,
  12615. store = _ref2.store,
  12616. $index = _ref2.$index;
  12617. return h('el-checkbox', {
  12618. nativeOn: {
  12619. 'click': function click(event) {
  12620. return event.stopPropagation();
  12621. }
  12622. },
  12623. attrs: {
  12624. value: isSelected,
  12625. disabled: column.selectable ? !column.selectable.call(null, row, $index) : false
  12626. },
  12627. on: {
  12628. 'input': function input() {
  12629. store.commit('rowSelectedChanged', row);
  12630. }
  12631. }
  12632. });
  12633. },
  12634. sortable: false,
  12635. resizable: false
  12636. },
  12637. index: {
  12638. renderHeader: function renderHeader(h, _ref3) {
  12639. var column = _ref3.column;
  12640. return column.label || '#';
  12641. },
  12642. renderCell: function renderCell(h, _ref4) {
  12643. var $index = _ref4.$index,
  12644. column = _ref4.column;
  12645. var i = $index + 1;
  12646. var index = column.index;
  12647. if (typeof index === 'number') {
  12648. i = $index + index;
  12649. } else if (typeof index === 'function') {
  12650. i = index($index);
  12651. }
  12652. return h('div', [i]);
  12653. },
  12654. sortable: false
  12655. },
  12656. expand: {
  12657. renderHeader: function renderHeader(h, _ref5) {
  12658. var column = _ref5.column;
  12659. return column.label || '';
  12660. },
  12661. renderCell: function renderCell(h, _ref6) {
  12662. var row = _ref6.row,
  12663. store = _ref6.store,
  12664. isExpanded = _ref6.isExpanded;
  12665. var classes = ['el-table__expand-icon'];
  12666. if (isExpanded) {
  12667. classes.push('el-table__expand-icon--expanded');
  12668. }
  12669. var callback = function callback(e) {
  12670. e.stopPropagation();
  12671. store.toggleRowExpansion(row);
  12672. };
  12673. return h(
  12674. 'div',
  12675. { 'class': classes,
  12676. on: {
  12677. 'click': callback
  12678. }
  12679. },
  12680. [h('i', { 'class': 'el-icon el-icon-arrow-right' })]
  12681. );
  12682. },
  12683. sortable: false,
  12684. resizable: false,
  12685. className: 'el-table__expand-column'
  12686. }
  12687. };
  12688. function defaultRenderCell(h, _ref7) {
  12689. var row = _ref7.row,
  12690. column = _ref7.column,
  12691. $index = _ref7.$index;
  12692. var property = column.property;
  12693. var value = property && Object(util_["getPropByPath"])(row, property).v;
  12694. if (column && column.formatter) {
  12695. return column.formatter(row, column, value, $index);
  12696. }
  12697. return value;
  12698. }
  12699. function treeCellPrefix(h, _ref8) {
  12700. var row = _ref8.row,
  12701. treeNode = _ref8.treeNode,
  12702. store = _ref8.store;
  12703. if (!treeNode) return null;
  12704. var ele = [];
  12705. var callback = function callback(e) {
  12706. e.stopPropagation();
  12707. store.loadOrToggle(row);
  12708. };
  12709. if (treeNode.indent) {
  12710. ele.push(h('span', { 'class': 'el-table__indent', style: { 'padding-left': treeNode.indent + 'px' } }));
  12711. }
  12712. if (typeof treeNode.expanded === 'boolean' && !treeNode.noLazyChildren) {
  12713. var expandClasses = ['el-table__expand-icon', treeNode.expanded ? 'el-table__expand-icon--expanded' : ''];
  12714. var iconClasses = ['el-icon-arrow-right'];
  12715. if (treeNode.loading) {
  12716. iconClasses = ['el-icon-loading'];
  12717. }
  12718. ele.push(h(
  12719. 'div',
  12720. { 'class': expandClasses,
  12721. on: {
  12722. 'click': callback
  12723. }
  12724. },
  12725. [h('i', { 'class': iconClasses })]
  12726. ));
  12727. } else {
  12728. ele.push(h('span', { 'class': 'el-table__placeholder' }));
  12729. }
  12730. return ele;
  12731. }
  12732. // CONCATENATED MODULE: ./packages/table/src/table-column.js
  12733. 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; };
  12734. var columnIdSeed = 1;
  12735. /* harmony default export */ var table_column = ({
  12736. name: 'ElTableColumn',
  12737. props: {
  12738. type: {
  12739. type: String,
  12740. default: 'default'
  12741. },
  12742. label: String,
  12743. className: String,
  12744. labelClassName: String,
  12745. property: String,
  12746. prop: String,
  12747. width: {},
  12748. minWidth: {},
  12749. renderHeader: Function,
  12750. sortable: {
  12751. type: [Boolean, String],
  12752. default: false
  12753. },
  12754. sortMethod: Function,
  12755. sortBy: [String, Function, Array],
  12756. resizable: {
  12757. type: Boolean,
  12758. default: true
  12759. },
  12760. columnKey: String,
  12761. align: String,
  12762. headerAlign: String,
  12763. showTooltipWhenOverflow: Boolean,
  12764. showOverflowTooltip: Boolean,
  12765. fixed: [Boolean, String],
  12766. formatter: Function,
  12767. selectable: Function,
  12768. reserveSelection: Boolean,
  12769. filterMethod: Function,
  12770. filteredValue: Array,
  12771. filters: Array,
  12772. filterPlacement: String,
  12773. filterMultiple: {
  12774. type: Boolean,
  12775. default: true
  12776. },
  12777. index: [Number, Function],
  12778. sortOrders: {
  12779. type: Array,
  12780. default: function _default() {
  12781. return ['ascending', 'descending', null];
  12782. },
  12783. validator: function validator(val) {
  12784. return val.every(function (order) {
  12785. return ['ascending', 'descending', null].indexOf(order) > -1;
  12786. });
  12787. }
  12788. }
  12789. },
  12790. data: function data() {
  12791. return {
  12792. isSubColumn: false,
  12793. columns: []
  12794. };
  12795. },
  12796. computed: {
  12797. owner: function owner() {
  12798. var parent = this.$parent;
  12799. while (parent && !parent.tableId) {
  12800. parent = parent.$parent;
  12801. }
  12802. return parent;
  12803. },
  12804. columnOrTableParent: function columnOrTableParent() {
  12805. var parent = this.$parent;
  12806. while (parent && !parent.tableId && !parent.columnId) {
  12807. parent = parent.$parent;
  12808. }
  12809. return parent;
  12810. },
  12811. realWidth: function realWidth() {
  12812. return parseWidth(this.width);
  12813. },
  12814. realMinWidth: function realMinWidth() {
  12815. return parseMinWidth(this.minWidth);
  12816. },
  12817. realAlign: function realAlign() {
  12818. return this.align ? 'is-' + this.align : null;
  12819. },
  12820. realHeaderAlign: function realHeaderAlign() {
  12821. return this.headerAlign ? 'is-' + this.headerAlign : this.realAlign;
  12822. }
  12823. },
  12824. methods: {
  12825. getPropsData: function getPropsData() {
  12826. var _this = this;
  12827. for (var _len = arguments.length, props = Array(_len), _key = 0; _key < _len; _key++) {
  12828. props[_key] = arguments[_key];
  12829. }
  12830. return props.reduce(function (prev, cur) {
  12831. if (Array.isArray(cur)) {
  12832. cur.forEach(function (key) {
  12833. prev[key] = _this[key];
  12834. });
  12835. }
  12836. return prev;
  12837. }, {});
  12838. },
  12839. getColumnElIndex: function getColumnElIndex(children, child) {
  12840. return [].indexOf.call(children, child);
  12841. },
  12842. setColumnWidth: function setColumnWidth(column) {
  12843. if (this.realWidth) {
  12844. column.width = this.realWidth;
  12845. }
  12846. if (this.realMinWidth) {
  12847. column.minWidth = this.realMinWidth;
  12848. }
  12849. if (!column.minWidth) {
  12850. column.minWidth = 80;
  12851. }
  12852. column.realWidth = column.width === undefined ? column.minWidth : column.width;
  12853. return column;
  12854. },
  12855. setColumnForcedProps: function setColumnForcedProps(column) {
  12856. // 对于特定类型的 column,某些属性不允许设置
  12857. var type = column.type;
  12858. var source = cellForced[type] || {};
  12859. Object.keys(source).forEach(function (prop) {
  12860. var value = source[prop];
  12861. if (value !== undefined) {
  12862. column[prop] = prop === 'className' ? column[prop] + ' ' + value : value;
  12863. }
  12864. });
  12865. return column;
  12866. },
  12867. setColumnRenders: function setColumnRenders(column) {
  12868. var _this2 = this;
  12869. var h = this.$createElement;
  12870. // renderHeader 属性不推荐使用。
  12871. if (this.renderHeader) {
  12872. console.warn('[Element Warn][TableColumn]Comparing to render-header, scoped-slot header is easier to use. We recommend users to use scoped-slot header.');
  12873. } else if (column.type !== 'selection') {
  12874. column.renderHeader = function (h, scope) {
  12875. var renderHeader = _this2.$scopedSlots.header;
  12876. return renderHeader ? renderHeader(scope) : column.label;
  12877. };
  12878. }
  12879. var originRenderCell = column.renderCell;
  12880. // TODO: 这里的实现调整
  12881. if (column.type === 'expand') {
  12882. // 对于展开行,renderCell 不允许配置的。在上一步中已经设置过,这里需要简单封装一下。
  12883. column.renderCell = function (h, data) {
  12884. return h(
  12885. 'div',
  12886. { 'class': 'cell' },
  12887. [originRenderCell(h, data)]
  12888. );
  12889. };
  12890. this.owner.renderExpanded = function (h, data) {
  12891. return _this2.$scopedSlots.default ? _this2.$scopedSlots.default(data) : _this2.$slots.default;
  12892. };
  12893. } else {
  12894. originRenderCell = originRenderCell || defaultRenderCell;
  12895. // 对 renderCell 进行包装
  12896. column.renderCell = function (h, data) {
  12897. var children = null;
  12898. if (_this2.$scopedSlots.default) {
  12899. children = _this2.$scopedSlots.default(data);
  12900. } else {
  12901. children = originRenderCell(h, data);
  12902. }
  12903. var prefix = treeCellPrefix(h, data);
  12904. var props = {
  12905. class: 'cell',
  12906. style: {}
  12907. };
  12908. if (column.showOverflowTooltip) {
  12909. props.class += ' el-tooltip';
  12910. props.style = { width: (data.column.realWidth || data.column.width) - 1 + 'px' };
  12911. }
  12912. return h(
  12913. 'div',
  12914. props,
  12915. [prefix, children]
  12916. );
  12917. };
  12918. }
  12919. return column;
  12920. },
  12921. registerNormalWatchers: function registerNormalWatchers() {
  12922. var _this3 = this;
  12923. var props = ['label', 'property', 'filters', 'filterMultiple', 'sortable', 'index', 'formatter', 'className', 'labelClassName', 'showOverflowTooltip'];
  12924. // 一些属性具有别名
  12925. var aliases = {
  12926. prop: 'property',
  12927. realAlign: 'align',
  12928. realHeaderAlign: 'headerAlign',
  12929. realWidth: 'width'
  12930. };
  12931. var allAliases = props.reduce(function (prev, cur) {
  12932. prev[cur] = cur;
  12933. return prev;
  12934. }, aliases);
  12935. Object.keys(allAliases).forEach(function (key) {
  12936. var columnKey = aliases[key];
  12937. _this3.$watch(key, function (newVal) {
  12938. _this3.columnConfig[columnKey] = newVal;
  12939. });
  12940. });
  12941. },
  12942. registerComplexWatchers: function registerComplexWatchers() {
  12943. var _this4 = this;
  12944. var props = ['fixed'];
  12945. var aliases = {
  12946. realWidth: 'width',
  12947. realMinWidth: 'minWidth'
  12948. };
  12949. var allAliases = props.reduce(function (prev, cur) {
  12950. prev[cur] = cur;
  12951. return prev;
  12952. }, aliases);
  12953. Object.keys(allAliases).forEach(function (key) {
  12954. var columnKey = aliases[key];
  12955. _this4.$watch(key, function (newVal) {
  12956. _this4.columnConfig[columnKey] = newVal;
  12957. var updateColumns = columnKey === 'fixed';
  12958. _this4.owner.store.scheduleLayout(updateColumns);
  12959. });
  12960. });
  12961. }
  12962. },
  12963. components: {
  12964. ElCheckbox: checkbox_default.a
  12965. },
  12966. beforeCreate: function beforeCreate() {
  12967. this.row = {};
  12968. this.column = {};
  12969. this.$index = 0;
  12970. this.columnId = '';
  12971. },
  12972. created: function created() {
  12973. var parent = this.columnOrTableParent;
  12974. this.isSubColumn = this.owner !== parent;
  12975. this.columnId = (parent.tableId || parent.columnId) + '_column_' + columnIdSeed++;
  12976. var type = this.type || 'default';
  12977. var sortable = this.sortable === '' ? true : this.sortable;
  12978. var defaults = table_column_extends({}, cellStarts[type], {
  12979. id: this.columnId,
  12980. type: type,
  12981. property: this.prop || this.property,
  12982. align: this.realAlign,
  12983. headerAlign: this.realHeaderAlign,
  12984. showOverflowTooltip: this.showOverflowTooltip || this.showTooltipWhenOverflow,
  12985. // filter 相关属性
  12986. filterable: this.filters || this.filterMethod,
  12987. filteredValue: [],
  12988. filterPlacement: '',
  12989. isColumnGroup: false,
  12990. filterOpened: false,
  12991. // sort 相关属性
  12992. sortable: sortable,
  12993. // index 列
  12994. index: this.index
  12995. });
  12996. var basicProps = ['columnKey', 'label', 'className', 'labelClassName', 'type', 'renderHeader', 'formatter', 'fixed', 'resizable'];
  12997. var sortProps = ['sortMethod', 'sortBy', 'sortOrders'];
  12998. var selectProps = ['selectable', 'reserveSelection'];
  12999. var filterProps = ['filterMethod', 'filters', 'filterMultiple', 'filterOpened', 'filteredValue', 'filterPlacement'];
  13000. var column = this.getPropsData(basicProps, sortProps, selectProps, filterProps);
  13001. column = mergeOptions(defaults, column);
  13002. // 注意 compose 中函数执行的顺序是从右到左
  13003. var chains = compose(this.setColumnRenders, this.setColumnWidth, this.setColumnForcedProps);
  13004. column = chains(column);
  13005. this.columnConfig = column;
  13006. // 注册 watcher
  13007. this.registerNormalWatchers();
  13008. this.registerComplexWatchers();
  13009. },
  13010. mounted: function mounted() {
  13011. var owner = this.owner;
  13012. var parent = this.columnOrTableParent;
  13013. var children = this.isSubColumn ? parent.$el.children : parent.$refs.hiddenColumns.children;
  13014. var columnIndex = this.getColumnElIndex(children, this.$el);
  13015. owner.store.commit('insertColumn', this.columnConfig, columnIndex, this.isSubColumn ? parent.columnConfig : null);
  13016. },
  13017. destroyed: function destroyed() {
  13018. if (!this.$parent) return;
  13019. var parent = this.$parent;
  13020. this.owner.store.commit('removeColumn', this.columnConfig, this.isSubColumn ? parent.columnConfig : null);
  13021. },
  13022. render: function render(h) {
  13023. // slots 也要渲染,需要计算合并表头
  13024. return h('div', this.$slots.default);
  13025. }
  13026. });
  13027. // CONCATENATED MODULE: ./packages/table-column/index.js
  13028. /* istanbul ignore next */
  13029. table_column.install = function (Vue) {
  13030. Vue.component(table_column.name, table_column);
  13031. };
  13032. /* harmony default export */ var packages_table_column = (table_column);
  13033. // 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&
  13034. var pickervue_type_template_id_79ae069f_render = function() {
  13035. var _vm = this
  13036. var _h = _vm.$createElement
  13037. var _c = _vm._self._c || _h
  13038. return !_vm.ranged
  13039. ? _c(
  13040. "el-input",
  13041. _vm._b(
  13042. {
  13043. directives: [
  13044. {
  13045. name: "clickoutside",
  13046. rawName: "v-clickoutside",
  13047. value: _vm.handleClose,
  13048. expression: "handleClose"
  13049. }
  13050. ],
  13051. ref: "reference",
  13052. staticClass: "el-date-editor",
  13053. class: "el-date-editor--" + _vm.type,
  13054. attrs: {
  13055. readonly:
  13056. !_vm.editable ||
  13057. _vm.readonly ||
  13058. _vm.type === "dates" ||
  13059. _vm.type === "week" ||
  13060. _vm.type === "years" ||
  13061. _vm.type === "months",
  13062. disabled: _vm.pickerDisabled,
  13063. size: _vm.pickerSize,
  13064. name: _vm.name,
  13065. placeholder: _vm.placeholder,
  13066. value: _vm.displayValue,
  13067. validateEvent: false
  13068. },
  13069. on: {
  13070. focus: _vm.handleFocus,
  13071. input: function(value) {
  13072. return (_vm.userInput = value)
  13073. },
  13074. change: _vm.handleChange
  13075. },
  13076. nativeOn: {
  13077. keydown: function($event) {
  13078. return _vm.handleKeydown($event)
  13079. },
  13080. mouseenter: function($event) {
  13081. return _vm.handleMouseEnter($event)
  13082. },
  13083. mouseleave: function($event) {
  13084. _vm.showClose = false
  13085. }
  13086. }
  13087. },
  13088. "el-input",
  13089. _vm.firstInputId,
  13090. false
  13091. ),
  13092. [
  13093. _c("i", {
  13094. staticClass: "el-input__icon",
  13095. class: _vm.triggerClass,
  13096. attrs: { slot: "prefix" },
  13097. on: { click: _vm.handleFocus },
  13098. slot: "prefix"
  13099. }),
  13100. _vm.haveTrigger
  13101. ? _c("i", {
  13102. staticClass: "el-input__icon",
  13103. class: [_vm.showClose ? "" + _vm.clearIcon : ""],
  13104. attrs: { slot: "suffix" },
  13105. on: { click: _vm.handleClickIcon },
  13106. slot: "suffix"
  13107. })
  13108. : _vm._e()
  13109. ]
  13110. )
  13111. : _c(
  13112. "div",
  13113. {
  13114. directives: [
  13115. {
  13116. name: "clickoutside",
  13117. rawName: "v-clickoutside",
  13118. value: _vm.handleClose,
  13119. expression: "handleClose"
  13120. }
  13121. ],
  13122. ref: "reference",
  13123. staticClass: "el-date-editor el-range-editor el-input__inner",
  13124. class: [
  13125. "el-date-editor--" + _vm.type,
  13126. _vm.pickerSize ? "el-range-editor--" + _vm.pickerSize : "",
  13127. _vm.pickerDisabled ? "is-disabled" : "",
  13128. _vm.pickerVisible ? "is-active" : ""
  13129. ],
  13130. on: {
  13131. click: _vm.handleRangeClick,
  13132. mouseenter: _vm.handleMouseEnter,
  13133. mouseleave: function($event) {
  13134. _vm.showClose = false
  13135. },
  13136. keydown: _vm.handleKeydown
  13137. }
  13138. },
  13139. [
  13140. _c("i", {
  13141. class: ["el-input__icon", "el-range__icon", _vm.triggerClass]
  13142. }),
  13143. _c(
  13144. "input",
  13145. _vm._b(
  13146. {
  13147. staticClass: "el-range-input",
  13148. attrs: {
  13149. autocomplete: "off",
  13150. placeholder: _vm.startPlaceholder,
  13151. disabled: _vm.pickerDisabled,
  13152. readonly: !_vm.editable || _vm.readonly,
  13153. name: _vm.name && _vm.name[0]
  13154. },
  13155. domProps: { value: _vm.displayValue && _vm.displayValue[0] },
  13156. on: {
  13157. input: _vm.handleStartInput,
  13158. change: _vm.handleStartChange,
  13159. focus: _vm.handleFocus
  13160. }
  13161. },
  13162. "input",
  13163. _vm.firstInputId,
  13164. false
  13165. )
  13166. ),
  13167. _vm._t("range-separator", [
  13168. _c("span", { staticClass: "el-range-separator" }, [
  13169. _vm._v(_vm._s(_vm.rangeSeparator))
  13170. ])
  13171. ]),
  13172. _c(
  13173. "input",
  13174. _vm._b(
  13175. {
  13176. staticClass: "el-range-input",
  13177. attrs: {
  13178. autocomplete: "off",
  13179. placeholder: _vm.endPlaceholder,
  13180. disabled: _vm.pickerDisabled,
  13181. readonly: !_vm.editable || _vm.readonly,
  13182. name: _vm.name && _vm.name[1]
  13183. },
  13184. domProps: { value: _vm.displayValue && _vm.displayValue[1] },
  13185. on: {
  13186. input: _vm.handleEndInput,
  13187. change: _vm.handleEndChange,
  13188. focus: _vm.handleFocus
  13189. }
  13190. },
  13191. "input",
  13192. _vm.secondInputId,
  13193. false
  13194. )
  13195. ),
  13196. _vm.haveTrigger
  13197. ? _c("i", {
  13198. staticClass: "el-input__icon el-range__close-icon",
  13199. class: [_vm.showClose ? "" + _vm.clearIcon : ""],
  13200. on: { click: _vm.handleClickIcon }
  13201. })
  13202. : _vm._e()
  13203. ],
  13204. 2
  13205. )
  13206. }
  13207. var pickervue_type_template_id_79ae069f_staticRenderFns = []
  13208. pickervue_type_template_id_79ae069f_render._withStripped = true
  13209. // CONCATENATED MODULE: ./packages/date-picker/src/picker.vue?vue&type=template&id=79ae069f&
  13210. // EXTERNAL MODULE: external "element-ui/lib/utils/date-util"
  13211. var date_util_ = __webpack_require__(0);
  13212. // 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&
  13213. //
  13214. //
  13215. //
  13216. //
  13217. //
  13218. //
  13219. //
  13220. //
  13221. //
  13222. //
  13223. //
  13224. //
  13225. //
  13226. //
  13227. //
  13228. //
  13229. //
  13230. //
  13231. //
  13232. //
  13233. //
  13234. //
  13235. //
  13236. //
  13237. //
  13238. //
  13239. //
  13240. //
  13241. //
  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. var NewPopper = {
  13299. props: {
  13300. appendToBody: vue_popper_default.a.props.appendToBody,
  13301. offset: vue_popper_default.a.props.offset,
  13302. boundariesPadding: vue_popper_default.a.props.boundariesPadding,
  13303. arrowOffset: vue_popper_default.a.props.arrowOffset,
  13304. transformOrigin: vue_popper_default.a.props.transformOrigin
  13305. },
  13306. methods: vue_popper_default.a.methods,
  13307. data: function data() {
  13308. return merge_default()({ visibleArrow: true }, vue_popper_default.a.data);
  13309. },
  13310. beforeDestroy: vue_popper_default.a.beforeDestroy
  13311. };
  13312. var DEFAULT_FORMATS = {
  13313. date: 'yyyy-MM-dd',
  13314. month: 'yyyy-MM',
  13315. months: 'yyyy-MM',
  13316. datetime: 'yyyy-MM-dd HH:mm:ss',
  13317. time: 'HH:mm:ss',
  13318. week: 'yyyywWW',
  13319. timerange: 'HH:mm:ss',
  13320. daterange: 'yyyy-MM-dd',
  13321. monthrange: 'yyyy-MM',
  13322. datetimerange: 'yyyy-MM-dd HH:mm:ss',
  13323. year: 'yyyy',
  13324. years: 'yyyy'
  13325. };
  13326. var HAVE_TRIGGER_TYPES = ['date', 'datetime', 'time', 'time-select', 'week', 'month', 'year', 'daterange', 'monthrange', 'timerange', 'datetimerange', 'dates', 'months', 'years'];
  13327. var pickervue_type_script_lang_js_DATE_FORMATTER = function DATE_FORMATTER(value, format) {
  13328. if (format === 'timestamp') return value.getTime();
  13329. return Object(date_util_["formatDate"])(value, format);
  13330. };
  13331. var pickervue_type_script_lang_js_DATE_PARSER = function DATE_PARSER(text, format) {
  13332. if (format === 'timestamp') return new Date(Number(text));
  13333. return Object(date_util_["parseDate"])(text, format);
  13334. };
  13335. var RANGE_FORMATTER = function RANGE_FORMATTER(value, format) {
  13336. if (Array.isArray(value) && value.length === 2) {
  13337. var start = value[0];
  13338. var end = value[1];
  13339. if (start && end) {
  13340. return [pickervue_type_script_lang_js_DATE_FORMATTER(start, format), pickervue_type_script_lang_js_DATE_FORMATTER(end, format)];
  13341. }
  13342. }
  13343. return '';
  13344. };
  13345. var RANGE_PARSER = function RANGE_PARSER(array, format, separator) {
  13346. if (!Array.isArray(array)) {
  13347. array = array.split(separator);
  13348. }
  13349. if (array.length === 2) {
  13350. var range1 = array[0];
  13351. var range2 = array[1];
  13352. return [pickervue_type_script_lang_js_DATE_PARSER(range1, format), pickervue_type_script_lang_js_DATE_PARSER(range2, format)];
  13353. }
  13354. return [];
  13355. };
  13356. var TYPE_VALUE_RESOLVER_MAP = {
  13357. default: {
  13358. formatter: function formatter(value) {
  13359. if (!value) return '';
  13360. return '' + value;
  13361. },
  13362. parser: function parser(text) {
  13363. if (text === undefined || text === '') return null;
  13364. return text;
  13365. }
  13366. },
  13367. week: {
  13368. formatter: function formatter(value, format) {
  13369. var week = Object(date_util_["getWeekNumber"])(value);
  13370. var month = value.getMonth();
  13371. var trueDate = new Date(value);
  13372. if (week === 1 && month === 11) {
  13373. trueDate.setHours(0, 0, 0, 0);
  13374. trueDate.setDate(trueDate.getDate() + 3 - (trueDate.getDay() + 6) % 7);
  13375. }
  13376. var date = Object(date_util_["formatDate"])(trueDate, format);
  13377. date = /WW/.test(date) ? date.replace(/WW/, week < 10 ? '0' + week : week) : date.replace(/W/, week);
  13378. return date;
  13379. },
  13380. parser: function parser(text, format) {
  13381. // parse as if a normal date
  13382. return TYPE_VALUE_RESOLVER_MAP.date.parser(text, format);
  13383. }
  13384. },
  13385. date: {
  13386. formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
  13387. parser: pickervue_type_script_lang_js_DATE_PARSER
  13388. },
  13389. datetime: {
  13390. formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
  13391. parser: pickervue_type_script_lang_js_DATE_PARSER
  13392. },
  13393. daterange: {
  13394. formatter: RANGE_FORMATTER,
  13395. parser: RANGE_PARSER
  13396. },
  13397. monthrange: {
  13398. formatter: RANGE_FORMATTER,
  13399. parser: RANGE_PARSER
  13400. },
  13401. datetimerange: {
  13402. formatter: RANGE_FORMATTER,
  13403. parser: RANGE_PARSER
  13404. },
  13405. timerange: {
  13406. formatter: RANGE_FORMATTER,
  13407. parser: RANGE_PARSER
  13408. },
  13409. time: {
  13410. formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
  13411. parser: pickervue_type_script_lang_js_DATE_PARSER
  13412. },
  13413. month: {
  13414. formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
  13415. parser: pickervue_type_script_lang_js_DATE_PARSER
  13416. },
  13417. year: {
  13418. formatter: pickervue_type_script_lang_js_DATE_FORMATTER,
  13419. parser: pickervue_type_script_lang_js_DATE_PARSER
  13420. },
  13421. number: {
  13422. formatter: function formatter(value) {
  13423. if (!value) return '';
  13424. return '' + value;
  13425. },
  13426. parser: function parser(text) {
  13427. var result = Number(text);
  13428. if (!isNaN(text)) {
  13429. return result;
  13430. } else {
  13431. return null;
  13432. }
  13433. }
  13434. },
  13435. dates: {
  13436. formatter: function formatter(value, format) {
  13437. return value.map(function (date) {
  13438. return pickervue_type_script_lang_js_DATE_FORMATTER(date, format);
  13439. });
  13440. },
  13441. parser: function parser(value, format) {
  13442. return (typeof value === 'string' ? value.split(', ') : value).map(function (date) {
  13443. return date instanceof Date ? date : pickervue_type_script_lang_js_DATE_PARSER(date, format);
  13444. });
  13445. }
  13446. },
  13447. months: {
  13448. formatter: function formatter(value, format) {
  13449. return value.map(function (date) {
  13450. return pickervue_type_script_lang_js_DATE_FORMATTER(date, format);
  13451. });
  13452. },
  13453. parser: function parser(value, format) {
  13454. return (typeof value === 'string' ? value.split(', ') : value).map(function (date) {
  13455. return date instanceof Date ? date : pickervue_type_script_lang_js_DATE_PARSER(date, format);
  13456. });
  13457. }
  13458. },
  13459. years: {
  13460. formatter: function formatter(value, format) {
  13461. return value.map(function (date) {
  13462. return pickervue_type_script_lang_js_DATE_FORMATTER(date, format);
  13463. });
  13464. },
  13465. parser: function parser(value, format) {
  13466. return (typeof value === 'string' ? value.split(', ') : value).map(function (date) {
  13467. return date instanceof Date ? date : pickervue_type_script_lang_js_DATE_PARSER(date, format);
  13468. });
  13469. }
  13470. }
  13471. };
  13472. var PLACEMENT_MAP = {
  13473. left: 'bottom-start',
  13474. center: 'bottom',
  13475. right: 'bottom-end'
  13476. };
  13477. var parseAsFormatAndType = function parseAsFormatAndType(value, customFormat, type) {
  13478. var rangeSeparator = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '-';
  13479. if (!value) return null;
  13480. var parser = (TYPE_VALUE_RESOLVER_MAP[type] || TYPE_VALUE_RESOLVER_MAP['default']).parser;
  13481. var format = customFormat || DEFAULT_FORMATS[type];
  13482. return parser(value, format, rangeSeparator);
  13483. };
  13484. var formatAsFormatAndType = function formatAsFormatAndType(value, customFormat, type) {
  13485. if (!value) return null;
  13486. var formatter = (TYPE_VALUE_RESOLVER_MAP[type] || TYPE_VALUE_RESOLVER_MAP['default']).formatter;
  13487. var format = customFormat || DEFAULT_FORMATS[type];
  13488. return formatter(value, format);
  13489. };
  13490. /*
  13491. * Considers:
  13492. * 1. Date object
  13493. * 2. date string
  13494. * 3. array of 1 or 2
  13495. */
  13496. var valueEquals = function valueEquals(a, b) {
  13497. // considers Date object and string
  13498. var dateEquals = function dateEquals(a, b) {
  13499. var aIsDate = a instanceof Date;
  13500. var bIsDate = b instanceof Date;
  13501. if (aIsDate && bIsDate) {
  13502. return a.getTime() === b.getTime();
  13503. }
  13504. if (!aIsDate && !bIsDate) {
  13505. return a === b;
  13506. }
  13507. return false;
  13508. };
  13509. var aIsArray = a instanceof Array;
  13510. var bIsArray = b instanceof Array;
  13511. if (aIsArray && bIsArray) {
  13512. if (a.length !== b.length) {
  13513. return false;
  13514. }
  13515. return a.every(function (item, index) {
  13516. return dateEquals(item, b[index]);
  13517. });
  13518. }
  13519. if (!aIsArray && !bIsArray) {
  13520. return dateEquals(a, b);
  13521. }
  13522. return false;
  13523. };
  13524. var isString = function isString(val) {
  13525. return typeof val === 'string' || val instanceof String;
  13526. };
  13527. var pickervue_type_script_lang_js_validator = function validator(val) {
  13528. // either: String, Array of String, null / undefined
  13529. return val === null || val === undefined || isString(val) || Array.isArray(val) && val.length === 2 && val.every(isString);
  13530. };
  13531. /* harmony default export */ var pickervue_type_script_lang_js_ = ({
  13532. mixins: [emitter_default.a, NewPopper],
  13533. inject: {
  13534. elForm: {
  13535. default: ''
  13536. },
  13537. elFormItem: {
  13538. default: ''
  13539. }
  13540. },
  13541. props: {
  13542. size: String,
  13543. format: String,
  13544. valueFormat: String,
  13545. readonly: Boolean,
  13546. placeholder: String,
  13547. startPlaceholder: String,
  13548. endPlaceholder: String,
  13549. prefixIcon: String,
  13550. clearIcon: {
  13551. type: String,
  13552. default: 'el-icon-circle-close'
  13553. },
  13554. name: {
  13555. default: '',
  13556. validator: pickervue_type_script_lang_js_validator
  13557. },
  13558. disabled: Boolean,
  13559. clearable: {
  13560. type: Boolean,
  13561. default: true
  13562. },
  13563. id: {
  13564. default: '',
  13565. validator: pickervue_type_script_lang_js_validator
  13566. },
  13567. popperClass: String,
  13568. editable: {
  13569. type: Boolean,
  13570. default: true
  13571. },
  13572. align: {
  13573. type: String,
  13574. default: 'left'
  13575. },
  13576. value: {},
  13577. defaultValue: {},
  13578. defaultTime: {},
  13579. rangeSeparator: {
  13580. default: '-'
  13581. },
  13582. pickerOptions: {},
  13583. unlinkPanels: Boolean,
  13584. validateEvent: {
  13585. type: Boolean,
  13586. default: true
  13587. }
  13588. },
  13589. components: { ElInput: input_default.a },
  13590. directives: { Clickoutside: clickoutside_default.a },
  13591. data: function data() {
  13592. return {
  13593. pickerVisible: false,
  13594. showClose: false,
  13595. userInput: null,
  13596. valueOnOpen: null, // value when picker opens, used to determine whether to emit change
  13597. unwatchPickerOptions: null
  13598. };
  13599. },
  13600. watch: {
  13601. pickerVisible: function pickerVisible(val) {
  13602. if (this.readonly || this.pickerDisabled) return;
  13603. if (val) {
  13604. this.showPicker();
  13605. this.valueOnOpen = Array.isArray(this.value) ? [].concat(this.value) : this.value;
  13606. } else {
  13607. this.hidePicker();
  13608. this.emitChange(this.value);
  13609. this.userInput = null;
  13610. if (this.validateEvent) {
  13611. this.dispatch('ElFormItem', 'el.form.blur');
  13612. }
  13613. this.$emit('blur', this);
  13614. this.blur();
  13615. }
  13616. },
  13617. parsedValue: {
  13618. immediate: true,
  13619. handler: function handler(val) {
  13620. if (this.picker) {
  13621. this.picker.value = val;
  13622. }
  13623. }
  13624. },
  13625. defaultValue: function defaultValue(val) {
  13626. // NOTE: should eventually move to jsx style picker + panel ?
  13627. if (this.picker) {
  13628. this.picker.defaultValue = val;
  13629. }
  13630. },
  13631. value: function value(val, oldVal) {
  13632. if (!valueEquals(val, oldVal) && !this.pickerVisible && this.validateEvent) {
  13633. this.dispatch('ElFormItem', 'el.form.change', val);
  13634. }
  13635. }
  13636. },
  13637. computed: {
  13638. ranged: function ranged() {
  13639. return this.type.indexOf('range') > -1;
  13640. },
  13641. reference: function reference() {
  13642. var reference = this.$refs.reference;
  13643. return reference.$el || reference;
  13644. },
  13645. refInput: function refInput() {
  13646. if (this.reference) {
  13647. return [].slice.call(this.reference.querySelectorAll('input'));
  13648. }
  13649. return [];
  13650. },
  13651. valueIsEmpty: function valueIsEmpty() {
  13652. var val = this.value;
  13653. if (Array.isArray(val)) {
  13654. for (var i = 0, len = val.length; i < len; i++) {
  13655. if (val[i]) {
  13656. return false;
  13657. }
  13658. }
  13659. } else {
  13660. if (val) {
  13661. return false;
  13662. }
  13663. }
  13664. return true;
  13665. },
  13666. triggerClass: function triggerClass() {
  13667. return this.prefixIcon || (this.type.indexOf('time') !== -1 ? 'el-icon-time' : 'el-icon-date');
  13668. },
  13669. selectionMode: function selectionMode() {
  13670. if (this.type === 'week') {
  13671. return 'week';
  13672. } else if (this.type === 'month') {
  13673. return 'month';
  13674. } else if (this.type === 'year') {
  13675. return 'year';
  13676. } else if (this.type === 'dates') {
  13677. return 'dates';
  13678. } else if (this.type === 'months') {
  13679. return 'months';
  13680. } else if (this.type === 'years') {
  13681. return 'years';
  13682. }
  13683. return 'day';
  13684. },
  13685. haveTrigger: function haveTrigger() {
  13686. if (typeof this.showTrigger !== 'undefined') {
  13687. return this.showTrigger;
  13688. }
  13689. return HAVE_TRIGGER_TYPES.indexOf(this.type) !== -1;
  13690. },
  13691. displayValue: function displayValue() {
  13692. var formattedValue = formatAsFormatAndType(this.parsedValue, this.format, this.type, this.rangeSeparator);
  13693. if (Array.isArray(this.userInput)) {
  13694. return [this.userInput[0] || formattedValue && formattedValue[0] || '', this.userInput[1] || formattedValue && formattedValue[1] || ''];
  13695. } else if (this.userInput !== null) {
  13696. return this.userInput;
  13697. } else if (formattedValue) {
  13698. return this.type === 'dates' || this.type === 'years' || this.type === 'months' ? formattedValue.join(', ') : formattedValue;
  13699. } else {
  13700. return '';
  13701. }
  13702. },
  13703. parsedValue: function parsedValue() {
  13704. if (!this.value) return this.value; // component value is not set
  13705. if (this.type === 'time-select') return this.value; // time-select does not require parsing, this might change in next major version
  13706. var valueIsDateObject = Object(date_util_["isDateObject"])(this.value) || Array.isArray(this.value) && this.value.every(date_util_["isDateObject"]);
  13707. if (valueIsDateObject) {
  13708. return this.value;
  13709. }
  13710. if (this.valueFormat) {
  13711. return parseAsFormatAndType(this.value, this.valueFormat, this.type, this.rangeSeparator) || this.value;
  13712. }
  13713. // NOTE: deal with common but incorrect usage, should remove in next major version
  13714. // user might provide string / timestamp without value-format, coerce them into date (or array of date)
  13715. return Array.isArray(this.value) ? this.value.map(function (val) {
  13716. return new Date(val);
  13717. }) : new Date(this.value);
  13718. },
  13719. _elFormItemSize: function _elFormItemSize() {
  13720. return (this.elFormItem || {}).elFormItemSize;
  13721. },
  13722. pickerSize: function pickerSize() {
  13723. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  13724. },
  13725. pickerDisabled: function pickerDisabled() {
  13726. return this.disabled || (this.elForm || {}).disabled;
  13727. },
  13728. firstInputId: function firstInputId() {
  13729. var obj = {};
  13730. var id = void 0;
  13731. if (this.ranged) {
  13732. id = this.id && this.id[0];
  13733. } else {
  13734. id = this.id;
  13735. }
  13736. if (id) obj.id = id;
  13737. return obj;
  13738. },
  13739. secondInputId: function secondInputId() {
  13740. var obj = {};
  13741. var id = void 0;
  13742. if (this.ranged) {
  13743. id = this.id && this.id[1];
  13744. }
  13745. if (id) obj.id = id;
  13746. return obj;
  13747. }
  13748. },
  13749. created: function created() {
  13750. // vue-popper
  13751. this.popperOptions = {
  13752. boundariesPadding: 0,
  13753. gpuAcceleration: false
  13754. };
  13755. this.placement = PLACEMENT_MAP[this.align] || PLACEMENT_MAP.left;
  13756. this.$on('fieldReset', this.handleFieldReset);
  13757. },
  13758. methods: {
  13759. focus: function focus() {
  13760. if (!this.ranged) {
  13761. this.$refs.reference.focus();
  13762. } else {
  13763. this.handleFocus();
  13764. }
  13765. },
  13766. blur: function blur() {
  13767. this.refInput.forEach(function (input) {
  13768. return input.blur();
  13769. });
  13770. },
  13771. // {parse, formatTo} Value deals maps component value with internal Date
  13772. parseValue: function parseValue(value) {
  13773. var isParsed = Object(date_util_["isDateObject"])(value) || Array.isArray(value) && value.every(date_util_["isDateObject"]);
  13774. if (this.valueFormat && !isParsed) {
  13775. return parseAsFormatAndType(value, this.valueFormat, this.type, this.rangeSeparator) || value;
  13776. } else {
  13777. return value;
  13778. }
  13779. },
  13780. formatToValue: function formatToValue(date) {
  13781. var isFormattable = Object(date_util_["isDateObject"])(date) || Array.isArray(date) && date.every(date_util_["isDateObject"]);
  13782. if (this.valueFormat && isFormattable) {
  13783. return formatAsFormatAndType(date, this.valueFormat, this.type, this.rangeSeparator);
  13784. } else {
  13785. return date;
  13786. }
  13787. },
  13788. // {parse, formatTo} String deals with user input
  13789. parseString: function parseString(value) {
  13790. var type = Array.isArray(value) ? this.type : this.type.replace('range', '');
  13791. return parseAsFormatAndType(value, this.format, type);
  13792. },
  13793. formatToString: function formatToString(value) {
  13794. var type = Array.isArray(value) ? this.type : this.type.replace('range', '');
  13795. return formatAsFormatAndType(value, this.format, type);
  13796. },
  13797. handleMouseEnter: function handleMouseEnter() {
  13798. if (this.readonly || this.pickerDisabled) return;
  13799. if (!this.valueIsEmpty && this.clearable) {
  13800. this.showClose = true;
  13801. }
  13802. },
  13803. handleChange: function handleChange() {
  13804. if (this.userInput) {
  13805. var value = this.parseString(this.displayValue);
  13806. if (value) {
  13807. this.picker.value = value;
  13808. if (this.isValidValue(value)) {
  13809. this.emitInput(value);
  13810. this.userInput = null;
  13811. }
  13812. }
  13813. }
  13814. if (this.userInput === '') {
  13815. this.emitInput(null);
  13816. this.emitChange(null);
  13817. this.userInput = null;
  13818. }
  13819. },
  13820. handleStartInput: function handleStartInput(event) {
  13821. if (this.userInput) {
  13822. this.userInput = [event.target.value, this.userInput[1]];
  13823. } else {
  13824. this.userInput = [event.target.value, null];
  13825. }
  13826. },
  13827. handleEndInput: function handleEndInput(event) {
  13828. if (this.userInput) {
  13829. this.userInput = [this.userInput[0], event.target.value];
  13830. } else {
  13831. this.userInput = [null, event.target.value];
  13832. }
  13833. },
  13834. handleStartChange: function handleStartChange(event) {
  13835. var value = this.parseString(this.userInput && this.userInput[0]);
  13836. if (value) {
  13837. this.userInput = [this.formatToString(value), this.displayValue[1]];
  13838. var newValue = [value, this.picker.value && this.picker.value[1]];
  13839. this.picker.value = newValue;
  13840. if (this.isValidValue(newValue)) {
  13841. this.emitInput(newValue);
  13842. this.userInput = null;
  13843. }
  13844. }
  13845. },
  13846. handleEndChange: function handleEndChange(event) {
  13847. var value = this.parseString(this.userInput && this.userInput[1]);
  13848. if (value) {
  13849. this.userInput = [this.displayValue[0], this.formatToString(value)];
  13850. var newValue = [this.picker.value && this.picker.value[0], value];
  13851. this.picker.value = newValue;
  13852. if (this.isValidValue(newValue)) {
  13853. this.emitInput(newValue);
  13854. this.userInput = null;
  13855. }
  13856. }
  13857. },
  13858. handleClickIcon: function handleClickIcon(event) {
  13859. if (this.readonly || this.pickerDisabled) return;
  13860. if (this.showClose) {
  13861. this.valueOnOpen = this.value;
  13862. event.stopPropagation();
  13863. this.emitInput(null);
  13864. this.emitChange(null);
  13865. this.showClose = false;
  13866. if (this.picker && typeof this.picker.handleClear === 'function') {
  13867. this.picker.handleClear();
  13868. }
  13869. } else {
  13870. this.pickerVisible = !this.pickerVisible;
  13871. }
  13872. },
  13873. handleClose: function handleClose() {
  13874. if (!this.pickerVisible) return;
  13875. this.pickerVisible = false;
  13876. if (this.type === 'dates' || this.type === 'years' || this.type === 'months') {
  13877. // restore to former value
  13878. var oldValue = parseAsFormatAndType(this.valueOnOpen, this.valueFormat, this.type, this.rangeSeparator) || this.valueOnOpen;
  13879. this.emitInput(oldValue);
  13880. }
  13881. },
  13882. handleFieldReset: function handleFieldReset(initialValue) {
  13883. this.userInput = initialValue === '' ? null : initialValue;
  13884. },
  13885. handleFocus: function handleFocus() {
  13886. var type = this.type;
  13887. if (HAVE_TRIGGER_TYPES.indexOf(type) !== -1 && !this.pickerVisible) {
  13888. this.pickerVisible = true;
  13889. }
  13890. this.$emit('focus', this);
  13891. },
  13892. handleKeydown: function handleKeydown(event) {
  13893. var _this = this;
  13894. var keyCode = event.keyCode;
  13895. // ESC
  13896. if (keyCode === 27) {
  13897. this.pickerVisible = false;
  13898. event.stopPropagation();
  13899. return;
  13900. }
  13901. // Tab
  13902. if (keyCode === 9) {
  13903. if (!this.ranged) {
  13904. this.handleChange();
  13905. this.pickerVisible = this.picker.visible = false;
  13906. this.blur();
  13907. event.stopPropagation();
  13908. } else {
  13909. // user may change focus between two input
  13910. setTimeout(function () {
  13911. if (_this.refInput.indexOf(document.activeElement) === -1) {
  13912. _this.pickerVisible = false;
  13913. _this.blur();
  13914. event.stopPropagation();
  13915. }
  13916. }, 0);
  13917. }
  13918. return;
  13919. }
  13920. // Enter
  13921. if (keyCode === 13) {
  13922. if (this.userInput === '' || this.isValidValue(this.parseString(this.displayValue))) {
  13923. this.handleChange();
  13924. this.pickerVisible = this.picker.visible = false;
  13925. this.blur();
  13926. }
  13927. event.stopPropagation();
  13928. return;
  13929. }
  13930. // if user is typing, do not let picker handle key input
  13931. if (this.userInput) {
  13932. event.stopPropagation();
  13933. return;
  13934. }
  13935. // delegate other keys to panel
  13936. if (this.picker && this.picker.handleKeydown) {
  13937. this.picker.handleKeydown(event);
  13938. }
  13939. },
  13940. handleRangeClick: function handleRangeClick() {
  13941. var type = this.type;
  13942. if (HAVE_TRIGGER_TYPES.indexOf(type) !== -1 && !this.pickerVisible) {
  13943. this.pickerVisible = true;
  13944. }
  13945. this.$emit('focus', this);
  13946. },
  13947. hidePicker: function hidePicker() {
  13948. if (this.picker) {
  13949. this.picker.resetView && this.picker.resetView();
  13950. this.pickerVisible = this.picker.visible = false;
  13951. this.destroyPopper();
  13952. }
  13953. },
  13954. showPicker: function showPicker() {
  13955. var _this2 = this;
  13956. if (this.$isServer) return;
  13957. if (!this.picker) {
  13958. this.mountPicker();
  13959. }
  13960. this.pickerVisible = this.picker.visible = true;
  13961. this.updatePopper();
  13962. this.picker.value = this.parsedValue;
  13963. this.picker.resetView && this.picker.resetView();
  13964. this.$nextTick(function () {
  13965. _this2.picker.adjustSpinners && _this2.picker.adjustSpinners();
  13966. });
  13967. },
  13968. mountPicker: function mountPicker() {
  13969. var _this3 = this;
  13970. this.picker = new external_vue_default.a(this.panel).$mount();
  13971. this.picker.defaultValue = this.defaultValue;
  13972. this.picker.defaultTime = this.defaultTime;
  13973. this.picker.popperClass = this.popperClass;
  13974. this.popperElm = this.picker.$el;
  13975. this.picker.width = this.reference.getBoundingClientRect().width;
  13976. this.picker.showTime = this.type === 'datetime' || this.type === 'datetimerange';
  13977. this.picker.selectionMode = this.selectionMode;
  13978. this.picker.unlinkPanels = this.unlinkPanels;
  13979. this.picker.arrowControl = this.arrowControl || this.timeArrowControl || false;
  13980. this.$watch('format', function (format) {
  13981. _this3.picker.format = format;
  13982. });
  13983. var updateOptions = function updateOptions() {
  13984. var options = _this3.pickerOptions;
  13985. if (options && options.selectableRange) {
  13986. var ranges = options.selectableRange;
  13987. var parser = TYPE_VALUE_RESOLVER_MAP.datetimerange.parser;
  13988. var format = DEFAULT_FORMATS.timerange;
  13989. ranges = Array.isArray(ranges) ? ranges : [ranges];
  13990. _this3.picker.selectableRange = ranges.map(function (range) {
  13991. return parser(range, format, _this3.rangeSeparator);
  13992. });
  13993. }
  13994. for (var option in options) {
  13995. if (options.hasOwnProperty(option) &&
  13996. // 忽略 time-picker 的该配置项
  13997. option !== 'selectableRange') {
  13998. _this3.picker[option] = options[option];
  13999. }
  14000. }
  14001. // main format must prevail over undocumented pickerOptions.format
  14002. if (_this3.format) {
  14003. _this3.picker.format = _this3.format;
  14004. }
  14005. };
  14006. updateOptions();
  14007. this.unwatchPickerOptions = this.$watch('pickerOptions', function () {
  14008. return updateOptions();
  14009. }, { deep: true });
  14010. this.$el.appendChild(this.picker.$el);
  14011. this.picker.resetView && this.picker.resetView();
  14012. this.picker.$on('dodestroy', this.doDestroy);
  14013. this.picker.$on('pick', function () {
  14014. var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  14015. var visible = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  14016. _this3.userInput = null;
  14017. _this3.pickerVisible = _this3.picker.visible = visible;
  14018. _this3.emitInput(date);
  14019. _this3.picker.resetView && _this3.picker.resetView();
  14020. });
  14021. this.picker.$on('select-range', function (start, end, pos) {
  14022. if (_this3.refInput.length === 0) return;
  14023. if (!pos || pos === 'min') {
  14024. _this3.refInput[0].setSelectionRange(start, end);
  14025. _this3.refInput[0].focus();
  14026. } else if (pos === 'max') {
  14027. _this3.refInput[1].setSelectionRange(start, end);
  14028. _this3.refInput[1].focus();
  14029. }
  14030. });
  14031. },
  14032. unmountPicker: function unmountPicker() {
  14033. if (this.picker) {
  14034. this.picker.$destroy();
  14035. this.picker.$off();
  14036. if (typeof this.unwatchPickerOptions === 'function') {
  14037. this.unwatchPickerOptions();
  14038. }
  14039. this.picker.$el.parentNode.removeChild(this.picker.$el);
  14040. }
  14041. },
  14042. emitChange: function emitChange(val) {
  14043. // determine user real change only
  14044. if (!valueEquals(val, this.valueOnOpen)) {
  14045. this.$emit('change', val);
  14046. this.valueOnOpen = val;
  14047. if (this.validateEvent) {
  14048. this.dispatch('ElFormItem', 'el.form.change', val);
  14049. }
  14050. }
  14051. },
  14052. emitInput: function emitInput(val) {
  14053. var formatted = this.formatToValue(val);
  14054. if (!valueEquals(this.value, formatted)) {
  14055. this.$emit('input', formatted);
  14056. }
  14057. },
  14058. isValidValue: function isValidValue(value) {
  14059. if (!this.picker) {
  14060. this.mountPicker();
  14061. }
  14062. if (this.picker.isValidValue) {
  14063. return value && this.picker.isValidValue(value);
  14064. } else {
  14065. return true;
  14066. }
  14067. }
  14068. }
  14069. });
  14070. // CONCATENATED MODULE: ./packages/date-picker/src/picker.vue?vue&type=script&lang=js&
  14071. /* harmony default export */ var src_pickervue_type_script_lang_js_ = (pickervue_type_script_lang_js_);
  14072. // CONCATENATED MODULE: ./packages/date-picker/src/picker.vue
  14073. /* normalize component */
  14074. var picker_component = normalizeComponent(
  14075. src_pickervue_type_script_lang_js_,
  14076. pickervue_type_template_id_79ae069f_render,
  14077. pickervue_type_template_id_79ae069f_staticRenderFns,
  14078. false,
  14079. null,
  14080. null,
  14081. null
  14082. )
  14083. /* hot reload */
  14084. if (false) { var picker_api; }
  14085. picker_component.options.__file = "packages/date-picker/src/picker.vue"
  14086. /* harmony default export */ var picker = (picker_component.exports);
  14087. // 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&
  14088. var datevue_type_template_id_2440d4ea_render = function() {
  14089. var _vm = this
  14090. var _h = _vm.$createElement
  14091. var _c = _vm._self._c || _h
  14092. return _c(
  14093. "transition",
  14094. {
  14095. attrs: { name: "el-zoom-in-top" },
  14096. on: { "after-enter": _vm.handleEnter, "after-leave": _vm.handleLeave }
  14097. },
  14098. [
  14099. _c(
  14100. "div",
  14101. {
  14102. directives: [
  14103. {
  14104. name: "show",
  14105. rawName: "v-show",
  14106. value: _vm.visible,
  14107. expression: "visible"
  14108. }
  14109. ],
  14110. staticClass: "el-picker-panel el-date-picker el-popper",
  14111. class: [
  14112. {
  14113. "has-sidebar": _vm.$slots.sidebar || _vm.shortcuts,
  14114. "has-time": _vm.showTime
  14115. },
  14116. _vm.popperClass
  14117. ]
  14118. },
  14119. [
  14120. _c(
  14121. "div",
  14122. { staticClass: "el-picker-panel__body-wrapper" },
  14123. [
  14124. _vm._t("sidebar"),
  14125. _vm.shortcuts
  14126. ? _c(
  14127. "div",
  14128. { staticClass: "el-picker-panel__sidebar" },
  14129. _vm._l(_vm.shortcuts, function(shortcut, key) {
  14130. return _c(
  14131. "button",
  14132. {
  14133. key: key,
  14134. staticClass: "el-picker-panel__shortcut",
  14135. attrs: { type: "button" },
  14136. on: {
  14137. click: function($event) {
  14138. _vm.handleShortcutClick(shortcut)
  14139. }
  14140. }
  14141. },
  14142. [_vm._v(_vm._s(shortcut.text))]
  14143. )
  14144. }),
  14145. 0
  14146. )
  14147. : _vm._e(),
  14148. _c("div", { staticClass: "el-picker-panel__body" }, [
  14149. _vm.showTime
  14150. ? _c("div", { staticClass: "el-date-picker__time-header" }, [
  14151. _c(
  14152. "span",
  14153. { staticClass: "el-date-picker__editor-wrap" },
  14154. [
  14155. _c("el-input", {
  14156. attrs: {
  14157. placeholder: _vm.t("el.datepicker.selectDate"),
  14158. value: _vm.visibleDate,
  14159. size: "small"
  14160. },
  14161. on: {
  14162. input: function(val) {
  14163. return (_vm.userInputDate = val)
  14164. },
  14165. change: _vm.handleVisibleDateChange
  14166. }
  14167. })
  14168. ],
  14169. 1
  14170. ),
  14171. _c(
  14172. "span",
  14173. {
  14174. directives: [
  14175. {
  14176. name: "clickoutside",
  14177. rawName: "v-clickoutside",
  14178. value: _vm.handleTimePickClose,
  14179. expression: "handleTimePickClose"
  14180. }
  14181. ],
  14182. staticClass: "el-date-picker__editor-wrap"
  14183. },
  14184. [
  14185. _c("el-input", {
  14186. ref: "input",
  14187. attrs: {
  14188. placeholder: _vm.t("el.datepicker.selectTime"),
  14189. value: _vm.visibleTime,
  14190. size: "small"
  14191. },
  14192. on: {
  14193. focus: function($event) {
  14194. _vm.timePickerVisible = true
  14195. },
  14196. input: function(val) {
  14197. return (_vm.userInputTime = val)
  14198. },
  14199. change: _vm.handleVisibleTimeChange
  14200. }
  14201. }),
  14202. _c("time-picker", {
  14203. ref: "timepicker",
  14204. attrs: {
  14205. "time-arrow-control": _vm.arrowControl,
  14206. visible: _vm.timePickerVisible
  14207. },
  14208. on: {
  14209. pick: _vm.handleTimePick,
  14210. mounted: _vm.proxyTimePickerDataProperties
  14211. }
  14212. })
  14213. ],
  14214. 1
  14215. )
  14216. ])
  14217. : _vm._e(),
  14218. _c(
  14219. "div",
  14220. {
  14221. directives: [
  14222. {
  14223. name: "show",
  14224. rawName: "v-show",
  14225. value: _vm.currentView !== "time",
  14226. expression: "currentView !== 'time'"
  14227. }
  14228. ],
  14229. staticClass: "el-date-picker__header",
  14230. class: {
  14231. "el-date-picker__header--bordered":
  14232. _vm.currentView === "year" ||
  14233. _vm.currentView === "month"
  14234. }
  14235. },
  14236. [
  14237. _c("button", {
  14238. staticClass:
  14239. "el-picker-panel__icon-btn el-date-picker__prev-btn el-icon-d-arrow-left",
  14240. attrs: {
  14241. type: "button",
  14242. "aria-label": _vm.t("el.datepicker.prevYear")
  14243. },
  14244. on: { click: _vm.prevYear }
  14245. }),
  14246. _c("button", {
  14247. directives: [
  14248. {
  14249. name: "show",
  14250. rawName: "v-show",
  14251. value: _vm.currentView === "date",
  14252. expression: "currentView === 'date'"
  14253. }
  14254. ],
  14255. staticClass:
  14256. "el-picker-panel__icon-btn el-date-picker__prev-btn el-icon-arrow-left",
  14257. attrs: {
  14258. type: "button",
  14259. "aria-label": _vm.t("el.datepicker.prevMonth")
  14260. },
  14261. on: { click: _vm.prevMonth }
  14262. }),
  14263. _c(
  14264. "span",
  14265. {
  14266. staticClass: "el-date-picker__header-label",
  14267. attrs: { role: "button" },
  14268. on: { click: _vm.showYearPicker }
  14269. },
  14270. [_vm._v(_vm._s(_vm.yearLabel))]
  14271. ),
  14272. _c(
  14273. "span",
  14274. {
  14275. directives: [
  14276. {
  14277. name: "show",
  14278. rawName: "v-show",
  14279. value: _vm.currentView === "date",
  14280. expression: "currentView === 'date'"
  14281. }
  14282. ],
  14283. staticClass: "el-date-picker__header-label",
  14284. class: { active: _vm.currentView === "month" },
  14285. attrs: { role: "button" },
  14286. on: { click: _vm.showMonthPicker }
  14287. },
  14288. [
  14289. _vm._v(
  14290. _vm._s(_vm.t("el.datepicker.month" + (_vm.month + 1)))
  14291. )
  14292. ]
  14293. ),
  14294. _c("button", {
  14295. staticClass:
  14296. "el-picker-panel__icon-btn el-date-picker__next-btn el-icon-d-arrow-right",
  14297. attrs: {
  14298. type: "button",
  14299. "aria-label": _vm.t("el.datepicker.nextYear")
  14300. },
  14301. on: { click: _vm.nextYear }
  14302. }),
  14303. _c("button", {
  14304. directives: [
  14305. {
  14306. name: "show",
  14307. rawName: "v-show",
  14308. value: _vm.currentView === "date",
  14309. expression: "currentView === 'date'"
  14310. }
  14311. ],
  14312. staticClass:
  14313. "el-picker-panel__icon-btn el-date-picker__next-btn el-icon-arrow-right",
  14314. attrs: {
  14315. type: "button",
  14316. "aria-label": _vm.t("el.datepicker.nextMonth")
  14317. },
  14318. on: { click: _vm.nextMonth }
  14319. })
  14320. ]
  14321. ),
  14322. _c(
  14323. "div",
  14324. { staticClass: "el-picker-panel__content" },
  14325. [
  14326. _c("date-table", {
  14327. directives: [
  14328. {
  14329. name: "show",
  14330. rawName: "v-show",
  14331. value: _vm.currentView === "date",
  14332. expression: "currentView === 'date'"
  14333. }
  14334. ],
  14335. attrs: {
  14336. "selection-mode": _vm.selectionMode,
  14337. "first-day-of-week": _vm.firstDayOfWeek,
  14338. value: _vm.value,
  14339. "default-value": _vm.defaultValue
  14340. ? new Date(_vm.defaultValue)
  14341. : null,
  14342. date: _vm.date,
  14343. "cell-class-name": _vm.cellClassName,
  14344. "disabled-date": _vm.disabledDate
  14345. },
  14346. on: { pick: _vm.handleDatePick }
  14347. }),
  14348. _c("year-table", {
  14349. directives: [
  14350. {
  14351. name: "show",
  14352. rawName: "v-show",
  14353. value: _vm.currentView === "year",
  14354. expression: "currentView === 'year'"
  14355. }
  14356. ],
  14357. attrs: {
  14358. "selection-mode": _vm.selectionMode,
  14359. value: _vm.value,
  14360. "default-value": _vm.defaultValue
  14361. ? new Date(_vm.defaultValue)
  14362. : null,
  14363. date: _vm.date,
  14364. "disabled-date": _vm.disabledDate
  14365. },
  14366. on: { pick: _vm.handleYearPick }
  14367. }),
  14368. _c("month-table", {
  14369. directives: [
  14370. {
  14371. name: "show",
  14372. rawName: "v-show",
  14373. value: _vm.currentView === "month",
  14374. expression: "currentView === 'month'"
  14375. }
  14376. ],
  14377. attrs: {
  14378. "selection-mode": _vm.selectionMode,
  14379. value: _vm.value,
  14380. "default-value": _vm.defaultValue
  14381. ? new Date(_vm.defaultValue)
  14382. : null,
  14383. date: _vm.date,
  14384. "disabled-date": _vm.disabledDate
  14385. },
  14386. on: { pick: _vm.handleMonthPick }
  14387. })
  14388. ],
  14389. 1
  14390. )
  14391. ])
  14392. ],
  14393. 2
  14394. ),
  14395. _c(
  14396. "div",
  14397. {
  14398. directives: [
  14399. {
  14400. name: "show",
  14401. rawName: "v-show",
  14402. value:
  14403. _vm.footerVisible &&
  14404. (_vm.currentView === "date" ||
  14405. _vm.currentView === "month" ||
  14406. _vm.currentView === "year"),
  14407. expression:
  14408. "footerVisible && (currentView === 'date' || currentView === 'month' || currentView === 'year')"
  14409. }
  14410. ],
  14411. staticClass: "el-picker-panel__footer"
  14412. },
  14413. [
  14414. _c(
  14415. "el-button",
  14416. {
  14417. directives: [
  14418. {
  14419. name: "show",
  14420. rawName: "v-show",
  14421. value:
  14422. _vm.selectionMode !== "dates" &&
  14423. _vm.selectionMode !== "months" &&
  14424. _vm.selectionMode !== "years",
  14425. expression:
  14426. "selectionMode !== 'dates' && selectionMode !== 'months' && selectionMode !== 'years'"
  14427. }
  14428. ],
  14429. staticClass: "el-picker-panel__link-btn",
  14430. attrs: { size: "mini", type: "text" },
  14431. on: { click: _vm.changeToNow }
  14432. },
  14433. [
  14434. _vm._v(
  14435. "\n " +
  14436. _vm._s(_vm.t("el.datepicker.now")) +
  14437. "\n "
  14438. )
  14439. ]
  14440. ),
  14441. _c(
  14442. "el-button",
  14443. {
  14444. staticClass: "el-picker-panel__link-btn",
  14445. attrs: { plain: "", size: "mini" },
  14446. on: { click: _vm.confirm }
  14447. },
  14448. [
  14449. _vm._v(
  14450. "\n " +
  14451. _vm._s(_vm.t("el.datepicker.confirm")) +
  14452. "\n "
  14453. )
  14454. ]
  14455. )
  14456. ],
  14457. 1
  14458. )
  14459. ]
  14460. )
  14461. ]
  14462. )
  14463. }
  14464. var datevue_type_template_id_2440d4ea_staticRenderFns = []
  14465. datevue_type_template_id_2440d4ea_render._withStripped = true
  14466. // CONCATENATED MODULE: ./packages/date-picker/src/panel/date.vue?vue&type=template&id=2440d4ea&
  14467. // 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&
  14468. var timevue_type_template_id_3d939089_render = function() {
  14469. var _vm = this
  14470. var _h = _vm.$createElement
  14471. var _c = _vm._self._c || _h
  14472. return _c(
  14473. "transition",
  14474. {
  14475. attrs: { name: "el-zoom-in-top" },
  14476. on: {
  14477. "after-leave": function($event) {
  14478. _vm.$emit("dodestroy")
  14479. }
  14480. }
  14481. },
  14482. [
  14483. _c(
  14484. "div",
  14485. {
  14486. directives: [
  14487. {
  14488. name: "show",
  14489. rawName: "v-show",
  14490. value: _vm.visible,
  14491. expression: "visible"
  14492. }
  14493. ],
  14494. staticClass: "el-time-panel el-popper",
  14495. class: _vm.popperClass
  14496. },
  14497. [
  14498. _c(
  14499. "div",
  14500. {
  14501. staticClass: "el-time-panel__content",
  14502. class: { "has-seconds": _vm.showSeconds }
  14503. },
  14504. [
  14505. _c("time-spinner", {
  14506. ref: "spinner",
  14507. attrs: {
  14508. "arrow-control": _vm.useArrow,
  14509. "show-seconds": _vm.showSeconds,
  14510. "am-pm-mode": _vm.amPmMode,
  14511. date: _vm.date
  14512. },
  14513. on: {
  14514. change: _vm.handleChange,
  14515. "select-range": _vm.setSelectionRange
  14516. }
  14517. })
  14518. ],
  14519. 1
  14520. ),
  14521. _c("div", { staticClass: "el-time-panel__footer" }, [
  14522. _c(
  14523. "button",
  14524. {
  14525. staticClass: "el-time-panel__btn cancel",
  14526. attrs: { type: "button" },
  14527. on: { click: _vm.handleCancel }
  14528. },
  14529. [_vm._v(_vm._s(_vm.t("el.datepicker.cancel")))]
  14530. ),
  14531. _c(
  14532. "button",
  14533. {
  14534. staticClass: "el-time-panel__btn",
  14535. class: { confirm: !_vm.disabled },
  14536. attrs: { type: "button" },
  14537. on: {
  14538. click: function($event) {
  14539. _vm.handleConfirm()
  14540. }
  14541. }
  14542. },
  14543. [_vm._v(_vm._s(_vm.t("el.datepicker.confirm")))]
  14544. )
  14545. ])
  14546. ]
  14547. )
  14548. ]
  14549. )
  14550. }
  14551. var timevue_type_template_id_3d939089_staticRenderFns = []
  14552. timevue_type_template_id_3d939089_render._withStripped = true
  14553. // CONCATENATED MODULE: ./packages/date-picker/src/panel/time.vue?vue&type=template&id=3d939089&
  14554. // 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&
  14555. var time_spinnervue_type_template_id_1facadeb_render = function() {
  14556. var _vm = this
  14557. var _h = _vm.$createElement
  14558. var _c = _vm._self._c || _h
  14559. return _c(
  14560. "div",
  14561. {
  14562. staticClass: "el-time-spinner",
  14563. class: { "has-seconds": _vm.showSeconds }
  14564. },
  14565. [
  14566. !_vm.arrowControl
  14567. ? [
  14568. _c(
  14569. "el-scrollbar",
  14570. {
  14571. ref: "hours",
  14572. staticClass: "el-time-spinner__wrapper",
  14573. attrs: {
  14574. "wrap-style": "max-height: inherit;",
  14575. "view-class": "el-time-spinner__list",
  14576. noresize: "",
  14577. tag: "ul"
  14578. },
  14579. nativeOn: {
  14580. mouseenter: function($event) {
  14581. _vm.emitSelectRange("hours")
  14582. },
  14583. mousemove: function($event) {
  14584. _vm.adjustCurrentSpinner("hours")
  14585. }
  14586. }
  14587. },
  14588. _vm._l(_vm.hoursList, function(disabled, hour) {
  14589. return _c(
  14590. "li",
  14591. {
  14592. key: hour,
  14593. staticClass: "el-time-spinner__item",
  14594. class: { active: hour === _vm.hours, disabled: disabled },
  14595. on: {
  14596. click: function($event) {
  14597. _vm.handleClick("hours", {
  14598. value: hour,
  14599. disabled: disabled
  14600. })
  14601. }
  14602. }
  14603. },
  14604. [
  14605. _vm._v(
  14606. _vm._s(
  14607. ("0" + (_vm.amPmMode ? hour % 12 || 12 : hour)).slice(
  14608. -2
  14609. )
  14610. ) + _vm._s(_vm.amPm(hour))
  14611. )
  14612. ]
  14613. )
  14614. }),
  14615. 0
  14616. ),
  14617. _c(
  14618. "el-scrollbar",
  14619. {
  14620. ref: "minutes",
  14621. staticClass: "el-time-spinner__wrapper",
  14622. attrs: {
  14623. "wrap-style": "max-height: inherit;",
  14624. "view-class": "el-time-spinner__list",
  14625. noresize: "",
  14626. tag: "ul"
  14627. },
  14628. nativeOn: {
  14629. mouseenter: function($event) {
  14630. _vm.emitSelectRange("minutes")
  14631. },
  14632. mousemove: function($event) {
  14633. _vm.adjustCurrentSpinner("minutes")
  14634. }
  14635. }
  14636. },
  14637. _vm._l(_vm.minutesList, function(enabled, key) {
  14638. return _c(
  14639. "li",
  14640. {
  14641. key: key,
  14642. staticClass: "el-time-spinner__item",
  14643. class: { active: key === _vm.minutes, disabled: !enabled },
  14644. on: {
  14645. click: function($event) {
  14646. _vm.handleClick("minutes", {
  14647. value: key,
  14648. disabled: false
  14649. })
  14650. }
  14651. }
  14652. },
  14653. [_vm._v(_vm._s(("0" + key).slice(-2)))]
  14654. )
  14655. }),
  14656. 0
  14657. ),
  14658. _c(
  14659. "el-scrollbar",
  14660. {
  14661. directives: [
  14662. {
  14663. name: "show",
  14664. rawName: "v-show",
  14665. value: _vm.showSeconds,
  14666. expression: "showSeconds"
  14667. }
  14668. ],
  14669. ref: "seconds",
  14670. staticClass: "el-time-spinner__wrapper",
  14671. attrs: {
  14672. "wrap-style": "max-height: inherit;",
  14673. "view-class": "el-time-spinner__list",
  14674. noresize: "",
  14675. tag: "ul"
  14676. },
  14677. nativeOn: {
  14678. mouseenter: function($event) {
  14679. _vm.emitSelectRange("seconds")
  14680. },
  14681. mousemove: function($event) {
  14682. _vm.adjustCurrentSpinner("seconds")
  14683. }
  14684. }
  14685. },
  14686. _vm._l(60, function(second, key) {
  14687. return _c(
  14688. "li",
  14689. {
  14690. key: key,
  14691. staticClass: "el-time-spinner__item",
  14692. class: { active: key === _vm.seconds },
  14693. on: {
  14694. click: function($event) {
  14695. _vm.handleClick("seconds", {
  14696. value: key,
  14697. disabled: false
  14698. })
  14699. }
  14700. }
  14701. },
  14702. [_vm._v(_vm._s(("0" + key).slice(-2)))]
  14703. )
  14704. }),
  14705. 0
  14706. )
  14707. ]
  14708. : _vm._e(),
  14709. _vm.arrowControl
  14710. ? [
  14711. _c(
  14712. "div",
  14713. {
  14714. staticClass: "el-time-spinner__wrapper is-arrow",
  14715. on: {
  14716. mouseenter: function($event) {
  14717. _vm.emitSelectRange("hours")
  14718. }
  14719. }
  14720. },
  14721. [
  14722. _c("i", {
  14723. directives: [
  14724. {
  14725. name: "repeat-click",
  14726. rawName: "v-repeat-click",
  14727. value: _vm.decrease,
  14728. expression: "decrease"
  14729. }
  14730. ],
  14731. staticClass: "el-time-spinner__arrow el-icon-arrow-up"
  14732. }),
  14733. _c("i", {
  14734. directives: [
  14735. {
  14736. name: "repeat-click",
  14737. rawName: "v-repeat-click",
  14738. value: _vm.increase,
  14739. expression: "increase"
  14740. }
  14741. ],
  14742. staticClass: "el-time-spinner__arrow el-icon-arrow-down"
  14743. }),
  14744. _c(
  14745. "ul",
  14746. { ref: "hours", staticClass: "el-time-spinner__list" },
  14747. _vm._l(_vm.arrowHourList, function(hour, key) {
  14748. return _c(
  14749. "li",
  14750. {
  14751. key: key,
  14752. staticClass: "el-time-spinner__item",
  14753. class: {
  14754. active: hour === _vm.hours,
  14755. disabled: _vm.hoursList[hour]
  14756. }
  14757. },
  14758. [
  14759. _vm._v(
  14760. _vm._s(
  14761. hour === undefined
  14762. ? ""
  14763. : (
  14764. "0" + (_vm.amPmMode ? hour % 12 || 12 : hour)
  14765. ).slice(-2) + _vm.amPm(hour)
  14766. )
  14767. )
  14768. ]
  14769. )
  14770. }),
  14771. 0
  14772. )
  14773. ]
  14774. ),
  14775. _c(
  14776. "div",
  14777. {
  14778. staticClass: "el-time-spinner__wrapper is-arrow",
  14779. on: {
  14780. mouseenter: function($event) {
  14781. _vm.emitSelectRange("minutes")
  14782. }
  14783. }
  14784. },
  14785. [
  14786. _c("i", {
  14787. directives: [
  14788. {
  14789. name: "repeat-click",
  14790. rawName: "v-repeat-click",
  14791. value: _vm.decrease,
  14792. expression: "decrease"
  14793. }
  14794. ],
  14795. staticClass: "el-time-spinner__arrow el-icon-arrow-up"
  14796. }),
  14797. _c("i", {
  14798. directives: [
  14799. {
  14800. name: "repeat-click",
  14801. rawName: "v-repeat-click",
  14802. value: _vm.increase,
  14803. expression: "increase"
  14804. }
  14805. ],
  14806. staticClass: "el-time-spinner__arrow el-icon-arrow-down"
  14807. }),
  14808. _c(
  14809. "ul",
  14810. { ref: "minutes", staticClass: "el-time-spinner__list" },
  14811. _vm._l(_vm.arrowMinuteList, function(minute, key) {
  14812. return _c(
  14813. "li",
  14814. {
  14815. key: key,
  14816. staticClass: "el-time-spinner__item",
  14817. class: { active: minute === _vm.minutes }
  14818. },
  14819. [
  14820. _vm._v(
  14821. "\n " +
  14822. _vm._s(
  14823. minute === undefined
  14824. ? ""
  14825. : ("0" + minute).slice(-2)
  14826. ) +
  14827. "\n "
  14828. )
  14829. ]
  14830. )
  14831. }),
  14832. 0
  14833. )
  14834. ]
  14835. ),
  14836. _vm.showSeconds
  14837. ? _c(
  14838. "div",
  14839. {
  14840. staticClass: "el-time-spinner__wrapper is-arrow",
  14841. on: {
  14842. mouseenter: function($event) {
  14843. _vm.emitSelectRange("seconds")
  14844. }
  14845. }
  14846. },
  14847. [
  14848. _c("i", {
  14849. directives: [
  14850. {
  14851. name: "repeat-click",
  14852. rawName: "v-repeat-click",
  14853. value: _vm.decrease,
  14854. expression: "decrease"
  14855. }
  14856. ],
  14857. staticClass: "el-time-spinner__arrow el-icon-arrow-up"
  14858. }),
  14859. _c("i", {
  14860. directives: [
  14861. {
  14862. name: "repeat-click",
  14863. rawName: "v-repeat-click",
  14864. value: _vm.increase,
  14865. expression: "increase"
  14866. }
  14867. ],
  14868. staticClass: "el-time-spinner__arrow el-icon-arrow-down"
  14869. }),
  14870. _c(
  14871. "ul",
  14872. { ref: "seconds", staticClass: "el-time-spinner__list" },
  14873. _vm._l(_vm.arrowSecondList, function(second, key) {
  14874. return _c(
  14875. "li",
  14876. {
  14877. key: key,
  14878. staticClass: "el-time-spinner__item",
  14879. class: { active: second === _vm.seconds }
  14880. },
  14881. [
  14882. _vm._v(
  14883. "\n " +
  14884. _vm._s(
  14885. second === undefined
  14886. ? ""
  14887. : ("0" + second).slice(-2)
  14888. ) +
  14889. "\n "
  14890. )
  14891. ]
  14892. )
  14893. }),
  14894. 0
  14895. )
  14896. ]
  14897. )
  14898. : _vm._e()
  14899. ]
  14900. : _vm._e()
  14901. ],
  14902. 2
  14903. )
  14904. }
  14905. var time_spinnervue_type_template_id_1facadeb_staticRenderFns = []
  14906. time_spinnervue_type_template_id_1facadeb_render._withStripped = true
  14907. // CONCATENATED MODULE: ./packages/date-picker/src/basic/time-spinner.vue?vue&type=template&id=1facadeb&
  14908. // 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&
  14909. //
  14910. //
  14911. //
  14912. //
  14913. //
  14914. //
  14915. //
  14916. //
  14917. //
  14918. //
  14919. //
  14920. //
  14921. //
  14922. //
  14923. //
  14924. //
  14925. //
  14926. //
  14927. //
  14928. //
  14929. //
  14930. //
  14931. //
  14932. //
  14933. //
  14934. //
  14935. //
  14936. //
  14937. //
  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. /* harmony default export */ var time_spinnervue_type_script_lang_js_ = ({
  15012. components: { ElScrollbar: scrollbar_default.a },
  15013. directives: {
  15014. repeatClick: repeat_click
  15015. },
  15016. props: {
  15017. date: {},
  15018. defaultValue: {}, // reserved for future use
  15019. showSeconds: {
  15020. type: Boolean,
  15021. default: true
  15022. },
  15023. arrowControl: Boolean,
  15024. amPmMode: {
  15025. type: String,
  15026. default: '' // 'a': am/pm; 'A': AM/PM
  15027. }
  15028. },
  15029. computed: {
  15030. hours: function hours() {
  15031. return this.date.getHours();
  15032. },
  15033. minutes: function minutes() {
  15034. return this.date.getMinutes();
  15035. },
  15036. seconds: function seconds() {
  15037. return this.date.getSeconds();
  15038. },
  15039. hoursList: function hoursList() {
  15040. return Object(date_util_["getRangeHours"])(this.selectableRange);
  15041. },
  15042. minutesList: function minutesList() {
  15043. return Object(date_util_["getRangeMinutes"])(this.selectableRange, this.hours);
  15044. },
  15045. arrowHourList: function arrowHourList() {
  15046. var hours = this.hours;
  15047. return [hours > 0 ? hours - 1 : undefined, hours, hours < 23 ? hours + 1 : undefined];
  15048. },
  15049. arrowMinuteList: function arrowMinuteList() {
  15050. var minutes = this.minutes;
  15051. return [minutes > 0 ? minutes - 1 : undefined, minutes, minutes < 59 ? minutes + 1 : undefined];
  15052. },
  15053. arrowSecondList: function arrowSecondList() {
  15054. var seconds = this.seconds;
  15055. return [seconds > 0 ? seconds - 1 : undefined, seconds, seconds < 59 ? seconds + 1 : undefined];
  15056. }
  15057. },
  15058. data: function data() {
  15059. return {
  15060. selectableRange: [],
  15061. currentScrollbar: null
  15062. };
  15063. },
  15064. mounted: function mounted() {
  15065. var _this = this;
  15066. this.$nextTick(function () {
  15067. !_this.arrowControl && _this.bindScrollEvent();
  15068. });
  15069. },
  15070. methods: {
  15071. increase: function increase() {
  15072. this.scrollDown(1);
  15073. },
  15074. decrease: function decrease() {
  15075. this.scrollDown(-1);
  15076. },
  15077. modifyDateField: function modifyDateField(type, value) {
  15078. switch (type) {
  15079. case 'hours':
  15080. this.$emit('change', Object(date_util_["modifyTime"])(this.date, value, this.minutes, this.seconds));break;
  15081. case 'minutes':
  15082. this.$emit('change', Object(date_util_["modifyTime"])(this.date, this.hours, value, this.seconds));break;
  15083. case 'seconds':
  15084. this.$emit('change', Object(date_util_["modifyTime"])(this.date, this.hours, this.minutes, value));break;
  15085. }
  15086. },
  15087. handleClick: function handleClick(type, _ref) {
  15088. var value = _ref.value,
  15089. disabled = _ref.disabled;
  15090. if (!disabled) {
  15091. this.modifyDateField(type, value);
  15092. this.emitSelectRange(type);
  15093. this.adjustSpinner(type, value);
  15094. }
  15095. },
  15096. emitSelectRange: function emitSelectRange(type) {
  15097. if (type === 'hours') {
  15098. this.$emit('select-range', 0, 2);
  15099. } else if (type === 'minutes') {
  15100. this.$emit('select-range', 3, 5);
  15101. } else if (type === 'seconds') {
  15102. this.$emit('select-range', 6, 8);
  15103. }
  15104. this.currentScrollbar = type;
  15105. },
  15106. bindScrollEvent: function bindScrollEvent() {
  15107. var _this2 = this;
  15108. var bindFunction = function bindFunction(type) {
  15109. _this2.$refs[type].wrap.onscroll = function (e) {
  15110. // TODO: scroll is emitted when set scrollTop programatically
  15111. // should find better solutions in the future!
  15112. _this2.handleScroll(type, e);
  15113. };
  15114. };
  15115. bindFunction('hours');
  15116. bindFunction('minutes');
  15117. bindFunction('seconds');
  15118. },
  15119. handleScroll: function handleScroll(type) {
  15120. 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);
  15121. this.modifyDateField(type, value);
  15122. },
  15123. // NOTE: used by datetime / date-range panel
  15124. // renamed from adjustScrollTop
  15125. // should try to refactory it
  15126. adjustSpinners: function adjustSpinners() {
  15127. this.adjustSpinner('hours', this.hours);
  15128. this.adjustSpinner('minutes', this.minutes);
  15129. this.adjustSpinner('seconds', this.seconds);
  15130. },
  15131. adjustCurrentSpinner: function adjustCurrentSpinner(type) {
  15132. this.adjustSpinner(type, this[type]);
  15133. },
  15134. adjustSpinner: function adjustSpinner(type, value) {
  15135. if (this.arrowControl) return;
  15136. var el = this.$refs[type].wrap;
  15137. if (el) {
  15138. el.scrollTop = Math.max(0, value * this.typeItemHeight(type));
  15139. }
  15140. },
  15141. scrollDown: function scrollDown(step) {
  15142. var _this3 = this;
  15143. if (!this.currentScrollbar) {
  15144. this.emitSelectRange('hours');
  15145. }
  15146. var label = this.currentScrollbar;
  15147. var hoursList = this.hoursList;
  15148. var now = this[label];
  15149. if (this.currentScrollbar === 'hours') {
  15150. var total = Math.abs(step);
  15151. step = step > 0 ? 1 : -1;
  15152. var length = hoursList.length;
  15153. while (length-- && total) {
  15154. now = (now + step + hoursList.length) % hoursList.length;
  15155. if (hoursList[now]) {
  15156. continue;
  15157. }
  15158. total--;
  15159. }
  15160. if (hoursList[now]) return;
  15161. } else {
  15162. now = (now + step + 60) % 60;
  15163. }
  15164. this.modifyDateField(label, now);
  15165. this.adjustSpinner(label, now);
  15166. this.$nextTick(function () {
  15167. return _this3.emitSelectRange(_this3.currentScrollbar);
  15168. });
  15169. },
  15170. amPm: function amPm(hour) {
  15171. var shouldShowAmPm = this.amPmMode.toLowerCase() === 'a';
  15172. if (!shouldShowAmPm) return '';
  15173. var isCapital = this.amPmMode === 'A';
  15174. var content = hour < 12 ? ' am' : ' pm';
  15175. if (isCapital) content = content.toUpperCase();
  15176. return content;
  15177. },
  15178. typeItemHeight: function typeItemHeight(type) {
  15179. return this.$refs[type].$el.querySelector('li').offsetHeight;
  15180. },
  15181. scrollBarHeight: function scrollBarHeight(type) {
  15182. return this.$refs[type].$el.offsetHeight;
  15183. }
  15184. }
  15185. });
  15186. // CONCATENATED MODULE: ./packages/date-picker/src/basic/time-spinner.vue?vue&type=script&lang=js&
  15187. /* harmony default export */ var basic_time_spinnervue_type_script_lang_js_ = (time_spinnervue_type_script_lang_js_);
  15188. // CONCATENATED MODULE: ./packages/date-picker/src/basic/time-spinner.vue
  15189. /* normalize component */
  15190. var time_spinner_component = normalizeComponent(
  15191. basic_time_spinnervue_type_script_lang_js_,
  15192. time_spinnervue_type_template_id_1facadeb_render,
  15193. time_spinnervue_type_template_id_1facadeb_staticRenderFns,
  15194. false,
  15195. null,
  15196. null,
  15197. null
  15198. )
  15199. /* hot reload */
  15200. if (false) { var time_spinner_api; }
  15201. time_spinner_component.options.__file = "packages/date-picker/src/basic/time-spinner.vue"
  15202. /* harmony default export */ var time_spinner = (time_spinner_component.exports);
  15203. // 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&
  15204. //
  15205. //
  15206. //
  15207. //
  15208. //
  15209. //
  15210. //
  15211. //
  15212. //
  15213. //
  15214. //
  15215. //
  15216. //
  15217. //
  15218. //
  15219. //
  15220. //
  15221. //
  15222. //
  15223. //
  15224. //
  15225. //
  15226. //
  15227. //
  15228. //
  15229. //
  15230. //
  15231. //
  15232. //
  15233. //
  15234. //
  15235. //
  15236. /* harmony default export */ var timevue_type_script_lang_js_ = ({
  15237. mixins: [locale_default.a],
  15238. components: {
  15239. TimeSpinner: time_spinner
  15240. },
  15241. props: {
  15242. visible: Boolean,
  15243. timeArrowControl: Boolean
  15244. },
  15245. watch: {
  15246. visible: function visible(val) {
  15247. var _this = this;
  15248. if (val) {
  15249. this.oldValue = this.value;
  15250. this.$nextTick(function () {
  15251. return _this.$refs.spinner.emitSelectRange('hours');
  15252. });
  15253. } else {
  15254. this.needInitAdjust = true;
  15255. }
  15256. },
  15257. value: function value(newVal) {
  15258. var _this2 = this;
  15259. var date = void 0;
  15260. if (newVal instanceof Date) {
  15261. date = Object(date_util_["limitTimeRange"])(newVal, this.selectableRange, this.format);
  15262. } else if (!newVal) {
  15263. date = this.defaultValue ? new Date(this.defaultValue) : new Date();
  15264. }
  15265. this.date = date;
  15266. if (this.visible && this.needInitAdjust) {
  15267. this.$nextTick(function (_) {
  15268. return _this2.adjustSpinners();
  15269. });
  15270. this.needInitAdjust = false;
  15271. }
  15272. },
  15273. selectableRange: function selectableRange(val) {
  15274. this.$refs.spinner.selectableRange = val;
  15275. },
  15276. defaultValue: function defaultValue(val) {
  15277. if (!Object(date_util_["isDate"])(this.value)) {
  15278. this.date = val ? new Date(val) : new Date();
  15279. }
  15280. }
  15281. },
  15282. data: function data() {
  15283. return {
  15284. popperClass: '',
  15285. format: 'HH:mm:ss',
  15286. value: '',
  15287. defaultValue: null,
  15288. date: new Date(),
  15289. oldValue: new Date(),
  15290. selectableRange: [],
  15291. selectionRange: [0, 2],
  15292. disabled: false,
  15293. arrowControl: false,
  15294. needInitAdjust: true
  15295. };
  15296. },
  15297. computed: {
  15298. showSeconds: function showSeconds() {
  15299. return (this.format || '').indexOf('ss') !== -1;
  15300. },
  15301. useArrow: function useArrow() {
  15302. return this.arrowControl || this.timeArrowControl || false;
  15303. },
  15304. amPmMode: function amPmMode() {
  15305. if ((this.format || '').indexOf('A') !== -1) return 'A';
  15306. if ((this.format || '').indexOf('a') !== -1) return 'a';
  15307. return '';
  15308. }
  15309. },
  15310. methods: {
  15311. handleCancel: function handleCancel() {
  15312. this.$emit('pick', this.oldValue, false);
  15313. },
  15314. handleChange: function handleChange(date) {
  15315. // this.visible avoids edge cases, when use scrolls during panel closing animation
  15316. if (this.visible) {
  15317. this.date = Object(date_util_["clearMilliseconds"])(date);
  15318. // if date is out of range, do not emit
  15319. if (this.isValidValue(this.date)) {
  15320. this.$emit('pick', this.date, true);
  15321. }
  15322. }
  15323. },
  15324. setSelectionRange: function setSelectionRange(start, end) {
  15325. this.$emit('select-range', start, end);
  15326. this.selectionRange = [start, end];
  15327. },
  15328. handleConfirm: function handleConfirm() {
  15329. var visible = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  15330. var first = arguments[1];
  15331. if (first) return;
  15332. var date = Object(date_util_["clearMilliseconds"])(Object(date_util_["limitTimeRange"])(this.date, this.selectableRange, this.format));
  15333. this.$emit('pick', date, visible, first);
  15334. },
  15335. handleKeydown: function handleKeydown(event) {
  15336. var keyCode = event.keyCode;
  15337. var mapping = { 38: -1, 40: 1, 37: -1, 39: 1 };
  15338. // Left or Right
  15339. if (keyCode === 37 || keyCode === 39) {
  15340. var step = mapping[keyCode];
  15341. this.changeSelectionRange(step);
  15342. event.preventDefault();
  15343. return;
  15344. }
  15345. // Up or Down
  15346. if (keyCode === 38 || keyCode === 40) {
  15347. var _step = mapping[keyCode];
  15348. this.$refs.spinner.scrollDown(_step);
  15349. event.preventDefault();
  15350. return;
  15351. }
  15352. },
  15353. isValidValue: function isValidValue(date) {
  15354. return Object(date_util_["timeWithinRange"])(date, this.selectableRange, this.format);
  15355. },
  15356. adjustSpinners: function adjustSpinners() {
  15357. return this.$refs.spinner.adjustSpinners();
  15358. },
  15359. changeSelectionRange: function changeSelectionRange(step) {
  15360. var list = [0, 3].concat(this.showSeconds ? [6] : []);
  15361. var mapping = ['hours', 'minutes'].concat(this.showSeconds ? ['seconds'] : []);
  15362. var index = list.indexOf(this.selectionRange[0]);
  15363. var next = (index + step + list.length) % list.length;
  15364. this.$refs.spinner.emitSelectRange(mapping[next]);
  15365. }
  15366. },
  15367. mounted: function mounted() {
  15368. var _this3 = this;
  15369. this.$nextTick(function () {
  15370. return _this3.handleConfirm(true, true);
  15371. });
  15372. this.$emit('mounted');
  15373. }
  15374. });
  15375. // CONCATENATED MODULE: ./packages/date-picker/src/panel/time.vue?vue&type=script&lang=js&
  15376. /* harmony default export */ var panel_timevue_type_script_lang_js_ = (timevue_type_script_lang_js_);
  15377. // CONCATENATED MODULE: ./packages/date-picker/src/panel/time.vue
  15378. /* normalize component */
  15379. var time_component = normalizeComponent(
  15380. panel_timevue_type_script_lang_js_,
  15381. timevue_type_template_id_3d939089_render,
  15382. timevue_type_template_id_3d939089_staticRenderFns,
  15383. false,
  15384. null,
  15385. null,
  15386. null
  15387. )
  15388. /* hot reload */
  15389. if (false) { var time_api; }
  15390. time_component.options.__file = "packages/date-picker/src/panel/time.vue"
  15391. /* harmony default export */ var panel_time = (time_component.exports);
  15392. // 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&
  15393. var year_tablevue_type_template_id_c86ab5e0_render = function() {
  15394. var _vm = this
  15395. var _h = _vm.$createElement
  15396. var _c = _vm._self._c || _h
  15397. return _c(
  15398. "table",
  15399. { staticClass: "el-year-table", on: { click: _vm.handleYearTableClick } },
  15400. [
  15401. _c("tbody", [
  15402. _c("tr", [
  15403. _c(
  15404. "td",
  15405. {
  15406. staticClass: "available",
  15407. class: _vm.getCellStyle(_vm.startYear + 0)
  15408. },
  15409. [_c("a", { staticClass: "cell" }, [_vm._v(_vm._s(_vm.startYear))])]
  15410. ),
  15411. _c(
  15412. "td",
  15413. {
  15414. staticClass: "available",
  15415. class: _vm.getCellStyle(_vm.startYear + 1)
  15416. },
  15417. [
  15418. _c("a", { staticClass: "cell" }, [
  15419. _vm._v(_vm._s(_vm.startYear + 1))
  15420. ])
  15421. ]
  15422. ),
  15423. _c(
  15424. "td",
  15425. {
  15426. staticClass: "available",
  15427. class: _vm.getCellStyle(_vm.startYear + 2)
  15428. },
  15429. [
  15430. _c("a", { staticClass: "cell" }, [
  15431. _vm._v(_vm._s(_vm.startYear + 2))
  15432. ])
  15433. ]
  15434. ),
  15435. _c(
  15436. "td",
  15437. {
  15438. staticClass: "available",
  15439. class: _vm.getCellStyle(_vm.startYear + 3)
  15440. },
  15441. [
  15442. _c("a", { staticClass: "cell" }, [
  15443. _vm._v(_vm._s(_vm.startYear + 3))
  15444. ])
  15445. ]
  15446. )
  15447. ]),
  15448. _c("tr", [
  15449. _c(
  15450. "td",
  15451. {
  15452. staticClass: "available",
  15453. class: _vm.getCellStyle(_vm.startYear + 4)
  15454. },
  15455. [
  15456. _c("a", { staticClass: "cell" }, [
  15457. _vm._v(_vm._s(_vm.startYear + 4))
  15458. ])
  15459. ]
  15460. ),
  15461. _c(
  15462. "td",
  15463. {
  15464. staticClass: "available",
  15465. class: _vm.getCellStyle(_vm.startYear + 5)
  15466. },
  15467. [
  15468. _c("a", { staticClass: "cell" }, [
  15469. _vm._v(_vm._s(_vm.startYear + 5))
  15470. ])
  15471. ]
  15472. ),
  15473. _c(
  15474. "td",
  15475. {
  15476. staticClass: "available",
  15477. class: _vm.getCellStyle(_vm.startYear + 6)
  15478. },
  15479. [
  15480. _c("a", { staticClass: "cell" }, [
  15481. _vm._v(_vm._s(_vm.startYear + 6))
  15482. ])
  15483. ]
  15484. ),
  15485. _c(
  15486. "td",
  15487. {
  15488. staticClass: "available",
  15489. class: _vm.getCellStyle(_vm.startYear + 7)
  15490. },
  15491. [
  15492. _c("a", { staticClass: "cell" }, [
  15493. _vm._v(_vm._s(_vm.startYear + 7))
  15494. ])
  15495. ]
  15496. )
  15497. ]),
  15498. _c("tr", [
  15499. _c(
  15500. "td",
  15501. {
  15502. staticClass: "available",
  15503. class: _vm.getCellStyle(_vm.startYear + 8)
  15504. },
  15505. [
  15506. _c("a", { staticClass: "cell" }, [
  15507. _vm._v(_vm._s(_vm.startYear + 8))
  15508. ])
  15509. ]
  15510. ),
  15511. _c(
  15512. "td",
  15513. {
  15514. staticClass: "available",
  15515. class: _vm.getCellStyle(_vm.startYear + 9)
  15516. },
  15517. [
  15518. _c("a", { staticClass: "cell" }, [
  15519. _vm._v(_vm._s(_vm.startYear + 9))
  15520. ])
  15521. ]
  15522. ),
  15523. _c("td"),
  15524. _c("td")
  15525. ])
  15526. ])
  15527. ]
  15528. )
  15529. }
  15530. var year_tablevue_type_template_id_c86ab5e0_staticRenderFns = []
  15531. year_tablevue_type_template_id_c86ab5e0_render._withStripped = true
  15532. // CONCATENATED MODULE: ./packages/date-picker/src/basic/year-table.vue?vue&type=template&id=c86ab5e0&
  15533. // 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&
  15534. //
  15535. //
  15536. //
  15537. //
  15538. //
  15539. //
  15540. //
  15541. //
  15542. //
  15543. //
  15544. //
  15545. //
  15546. //
  15547. //
  15548. //
  15549. //
  15550. //
  15551. //
  15552. //
  15553. //
  15554. //
  15555. //
  15556. //
  15557. //
  15558. //
  15559. //
  15560. //
  15561. //
  15562. //
  15563. //
  15564. //
  15565. //
  15566. //
  15567. //
  15568. //
  15569. //
  15570. //
  15571. //
  15572. //
  15573. //
  15574. //
  15575. //
  15576. //
  15577. //
  15578. //
  15579. var year_tablevue_type_script_lang_js_datesInYear = function datesInYear(year) {
  15580. var numOfDays = Object(date_util_["getDayCountOfYear"])(year);
  15581. var firstDay = new Date(year, 0, 1);
  15582. return Object(date_util_["range"])(numOfDays).map(function (n) {
  15583. return Object(date_util_["nextDate"])(firstDay, n);
  15584. });
  15585. };
  15586. /* harmony default export */ var year_tablevue_type_script_lang_js_ = ({
  15587. props: {
  15588. disabledDate: {},
  15589. value: {},
  15590. defaultValue: {
  15591. validator: function validator(val) {
  15592. // null or valid Date Object
  15593. return val === null || val instanceof Date && Object(date_util_["isDate"])(val);
  15594. }
  15595. },
  15596. date: {},
  15597. selectionMode: {}
  15598. },
  15599. computed: {
  15600. startYear: function startYear() {
  15601. return Math.floor(this.date.getFullYear() / 10) * 10;
  15602. }
  15603. },
  15604. methods: {
  15605. getCellStyle: function getCellStyle(year) {
  15606. var style = {};
  15607. var today = new Date();
  15608. style.disabled = typeof this.disabledDate === 'function' ? year_tablevue_type_script_lang_js_datesInYear(year).every(this.disabledDate) : false;
  15609. style.current = Object(util_["arrayFindIndex"])(Object(util_["coerceTruthyValueToArray"])(this.value), function (date) {
  15610. return date.getFullYear() === year;
  15611. }) >= 0;
  15612. style.today = today.getFullYear() === year;
  15613. style.default = this.defaultValue && this.defaultValue.getFullYear() === year;
  15614. return style;
  15615. },
  15616. handleYearTableClick: function handleYearTableClick(event) {
  15617. var target = event.target;
  15618. if (target.tagName === 'A') {
  15619. if (Object(dom_["hasClass"])(target.parentNode, 'disabled')) return;
  15620. var year = target.textContent || target.innerText;
  15621. if (this.selectionMode === 'years') {
  15622. var value = this.value || [];
  15623. var idx = Object(util_["arrayFindIndex"])(value, function (date) {
  15624. return date.getFullYear() === Number(year);
  15625. });
  15626. var newValue = idx > -1 ? [].concat(value.slice(0, idx), value.slice(idx + 1)) : [].concat(value, [new Date(year)]);
  15627. this.$emit('pick', newValue);
  15628. } else {
  15629. this.$emit('pick', Number(year));
  15630. }
  15631. }
  15632. }
  15633. }
  15634. });
  15635. // CONCATENATED MODULE: ./packages/date-picker/src/basic/year-table.vue?vue&type=script&lang=js&
  15636. /* harmony default export */ var basic_year_tablevue_type_script_lang_js_ = (year_tablevue_type_script_lang_js_);
  15637. // CONCATENATED MODULE: ./packages/date-picker/src/basic/year-table.vue
  15638. /* normalize component */
  15639. var year_table_component = normalizeComponent(
  15640. basic_year_tablevue_type_script_lang_js_,
  15641. year_tablevue_type_template_id_c86ab5e0_render,
  15642. year_tablevue_type_template_id_c86ab5e0_staticRenderFns,
  15643. false,
  15644. null,
  15645. null,
  15646. null
  15647. )
  15648. /* hot reload */
  15649. if (false) { var year_table_api; }
  15650. year_table_component.options.__file = "packages/date-picker/src/basic/year-table.vue"
  15651. /* harmony default export */ var year_table = (year_table_component.exports);
  15652. // 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&
  15653. var month_tablevue_type_template_id_654d4f42_render = function() {
  15654. var _vm = this
  15655. var _h = _vm.$createElement
  15656. var _c = _vm._self._c || _h
  15657. return _c(
  15658. "table",
  15659. {
  15660. staticClass: "el-month-table",
  15661. on: { click: _vm.handleMonthTableClick, mousemove: _vm.handleMouseMove }
  15662. },
  15663. [
  15664. _c(
  15665. "tbody",
  15666. _vm._l(_vm.rows, function(row, key) {
  15667. return _c(
  15668. "tr",
  15669. { key: key },
  15670. _vm._l(row, function(cell, key) {
  15671. return _c("td", { key: key, class: _vm.getCellStyle(cell) }, [
  15672. _c("div", [
  15673. _c("a", { staticClass: "cell" }, [
  15674. _vm._v(
  15675. _vm._s(
  15676. _vm.t("el.datepicker.months." + _vm.months[cell.text])
  15677. )
  15678. )
  15679. ])
  15680. ])
  15681. ])
  15682. }),
  15683. 0
  15684. )
  15685. }),
  15686. 0
  15687. )
  15688. ]
  15689. )
  15690. }
  15691. var month_tablevue_type_template_id_654d4f42_staticRenderFns = []
  15692. month_tablevue_type_template_id_654d4f42_render._withStripped = true
  15693. // CONCATENATED MODULE: ./packages/date-picker/src/basic/month-table.vue?vue&type=template&id=654d4f42&
  15694. // 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&
  15695. //
  15696. //
  15697. //
  15698. //
  15699. //
  15700. //
  15701. //
  15702. //
  15703. //
  15704. //
  15705. //
  15706. //
  15707. //
  15708. //
  15709. var month_tablevue_type_script_lang_js_datesInMonth = function datesInMonth(year, month) {
  15710. var numOfDays = Object(date_util_["getDayCountOfMonth"])(year, month);
  15711. var firstDay = new Date(year, month, 1);
  15712. return Object(date_util_["range"])(numOfDays).map(function (n) {
  15713. return Object(date_util_["nextDate"])(firstDay, n);
  15714. });
  15715. };
  15716. var clearDate = function clearDate(date) {
  15717. return new Date(date.getFullYear(), date.getMonth());
  15718. };
  15719. var getMonthTimestamp = function getMonthTimestamp(time) {
  15720. if (typeof time === 'number' || typeof time === 'string') {
  15721. return clearDate(new Date(time)).getTime();
  15722. } else if (time instanceof Date) {
  15723. return clearDate(time).getTime();
  15724. } else {
  15725. return NaN;
  15726. }
  15727. };
  15728. // remove the first element that satisfies `pred` from arr
  15729. // return a new array if modification occurs
  15730. // return the original array otherwise
  15731. var month_tablevue_type_script_lang_js_removeFromArray = function removeFromArray(arr, pred) {
  15732. var idx = typeof pred === 'function' ? Object(util_["arrayFindIndex"])(arr, pred) : arr.indexOf(pred);
  15733. return idx >= 0 ? [].concat(arr.slice(0, idx), arr.slice(idx + 1)) : arr;
  15734. };
  15735. /* harmony default export */ var month_tablevue_type_script_lang_js_ = ({
  15736. props: {
  15737. disabledDate: {},
  15738. value: {},
  15739. selectionMode: {
  15740. default: 'month'
  15741. },
  15742. minDate: {},
  15743. maxDate: {},
  15744. defaultValue: {
  15745. validator: function validator(val) {
  15746. // null or valid Date Object
  15747. return val === null || Object(date_util_["isDate"])(val) || Array.isArray(val) && val.every(date_util_["isDate"]);
  15748. }
  15749. },
  15750. date: {},
  15751. rangeState: {
  15752. default: function _default() {
  15753. return {
  15754. endDate: null,
  15755. selecting: false
  15756. };
  15757. }
  15758. }
  15759. },
  15760. mixins: [locale_default.a],
  15761. watch: {
  15762. 'rangeState.endDate': function rangeStateEndDate(newVal) {
  15763. this.markRange(this.minDate, newVal);
  15764. },
  15765. minDate: function minDate(newVal, oldVal) {
  15766. if (getMonthTimestamp(newVal) !== getMonthTimestamp(oldVal)) {
  15767. this.markRange(this.minDate, this.maxDate);
  15768. }
  15769. },
  15770. maxDate: function maxDate(newVal, oldVal) {
  15771. if (getMonthTimestamp(newVal) !== getMonthTimestamp(oldVal)) {
  15772. this.markRange(this.minDate, this.maxDate);
  15773. }
  15774. }
  15775. },
  15776. data: function data() {
  15777. return {
  15778. months: ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'],
  15779. tableRows: [[], [], []],
  15780. lastRow: null,
  15781. lastColumn: null
  15782. };
  15783. },
  15784. methods: {
  15785. cellMatchesDate: function cellMatchesDate(cell, date) {
  15786. var value = new Date(date);
  15787. return this.date.getFullYear() === value.getFullYear() && Number(cell.text) === value.getMonth();
  15788. },
  15789. getCellStyle: function getCellStyle(cell) {
  15790. var _this = this;
  15791. var style = {};
  15792. var year = this.date.getFullYear();
  15793. var today = new Date();
  15794. var month = cell.text;
  15795. var defaultValue = this.defaultValue ? Array.isArray(this.defaultValue) ? this.defaultValue : [this.defaultValue] : [];
  15796. style.disabled = typeof this.disabledDate === 'function' ? month_tablevue_type_script_lang_js_datesInMonth(year, month).every(this.disabledDate) : false;
  15797. style.current = Object(util_["arrayFindIndex"])(Object(util_["coerceTruthyValueToArray"])(this.value), function (date) {
  15798. return date.getFullYear() === year && date.getMonth() === month;
  15799. }) >= 0;
  15800. style.today = today.getFullYear() === year && today.getMonth() === month;
  15801. style.default = defaultValue.some(function (date) {
  15802. return _this.cellMatchesDate(cell, date);
  15803. });
  15804. if (cell.inRange) {
  15805. style['in-range'] = true;
  15806. if (cell.start) {
  15807. style['start-date'] = true;
  15808. }
  15809. if (cell.end) {
  15810. style['end-date'] = true;
  15811. }
  15812. }
  15813. return style;
  15814. },
  15815. getMonthOfCell: function getMonthOfCell(month) {
  15816. var year = this.date.getFullYear();
  15817. return new Date(year, month, 1);
  15818. },
  15819. markRange: function markRange(minDate, maxDate) {
  15820. minDate = getMonthTimestamp(minDate);
  15821. maxDate = getMonthTimestamp(maxDate) || minDate;
  15822. var _ref = [Math.min(minDate, maxDate), Math.max(minDate, maxDate)];
  15823. minDate = _ref[0];
  15824. maxDate = _ref[1];
  15825. var rows = this.rows;
  15826. for (var i = 0, k = rows.length; i < k; i++) {
  15827. var row = rows[i];
  15828. for (var j = 0, l = row.length; j < l; j++) {
  15829. var cell = row[j];
  15830. var index = i * 4 + j;
  15831. var time = new Date(this.date.getFullYear(), index).getTime();
  15832. cell.inRange = minDate && time >= minDate && time <= maxDate;
  15833. cell.start = minDate && time === minDate;
  15834. cell.end = maxDate && time === maxDate;
  15835. }
  15836. }
  15837. },
  15838. handleMouseMove: function handleMouseMove(event) {
  15839. if (!this.rangeState.selecting) return;
  15840. var target = event.target;
  15841. if (target.tagName === 'A') {
  15842. target = target.parentNode.parentNode;
  15843. }
  15844. if (target.tagName === 'DIV') {
  15845. target = target.parentNode;
  15846. }
  15847. if (target.tagName !== 'TD') return;
  15848. var row = target.parentNode.rowIndex;
  15849. var column = target.cellIndex;
  15850. // can not select disabled date
  15851. if (this.rows[row][column].disabled) return;
  15852. // only update rangeState when mouse moves to a new cell
  15853. // this avoids frequent Date object creation and improves performance
  15854. if (row !== this.lastRow || column !== this.lastColumn) {
  15855. this.lastRow = row;
  15856. this.lastColumn = column;
  15857. this.$emit('changerange', {
  15858. minDate: this.minDate,
  15859. maxDate: this.maxDate,
  15860. rangeState: {
  15861. selecting: true,
  15862. endDate: this.getMonthOfCell(row * 4 + column)
  15863. }
  15864. });
  15865. }
  15866. },
  15867. handleMonthTableClick: function handleMonthTableClick(event) {
  15868. var target = event.target;
  15869. if (target.tagName === 'A') {
  15870. target = target.parentNode.parentNode;
  15871. }
  15872. if (target.tagName === 'DIV') {
  15873. target = target.parentNode;
  15874. }
  15875. if (target.tagName !== 'TD') return;
  15876. if (Object(dom_["hasClass"])(target, 'disabled')) return;
  15877. var column = target.cellIndex;
  15878. var row = target.parentNode.rowIndex;
  15879. var month = row * 4 + column;
  15880. var newDate = this.getMonthOfCell(month);
  15881. if (this.selectionMode === 'range') {
  15882. if (!this.rangeState.selecting) {
  15883. this.$emit('pick', { minDate: newDate, maxDate: null });
  15884. this.rangeState.selecting = true;
  15885. } else {
  15886. if (newDate >= this.minDate) {
  15887. this.$emit('pick', { minDate: this.minDate, maxDate: newDate });
  15888. } else {
  15889. this.$emit('pick', { minDate: newDate, maxDate: this.minDate });
  15890. }
  15891. this.rangeState.selecting = false;
  15892. }
  15893. } else if (this.selectionMode === 'months') {
  15894. var value = this.value || [];
  15895. var year = this.date.getFullYear();
  15896. var newValue = Object(util_["arrayFindIndex"])(value, function (date) {
  15897. return date.getFullYear() === year && date.getMonth() === month;
  15898. }) >= 0 ? month_tablevue_type_script_lang_js_removeFromArray(value, function (date) {
  15899. return date.getTime() === newDate.getTime();
  15900. }) : [].concat(value, [newDate]);
  15901. this.$emit('pick', newValue);
  15902. } else {
  15903. this.$emit('pick', month);
  15904. }
  15905. }
  15906. },
  15907. computed: {
  15908. rows: function rows() {
  15909. var _this2 = this;
  15910. // TODO: refactory rows / getCellClasses
  15911. var rows = this.tableRows;
  15912. var disabledDate = this.disabledDate;
  15913. var selectedDate = [];
  15914. var now = getMonthTimestamp(new Date());
  15915. for (var i = 0; i < 3; i++) {
  15916. var row = rows[i];
  15917. var _loop = function _loop(j) {
  15918. var cell = row[j];
  15919. if (!cell) {
  15920. cell = { row: i, column: j, type: 'normal', inRange: false, start: false, end: false };
  15921. }
  15922. cell.type = 'normal';
  15923. var index = i * 4 + j;
  15924. var time = new Date(_this2.date.getFullYear(), index).getTime();
  15925. cell.inRange = time >= getMonthTimestamp(_this2.minDate) && time <= getMonthTimestamp(_this2.maxDate);
  15926. cell.start = _this2.minDate && time === getMonthTimestamp(_this2.minDate);
  15927. cell.end = _this2.maxDate && time === getMonthTimestamp(_this2.maxDate);
  15928. var isToday = time === now;
  15929. if (isToday) {
  15930. cell.type = 'today';
  15931. }
  15932. cell.text = index;
  15933. var cellDate = new Date(time);
  15934. cell.disabled = typeof disabledDate === 'function' && disabledDate(cellDate);
  15935. cell.selected = Object(util_["arrayFind"])(selectedDate, function (date) {
  15936. return date.getTime() === cellDate.getTime();
  15937. });
  15938. _this2.$set(row, j, cell);
  15939. };
  15940. for (var j = 0; j < 4; j++) {
  15941. _loop(j);
  15942. }
  15943. }
  15944. return rows;
  15945. }
  15946. }
  15947. });
  15948. // CONCATENATED MODULE: ./packages/date-picker/src/basic/month-table.vue?vue&type=script&lang=js&
  15949. /* harmony default export */ var basic_month_tablevue_type_script_lang_js_ = (month_tablevue_type_script_lang_js_);
  15950. // CONCATENATED MODULE: ./packages/date-picker/src/basic/month-table.vue
  15951. /* normalize component */
  15952. var month_table_component = normalizeComponent(
  15953. basic_month_tablevue_type_script_lang_js_,
  15954. month_tablevue_type_template_id_654d4f42_render,
  15955. month_tablevue_type_template_id_654d4f42_staticRenderFns,
  15956. false,
  15957. null,
  15958. null,
  15959. null
  15960. )
  15961. /* hot reload */
  15962. if (false) { var month_table_api; }
  15963. month_table_component.options.__file = "packages/date-picker/src/basic/month-table.vue"
  15964. /* harmony default export */ var month_table = (month_table_component.exports);
  15965. // 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&
  15966. var date_tablevue_type_template_id_5d1f3341_render = function() {
  15967. var _vm = this
  15968. var _h = _vm.$createElement
  15969. var _c = _vm._self._c || _h
  15970. return _c(
  15971. "table",
  15972. {
  15973. staticClass: "el-date-table",
  15974. class: { "is-week-mode": _vm.selectionMode === "week" },
  15975. attrs: { cellspacing: "0", cellpadding: "0" },
  15976. on: { click: _vm.handleClick, mousemove: _vm.handleMouseMove }
  15977. },
  15978. [
  15979. _c(
  15980. "tbody",
  15981. [
  15982. _c(
  15983. "tr",
  15984. [
  15985. _vm.showWeekNumber
  15986. ? _c("th", [_vm._v(_vm._s(_vm.t("el.datepicker.week")))])
  15987. : _vm._e(),
  15988. _vm._l(_vm.WEEKS, function(week, key) {
  15989. return _c("th", { key: key }, [
  15990. _vm._v(_vm._s(_vm.t("el.datepicker.weeks." + week)))
  15991. ])
  15992. })
  15993. ],
  15994. 2
  15995. ),
  15996. _vm._l(_vm.rows, function(row, key) {
  15997. return _c(
  15998. "tr",
  15999. {
  16000. key: key,
  16001. staticClass: "el-date-table__row",
  16002. class: { current: _vm.isWeekActive(row[1]) }
  16003. },
  16004. _vm._l(row, function(cell, key) {
  16005. return _c("td", { key: key, class: _vm.getCellClasses(cell) }, [
  16006. _c("div", [
  16007. _c("span", [
  16008. _vm._v("\n " + _vm._s(cell.text) + "\n ")
  16009. ])
  16010. ])
  16011. ])
  16012. }),
  16013. 0
  16014. )
  16015. })
  16016. ],
  16017. 2
  16018. )
  16019. ]
  16020. )
  16021. }
  16022. var date_tablevue_type_template_id_5d1f3341_staticRenderFns = []
  16023. date_tablevue_type_template_id_5d1f3341_render._withStripped = true
  16024. // CONCATENATED MODULE: ./packages/date-picker/src/basic/date-table.vue?vue&type=template&id=5d1f3341&
  16025. // 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&
  16026. //
  16027. //
  16028. //
  16029. //
  16030. //
  16031. //
  16032. //
  16033. //
  16034. //
  16035. //
  16036. //
  16037. //
  16038. //
  16039. //
  16040. //
  16041. //
  16042. //
  16043. //
  16044. //
  16045. //
  16046. //
  16047. //
  16048. //
  16049. //
  16050. //
  16051. //
  16052. //
  16053. //
  16054. //
  16055. //
  16056. //
  16057. //
  16058. //
  16059. var _WEEKS = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];
  16060. var date_tablevue_type_script_lang_js_getDateTimestamp = function getDateTimestamp(time) {
  16061. if (typeof time === 'number' || typeof time === 'string') {
  16062. return Object(date_util_["clearTime"])(new Date(time)).getTime();
  16063. } else if (time instanceof Date) {
  16064. return Object(date_util_["clearTime"])(time).getTime();
  16065. } else {
  16066. return NaN;
  16067. }
  16068. };
  16069. // remove the first element that satisfies `pred` from arr
  16070. // return a new array if modification occurs
  16071. // return the original array otherwise
  16072. var date_tablevue_type_script_lang_js_removeFromArray = function removeFromArray(arr, pred) {
  16073. var idx = typeof pred === 'function' ? Object(util_["arrayFindIndex"])(arr, pred) : arr.indexOf(pred);
  16074. return idx >= 0 ? [].concat(arr.slice(0, idx), arr.slice(idx + 1)) : arr;
  16075. };
  16076. /* harmony default export */ var date_tablevue_type_script_lang_js_ = ({
  16077. mixins: [locale_default.a],
  16078. props: {
  16079. firstDayOfWeek: {
  16080. default: 7,
  16081. type: Number,
  16082. validator: function validator(val) {
  16083. return val >= 1 && val <= 7;
  16084. }
  16085. },
  16086. value: {},
  16087. defaultValue: {
  16088. validator: function validator(val) {
  16089. // either: null, valid Date object, Array of valid Date objects
  16090. return val === null || Object(date_util_["isDate"])(val) || Array.isArray(val) && val.every(date_util_["isDate"]);
  16091. }
  16092. },
  16093. date: {},
  16094. selectionMode: {
  16095. default: 'day'
  16096. },
  16097. showWeekNumber: {
  16098. type: Boolean,
  16099. default: false
  16100. },
  16101. disabledDate: {},
  16102. cellClassName: {},
  16103. minDate: {},
  16104. maxDate: {},
  16105. rangeState: {
  16106. default: function _default() {
  16107. return {
  16108. endDate: null,
  16109. selecting: false
  16110. };
  16111. }
  16112. }
  16113. },
  16114. computed: {
  16115. offsetDay: function offsetDay() {
  16116. var week = this.firstDayOfWeek;
  16117. // 周日为界限,左右偏移的天数,3217654 例如周一就是 -1,目的是调整前两行日期的位置
  16118. return week > 3 ? 7 - week : -week;
  16119. },
  16120. WEEKS: function WEEKS() {
  16121. var week = this.firstDayOfWeek;
  16122. return _WEEKS.concat(_WEEKS).slice(week, week + 7);
  16123. },
  16124. year: function year() {
  16125. return this.date.getFullYear();
  16126. },
  16127. month: function month() {
  16128. return this.date.getMonth();
  16129. },
  16130. startDate: function startDate() {
  16131. return Object(date_util_["getStartDateOfMonth"])(this.year, this.month);
  16132. },
  16133. rows: function rows() {
  16134. var _this = this;
  16135. // TODO: refactory rows / getCellClasses
  16136. var date = new Date(this.year, this.month, 1);
  16137. var day = Object(date_util_["getFirstDayOfMonth"])(date); // day of first day
  16138. var dateCountOfMonth = Object(date_util_["getDayCountOfMonth"])(date.getFullYear(), date.getMonth());
  16139. var dateCountOfLastMonth = Object(date_util_["getDayCountOfMonth"])(date.getFullYear(), date.getMonth() === 0 ? 11 : date.getMonth() - 1);
  16140. day = day === 0 ? 7 : day;
  16141. var offset = this.offsetDay;
  16142. var rows = this.tableRows;
  16143. var count = 1;
  16144. var startDate = this.startDate;
  16145. var disabledDate = this.disabledDate;
  16146. var cellClassName = this.cellClassName;
  16147. var selectedDate = this.selectionMode === 'dates' ? Object(util_["coerceTruthyValueToArray"])(this.value) : [];
  16148. var now = date_tablevue_type_script_lang_js_getDateTimestamp(new Date());
  16149. for (var i = 0; i < 6; i++) {
  16150. var row = rows[i];
  16151. if (this.showWeekNumber) {
  16152. if (!row[0]) {
  16153. row[0] = { type: 'week', text: Object(date_util_["getWeekNumber"])(Object(date_util_["nextDate"])(startDate, i * 7 + 1)) };
  16154. }
  16155. }
  16156. var _loop = function _loop(j) {
  16157. var cell = row[_this.showWeekNumber ? j + 1 : j];
  16158. if (!cell) {
  16159. cell = { row: i, column: j, type: 'normal', inRange: false, start: false, end: false };
  16160. }
  16161. cell.type = 'normal';
  16162. var index = i * 7 + j;
  16163. var time = Object(date_util_["nextDate"])(startDate, index - offset).getTime();
  16164. cell.inRange = time >= date_tablevue_type_script_lang_js_getDateTimestamp(_this.minDate) && time <= date_tablevue_type_script_lang_js_getDateTimestamp(_this.maxDate);
  16165. cell.start = _this.minDate && time === date_tablevue_type_script_lang_js_getDateTimestamp(_this.minDate);
  16166. cell.end = _this.maxDate && time === date_tablevue_type_script_lang_js_getDateTimestamp(_this.maxDate);
  16167. var isToday = time === now;
  16168. if (isToday) {
  16169. cell.type = 'today';
  16170. }
  16171. if (i >= 0 && i <= 1) {
  16172. var numberOfDaysFromPreviousMonth = day + offset < 0 ? 7 + day + offset : day + offset;
  16173. if (j + i * 7 >= numberOfDaysFromPreviousMonth) {
  16174. cell.text = count++;
  16175. } else {
  16176. cell.text = dateCountOfLastMonth - (numberOfDaysFromPreviousMonth - j % 7) + 1 + i * 7;
  16177. cell.type = 'prev-month';
  16178. }
  16179. } else {
  16180. if (count <= dateCountOfMonth) {
  16181. cell.text = count++;
  16182. } else {
  16183. cell.text = count++ - dateCountOfMonth;
  16184. cell.type = 'next-month';
  16185. }
  16186. }
  16187. var cellDate = new Date(time);
  16188. cell.disabled = typeof disabledDate === 'function' && disabledDate(cellDate);
  16189. cell.selected = Object(util_["arrayFind"])(selectedDate, function (date) {
  16190. return date.getTime() === cellDate.getTime();
  16191. });
  16192. cell.customClass = typeof cellClassName === 'function' && cellClassName(cellDate);
  16193. _this.$set(row, _this.showWeekNumber ? j + 1 : j, cell);
  16194. };
  16195. for (var j = 0; j < 7; j++) {
  16196. _loop(j);
  16197. }
  16198. if (this.selectionMode === 'week') {
  16199. var start = this.showWeekNumber ? 1 : 0;
  16200. var end = this.showWeekNumber ? 7 : 6;
  16201. var isWeekActive = this.isWeekActive(row[start + 1]);
  16202. row[start].inRange = isWeekActive;
  16203. row[start].start = isWeekActive;
  16204. row[end].inRange = isWeekActive;
  16205. row[end].end = isWeekActive;
  16206. }
  16207. }
  16208. return rows;
  16209. }
  16210. },
  16211. watch: {
  16212. 'rangeState.endDate': function rangeStateEndDate(newVal) {
  16213. this.markRange(this.minDate, newVal);
  16214. },
  16215. minDate: function minDate(newVal, oldVal) {
  16216. if (date_tablevue_type_script_lang_js_getDateTimestamp(newVal) !== date_tablevue_type_script_lang_js_getDateTimestamp(oldVal)) {
  16217. this.markRange(this.minDate, this.maxDate);
  16218. }
  16219. },
  16220. maxDate: function maxDate(newVal, oldVal) {
  16221. if (date_tablevue_type_script_lang_js_getDateTimestamp(newVal) !== date_tablevue_type_script_lang_js_getDateTimestamp(oldVal)) {
  16222. this.markRange(this.minDate, this.maxDate);
  16223. }
  16224. }
  16225. },
  16226. data: function data() {
  16227. return {
  16228. tableRows: [[], [], [], [], [], []],
  16229. lastRow: null,
  16230. lastColumn: null
  16231. };
  16232. },
  16233. methods: {
  16234. cellMatchesDate: function cellMatchesDate(cell, date) {
  16235. var value = new Date(date);
  16236. return this.year === value.getFullYear() && this.month === value.getMonth() && Number(cell.text) === value.getDate();
  16237. },
  16238. getCellClasses: function getCellClasses(cell) {
  16239. var _this2 = this;
  16240. var selectionMode = this.selectionMode;
  16241. var defaultValue = this.defaultValue ? Array.isArray(this.defaultValue) ? this.defaultValue : [this.defaultValue] : [];
  16242. var classes = [];
  16243. if ((cell.type === 'normal' || cell.type === 'today') && !cell.disabled) {
  16244. classes.push('available');
  16245. if (cell.type === 'today') {
  16246. classes.push('today');
  16247. }
  16248. } else {
  16249. classes.push(cell.type);
  16250. }
  16251. if (cell.type === 'normal' && defaultValue.some(function (date) {
  16252. return _this2.cellMatchesDate(cell, date);
  16253. })) {
  16254. classes.push('default');
  16255. }
  16256. if (selectionMode === 'day' && (cell.type === 'normal' || cell.type === 'today') && this.cellMatchesDate(cell, this.value)) {
  16257. classes.push('current');
  16258. }
  16259. if (cell.inRange && (cell.type === 'normal' || cell.type === 'today' || this.selectionMode === 'week')) {
  16260. classes.push('in-range');
  16261. if (cell.start) {
  16262. classes.push('start-date');
  16263. }
  16264. if (cell.end) {
  16265. classes.push('end-date');
  16266. }
  16267. }
  16268. if (cell.disabled) {
  16269. classes.push('disabled');
  16270. }
  16271. if (cell.selected) {
  16272. classes.push('selected');
  16273. }
  16274. if (cell.customClass) {
  16275. classes.push(cell.customClass);
  16276. }
  16277. return classes.join(' ');
  16278. },
  16279. getDateOfCell: function getDateOfCell(row, column) {
  16280. var offsetFromStart = row * 7 + (column - (this.showWeekNumber ? 1 : 0)) - this.offsetDay;
  16281. return Object(date_util_["nextDate"])(this.startDate, offsetFromStart);
  16282. },
  16283. isWeekActive: function isWeekActive(cell) {
  16284. if (this.selectionMode !== 'week') return false;
  16285. var newDate = new Date(this.year, this.month, 1);
  16286. var year = newDate.getFullYear();
  16287. var month = newDate.getMonth();
  16288. if (cell.type === 'prev-month') {
  16289. newDate.setMonth(month === 0 ? 11 : month - 1);
  16290. newDate.setFullYear(month === 0 ? year - 1 : year);
  16291. }
  16292. if (cell.type === 'next-month') {
  16293. newDate.setMonth(month === 11 ? 0 : month + 1);
  16294. newDate.setFullYear(month === 11 ? year + 1 : year);
  16295. }
  16296. newDate.setDate(parseInt(cell.text, 10));
  16297. if (Object(date_util_["isDate"])(this.value)) {
  16298. var dayOffset = (this.value.getDay() - this.firstDayOfWeek + 7) % 7 - 1;
  16299. var weekDate = Object(date_util_["prevDate"])(this.value, dayOffset);
  16300. return weekDate.getTime() === newDate.getTime();
  16301. }
  16302. return false;
  16303. },
  16304. markRange: function markRange(minDate, maxDate) {
  16305. minDate = date_tablevue_type_script_lang_js_getDateTimestamp(minDate);
  16306. maxDate = date_tablevue_type_script_lang_js_getDateTimestamp(maxDate) || minDate;
  16307. var _ref = [Math.min(minDate, maxDate), Math.max(minDate, maxDate)];
  16308. minDate = _ref[0];
  16309. maxDate = _ref[1];
  16310. var startDate = this.startDate;
  16311. var rows = this.rows;
  16312. for (var i = 0, k = rows.length; i < k; i++) {
  16313. var row = rows[i];
  16314. for (var j = 0, l = row.length; j < l; j++) {
  16315. if (this.showWeekNumber && j === 0) continue;
  16316. var _cell = row[j];
  16317. var index = i * 7 + j + (this.showWeekNumber ? -1 : 0);
  16318. var time = Object(date_util_["nextDate"])(startDate, index - this.offsetDay).getTime();
  16319. _cell.inRange = minDate && time >= minDate && time <= maxDate;
  16320. _cell.start = minDate && time === minDate;
  16321. _cell.end = maxDate && time === maxDate;
  16322. }
  16323. }
  16324. },
  16325. handleMouseMove: function handleMouseMove(event) {
  16326. if (!this.rangeState.selecting) return;
  16327. var target = event.target;
  16328. if (target.tagName === 'SPAN') {
  16329. target = target.parentNode.parentNode;
  16330. }
  16331. if (target.tagName === 'DIV') {
  16332. target = target.parentNode;
  16333. }
  16334. if (target.tagName !== 'TD') return;
  16335. var row = target.parentNode.rowIndex - 1;
  16336. var column = target.cellIndex;
  16337. // can not select disabled date
  16338. if (this.rows[row][column].disabled) return;
  16339. // only update rangeState when mouse moves to a new cell
  16340. // this avoids frequent Date object creation and improves performance
  16341. if (row !== this.lastRow || column !== this.lastColumn) {
  16342. this.lastRow = row;
  16343. this.lastColumn = column;
  16344. this.$emit('changerange', {
  16345. minDate: this.minDate,
  16346. maxDate: this.maxDate,
  16347. rangeState: {
  16348. selecting: true,
  16349. endDate: this.getDateOfCell(row, column)
  16350. }
  16351. });
  16352. }
  16353. },
  16354. handleClick: function handleClick(event) {
  16355. var target = event.target;
  16356. if (target.tagName === 'SPAN') {
  16357. target = target.parentNode.parentNode;
  16358. }
  16359. if (target.tagName === 'DIV') {
  16360. target = target.parentNode;
  16361. }
  16362. if (target.tagName !== 'TD') return;
  16363. var row = target.parentNode.rowIndex - 1;
  16364. var column = this.selectionMode === 'week' ? 1 : target.cellIndex;
  16365. var cell = this.rows[row][column];
  16366. if (cell.disabled || cell.type === 'week') return;
  16367. var newDate = this.getDateOfCell(row, column);
  16368. if (this.selectionMode === 'range') {
  16369. if (!this.rangeState.selecting) {
  16370. this.$emit('pick', { minDate: newDate, maxDate: null });
  16371. this.rangeState.selecting = true;
  16372. } else {
  16373. if (newDate >= this.minDate) {
  16374. this.$emit('pick', { minDate: this.minDate, maxDate: newDate });
  16375. } else {
  16376. this.$emit('pick', { minDate: newDate, maxDate: this.minDate });
  16377. }
  16378. this.rangeState.selecting = false;
  16379. }
  16380. } else if (this.selectionMode === 'day') {
  16381. this.$emit('pick', newDate);
  16382. } else if (this.selectionMode === 'week') {
  16383. var weekNumber = Object(date_util_["getWeekNumber"])(newDate);
  16384. var value = newDate.getFullYear() + 'w' + weekNumber;
  16385. this.$emit('pick', {
  16386. year: newDate.getFullYear(),
  16387. week: weekNumber,
  16388. value: value,
  16389. date: newDate
  16390. });
  16391. } else if (this.selectionMode === 'dates') {
  16392. var _value = this.value || [];
  16393. var newValue = cell.selected ? date_tablevue_type_script_lang_js_removeFromArray(_value, function (date) {
  16394. return date.getTime() === newDate.getTime();
  16395. }) : [].concat(_value, [newDate]);
  16396. this.$emit('pick', newValue);
  16397. }
  16398. }
  16399. }
  16400. });
  16401. // CONCATENATED MODULE: ./packages/date-picker/src/basic/date-table.vue?vue&type=script&lang=js&
  16402. /* harmony default export */ var basic_date_tablevue_type_script_lang_js_ = (date_tablevue_type_script_lang_js_);
  16403. // CONCATENATED MODULE: ./packages/date-picker/src/basic/date-table.vue
  16404. /* normalize component */
  16405. var date_table_component = normalizeComponent(
  16406. basic_date_tablevue_type_script_lang_js_,
  16407. date_tablevue_type_template_id_5d1f3341_render,
  16408. date_tablevue_type_template_id_5d1f3341_staticRenderFns,
  16409. false,
  16410. null,
  16411. null,
  16412. null
  16413. )
  16414. /* hot reload */
  16415. if (false) { var date_table_api; }
  16416. date_table_component.options.__file = "packages/date-picker/src/basic/date-table.vue"
  16417. /* harmony default export */ var date_table = (date_table_component.exports);
  16418. // 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&
  16419. //
  16420. //
  16421. //
  16422. //
  16423. //
  16424. //
  16425. //
  16426. //
  16427. //
  16428. //
  16429. //
  16430. //
  16431. //
  16432. //
  16433. //
  16434. //
  16435. //
  16436. //
  16437. //
  16438. //
  16439. //
  16440. //
  16441. //
  16442. //
  16443. //
  16444. //
  16445. //
  16446. //
  16447. //
  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. /* harmony default export */ var datevue_type_script_lang_js_ = ({
  16566. mixins: [locale_default.a],
  16567. directives: { Clickoutside: clickoutside_default.a },
  16568. watch: {
  16569. showTime: function showTime(val) {
  16570. var _this = this;
  16571. /* istanbul ignore if */
  16572. if (!val) return;
  16573. this.$nextTick(function (_) {
  16574. var inputElm = _this.$refs.input.$el;
  16575. if (inputElm) {
  16576. _this.pickerWidth = inputElm.getBoundingClientRect().width + 10;
  16577. }
  16578. });
  16579. },
  16580. value: function value(val) {
  16581. if (this.selectionMode === 'dates' && this.value) return;
  16582. if (this.selectionMode === 'months' && this.value) return;
  16583. if (this.selectionMode === 'years' && this.value) return;
  16584. if (Object(date_util_["isDate"])(val)) {
  16585. this.date = new Date(val);
  16586. } else {
  16587. this.date = this.getDefaultValue();
  16588. }
  16589. },
  16590. defaultValue: function defaultValue(val) {
  16591. if (!Object(date_util_["isDate"])(this.value)) {
  16592. this.date = val ? new Date(val) : new Date();
  16593. }
  16594. },
  16595. timePickerVisible: function timePickerVisible(val) {
  16596. var _this2 = this;
  16597. if (val) this.$nextTick(function () {
  16598. return _this2.$refs.timepicker.adjustSpinners();
  16599. });
  16600. },
  16601. selectionMode: function selectionMode(newVal) {
  16602. if (newVal === 'month') {
  16603. /* istanbul ignore next */
  16604. if (this.currentView !== 'year' || this.currentView !== 'month') {
  16605. this.currentView = 'month';
  16606. }
  16607. } else if (newVal === 'dates') {
  16608. this.currentView = 'date';
  16609. } else if (newVal === 'years') {
  16610. this.currentView = 'year';
  16611. } else if (newVal === 'months') {
  16612. this.currentView = 'month';
  16613. }
  16614. }
  16615. },
  16616. methods: {
  16617. proxyTimePickerDataProperties: function proxyTimePickerDataProperties() {
  16618. var _this3 = this;
  16619. var format = function format(timeFormat) {
  16620. _this3.$refs.timepicker.format = timeFormat;
  16621. };
  16622. var value = function value(_value) {
  16623. _this3.$refs.timepicker.value = _value;
  16624. };
  16625. var date = function date(_date) {
  16626. _this3.$refs.timepicker.date = _date;
  16627. };
  16628. var selectableRange = function selectableRange(_selectableRange) {
  16629. _this3.$refs.timepicker.selectableRange = _selectableRange;
  16630. };
  16631. this.$watch('value', value);
  16632. this.$watch('date', date);
  16633. this.$watch('selectableRange', selectableRange);
  16634. format(this.timeFormat);
  16635. value(this.value);
  16636. date(this.date);
  16637. selectableRange(this.selectableRange);
  16638. },
  16639. handleClear: function handleClear() {
  16640. this.date = this.getDefaultValue();
  16641. this.$emit('pick', null);
  16642. },
  16643. emit: function emit(value) {
  16644. var _this4 = this;
  16645. for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  16646. args[_key - 1] = arguments[_key];
  16647. }
  16648. if (!value) {
  16649. this.$emit.apply(this, ['pick', value].concat(args));
  16650. } else if (Array.isArray(value)) {
  16651. var dates = value.map(function (date) {
  16652. return _this4.showTime ? Object(date_util_["clearMilliseconds"])(date) : Object(date_util_["clearTime"])(date);
  16653. });
  16654. this.$emit.apply(this, ['pick', dates].concat(args));
  16655. } else {
  16656. this.$emit.apply(this, ['pick', this.showTime ? Object(date_util_["clearMilliseconds"])(value) : Object(date_util_["clearTime"])(value)].concat(args));
  16657. }
  16658. this.userInputDate = null;
  16659. this.userInputTime = null;
  16660. },
  16661. // resetDate() {
  16662. // this.date = new Date(this.date);
  16663. // },
  16664. showMonthPicker: function showMonthPicker() {
  16665. this.currentView = 'month';
  16666. },
  16667. showYearPicker: function showYearPicker() {
  16668. this.currentView = 'year';
  16669. },
  16670. // XXX: 没用到
  16671. // handleLabelClick() {
  16672. // if (this.currentView === 'date') {
  16673. // this.showMonthPicker();
  16674. // } else if (this.currentView === 'month') {
  16675. // this.showYearPicker();
  16676. // }
  16677. // },
  16678. prevMonth: function prevMonth() {
  16679. this.date = Object(date_util_["prevMonth"])(this.date);
  16680. },
  16681. nextMonth: function nextMonth() {
  16682. this.date = Object(date_util_["nextMonth"])(this.date);
  16683. },
  16684. prevYear: function prevYear() {
  16685. if (this.currentView === 'year') {
  16686. this.date = Object(date_util_["prevYear"])(this.date, 10);
  16687. } else {
  16688. this.date = Object(date_util_["prevYear"])(this.date);
  16689. }
  16690. },
  16691. nextYear: function nextYear() {
  16692. if (this.currentView === 'year') {
  16693. this.date = Object(date_util_["nextYear"])(this.date, 10);
  16694. } else {
  16695. this.date = Object(date_util_["nextYear"])(this.date);
  16696. }
  16697. },
  16698. handleShortcutClick: function handleShortcutClick(shortcut) {
  16699. if (shortcut.onClick) {
  16700. shortcut.onClick(this);
  16701. }
  16702. },
  16703. handleTimePick: function handleTimePick(value, visible, first) {
  16704. if (Object(date_util_["isDate"])(value)) {
  16705. var newDate = this.value ? Object(date_util_["modifyTime"])(this.value, value.getHours(), value.getMinutes(), value.getSeconds()) : Object(date_util_["modifyWithTimeString"])(this.getDefaultValue(), this.defaultTime);
  16706. this.date = newDate;
  16707. this.emit(this.date, true);
  16708. } else {
  16709. this.emit(value, true);
  16710. }
  16711. if (!first) {
  16712. this.timePickerVisible = visible;
  16713. }
  16714. },
  16715. handleTimePickClose: function handleTimePickClose() {
  16716. this.timePickerVisible = false;
  16717. },
  16718. handleMonthPick: function handleMonthPick(month) {
  16719. if (this.selectionMode === 'month') {
  16720. this.date = Object(date_util_["modifyDate"])(this.date, this.year, month, 1);
  16721. this.emit(this.date);
  16722. } else if (this.selectionMode === 'months') {
  16723. this.emit(month, true);
  16724. } else {
  16725. this.date = Object(date_util_["changeYearMonthAndClampDate"])(this.date, this.year, month);
  16726. // TODO: should emit intermediate value ??
  16727. // this.emit(this.date);
  16728. this.currentView = 'date';
  16729. }
  16730. },
  16731. handleDatePick: function handleDatePick(value) {
  16732. if (this.selectionMode === 'day') {
  16733. var newDate = this.value ? Object(date_util_["modifyDate"])(this.value, value.getFullYear(), value.getMonth(), value.getDate()) : Object(date_util_["modifyWithTimeString"])(value, this.defaultTime);
  16734. // change default time while out of selectableRange
  16735. if (!this.checkDateWithinRange(newDate)) {
  16736. newDate = Object(date_util_["modifyDate"])(this.selectableRange[0][0], value.getFullYear(), value.getMonth(), value.getDate());
  16737. }
  16738. this.date = newDate;
  16739. this.emit(this.date, this.showTime);
  16740. } else if (this.selectionMode === 'week') {
  16741. this.emit(value.date);
  16742. } else if (this.selectionMode === 'dates') {
  16743. this.emit(value, true); // set false to keep panel open
  16744. }
  16745. },
  16746. handleYearPick: function handleYearPick(year) {
  16747. if (this.selectionMode === 'year') {
  16748. this.date = Object(date_util_["modifyDate"])(this.date, year, 0, 1);
  16749. this.emit(this.date);
  16750. } else if (this.selectionMode === 'years') {
  16751. this.emit(year, true);
  16752. } else {
  16753. this.date = Object(date_util_["changeYearMonthAndClampDate"])(this.date, year, this.month);
  16754. // TODO: should emit intermediate value ??
  16755. // this.emit(this.date, true);
  16756. this.currentView = 'month';
  16757. }
  16758. },
  16759. changeToNow: function changeToNow() {
  16760. // NOTE: not a permanent solution
  16761. // consider disable "now" button in the future
  16762. if ((!this.disabledDate || !this.disabledDate(new Date())) && this.checkDateWithinRange(new Date())) {
  16763. this.date = new Date();
  16764. this.emit(this.date);
  16765. }
  16766. },
  16767. confirm: function confirm() {
  16768. if (this.selectionMode === 'dates' || this.selectionMode === 'months' || this.selectionMode === 'years') {
  16769. this.emit(this.value);
  16770. } else {
  16771. // value were emitted in handle{Date,Time}Pick, nothing to update here
  16772. // deal with the scenario where: user opens the picker, then confirm without doing anything
  16773. var value = this.value ? this.value : Object(date_util_["modifyWithTimeString"])(this.getDefaultValue(), this.defaultTime);
  16774. this.date = new Date(value); // refresh date
  16775. this.emit(value);
  16776. }
  16777. },
  16778. resetView: function resetView() {
  16779. if (this.selectionMode === 'month' || this.selectionMode === 'months') {
  16780. this.currentView = 'month';
  16781. } else if (this.selectionMode === 'year' || this.selectionMode === 'years') {
  16782. this.currentView = 'year';
  16783. } else {
  16784. this.currentView = 'date';
  16785. }
  16786. },
  16787. handleEnter: function handleEnter() {
  16788. document.body.addEventListener('keydown', this.handleKeydown);
  16789. },
  16790. handleLeave: function handleLeave() {
  16791. this.$emit('dodestroy');
  16792. document.body.removeEventListener('keydown', this.handleKeydown);
  16793. },
  16794. handleKeydown: function handleKeydown(event) {
  16795. var keyCode = event.keyCode;
  16796. var list = [38, 40, 37, 39];
  16797. if (this.visible && !this.timePickerVisible) {
  16798. if (list.indexOf(keyCode) !== -1) {
  16799. this.handleKeyControl(keyCode);
  16800. event.stopPropagation();
  16801. event.preventDefault();
  16802. }
  16803. if (keyCode === 13 && this.userInputDate === null && this.userInputTime === null) {
  16804. // Enter
  16805. this.emit(this.date, false);
  16806. }
  16807. }
  16808. },
  16809. handleKeyControl: function handleKeyControl(keyCode) {
  16810. var mapping = {
  16811. 'year': {
  16812. 38: -4, 40: 4, 37: -1, 39: 1, offset: function offset(date, step) {
  16813. return date.setFullYear(date.getFullYear() + step);
  16814. }
  16815. },
  16816. 'month': {
  16817. 38: -4, 40: 4, 37: -1, 39: 1, offset: function offset(date, step) {
  16818. return date.setMonth(date.getMonth() + step);
  16819. }
  16820. },
  16821. 'week': {
  16822. 38: -1, 40: 1, 37: -1, 39: 1, offset: function offset(date, step) {
  16823. return date.setDate(date.getDate() + step * 7);
  16824. }
  16825. },
  16826. 'day': {
  16827. 38: -7, 40: 7, 37: -1, 39: 1, offset: function offset(date, step) {
  16828. return date.setDate(date.getDate() + step);
  16829. }
  16830. }
  16831. };
  16832. var mode = this.selectionMode;
  16833. var year = 3.1536e10;
  16834. var now = this.date.getTime();
  16835. var newDate = new Date(this.date.getTime());
  16836. while (Math.abs(now - newDate.getTime()) <= year) {
  16837. var map = mapping[mode];
  16838. map.offset(newDate, map[keyCode]);
  16839. if (typeof this.disabledDate === 'function' && this.disabledDate(newDate)) {
  16840. continue;
  16841. }
  16842. this.date = newDate;
  16843. this.$emit('pick', newDate, true);
  16844. break;
  16845. }
  16846. },
  16847. handleVisibleTimeChange: function handleVisibleTimeChange(value) {
  16848. var time = Object(date_util_["parseDate"])(value, this.timeFormat);
  16849. if (time && this.checkDateWithinRange(time)) {
  16850. this.date = Object(date_util_["modifyDate"])(time, this.year, this.month, this.monthDate);
  16851. this.userInputTime = null;
  16852. this.$refs.timepicker.value = this.date;
  16853. this.timePickerVisible = false;
  16854. this.emit(this.date, true);
  16855. }
  16856. },
  16857. handleVisibleDateChange: function handleVisibleDateChange(value) {
  16858. var date = Object(date_util_["parseDate"])(value, this.dateFormat);
  16859. if (date) {
  16860. if (typeof this.disabledDate === 'function' && this.disabledDate(date)) {
  16861. return;
  16862. }
  16863. this.date = Object(date_util_["modifyTime"])(date, this.date.getHours(), this.date.getMinutes(), this.date.getSeconds());
  16864. this.userInputDate = null;
  16865. this.resetView();
  16866. this.emit(this.date, true);
  16867. }
  16868. },
  16869. isValidValue: function isValidValue(value) {
  16870. return value && !isNaN(value) && (typeof this.disabledDate === 'function' ? !this.disabledDate(value) : true) && this.checkDateWithinRange(value);
  16871. },
  16872. getDefaultValue: function getDefaultValue() {
  16873. // if default-value is set, return it
  16874. // otherwise, return now (the moment this method gets called)
  16875. return this.defaultValue ? new Date(this.defaultValue) : new Date();
  16876. },
  16877. checkDateWithinRange: function checkDateWithinRange(date) {
  16878. return this.selectableRange.length > 0 ? Object(date_util_["timeWithinRange"])(date, this.selectableRange, this.format || 'HH:mm:ss') : true;
  16879. }
  16880. },
  16881. components: {
  16882. TimePicker: panel_time, YearTable: year_table, MonthTable: month_table, DateTable: date_table, ElInput: input_default.a, ElButton: button_default.a
  16883. },
  16884. data: function data() {
  16885. return {
  16886. popperClass: '',
  16887. date: new Date(),
  16888. value: '',
  16889. defaultValue: null, // use getDefaultValue() for time computation
  16890. defaultTime: null,
  16891. showTime: false,
  16892. selectionMode: 'day',
  16893. shortcuts: '',
  16894. visible: false,
  16895. currentView: 'date',
  16896. disabledDate: '',
  16897. cellClassName: '',
  16898. selectableRange: [],
  16899. firstDayOfWeek: 7,
  16900. showWeekNumber: false,
  16901. timePickerVisible: false,
  16902. format: '',
  16903. arrowControl: false,
  16904. userInputDate: null,
  16905. userInputTime: null
  16906. };
  16907. },
  16908. computed: {
  16909. year: function year() {
  16910. return this.date.getFullYear();
  16911. },
  16912. month: function month() {
  16913. return this.date.getMonth();
  16914. },
  16915. week: function week() {
  16916. return Object(date_util_["getWeekNumber"])(this.date);
  16917. },
  16918. monthDate: function monthDate() {
  16919. return this.date.getDate();
  16920. },
  16921. footerVisible: function footerVisible() {
  16922. return this.showTime || this.selectionMode === 'dates' || this.selectionMode === 'months' || this.selectionMode === 'years';
  16923. },
  16924. visibleTime: function visibleTime() {
  16925. if (this.userInputTime !== null) {
  16926. return this.userInputTime;
  16927. } else {
  16928. return Object(date_util_["formatDate"])(this.value || this.defaultValue, this.timeFormat);
  16929. }
  16930. },
  16931. visibleDate: function visibleDate() {
  16932. if (this.userInputDate !== null) {
  16933. return this.userInputDate;
  16934. } else {
  16935. return Object(date_util_["formatDate"])(this.value || this.defaultValue, this.dateFormat);
  16936. }
  16937. },
  16938. yearLabel: function yearLabel() {
  16939. var yearTranslation = this.t('el.datepicker.year');
  16940. if (this.currentView === 'year') {
  16941. var startYear = Math.floor(this.year / 10) * 10;
  16942. if (yearTranslation) {
  16943. return startYear + ' ' + yearTranslation + ' - ' + (startYear + 9) + ' ' + yearTranslation;
  16944. }
  16945. return startYear + ' - ' + (startYear + 9);
  16946. }
  16947. return this.year + ' ' + yearTranslation;
  16948. },
  16949. timeFormat: function timeFormat() {
  16950. if (this.format) {
  16951. return Object(date_util_["extractTimeFormat"])(this.format);
  16952. } else {
  16953. return 'HH:mm:ss';
  16954. }
  16955. },
  16956. dateFormat: function dateFormat() {
  16957. if (this.format) {
  16958. return Object(date_util_["extractDateFormat"])(this.format);
  16959. } else {
  16960. return 'yyyy-MM-dd';
  16961. }
  16962. }
  16963. }
  16964. });
  16965. // CONCATENATED MODULE: ./packages/date-picker/src/panel/date.vue?vue&type=script&lang=js&
  16966. /* harmony default export */ var panel_datevue_type_script_lang_js_ = (datevue_type_script_lang_js_);
  16967. // CONCATENATED MODULE: ./packages/date-picker/src/panel/date.vue
  16968. /* normalize component */
  16969. var date_component = normalizeComponent(
  16970. panel_datevue_type_script_lang_js_,
  16971. datevue_type_template_id_2440d4ea_render,
  16972. datevue_type_template_id_2440d4ea_staticRenderFns,
  16973. false,
  16974. null,
  16975. null,
  16976. null
  16977. )
  16978. /* hot reload */
  16979. if (false) { var date_api; }
  16980. date_component.options.__file = "packages/date-picker/src/panel/date.vue"
  16981. /* harmony default export */ var panel_date = (date_component.exports);
  16982. // 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&
  16983. var date_rangevue_type_template_id_2652849a_render = function() {
  16984. var _vm = this
  16985. var _h = _vm.$createElement
  16986. var _c = _vm._self._c || _h
  16987. return _c(
  16988. "transition",
  16989. {
  16990. attrs: { name: "el-zoom-in-top" },
  16991. on: {
  16992. "after-leave": function($event) {
  16993. _vm.$emit("dodestroy")
  16994. }
  16995. }
  16996. },
  16997. [
  16998. _c(
  16999. "div",
  17000. {
  17001. directives: [
  17002. {
  17003. name: "show",
  17004. rawName: "v-show",
  17005. value: _vm.visible,
  17006. expression: "visible"
  17007. }
  17008. ],
  17009. staticClass: "el-picker-panel el-date-range-picker el-popper",
  17010. class: [
  17011. {
  17012. "has-sidebar": _vm.$slots.sidebar || _vm.shortcuts,
  17013. "has-time": _vm.showTime
  17014. },
  17015. _vm.popperClass
  17016. ]
  17017. },
  17018. [
  17019. _c(
  17020. "div",
  17021. { staticClass: "el-picker-panel__body-wrapper" },
  17022. [
  17023. _vm._t("sidebar"),
  17024. _vm.shortcuts
  17025. ? _c(
  17026. "div",
  17027. { staticClass: "el-picker-panel__sidebar" },
  17028. _vm._l(_vm.shortcuts, function(shortcut, key) {
  17029. return _c(
  17030. "button",
  17031. {
  17032. key: key,
  17033. staticClass: "el-picker-panel__shortcut",
  17034. attrs: { type: "button" },
  17035. on: {
  17036. click: function($event) {
  17037. _vm.handleShortcutClick(shortcut)
  17038. }
  17039. }
  17040. },
  17041. [_vm._v(_vm._s(shortcut.text))]
  17042. )
  17043. }),
  17044. 0
  17045. )
  17046. : _vm._e(),
  17047. _c("div", { staticClass: "el-picker-panel__body" }, [
  17048. _vm.showTime
  17049. ? _c(
  17050. "div",
  17051. { staticClass: "el-date-range-picker__time-header" },
  17052. [
  17053. _c(
  17054. "span",
  17055. { staticClass: "el-date-range-picker__editors-wrap" },
  17056. [
  17057. _c(
  17058. "span",
  17059. {
  17060. staticClass:
  17061. "el-date-range-picker__time-picker-wrap"
  17062. },
  17063. [
  17064. _c("el-input", {
  17065. ref: "minInput",
  17066. staticClass: "el-date-range-picker__editor",
  17067. attrs: {
  17068. size: "small",
  17069. disabled: _vm.rangeState.selecting,
  17070. placeholder: _vm.t(
  17071. "el.datepicker.startDate"
  17072. ),
  17073. value: _vm.minVisibleDate
  17074. },
  17075. on: {
  17076. input: function(val) {
  17077. return _vm.handleDateInput(val, "min")
  17078. },
  17079. change: function(val) {
  17080. return _vm.handleDateChange(val, "min")
  17081. }
  17082. }
  17083. })
  17084. ],
  17085. 1
  17086. ),
  17087. _c(
  17088. "span",
  17089. {
  17090. directives: [
  17091. {
  17092. name: "clickoutside",
  17093. rawName: "v-clickoutside",
  17094. value: _vm.handleMinTimeClose,
  17095. expression: "handleMinTimeClose"
  17096. }
  17097. ],
  17098. staticClass:
  17099. "el-date-range-picker__time-picker-wrap"
  17100. },
  17101. [
  17102. _c("el-input", {
  17103. staticClass: "el-date-range-picker__editor",
  17104. attrs: {
  17105. size: "small",
  17106. disabled: _vm.rangeState.selecting,
  17107. placeholder: _vm.t(
  17108. "el.datepicker.startTime"
  17109. ),
  17110. value: _vm.minVisibleTime
  17111. },
  17112. on: {
  17113. focus: function($event) {
  17114. _vm.minTimePickerVisible = true
  17115. },
  17116. input: function(val) {
  17117. return _vm.handleTimeInput(val, "min")
  17118. },
  17119. change: function(val) {
  17120. return _vm.handleTimeChange(val, "min")
  17121. }
  17122. }
  17123. }),
  17124. _c("time-picker", {
  17125. ref: "minTimePicker",
  17126. attrs: {
  17127. "time-arrow-control": _vm.arrowControl,
  17128. visible: _vm.minTimePickerVisible
  17129. },
  17130. on: {
  17131. pick: _vm.handleMinTimePick,
  17132. mounted: function($event) {
  17133. _vm.$refs.minTimePicker.format =
  17134. _vm.timeFormat
  17135. }
  17136. }
  17137. })
  17138. ],
  17139. 1
  17140. )
  17141. ]
  17142. ),
  17143. _c("span", { staticClass: "el-icon-arrow-right" }),
  17144. _c(
  17145. "span",
  17146. {
  17147. staticClass:
  17148. "el-date-range-picker__editors-wrap is-right"
  17149. },
  17150. [
  17151. _c(
  17152. "span",
  17153. {
  17154. staticClass:
  17155. "el-date-range-picker__time-picker-wrap"
  17156. },
  17157. [
  17158. _c("el-input", {
  17159. staticClass: "el-date-range-picker__editor",
  17160. attrs: {
  17161. size: "small",
  17162. disabled: _vm.rangeState.selecting,
  17163. placeholder: _vm.t("el.datepicker.endDate"),
  17164. value: _vm.maxVisibleDate,
  17165. readonly: !_vm.minDate
  17166. },
  17167. on: {
  17168. input: function(val) {
  17169. return _vm.handleDateInput(val, "max")
  17170. },
  17171. change: function(val) {
  17172. return _vm.handleDateChange(val, "max")
  17173. }
  17174. }
  17175. })
  17176. ],
  17177. 1
  17178. ),
  17179. _c(
  17180. "span",
  17181. {
  17182. directives: [
  17183. {
  17184. name: "clickoutside",
  17185. rawName: "v-clickoutside",
  17186. value: _vm.handleMaxTimeClose,
  17187. expression: "handleMaxTimeClose"
  17188. }
  17189. ],
  17190. staticClass:
  17191. "el-date-range-picker__time-picker-wrap"
  17192. },
  17193. [
  17194. _c("el-input", {
  17195. staticClass: "el-date-range-picker__editor",
  17196. attrs: {
  17197. size: "small",
  17198. disabled: _vm.rangeState.selecting,
  17199. placeholder: _vm.t("el.datepicker.endTime"),
  17200. value: _vm.maxVisibleTime,
  17201. readonly: !_vm.minDate
  17202. },
  17203. on: {
  17204. focus: function($event) {
  17205. _vm.minDate &&
  17206. (_vm.maxTimePickerVisible = true)
  17207. },
  17208. input: function(val) {
  17209. return _vm.handleTimeInput(val, "max")
  17210. },
  17211. change: function(val) {
  17212. return _vm.handleTimeChange(val, "max")
  17213. }
  17214. }
  17215. }),
  17216. _c("time-picker", {
  17217. ref: "maxTimePicker",
  17218. attrs: {
  17219. "time-arrow-control": _vm.arrowControl,
  17220. visible: _vm.maxTimePickerVisible
  17221. },
  17222. on: {
  17223. pick: _vm.handleMaxTimePick,
  17224. mounted: function($event) {
  17225. _vm.$refs.maxTimePicker.format =
  17226. _vm.timeFormat
  17227. }
  17228. }
  17229. })
  17230. ],
  17231. 1
  17232. )
  17233. ]
  17234. )
  17235. ]
  17236. )
  17237. : _vm._e(),
  17238. _c(
  17239. "div",
  17240. {
  17241. staticClass:
  17242. "el-picker-panel__content el-date-range-picker__content is-left"
  17243. },
  17244. [
  17245. _c("div", { staticClass: "el-date-range-picker__header" }, [
  17246. _c("button", {
  17247. staticClass:
  17248. "el-picker-panel__icon-btn el-icon-d-arrow-left",
  17249. attrs: { type: "button" },
  17250. on: { click: _vm.leftPrevYear }
  17251. }),
  17252. _c("button", {
  17253. staticClass:
  17254. "el-picker-panel__icon-btn el-icon-arrow-left",
  17255. attrs: { type: "button" },
  17256. on: { click: _vm.leftPrevMonth }
  17257. }),
  17258. _vm.unlinkPanels
  17259. ? _c("button", {
  17260. staticClass:
  17261. "el-picker-panel__icon-btn el-icon-d-arrow-right",
  17262. class: { "is-disabled": !_vm.enableYearArrow },
  17263. attrs: {
  17264. type: "button",
  17265. disabled: !_vm.enableYearArrow
  17266. },
  17267. on: { click: _vm.leftNextYear }
  17268. })
  17269. : _vm._e(),
  17270. _vm.unlinkPanels
  17271. ? _c("button", {
  17272. staticClass:
  17273. "el-picker-panel__icon-btn el-icon-arrow-right",
  17274. class: { "is-disabled": !_vm.enableMonthArrow },
  17275. attrs: {
  17276. type: "button",
  17277. disabled: !_vm.enableMonthArrow
  17278. },
  17279. on: { click: _vm.leftNextMonth }
  17280. })
  17281. : _vm._e(),
  17282. _c("div", [_vm._v(_vm._s(_vm.leftLabel))])
  17283. ]),
  17284. _c("date-table", {
  17285. attrs: {
  17286. "selection-mode": "range",
  17287. date: _vm.leftDate,
  17288. "default-value": _vm.defaultValue,
  17289. "min-date": _vm.minDate,
  17290. "max-date": _vm.maxDate,
  17291. "range-state": _vm.rangeState,
  17292. "disabled-date": _vm.disabledDate,
  17293. "cell-class-name": _vm.cellClassName,
  17294. "first-day-of-week": _vm.firstDayOfWeek
  17295. },
  17296. on: {
  17297. changerange: _vm.handleChangeRange,
  17298. pick: _vm.handleRangePick
  17299. }
  17300. })
  17301. ],
  17302. 1
  17303. ),
  17304. _c(
  17305. "div",
  17306. {
  17307. staticClass:
  17308. "el-picker-panel__content el-date-range-picker__content is-right"
  17309. },
  17310. [
  17311. _c("div", { staticClass: "el-date-range-picker__header" }, [
  17312. _vm.unlinkPanels
  17313. ? _c("button", {
  17314. staticClass:
  17315. "el-picker-panel__icon-btn el-icon-d-arrow-left",
  17316. class: { "is-disabled": !_vm.enableYearArrow },
  17317. attrs: {
  17318. type: "button",
  17319. disabled: !_vm.enableYearArrow
  17320. },
  17321. on: { click: _vm.rightPrevYear }
  17322. })
  17323. : _vm._e(),
  17324. _vm.unlinkPanels
  17325. ? _c("button", {
  17326. staticClass:
  17327. "el-picker-panel__icon-btn el-icon-arrow-left",
  17328. class: { "is-disabled": !_vm.enableMonthArrow },
  17329. attrs: {
  17330. type: "button",
  17331. disabled: !_vm.enableMonthArrow
  17332. },
  17333. on: { click: _vm.rightPrevMonth }
  17334. })
  17335. : _vm._e(),
  17336. _c("button", {
  17337. staticClass:
  17338. "el-picker-panel__icon-btn el-icon-d-arrow-right",
  17339. attrs: { type: "button" },
  17340. on: { click: _vm.rightNextYear }
  17341. }),
  17342. _c("button", {
  17343. staticClass:
  17344. "el-picker-panel__icon-btn el-icon-arrow-right",
  17345. attrs: { type: "button" },
  17346. on: { click: _vm.rightNextMonth }
  17347. }),
  17348. _c("div", [_vm._v(_vm._s(_vm.rightLabel))])
  17349. ]),
  17350. _c("date-table", {
  17351. attrs: {
  17352. "selection-mode": "range",
  17353. date: _vm.rightDate,
  17354. "default-value": _vm.defaultValue,
  17355. "min-date": _vm.minDate,
  17356. "max-date": _vm.maxDate,
  17357. "range-state": _vm.rangeState,
  17358. "disabled-date": _vm.disabledDate,
  17359. "cell-class-name": _vm.cellClassName,
  17360. "first-day-of-week": _vm.firstDayOfWeek
  17361. },
  17362. on: {
  17363. changerange: _vm.handleChangeRange,
  17364. pick: _vm.handleRangePick
  17365. }
  17366. })
  17367. ],
  17368. 1
  17369. )
  17370. ])
  17371. ],
  17372. 2
  17373. ),
  17374. _vm.showTime
  17375. ? _c(
  17376. "div",
  17377. { staticClass: "el-picker-panel__footer" },
  17378. [
  17379. _c(
  17380. "el-button",
  17381. {
  17382. staticClass: "el-picker-panel__link-btn",
  17383. attrs: { size: "mini", type: "text" },
  17384. on: { click: _vm.handleClear }
  17385. },
  17386. [
  17387. _vm._v(
  17388. "\n " +
  17389. _vm._s(_vm.t("el.datepicker.clear")) +
  17390. "\n "
  17391. )
  17392. ]
  17393. ),
  17394. _c(
  17395. "el-button",
  17396. {
  17397. staticClass: "el-picker-panel__link-btn",
  17398. attrs: {
  17399. plain: "",
  17400. size: "mini",
  17401. disabled: _vm.btnDisabled
  17402. },
  17403. on: {
  17404. click: function($event) {
  17405. _vm.handleConfirm(false)
  17406. }
  17407. }
  17408. },
  17409. [
  17410. _vm._v(
  17411. "\n " +
  17412. _vm._s(_vm.t("el.datepicker.confirm")) +
  17413. "\n "
  17414. )
  17415. ]
  17416. )
  17417. ],
  17418. 1
  17419. )
  17420. : _vm._e()
  17421. ]
  17422. )
  17423. ]
  17424. )
  17425. }
  17426. var date_rangevue_type_template_id_2652849a_staticRenderFns = []
  17427. date_rangevue_type_template_id_2652849a_render._withStripped = true
  17428. // CONCATENATED MODULE: ./packages/date-picker/src/panel/date-range.vue?vue&type=template&id=2652849a&
  17429. // 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&
  17430. //
  17431. //
  17432. //
  17433. //
  17434. //
  17435. //
  17436. //
  17437. //
  17438. //
  17439. //
  17440. //
  17441. //
  17442. //
  17443. //
  17444. //
  17445. //
  17446. //
  17447. //
  17448. //
  17449. //
  17450. //
  17451. //
  17452. //
  17453. //
  17454. //
  17455. //
  17456. //
  17457. //
  17458. //
  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. var date_rangevue_type_script_lang_js_calcDefaultValue = function calcDefaultValue(defaultValue) {
  17620. if (Array.isArray(defaultValue)) {
  17621. return [new Date(defaultValue[0]), new Date(defaultValue[1])];
  17622. } else if (defaultValue) {
  17623. return [new Date(defaultValue), Object(date_util_["nextDate"])(new Date(defaultValue), 1)];
  17624. } else {
  17625. return [new Date(), Object(date_util_["nextDate"])(new Date(), 1)];
  17626. }
  17627. };
  17628. /* harmony default export */ var date_rangevue_type_script_lang_js_ = ({
  17629. mixins: [locale_default.a],
  17630. directives: { Clickoutside: clickoutside_default.a },
  17631. computed: {
  17632. btnDisabled: function btnDisabled() {
  17633. return !(this.minDate && this.maxDate && !this.selecting && this.isValidValue([this.minDate, this.maxDate]));
  17634. },
  17635. leftLabel: function leftLabel() {
  17636. return this.leftDate.getFullYear() + ' ' + this.t('el.datepicker.year') + ' ' + this.t('el.datepicker.month' + (this.leftDate.getMonth() + 1));
  17637. },
  17638. rightLabel: function rightLabel() {
  17639. return this.rightDate.getFullYear() + ' ' + this.t('el.datepicker.year') + ' ' + this.t('el.datepicker.month' + (this.rightDate.getMonth() + 1));
  17640. },
  17641. leftYear: function leftYear() {
  17642. return this.leftDate.getFullYear();
  17643. },
  17644. leftMonth: function leftMonth() {
  17645. return this.leftDate.getMonth();
  17646. },
  17647. leftMonthDate: function leftMonthDate() {
  17648. return this.leftDate.getDate();
  17649. },
  17650. rightYear: function rightYear() {
  17651. return this.rightDate.getFullYear();
  17652. },
  17653. rightMonth: function rightMonth() {
  17654. return this.rightDate.getMonth();
  17655. },
  17656. rightMonthDate: function rightMonthDate() {
  17657. return this.rightDate.getDate();
  17658. },
  17659. minVisibleDate: function minVisibleDate() {
  17660. if (this.dateUserInput.min !== null) return this.dateUserInput.min;
  17661. if (this.minDate) return Object(date_util_["formatDate"])(this.minDate, this.dateFormat);
  17662. return '';
  17663. },
  17664. maxVisibleDate: function maxVisibleDate() {
  17665. if (this.dateUserInput.max !== null) return this.dateUserInput.max;
  17666. if (this.maxDate || this.minDate) return Object(date_util_["formatDate"])(this.maxDate || this.minDate, this.dateFormat);
  17667. return '';
  17668. },
  17669. minVisibleTime: function minVisibleTime() {
  17670. if (this.timeUserInput.min !== null) return this.timeUserInput.min;
  17671. if (this.minDate) return Object(date_util_["formatDate"])(this.minDate, this.timeFormat);
  17672. return '';
  17673. },
  17674. maxVisibleTime: function maxVisibleTime() {
  17675. if (this.timeUserInput.max !== null) return this.timeUserInput.max;
  17676. if (this.maxDate || this.minDate) return Object(date_util_["formatDate"])(this.maxDate || this.minDate, this.timeFormat);
  17677. return '';
  17678. },
  17679. timeFormat: function timeFormat() {
  17680. if (this.format) {
  17681. return Object(date_util_["extractTimeFormat"])(this.format);
  17682. } else {
  17683. return 'HH:mm:ss';
  17684. }
  17685. },
  17686. dateFormat: function dateFormat() {
  17687. if (this.format) {
  17688. return Object(date_util_["extractDateFormat"])(this.format);
  17689. } else {
  17690. return 'yyyy-MM-dd';
  17691. }
  17692. },
  17693. enableMonthArrow: function enableMonthArrow() {
  17694. var nextMonth = (this.leftMonth + 1) % 12;
  17695. var yearOffset = this.leftMonth + 1 >= 12 ? 1 : 0;
  17696. return this.unlinkPanels && new Date(this.leftYear + yearOffset, nextMonth) < new Date(this.rightYear, this.rightMonth);
  17697. },
  17698. enableYearArrow: function enableYearArrow() {
  17699. return this.unlinkPanels && this.rightYear * 12 + this.rightMonth - (this.leftYear * 12 + this.leftMonth + 1) >= 12;
  17700. }
  17701. },
  17702. data: function data() {
  17703. return {
  17704. popperClass: '',
  17705. value: [],
  17706. defaultValue: null,
  17707. defaultTime: null,
  17708. minDate: '',
  17709. maxDate: '',
  17710. leftDate: new Date(),
  17711. rightDate: Object(date_util_["nextMonth"])(new Date()),
  17712. rangeState: {
  17713. endDate: null,
  17714. selecting: false,
  17715. row: null,
  17716. column: null
  17717. },
  17718. showTime: false,
  17719. shortcuts: '',
  17720. visible: '',
  17721. disabledDate: '',
  17722. cellClassName: '',
  17723. firstDayOfWeek: 7,
  17724. minTimePickerVisible: false,
  17725. maxTimePickerVisible: false,
  17726. format: '',
  17727. arrowControl: false,
  17728. unlinkPanels: false,
  17729. dateUserInput: {
  17730. min: null,
  17731. max: null
  17732. },
  17733. timeUserInput: {
  17734. min: null,
  17735. max: null
  17736. }
  17737. };
  17738. },
  17739. watch: {
  17740. minDate: function minDate(val) {
  17741. var _this = this;
  17742. this.dateUserInput.min = null;
  17743. this.timeUserInput.min = null;
  17744. this.$nextTick(function () {
  17745. if (_this.$refs.maxTimePicker && _this.maxDate && _this.maxDate < _this.minDate) {
  17746. var format = 'HH:mm:ss';
  17747. _this.$refs.maxTimePicker.selectableRange = [[Object(date_util_["parseDate"])(Object(date_util_["formatDate"])(_this.minDate, format), format), Object(date_util_["parseDate"])('23:59:59', format)]];
  17748. }
  17749. });
  17750. if (val && this.$refs.minTimePicker) {
  17751. this.$refs.minTimePicker.date = val;
  17752. this.$refs.minTimePicker.value = val;
  17753. }
  17754. },
  17755. maxDate: function maxDate(val) {
  17756. this.dateUserInput.max = null;
  17757. this.timeUserInput.max = null;
  17758. if (val && this.$refs.maxTimePicker) {
  17759. this.$refs.maxTimePicker.date = val;
  17760. this.$refs.maxTimePicker.value = val;
  17761. }
  17762. },
  17763. minTimePickerVisible: function minTimePickerVisible(val) {
  17764. var _this2 = this;
  17765. if (val) {
  17766. this.$nextTick(function () {
  17767. _this2.$refs.minTimePicker.date = _this2.minDate;
  17768. _this2.$refs.minTimePicker.value = _this2.minDate;
  17769. _this2.$refs.minTimePicker.adjustSpinners();
  17770. });
  17771. }
  17772. },
  17773. maxTimePickerVisible: function maxTimePickerVisible(val) {
  17774. var _this3 = this;
  17775. if (val) {
  17776. this.$nextTick(function () {
  17777. _this3.$refs.maxTimePicker.date = _this3.maxDate;
  17778. _this3.$refs.maxTimePicker.value = _this3.maxDate;
  17779. _this3.$refs.maxTimePicker.adjustSpinners();
  17780. });
  17781. }
  17782. },
  17783. value: function value(newVal) {
  17784. if (!newVal) {
  17785. this.minDate = null;
  17786. this.maxDate = null;
  17787. } else if (Array.isArray(newVal)) {
  17788. this.minDate = Object(date_util_["isDate"])(newVal[0]) ? new Date(newVal[0]) : null;
  17789. this.maxDate = Object(date_util_["isDate"])(newVal[1]) ? new Date(newVal[1]) : null;
  17790. if (this.minDate) {
  17791. this.leftDate = this.minDate;
  17792. if (this.unlinkPanels && this.maxDate) {
  17793. var minDateYear = this.minDate.getFullYear();
  17794. var minDateMonth = this.minDate.getMonth();
  17795. var maxDateYear = this.maxDate.getFullYear();
  17796. var maxDateMonth = this.maxDate.getMonth();
  17797. this.rightDate = minDateYear === maxDateYear && minDateMonth === maxDateMonth ? Object(date_util_["nextMonth"])(this.maxDate) : this.maxDate;
  17798. } else {
  17799. this.rightDate = Object(date_util_["nextMonth"])(this.leftDate);
  17800. }
  17801. } else {
  17802. this.leftDate = date_rangevue_type_script_lang_js_calcDefaultValue(this.defaultValue)[0];
  17803. this.rightDate = Object(date_util_["nextMonth"])(this.leftDate);
  17804. }
  17805. }
  17806. },
  17807. defaultValue: function defaultValue(val) {
  17808. if (!Array.isArray(this.value)) {
  17809. var _calcDefaultValue = date_rangevue_type_script_lang_js_calcDefaultValue(val),
  17810. left = _calcDefaultValue[0],
  17811. right = _calcDefaultValue[1];
  17812. this.leftDate = left;
  17813. this.rightDate = val && val[1] && this.unlinkPanels ? right : Object(date_util_["nextMonth"])(this.leftDate);
  17814. }
  17815. }
  17816. },
  17817. methods: {
  17818. handleClear: function handleClear() {
  17819. this.minDate = null;
  17820. this.maxDate = null;
  17821. this.leftDate = date_rangevue_type_script_lang_js_calcDefaultValue(this.defaultValue)[0];
  17822. this.rightDate = Object(date_util_["nextMonth"])(this.leftDate);
  17823. this.$emit('pick', null);
  17824. },
  17825. handleChangeRange: function handleChangeRange(val) {
  17826. this.minDate = val.minDate;
  17827. this.maxDate = val.maxDate;
  17828. this.rangeState = val.rangeState;
  17829. },
  17830. handleDateInput: function handleDateInput(value, type) {
  17831. this.dateUserInput[type] = value;
  17832. if (value.length !== this.dateFormat.length) return;
  17833. var parsedValue = Object(date_util_["parseDate"])(value, this.dateFormat);
  17834. if (parsedValue) {
  17835. if (typeof this.disabledDate === 'function' && this.disabledDate(new Date(parsedValue))) {
  17836. return;
  17837. }
  17838. if (type === 'min') {
  17839. this.minDate = Object(date_util_["modifyDate"])(this.minDate || new Date(), parsedValue.getFullYear(), parsedValue.getMonth(), parsedValue.getDate());
  17840. this.leftDate = new Date(parsedValue);
  17841. if (!this.unlinkPanels) {
  17842. this.rightDate = Object(date_util_["nextMonth"])(this.leftDate);
  17843. }
  17844. } else {
  17845. this.maxDate = Object(date_util_["modifyDate"])(this.maxDate || new Date(), parsedValue.getFullYear(), parsedValue.getMonth(), parsedValue.getDate());
  17846. this.rightDate = new Date(parsedValue);
  17847. if (!this.unlinkPanels) {
  17848. this.leftDate = Object(date_util_["prevMonth"])(parsedValue);
  17849. }
  17850. }
  17851. }
  17852. },
  17853. handleDateChange: function handleDateChange(value, type) {
  17854. var parsedValue = Object(date_util_["parseDate"])(value, this.dateFormat);
  17855. if (parsedValue) {
  17856. if (type === 'min') {
  17857. this.minDate = Object(date_util_["modifyDate"])(this.minDate, parsedValue.getFullYear(), parsedValue.getMonth(), parsedValue.getDate());
  17858. if (this.minDate > this.maxDate) {
  17859. this.maxDate = this.minDate;
  17860. }
  17861. } else {
  17862. this.maxDate = Object(date_util_["modifyDate"])(this.maxDate, parsedValue.getFullYear(), parsedValue.getMonth(), parsedValue.getDate());
  17863. if (this.maxDate < this.minDate) {
  17864. this.minDate = this.maxDate;
  17865. }
  17866. }
  17867. }
  17868. },
  17869. handleTimeInput: function handleTimeInput(value, type) {
  17870. var _this4 = this;
  17871. this.timeUserInput[type] = value;
  17872. if (value.length !== this.timeFormat.length) return;
  17873. var parsedValue = Object(date_util_["parseDate"])(value, this.timeFormat);
  17874. if (parsedValue) {
  17875. if (type === 'min') {
  17876. this.minDate = Object(date_util_["modifyTime"])(this.minDate, parsedValue.getHours(), parsedValue.getMinutes(), parsedValue.getSeconds());
  17877. this.$nextTick(function (_) {
  17878. return _this4.$refs.minTimePicker.adjustSpinners();
  17879. });
  17880. } else {
  17881. this.maxDate = Object(date_util_["modifyTime"])(this.maxDate, parsedValue.getHours(), parsedValue.getMinutes(), parsedValue.getSeconds());
  17882. this.$nextTick(function (_) {
  17883. return _this4.$refs.maxTimePicker.adjustSpinners();
  17884. });
  17885. }
  17886. }
  17887. },
  17888. handleTimeChange: function handleTimeChange(value, type) {
  17889. var parsedValue = Object(date_util_["parseDate"])(value, this.timeFormat);
  17890. if (parsedValue) {
  17891. if (type === 'min') {
  17892. this.minDate = Object(date_util_["modifyTime"])(this.minDate, parsedValue.getHours(), parsedValue.getMinutes(), parsedValue.getSeconds());
  17893. if (this.minDate > this.maxDate) {
  17894. this.maxDate = this.minDate;
  17895. }
  17896. this.$refs.minTimePicker.value = this.minDate;
  17897. this.minTimePickerVisible = false;
  17898. } else {
  17899. this.maxDate = Object(date_util_["modifyTime"])(this.maxDate, parsedValue.getHours(), parsedValue.getMinutes(), parsedValue.getSeconds());
  17900. if (this.maxDate < this.minDate) {
  17901. this.minDate = this.maxDate;
  17902. }
  17903. this.$refs.maxTimePicker.value = this.minDate;
  17904. this.maxTimePickerVisible = false;
  17905. }
  17906. }
  17907. },
  17908. handleRangePick: function handleRangePick(val) {
  17909. var _this5 = this;
  17910. var close = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  17911. var defaultTime = this.defaultTime || [];
  17912. var minDate = Object(date_util_["modifyWithTimeString"])(val.minDate, defaultTime[0]);
  17913. var maxDate = Object(date_util_["modifyWithTimeString"])(val.maxDate, defaultTime[1]);
  17914. if (this.maxDate === maxDate && this.minDate === minDate) {
  17915. return;
  17916. }
  17917. this.onPick && this.onPick(val);
  17918. this.maxDate = maxDate;
  17919. this.minDate = minDate;
  17920. // workaround for https://github.com/ElemeFE/element/issues/7539, should remove this block when we don't have to care about Chromium 55 - 57
  17921. setTimeout(function () {
  17922. _this5.maxDate = maxDate;
  17923. _this5.minDate = minDate;
  17924. }, 10);
  17925. if (!close || this.showTime) return;
  17926. this.handleConfirm();
  17927. },
  17928. handleShortcutClick: function handleShortcutClick(shortcut) {
  17929. if (shortcut.onClick) {
  17930. shortcut.onClick(this);
  17931. }
  17932. },
  17933. handleMinTimePick: function handleMinTimePick(value, visible, first) {
  17934. this.minDate = this.minDate || new Date();
  17935. if (value) {
  17936. this.minDate = Object(date_util_["modifyTime"])(this.minDate, value.getHours(), value.getMinutes(), value.getSeconds());
  17937. }
  17938. if (!first) {
  17939. this.minTimePickerVisible = visible;
  17940. }
  17941. if (!this.maxDate || this.maxDate && this.maxDate.getTime() < this.minDate.getTime()) {
  17942. this.maxDate = new Date(this.minDate);
  17943. }
  17944. },
  17945. handleMinTimeClose: function handleMinTimeClose() {
  17946. this.minTimePickerVisible = false;
  17947. },
  17948. handleMaxTimePick: function handleMaxTimePick(value, visible, first) {
  17949. if (this.maxDate && value) {
  17950. this.maxDate = Object(date_util_["modifyTime"])(this.maxDate, value.getHours(), value.getMinutes(), value.getSeconds());
  17951. }
  17952. if (!first) {
  17953. this.maxTimePickerVisible = visible;
  17954. }
  17955. if (this.maxDate && this.minDate && this.minDate.getTime() > this.maxDate.getTime()) {
  17956. this.minDate = new Date(this.maxDate);
  17957. }
  17958. },
  17959. handleMaxTimeClose: function handleMaxTimeClose() {
  17960. this.maxTimePickerVisible = false;
  17961. },
  17962. // leftPrev*, rightNext* need to take care of `unlinkPanels`
  17963. leftPrevYear: function leftPrevYear() {
  17964. this.leftDate = Object(date_util_["prevYear"])(this.leftDate);
  17965. if (!this.unlinkPanels) {
  17966. this.rightDate = Object(date_util_["nextMonth"])(this.leftDate);
  17967. }
  17968. },
  17969. leftPrevMonth: function leftPrevMonth() {
  17970. this.leftDate = Object(date_util_["prevMonth"])(this.leftDate);
  17971. if (!this.unlinkPanels) {
  17972. this.rightDate = Object(date_util_["nextMonth"])(this.leftDate);
  17973. }
  17974. },
  17975. rightNextYear: function rightNextYear() {
  17976. if (!this.unlinkPanels) {
  17977. this.leftDate = Object(date_util_["nextYear"])(this.leftDate);
  17978. this.rightDate = Object(date_util_["nextMonth"])(this.leftDate);
  17979. } else {
  17980. this.rightDate = Object(date_util_["nextYear"])(this.rightDate);
  17981. }
  17982. },
  17983. rightNextMonth: function rightNextMonth() {
  17984. if (!this.unlinkPanels) {
  17985. this.leftDate = Object(date_util_["nextMonth"])(this.leftDate);
  17986. this.rightDate = Object(date_util_["nextMonth"])(this.leftDate);
  17987. } else {
  17988. this.rightDate = Object(date_util_["nextMonth"])(this.rightDate);
  17989. }
  17990. },
  17991. // leftNext*, rightPrev* are called when `unlinkPanels` is true
  17992. leftNextYear: function leftNextYear() {
  17993. this.leftDate = Object(date_util_["nextYear"])(this.leftDate);
  17994. },
  17995. leftNextMonth: function leftNextMonth() {
  17996. this.leftDate = Object(date_util_["nextMonth"])(this.leftDate);
  17997. },
  17998. rightPrevYear: function rightPrevYear() {
  17999. this.rightDate = Object(date_util_["prevYear"])(this.rightDate);
  18000. },
  18001. rightPrevMonth: function rightPrevMonth() {
  18002. this.rightDate = Object(date_util_["prevMonth"])(this.rightDate);
  18003. },
  18004. handleConfirm: function handleConfirm() {
  18005. var visible = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  18006. if (this.isValidValue([this.minDate, this.maxDate])) {
  18007. this.$emit('pick', [this.minDate, this.maxDate], visible);
  18008. }
  18009. },
  18010. isValidValue: function isValidValue(value) {
  18011. 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);
  18012. },
  18013. resetView: function resetView() {
  18014. // NOTE: this is a hack to reset {min, max}Date on picker open.
  18015. // TODO: correct way of doing so is to refactor {min, max}Date to be dependent on value and internal selection state
  18016. // an alternative would be resetView whenever picker becomes visible, should also investigate date-panel's resetView
  18017. if (this.minDate && this.maxDate == null) this.rangeState.selecting = false;
  18018. this.minDate = this.value && Object(date_util_["isDate"])(this.value[0]) ? new Date(this.value[0]) : null;
  18019. this.maxDate = this.value && Object(date_util_["isDate"])(this.value[0]) ? new Date(this.value[1]) : null;
  18020. }
  18021. },
  18022. components: { TimePicker: panel_time, DateTable: date_table, ElInput: input_default.a, ElButton: button_default.a }
  18023. });
  18024. // CONCATENATED MODULE: ./packages/date-picker/src/panel/date-range.vue?vue&type=script&lang=js&
  18025. /* harmony default export */ var panel_date_rangevue_type_script_lang_js_ = (date_rangevue_type_script_lang_js_);
  18026. // CONCATENATED MODULE: ./packages/date-picker/src/panel/date-range.vue
  18027. /* normalize component */
  18028. var date_range_component = normalizeComponent(
  18029. panel_date_rangevue_type_script_lang_js_,
  18030. date_rangevue_type_template_id_2652849a_render,
  18031. date_rangevue_type_template_id_2652849a_staticRenderFns,
  18032. false,
  18033. null,
  18034. null,
  18035. null
  18036. )
  18037. /* hot reload */
  18038. if (false) { var date_range_api; }
  18039. date_range_component.options.__file = "packages/date-picker/src/panel/date-range.vue"
  18040. /* harmony default export */ var date_range = (date_range_component.exports);
  18041. // 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&
  18042. var month_rangevue_type_template_id_f2645fb8_render = function() {
  18043. var _vm = this
  18044. var _h = _vm.$createElement
  18045. var _c = _vm._self._c || _h
  18046. return _c(
  18047. "transition",
  18048. {
  18049. attrs: { name: "el-zoom-in-top" },
  18050. on: {
  18051. "after-leave": function($event) {
  18052. _vm.$emit("dodestroy")
  18053. }
  18054. }
  18055. },
  18056. [
  18057. _c(
  18058. "div",
  18059. {
  18060. directives: [
  18061. {
  18062. name: "show",
  18063. rawName: "v-show",
  18064. value: _vm.visible,
  18065. expression: "visible"
  18066. }
  18067. ],
  18068. staticClass: "el-picker-panel el-date-range-picker el-popper",
  18069. class: [
  18070. {
  18071. "has-sidebar": _vm.$slots.sidebar || _vm.shortcuts
  18072. },
  18073. _vm.popperClass
  18074. ]
  18075. },
  18076. [
  18077. _c(
  18078. "div",
  18079. { staticClass: "el-picker-panel__body-wrapper" },
  18080. [
  18081. _vm._t("sidebar"),
  18082. _vm.shortcuts
  18083. ? _c(
  18084. "div",
  18085. { staticClass: "el-picker-panel__sidebar" },
  18086. _vm._l(_vm.shortcuts, function(shortcut, key) {
  18087. return _c(
  18088. "button",
  18089. {
  18090. key: key,
  18091. staticClass: "el-picker-panel__shortcut",
  18092. attrs: { type: "button" },
  18093. on: {
  18094. click: function($event) {
  18095. _vm.handleShortcutClick(shortcut)
  18096. }
  18097. }
  18098. },
  18099. [_vm._v(_vm._s(shortcut.text))]
  18100. )
  18101. }),
  18102. 0
  18103. )
  18104. : _vm._e(),
  18105. _c("div", { staticClass: "el-picker-panel__body" }, [
  18106. _c(
  18107. "div",
  18108. {
  18109. staticClass:
  18110. "el-picker-panel__content el-date-range-picker__content is-left"
  18111. },
  18112. [
  18113. _c("div", { staticClass: "el-date-range-picker__header" }, [
  18114. _c("button", {
  18115. staticClass:
  18116. "el-picker-panel__icon-btn el-icon-d-arrow-left",
  18117. attrs: { type: "button" },
  18118. on: { click: _vm.leftPrevYear }
  18119. }),
  18120. _vm.unlinkPanels
  18121. ? _c("button", {
  18122. staticClass:
  18123. "el-picker-panel__icon-btn el-icon-d-arrow-right",
  18124. class: { "is-disabled": !_vm.enableYearArrow },
  18125. attrs: {
  18126. type: "button",
  18127. disabled: !_vm.enableYearArrow
  18128. },
  18129. on: { click: _vm.leftNextYear }
  18130. })
  18131. : _vm._e(),
  18132. _c("div", [_vm._v(_vm._s(_vm.leftLabel))])
  18133. ]),
  18134. _c("month-table", {
  18135. attrs: {
  18136. "selection-mode": "range",
  18137. date: _vm.leftDate,
  18138. "default-value": _vm.defaultValue,
  18139. "min-date": _vm.minDate,
  18140. "max-date": _vm.maxDate,
  18141. "range-state": _vm.rangeState,
  18142. "disabled-date": _vm.disabledDate
  18143. },
  18144. on: {
  18145. changerange: _vm.handleChangeRange,
  18146. pick: _vm.handleRangePick
  18147. }
  18148. })
  18149. ],
  18150. 1
  18151. ),
  18152. _c(
  18153. "div",
  18154. {
  18155. staticClass:
  18156. "el-picker-panel__content el-date-range-picker__content is-right"
  18157. },
  18158. [
  18159. _c("div", { staticClass: "el-date-range-picker__header" }, [
  18160. _vm.unlinkPanels
  18161. ? _c("button", {
  18162. staticClass:
  18163. "el-picker-panel__icon-btn el-icon-d-arrow-left",
  18164. class: { "is-disabled": !_vm.enableYearArrow },
  18165. attrs: {
  18166. type: "button",
  18167. disabled: !_vm.enableYearArrow
  18168. },
  18169. on: { click: _vm.rightPrevYear }
  18170. })
  18171. : _vm._e(),
  18172. _c("button", {
  18173. staticClass:
  18174. "el-picker-panel__icon-btn el-icon-d-arrow-right",
  18175. attrs: { type: "button" },
  18176. on: { click: _vm.rightNextYear }
  18177. }),
  18178. _c("div", [_vm._v(_vm._s(_vm.rightLabel))])
  18179. ]),
  18180. _c("month-table", {
  18181. attrs: {
  18182. "selection-mode": "range",
  18183. date: _vm.rightDate,
  18184. "default-value": _vm.defaultValue,
  18185. "min-date": _vm.minDate,
  18186. "max-date": _vm.maxDate,
  18187. "range-state": _vm.rangeState,
  18188. "disabled-date": _vm.disabledDate
  18189. },
  18190. on: {
  18191. changerange: _vm.handleChangeRange,
  18192. pick: _vm.handleRangePick
  18193. }
  18194. })
  18195. ],
  18196. 1
  18197. )
  18198. ])
  18199. ],
  18200. 2
  18201. )
  18202. ]
  18203. )
  18204. ]
  18205. )
  18206. }
  18207. var month_rangevue_type_template_id_f2645fb8_staticRenderFns = []
  18208. month_rangevue_type_template_id_f2645fb8_render._withStripped = true
  18209. // CONCATENATED MODULE: ./packages/date-picker/src/panel/month-range.vue?vue&type=template&id=f2645fb8&
  18210. // 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&
  18211. //
  18212. //
  18213. //
  18214. //
  18215. //
  18216. //
  18217. //
  18218. //
  18219. //
  18220. //
  18221. //
  18222. //
  18223. //
  18224. //
  18225. //
  18226. //
  18227. //
  18228. //
  18229. //
  18230. //
  18231. //
  18232. //
  18233. //
  18234. //
  18235. //
  18236. //
  18237. //
  18238. //
  18239. //
  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. var month_rangevue_type_script_lang_js_calcDefaultValue = function calcDefaultValue(defaultValue) {
  18291. if (Array.isArray(defaultValue)) {
  18292. return [new Date(defaultValue[0]), new Date(defaultValue[1])];
  18293. } else if (defaultValue) {
  18294. return [new Date(defaultValue), Object(date_util_["nextMonth"])(new Date(defaultValue))];
  18295. } else {
  18296. return [new Date(), Object(date_util_["nextMonth"])(new Date())];
  18297. }
  18298. };
  18299. /* harmony default export */ var month_rangevue_type_script_lang_js_ = ({
  18300. mixins: [locale_default.a],
  18301. directives: { Clickoutside: clickoutside_default.a },
  18302. computed: {
  18303. btnDisabled: function btnDisabled() {
  18304. return !(this.minDate && this.maxDate && !this.selecting && this.isValidValue([this.minDate, this.maxDate]));
  18305. },
  18306. leftLabel: function leftLabel() {
  18307. return this.leftDate.getFullYear() + ' ' + this.t('el.datepicker.year');
  18308. },
  18309. rightLabel: function rightLabel() {
  18310. return this.rightDate.getFullYear() + ' ' + this.t('el.datepicker.year');
  18311. },
  18312. leftYear: function leftYear() {
  18313. return this.leftDate.getFullYear();
  18314. },
  18315. rightYear: function rightYear() {
  18316. return this.rightDate.getFullYear() === this.leftDate.getFullYear() ? this.leftDate.getFullYear() + 1 : this.rightDate.getFullYear();
  18317. },
  18318. enableYearArrow: function enableYearArrow() {
  18319. return this.unlinkPanels && this.rightYear > this.leftYear + 1;
  18320. }
  18321. },
  18322. data: function data() {
  18323. return {
  18324. popperClass: '',
  18325. value: [],
  18326. defaultValue: null,
  18327. defaultTime: null,
  18328. minDate: '',
  18329. maxDate: '',
  18330. leftDate: new Date(),
  18331. rightDate: Object(date_util_["nextYear"])(new Date()),
  18332. rangeState: {
  18333. endDate: null,
  18334. selecting: false,
  18335. row: null,
  18336. column: null
  18337. },
  18338. shortcuts: '',
  18339. visible: '',
  18340. disabledDate: '',
  18341. format: '',
  18342. arrowControl: false,
  18343. unlinkPanels: false
  18344. };
  18345. },
  18346. watch: {
  18347. value: function value(newVal) {
  18348. if (!newVal) {
  18349. this.minDate = null;
  18350. this.maxDate = null;
  18351. } else if (Array.isArray(newVal)) {
  18352. this.minDate = Object(date_util_["isDate"])(newVal[0]) ? new Date(newVal[0]) : null;
  18353. this.maxDate = Object(date_util_["isDate"])(newVal[1]) ? new Date(newVal[1]) : null;
  18354. if (this.minDate) {
  18355. this.leftDate = this.minDate;
  18356. if (this.unlinkPanels && this.maxDate) {
  18357. var minDateYear = this.minDate.getFullYear();
  18358. var maxDateYear = this.maxDate.getFullYear();
  18359. this.rightDate = minDateYear === maxDateYear ? Object(date_util_["nextYear"])(this.maxDate) : this.maxDate;
  18360. } else {
  18361. this.rightDate = Object(date_util_["nextYear"])(this.leftDate);
  18362. }
  18363. } else {
  18364. this.leftDate = month_rangevue_type_script_lang_js_calcDefaultValue(this.defaultValue)[0];
  18365. this.rightDate = Object(date_util_["nextYear"])(this.leftDate);
  18366. }
  18367. }
  18368. },
  18369. defaultValue: function defaultValue(val) {
  18370. if (!Array.isArray(this.value)) {
  18371. var _calcDefaultValue = month_rangevue_type_script_lang_js_calcDefaultValue(val),
  18372. left = _calcDefaultValue[0],
  18373. right = _calcDefaultValue[1];
  18374. this.leftDate = left;
  18375. this.rightDate = val && val[1] && left.getFullYear() !== right.getFullYear() && this.unlinkPanels ? right : Object(date_util_["nextYear"])(this.leftDate);
  18376. }
  18377. }
  18378. },
  18379. methods: {
  18380. handleClear: function handleClear() {
  18381. this.minDate = null;
  18382. this.maxDate = null;
  18383. this.leftDate = month_rangevue_type_script_lang_js_calcDefaultValue(this.defaultValue)[0];
  18384. this.rightDate = Object(date_util_["nextYear"])(this.leftDate);
  18385. this.$emit('pick', null);
  18386. },
  18387. handleChangeRange: function handleChangeRange(val) {
  18388. this.minDate = val.minDate;
  18389. this.maxDate = val.maxDate;
  18390. this.rangeState = val.rangeState;
  18391. },
  18392. handleRangePick: function handleRangePick(val) {
  18393. var _this = this;
  18394. var close = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  18395. var defaultTime = this.defaultTime || [];
  18396. var minDate = Object(date_util_["modifyWithTimeString"])(val.minDate, defaultTime[0]);
  18397. var maxDate = Object(date_util_["modifyWithTimeString"])(val.maxDate, defaultTime[1]);
  18398. if (this.maxDate === maxDate && this.minDate === minDate) {
  18399. return;
  18400. }
  18401. this.onPick && this.onPick(val);
  18402. this.maxDate = maxDate;
  18403. this.minDate = minDate;
  18404. // workaround for https://github.com/ElemeFE/element/issues/7539, should remove this block when we don't have to care about Chromium 55 - 57
  18405. setTimeout(function () {
  18406. _this.maxDate = maxDate;
  18407. _this.minDate = minDate;
  18408. }, 10);
  18409. if (!close) return;
  18410. this.handleConfirm();
  18411. },
  18412. handleShortcutClick: function handleShortcutClick(shortcut) {
  18413. if (shortcut.onClick) {
  18414. shortcut.onClick(this);
  18415. }
  18416. },
  18417. // leftPrev*, rightNext* need to take care of `unlinkPanels`
  18418. leftPrevYear: function leftPrevYear() {
  18419. this.leftDate = Object(date_util_["prevYear"])(this.leftDate);
  18420. if (!this.unlinkPanels) {
  18421. this.rightDate = Object(date_util_["prevYear"])(this.rightDate);
  18422. }
  18423. },
  18424. rightNextYear: function rightNextYear() {
  18425. if (!this.unlinkPanels) {
  18426. this.leftDate = Object(date_util_["nextYear"])(this.leftDate);
  18427. }
  18428. this.rightDate = Object(date_util_["nextYear"])(this.rightDate);
  18429. },
  18430. // leftNext*, rightPrev* are called when `unlinkPanels` is true
  18431. leftNextYear: function leftNextYear() {
  18432. this.leftDate = Object(date_util_["nextYear"])(this.leftDate);
  18433. },
  18434. rightPrevYear: function rightPrevYear() {
  18435. this.rightDate = Object(date_util_["prevYear"])(this.rightDate);
  18436. },
  18437. handleConfirm: function handleConfirm() {
  18438. var visible = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  18439. if (this.isValidValue([this.minDate, this.maxDate])) {
  18440. this.$emit('pick', [this.minDate, this.maxDate], visible);
  18441. }
  18442. },
  18443. isValidValue: function isValidValue(value) {
  18444. 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);
  18445. },
  18446. resetView: function resetView() {
  18447. // NOTE: this is a hack to reset {min, max}Date on picker open.
  18448. // TODO: correct way of doing so is to refactor {min, max}Date to be dependent on value and internal selection state
  18449. // an alternative would be resetView whenever picker becomes visible, should also investigate date-panel's resetView
  18450. this.minDate = this.value && Object(date_util_["isDate"])(this.value[0]) ? new Date(this.value[0]) : null;
  18451. this.maxDate = this.value && Object(date_util_["isDate"])(this.value[0]) ? new Date(this.value[1]) : null;
  18452. }
  18453. },
  18454. components: { MonthTable: month_table, ElInput: input_default.a, ElButton: button_default.a }
  18455. });
  18456. // CONCATENATED MODULE: ./packages/date-picker/src/panel/month-range.vue?vue&type=script&lang=js&
  18457. /* harmony default export */ var panel_month_rangevue_type_script_lang_js_ = (month_rangevue_type_script_lang_js_);
  18458. // CONCATENATED MODULE: ./packages/date-picker/src/panel/month-range.vue
  18459. /* normalize component */
  18460. var month_range_component = normalizeComponent(
  18461. panel_month_rangevue_type_script_lang_js_,
  18462. month_rangevue_type_template_id_f2645fb8_render,
  18463. month_rangevue_type_template_id_f2645fb8_staticRenderFns,
  18464. false,
  18465. null,
  18466. null,
  18467. null
  18468. )
  18469. /* hot reload */
  18470. if (false) { var month_range_api; }
  18471. month_range_component.options.__file = "packages/date-picker/src/panel/month-range.vue"
  18472. /* harmony default export */ var month_range = (month_range_component.exports);
  18473. // CONCATENATED MODULE: ./packages/date-picker/src/picker/date-picker.js
  18474. var date_picker_getPanel = function getPanel(type) {
  18475. if (type === 'daterange' || type === 'datetimerange') {
  18476. return date_range;
  18477. } else if (type === 'monthrange') {
  18478. return month_range;
  18479. }
  18480. return panel_date;
  18481. };
  18482. /* harmony default export */ var date_picker = ({
  18483. mixins: [picker],
  18484. name: 'ElDatePicker',
  18485. props: {
  18486. type: {
  18487. type: String,
  18488. default: 'date'
  18489. },
  18490. timeArrowControl: Boolean
  18491. },
  18492. watch: {
  18493. type: function type(_type) {
  18494. if (this.picker) {
  18495. this.unmountPicker();
  18496. this.panel = date_picker_getPanel(_type);
  18497. this.mountPicker();
  18498. } else {
  18499. this.panel = date_picker_getPanel(_type);
  18500. }
  18501. }
  18502. },
  18503. created: function created() {
  18504. this.panel = date_picker_getPanel(this.type);
  18505. }
  18506. });
  18507. // CONCATENATED MODULE: ./packages/date-picker/index.js
  18508. /* istanbul ignore next */
  18509. date_picker.install = function install(Vue) {
  18510. Vue.component(date_picker.name, date_picker);
  18511. };
  18512. /* harmony default export */ var packages_date_picker = (date_picker);
  18513. // 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&
  18514. var time_selectvue_type_template_id_51ab9320_render = function() {
  18515. var _vm = this
  18516. var _h = _vm.$createElement
  18517. var _c = _vm._self._c || _h
  18518. return _c(
  18519. "transition",
  18520. {
  18521. attrs: { name: "el-zoom-in-top" },
  18522. on: {
  18523. "before-enter": _vm.handleMenuEnter,
  18524. "after-leave": function($event) {
  18525. _vm.$emit("dodestroy")
  18526. }
  18527. }
  18528. },
  18529. [
  18530. _c(
  18531. "div",
  18532. {
  18533. directives: [
  18534. {
  18535. name: "show",
  18536. rawName: "v-show",
  18537. value: _vm.visible,
  18538. expression: "visible"
  18539. }
  18540. ],
  18541. ref: "popper",
  18542. staticClass: "el-picker-panel time-select el-popper",
  18543. class: _vm.popperClass,
  18544. style: { width: _vm.width + "px" }
  18545. },
  18546. [
  18547. _c(
  18548. "el-scrollbar",
  18549. {
  18550. attrs: { noresize: "", "wrap-class": "el-picker-panel__content" }
  18551. },
  18552. _vm._l(_vm.items, function(item) {
  18553. return _c(
  18554. "div",
  18555. {
  18556. key: item.value,
  18557. staticClass: "time-select-item",
  18558. class: {
  18559. selected: _vm.value === item.value,
  18560. disabled: item.disabled,
  18561. default: item.value === _vm.defaultValue
  18562. },
  18563. attrs: { disabled: item.disabled },
  18564. on: {
  18565. click: function($event) {
  18566. _vm.handleClick(item)
  18567. }
  18568. }
  18569. },
  18570. [_vm._v(_vm._s(item.value))]
  18571. )
  18572. }),
  18573. 0
  18574. )
  18575. ],
  18576. 1
  18577. )
  18578. ]
  18579. )
  18580. }
  18581. var time_selectvue_type_template_id_51ab9320_staticRenderFns = []
  18582. time_selectvue_type_template_id_51ab9320_render._withStripped = true
  18583. // CONCATENATED MODULE: ./packages/date-picker/src/panel/time-select.vue?vue&type=template&id=51ab9320&
  18584. // 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&
  18585. //
  18586. //
  18587. //
  18588. //
  18589. //
  18590. //
  18591. //
  18592. //
  18593. //
  18594. //
  18595. //
  18596. //
  18597. //
  18598. //
  18599. //
  18600. //
  18601. //
  18602. //
  18603. //
  18604. //
  18605. var parseTime = function parseTime(time) {
  18606. var values = (time || '').split(':');
  18607. if (values.length >= 2) {
  18608. var hours = parseInt(values[0], 10);
  18609. var minutes = parseInt(values[1], 10);
  18610. return {
  18611. hours: hours,
  18612. minutes: minutes
  18613. };
  18614. }
  18615. /* istanbul ignore next */
  18616. return null;
  18617. };
  18618. var compareTime = function compareTime(time1, time2) {
  18619. var value1 = parseTime(time1);
  18620. var value2 = parseTime(time2);
  18621. var minutes1 = value1.minutes + value1.hours * 60;
  18622. var minutes2 = value2.minutes + value2.hours * 60;
  18623. if (minutes1 === minutes2) {
  18624. return 0;
  18625. }
  18626. return minutes1 > minutes2 ? 1 : -1;
  18627. };
  18628. var formatTime = function formatTime(time) {
  18629. return (time.hours < 10 ? '0' + time.hours : time.hours) + ':' + (time.minutes < 10 ? '0' + time.minutes : time.minutes);
  18630. };
  18631. var nextTime = function nextTime(time, step) {
  18632. var timeValue = parseTime(time);
  18633. var stepValue = parseTime(step);
  18634. var next = {
  18635. hours: timeValue.hours,
  18636. minutes: timeValue.minutes
  18637. };
  18638. next.minutes += stepValue.minutes;
  18639. next.hours += stepValue.hours;
  18640. next.hours += Math.floor(next.minutes / 60);
  18641. next.minutes = next.minutes % 60;
  18642. return formatTime(next);
  18643. };
  18644. /* harmony default export */ var time_selectvue_type_script_lang_js_ = ({
  18645. components: { ElScrollbar: scrollbar_default.a },
  18646. watch: {
  18647. value: function value(val) {
  18648. var _this = this;
  18649. if (!val) return;
  18650. this.$nextTick(function () {
  18651. return _this.scrollToOption();
  18652. });
  18653. }
  18654. },
  18655. methods: {
  18656. handleClick: function handleClick(item) {
  18657. if (!item.disabled) {
  18658. this.$emit('pick', item.value);
  18659. }
  18660. },
  18661. handleClear: function handleClear() {
  18662. this.$emit('pick', null);
  18663. },
  18664. scrollToOption: function scrollToOption() {
  18665. var selector = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '.selected';
  18666. var menu = this.$refs.popper.querySelector('.el-picker-panel__content');
  18667. scroll_into_view_default()(menu, menu.querySelector(selector));
  18668. },
  18669. handleMenuEnter: function handleMenuEnter() {
  18670. var _this2 = this;
  18671. var selected = this.items.map(function (item) {
  18672. return item.value;
  18673. }).indexOf(this.value) !== -1;
  18674. var hasDefault = this.items.map(function (item) {
  18675. return item.value;
  18676. }).indexOf(this.defaultValue) !== -1;
  18677. var option = selected && '.selected' || hasDefault && '.default' || '.time-select-item:not(.disabled)';
  18678. this.$nextTick(function () {
  18679. return _this2.scrollToOption(option);
  18680. });
  18681. },
  18682. scrollDown: function scrollDown(step) {
  18683. var items = this.items;
  18684. var length = items.length;
  18685. var total = items.length;
  18686. var index = items.map(function (item) {
  18687. return item.value;
  18688. }).indexOf(this.value);
  18689. while (total--) {
  18690. index = (index + step + length) % length;
  18691. if (!items[index].disabled) {
  18692. this.$emit('pick', items[index].value, true);
  18693. return;
  18694. }
  18695. }
  18696. },
  18697. isValidValue: function isValidValue(date) {
  18698. return this.items.filter(function (item) {
  18699. return !item.disabled;
  18700. }).map(function (item) {
  18701. return item.value;
  18702. }).indexOf(date) !== -1;
  18703. },
  18704. handleKeydown: function handleKeydown(event) {
  18705. var keyCode = event.keyCode;
  18706. if (keyCode === 38 || keyCode === 40) {
  18707. var mapping = { 40: 1, 38: -1 };
  18708. var offset = mapping[keyCode.toString()];
  18709. this.scrollDown(offset);
  18710. event.stopPropagation();
  18711. return;
  18712. }
  18713. }
  18714. },
  18715. data: function data() {
  18716. return {
  18717. popperClass: '',
  18718. start: '09:00',
  18719. end: '18:00',
  18720. step: '00:30',
  18721. value: '',
  18722. defaultValue: '',
  18723. visible: false,
  18724. minTime: '',
  18725. maxTime: '',
  18726. width: 0
  18727. };
  18728. },
  18729. computed: {
  18730. items: function items() {
  18731. var start = this.start;
  18732. var end = this.end;
  18733. var step = this.step;
  18734. var result = [];
  18735. if (start && end && step) {
  18736. var current = start;
  18737. while (compareTime(current, end) <= 0) {
  18738. result.push({
  18739. value: current,
  18740. disabled: compareTime(current, this.minTime || '-1:-1') <= 0 || compareTime(current, this.maxTime || '100:100') >= 0
  18741. });
  18742. current = nextTime(current, step);
  18743. }
  18744. }
  18745. return result;
  18746. }
  18747. }
  18748. });
  18749. // CONCATENATED MODULE: ./packages/date-picker/src/panel/time-select.vue?vue&type=script&lang=js&
  18750. /* harmony default export */ var panel_time_selectvue_type_script_lang_js_ = (time_selectvue_type_script_lang_js_);
  18751. // CONCATENATED MODULE: ./packages/date-picker/src/panel/time-select.vue
  18752. /* normalize component */
  18753. var time_select_component = normalizeComponent(
  18754. panel_time_selectvue_type_script_lang_js_,
  18755. time_selectvue_type_template_id_51ab9320_render,
  18756. time_selectvue_type_template_id_51ab9320_staticRenderFns,
  18757. false,
  18758. null,
  18759. null,
  18760. null
  18761. )
  18762. /* hot reload */
  18763. if (false) { var time_select_api; }
  18764. time_select_component.options.__file = "packages/date-picker/src/panel/time-select.vue"
  18765. /* harmony default export */ var time_select = (time_select_component.exports);
  18766. // CONCATENATED MODULE: ./packages/date-picker/src/picker/time-select.js
  18767. /* harmony default export */ var picker_time_select = ({
  18768. mixins: [picker],
  18769. name: 'ElTimeSelect',
  18770. componentName: 'ElTimeSelect',
  18771. props: {
  18772. type: {
  18773. type: String,
  18774. default: 'time-select'
  18775. }
  18776. },
  18777. beforeCreate: function beforeCreate() {
  18778. this.panel = time_select;
  18779. }
  18780. });
  18781. // CONCATENATED MODULE: ./packages/time-select/index.js
  18782. /* istanbul ignore next */
  18783. picker_time_select.install = function (Vue) {
  18784. Vue.component(picker_time_select.name, picker_time_select);
  18785. };
  18786. /* harmony default export */ var packages_time_select = (picker_time_select);
  18787. // 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&
  18788. var time_rangevue_type_template_id_fb28660e_render = function() {
  18789. var _vm = this
  18790. var _h = _vm.$createElement
  18791. var _c = _vm._self._c || _h
  18792. return _c(
  18793. "transition",
  18794. {
  18795. attrs: { name: "el-zoom-in-top" },
  18796. on: {
  18797. "after-leave": function($event) {
  18798. _vm.$emit("dodestroy")
  18799. }
  18800. }
  18801. },
  18802. [
  18803. _c(
  18804. "div",
  18805. {
  18806. directives: [
  18807. {
  18808. name: "show",
  18809. rawName: "v-show",
  18810. value: _vm.visible,
  18811. expression: "visible"
  18812. }
  18813. ],
  18814. staticClass: "el-time-range-picker el-picker-panel el-popper",
  18815. class: _vm.popperClass
  18816. },
  18817. [
  18818. _c("div", { staticClass: "el-time-range-picker__content" }, [
  18819. _c("div", { staticClass: "el-time-range-picker__cell" }, [
  18820. _c("div", { staticClass: "el-time-range-picker__header" }, [
  18821. _vm._v(_vm._s(_vm.t("el.datepicker.startTime")))
  18822. ]),
  18823. _c(
  18824. "div",
  18825. {
  18826. staticClass:
  18827. "el-time-range-picker__body el-time-panel__content",
  18828. class: {
  18829. "has-seconds": _vm.showSeconds,
  18830. "is-arrow": _vm.arrowControl
  18831. }
  18832. },
  18833. [
  18834. _c("time-spinner", {
  18835. ref: "minSpinner",
  18836. attrs: {
  18837. "show-seconds": _vm.showSeconds,
  18838. "am-pm-mode": _vm.amPmMode,
  18839. "arrow-control": _vm.arrowControl,
  18840. date: _vm.minDate
  18841. },
  18842. on: {
  18843. change: _vm.handleMinChange,
  18844. "select-range": _vm.setMinSelectionRange
  18845. }
  18846. })
  18847. ],
  18848. 1
  18849. )
  18850. ]),
  18851. _c("div", { staticClass: "el-time-range-picker__cell" }, [
  18852. _c("div", { staticClass: "el-time-range-picker__header" }, [
  18853. _vm._v(_vm._s(_vm.t("el.datepicker.endTime")))
  18854. ]),
  18855. _c(
  18856. "div",
  18857. {
  18858. staticClass:
  18859. "el-time-range-picker__body el-time-panel__content",
  18860. class: {
  18861. "has-seconds": _vm.showSeconds,
  18862. "is-arrow": _vm.arrowControl
  18863. }
  18864. },
  18865. [
  18866. _c("time-spinner", {
  18867. ref: "maxSpinner",
  18868. attrs: {
  18869. "show-seconds": _vm.showSeconds,
  18870. "am-pm-mode": _vm.amPmMode,
  18871. "arrow-control": _vm.arrowControl,
  18872. date: _vm.maxDate
  18873. },
  18874. on: {
  18875. change: _vm.handleMaxChange,
  18876. "select-range": _vm.setMaxSelectionRange
  18877. }
  18878. })
  18879. ],
  18880. 1
  18881. )
  18882. ])
  18883. ]),
  18884. _c("div", { staticClass: "el-time-panel__footer" }, [
  18885. _c(
  18886. "button",
  18887. {
  18888. staticClass: "el-time-panel__btn cancel",
  18889. attrs: { type: "button" },
  18890. on: {
  18891. click: function($event) {
  18892. _vm.handleCancel()
  18893. }
  18894. }
  18895. },
  18896. [_vm._v(_vm._s(_vm.t("el.datepicker.cancel")))]
  18897. ),
  18898. _c(
  18899. "button",
  18900. {
  18901. staticClass: "el-time-panel__btn confirm",
  18902. attrs: { type: "button", disabled: _vm.btnDisabled },
  18903. on: {
  18904. click: function($event) {
  18905. _vm.handleConfirm()
  18906. }
  18907. }
  18908. },
  18909. [_vm._v(_vm._s(_vm.t("el.datepicker.confirm")))]
  18910. )
  18911. ])
  18912. ]
  18913. )
  18914. ]
  18915. )
  18916. }
  18917. var time_rangevue_type_template_id_fb28660e_staticRenderFns = []
  18918. time_rangevue_type_template_id_fb28660e_render._withStripped = true
  18919. // CONCATENATED MODULE: ./packages/date-picker/src/panel/time-range.vue?vue&type=template&id=fb28660e&
  18920. // 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&
  18921. //
  18922. //
  18923. //
  18924. //
  18925. //
  18926. //
  18927. //
  18928. //
  18929. //
  18930. //
  18931. //
  18932. //
  18933. //
  18934. //
  18935. //
  18936. //
  18937. //
  18938. //
  18939. //
  18940. //
  18941. //
  18942. //
  18943. //
  18944. //
  18945. //
  18946. //
  18947. //
  18948. //
  18949. //
  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. var MIN_TIME = Object(date_util_["parseDate"])('00:00:00', 'HH:mm:ss');
  18979. var MAX_TIME = Object(date_util_["parseDate"])('23:59:59', 'HH:mm:ss');
  18980. var time_rangevue_type_script_lang_js_minTimeOfDay = function minTimeOfDay(date) {
  18981. return Object(date_util_["modifyDate"])(MIN_TIME, date.getFullYear(), date.getMonth(), date.getDate());
  18982. };
  18983. var time_rangevue_type_script_lang_js_maxTimeOfDay = function maxTimeOfDay(date) {
  18984. return Object(date_util_["modifyDate"])(MAX_TIME, date.getFullYear(), date.getMonth(), date.getDate());
  18985. };
  18986. // increase time by amount of milliseconds, but within the range of day
  18987. var advanceTime = function advanceTime(date, amount) {
  18988. return new Date(Math.min(date.getTime() + amount, time_rangevue_type_script_lang_js_maxTimeOfDay(date).getTime()));
  18989. };
  18990. /* harmony default export */ var time_rangevue_type_script_lang_js_ = ({
  18991. mixins: [locale_default.a],
  18992. components: { TimeSpinner: time_spinner },
  18993. computed: {
  18994. showSeconds: function showSeconds() {
  18995. return (this.format || '').indexOf('ss') !== -1;
  18996. },
  18997. offset: function offset() {
  18998. return this.showSeconds ? 11 : 8;
  18999. },
  19000. spinner: function spinner() {
  19001. return this.selectionRange[0] < this.offset ? this.$refs.minSpinner : this.$refs.maxSpinner;
  19002. },
  19003. btnDisabled: function btnDisabled() {
  19004. return this.minDate.getTime() > this.maxDate.getTime();
  19005. },
  19006. amPmMode: function amPmMode() {
  19007. if ((this.format || '').indexOf('A') !== -1) return 'A';
  19008. if ((this.format || '').indexOf('a') !== -1) return 'a';
  19009. return '';
  19010. }
  19011. },
  19012. data: function data() {
  19013. return {
  19014. popperClass: '',
  19015. minDate: new Date(),
  19016. maxDate: new Date(),
  19017. value: [],
  19018. oldValue: [new Date(), new Date()],
  19019. defaultValue: null,
  19020. format: 'HH:mm:ss',
  19021. visible: false,
  19022. selectionRange: [0, 2],
  19023. arrowControl: false
  19024. };
  19025. },
  19026. watch: {
  19027. value: function value(_value) {
  19028. if (Array.isArray(_value)) {
  19029. this.minDate = new Date(_value[0]);
  19030. this.maxDate = new Date(_value[1]);
  19031. } else {
  19032. if (Array.isArray(this.defaultValue)) {
  19033. this.minDate = new Date(this.defaultValue[0]);
  19034. this.maxDate = new Date(this.defaultValue[1]);
  19035. } else if (this.defaultValue) {
  19036. this.minDate = new Date(this.defaultValue);
  19037. this.maxDate = advanceTime(new Date(this.defaultValue), 60 * 60 * 1000);
  19038. } else {
  19039. this.minDate = new Date();
  19040. this.maxDate = advanceTime(new Date(), 60 * 60 * 1000);
  19041. }
  19042. }
  19043. },
  19044. visible: function visible(val) {
  19045. var _this = this;
  19046. if (val) {
  19047. this.oldValue = this.value;
  19048. this.$nextTick(function () {
  19049. return _this.$refs.minSpinner.emitSelectRange('hours');
  19050. });
  19051. }
  19052. }
  19053. },
  19054. methods: {
  19055. handleClear: function handleClear() {
  19056. this.$emit('pick', null);
  19057. },
  19058. handleCancel: function handleCancel() {
  19059. this.$emit('pick', this.oldValue);
  19060. },
  19061. handleMinChange: function handleMinChange(date) {
  19062. this.minDate = Object(date_util_["clearMilliseconds"])(date);
  19063. this.handleChange();
  19064. },
  19065. handleMaxChange: function handleMaxChange(date) {
  19066. this.maxDate = Object(date_util_["clearMilliseconds"])(date);
  19067. this.handleChange();
  19068. },
  19069. handleChange: function handleChange() {
  19070. if (this.isValidValue([this.minDate, this.maxDate])) {
  19071. this.$refs.minSpinner.selectableRange = [[time_rangevue_type_script_lang_js_minTimeOfDay(this.minDate), this.maxDate]];
  19072. this.$refs.maxSpinner.selectableRange = [[this.minDate, time_rangevue_type_script_lang_js_maxTimeOfDay(this.maxDate)]];
  19073. this.$emit('pick', [this.minDate, this.maxDate], true);
  19074. }
  19075. },
  19076. setMinSelectionRange: function setMinSelectionRange(start, end) {
  19077. this.$emit('select-range', start, end, 'min');
  19078. this.selectionRange = [start, end];
  19079. },
  19080. setMaxSelectionRange: function setMaxSelectionRange(start, end) {
  19081. this.$emit('select-range', start, end, 'max');
  19082. this.selectionRange = [start + this.offset, end + this.offset];
  19083. },
  19084. handleConfirm: function handleConfirm() {
  19085. var visible = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  19086. var minSelectableRange = this.$refs.minSpinner.selectableRange;
  19087. var maxSelectableRange = this.$refs.maxSpinner.selectableRange;
  19088. this.minDate = Object(date_util_["limitTimeRange"])(this.minDate, minSelectableRange, this.format);
  19089. this.maxDate = Object(date_util_["limitTimeRange"])(this.maxDate, maxSelectableRange, this.format);
  19090. this.$emit('pick', [this.minDate, this.maxDate], visible);
  19091. },
  19092. adjustSpinners: function adjustSpinners() {
  19093. this.$refs.minSpinner.adjustSpinners();
  19094. this.$refs.maxSpinner.adjustSpinners();
  19095. },
  19096. changeSelectionRange: function changeSelectionRange(step) {
  19097. var list = this.showSeconds ? [0, 3, 6, 11, 14, 17] : [0, 3, 8, 11];
  19098. var mapping = ['hours', 'minutes'].concat(this.showSeconds ? ['seconds'] : []);
  19099. var index = list.indexOf(this.selectionRange[0]);
  19100. var next = (index + step + list.length) % list.length;
  19101. var half = list.length / 2;
  19102. if (next < half) {
  19103. this.$refs.minSpinner.emitSelectRange(mapping[next]);
  19104. } else {
  19105. this.$refs.maxSpinner.emitSelectRange(mapping[next - half]);
  19106. }
  19107. },
  19108. isValidValue: function isValidValue(date) {
  19109. return Array.isArray(date) && Object(date_util_["timeWithinRange"])(this.minDate, this.$refs.minSpinner.selectableRange) && Object(date_util_["timeWithinRange"])(this.maxDate, this.$refs.maxSpinner.selectableRange);
  19110. },
  19111. handleKeydown: function handleKeydown(event) {
  19112. var keyCode = event.keyCode;
  19113. var mapping = { 38: -1, 40: 1, 37: -1, 39: 1 };
  19114. // Left or Right
  19115. if (keyCode === 37 || keyCode === 39) {
  19116. var step = mapping[keyCode];
  19117. this.changeSelectionRange(step);
  19118. event.preventDefault();
  19119. return;
  19120. }
  19121. // Up or Down
  19122. if (keyCode === 38 || keyCode === 40) {
  19123. var _step = mapping[keyCode];
  19124. this.spinner.scrollDown(_step);
  19125. event.preventDefault();
  19126. return;
  19127. }
  19128. }
  19129. }
  19130. });
  19131. // CONCATENATED MODULE: ./packages/date-picker/src/panel/time-range.vue?vue&type=script&lang=js&
  19132. /* harmony default export */ var panel_time_rangevue_type_script_lang_js_ = (time_rangevue_type_script_lang_js_);
  19133. // CONCATENATED MODULE: ./packages/date-picker/src/panel/time-range.vue
  19134. /* normalize component */
  19135. var time_range_component = normalizeComponent(
  19136. panel_time_rangevue_type_script_lang_js_,
  19137. time_rangevue_type_template_id_fb28660e_render,
  19138. time_rangevue_type_template_id_fb28660e_staticRenderFns,
  19139. false,
  19140. null,
  19141. null,
  19142. null
  19143. )
  19144. /* hot reload */
  19145. if (false) { var time_range_api; }
  19146. time_range_component.options.__file = "packages/date-picker/src/panel/time-range.vue"
  19147. /* harmony default export */ var time_range = (time_range_component.exports);
  19148. // CONCATENATED MODULE: ./packages/date-picker/src/picker/time-picker.js
  19149. /* harmony default export */ var time_picker = ({
  19150. mixins: [picker],
  19151. name: 'ElTimePicker',
  19152. props: {
  19153. isRange: Boolean,
  19154. arrowControl: Boolean
  19155. },
  19156. data: function data() {
  19157. return {
  19158. type: ''
  19159. };
  19160. },
  19161. watch: {
  19162. isRange: function isRange(_isRange) {
  19163. if (this.picker) {
  19164. this.unmountPicker();
  19165. this.type = _isRange ? 'timerange' : 'time';
  19166. this.panel = _isRange ? time_range : panel_time;
  19167. this.mountPicker();
  19168. } else {
  19169. this.type = _isRange ? 'timerange' : 'time';
  19170. this.panel = _isRange ? time_range : panel_time;
  19171. }
  19172. }
  19173. },
  19174. created: function created() {
  19175. this.type = this.isRange ? 'timerange' : 'time';
  19176. this.panel = this.isRange ? time_range : panel_time;
  19177. }
  19178. });
  19179. // CONCATENATED MODULE: ./packages/time-picker/index.js
  19180. /* istanbul ignore next */
  19181. time_picker.install = function (Vue) {
  19182. Vue.component(time_picker.name, time_picker);
  19183. };
  19184. /* harmony default export */ var packages_time_picker = (time_picker);
  19185. // 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&
  19186. var mainvue_type_template_id_52060272_render = function() {
  19187. var _vm = this
  19188. var _h = _vm.$createElement
  19189. var _c = _vm._self._c || _h
  19190. return _c(
  19191. "span",
  19192. [
  19193. _c(
  19194. "transition",
  19195. {
  19196. attrs: { name: _vm.transition },
  19197. on: {
  19198. "after-enter": _vm.handleAfterEnter,
  19199. "after-leave": _vm.handleAfterLeave
  19200. }
  19201. },
  19202. [
  19203. _c(
  19204. "div",
  19205. {
  19206. directives: [
  19207. {
  19208. name: "show",
  19209. rawName: "v-show",
  19210. value: !_vm.disabled && _vm.showPopper,
  19211. expression: "!disabled && showPopper"
  19212. }
  19213. ],
  19214. ref: "popper",
  19215. staticClass: "el-popover el-popper",
  19216. class: [_vm.popperClass, _vm.content && "el-popover--plain"],
  19217. style: { width: _vm.width + "px" },
  19218. attrs: {
  19219. role: "tooltip",
  19220. id: _vm.tooltipId,
  19221. "aria-hidden":
  19222. _vm.disabled || !_vm.showPopper ? "true" : "false"
  19223. }
  19224. },
  19225. [
  19226. _vm.title
  19227. ? _c("div", {
  19228. staticClass: "el-popover__title",
  19229. domProps: { textContent: _vm._s(_vm.title) }
  19230. })
  19231. : _vm._e(),
  19232. _vm._t("default", [_vm._v(_vm._s(_vm.content))])
  19233. ],
  19234. 2
  19235. )
  19236. ]
  19237. ),
  19238. _c(
  19239. "span",
  19240. { ref: "wrapper", staticClass: "el-popover__reference-wrapper" },
  19241. [_vm._t("reference")],
  19242. 2
  19243. )
  19244. ],
  19245. 1
  19246. )
  19247. }
  19248. var mainvue_type_template_id_52060272_staticRenderFns = []
  19249. mainvue_type_template_id_52060272_render._withStripped = true
  19250. // CONCATENATED MODULE: ./packages/popover/src/main.vue?vue&type=template&id=52060272&
  19251. // 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&
  19252. //
  19253. //
  19254. //
  19255. //
  19256. //
  19257. //
  19258. //
  19259. //
  19260. //
  19261. //
  19262. //
  19263. //
  19264. //
  19265. //
  19266. //
  19267. //
  19268. //
  19269. //
  19270. //
  19271. //
  19272. //
  19273. //
  19274. //
  19275. //
  19276. //
  19277. /* harmony default export */ var mainvue_type_script_lang_js_ = ({
  19278. name: 'ElPopover',
  19279. mixins: [vue_popper_default.a],
  19280. props: {
  19281. trigger: {
  19282. type: String,
  19283. default: 'click',
  19284. validator: function validator(value) {
  19285. return ['click', 'focus', 'hover', 'manual'].indexOf(value) > -1;
  19286. }
  19287. },
  19288. openDelay: {
  19289. type: Number,
  19290. default: 0
  19291. },
  19292. closeDelay: {
  19293. type: Number,
  19294. default: 200
  19295. },
  19296. title: String,
  19297. disabled: Boolean,
  19298. content: String,
  19299. reference: {},
  19300. popperClass: String,
  19301. width: {},
  19302. visibleArrow: {
  19303. default: true
  19304. },
  19305. arrowOffset: {
  19306. type: Number,
  19307. default: 0
  19308. },
  19309. transition: {
  19310. type: String,
  19311. default: 'fade-in-linear'
  19312. },
  19313. tabindex: {
  19314. type: Number,
  19315. default: 0
  19316. }
  19317. },
  19318. computed: {
  19319. tooltipId: function tooltipId() {
  19320. return 'el-popover-' + Object(util_["generateId"])();
  19321. }
  19322. },
  19323. watch: {
  19324. showPopper: function showPopper(val) {
  19325. if (this.disabled) {
  19326. return;
  19327. }
  19328. val ? this.$emit('show') : this.$emit('hide');
  19329. }
  19330. },
  19331. mounted: function mounted() {
  19332. var _this = this;
  19333. var reference = this.referenceElm = this.reference || this.$refs.reference;
  19334. var popper = this.popper || this.$refs.popper;
  19335. if (!reference && this.$refs.wrapper.children) {
  19336. reference = this.referenceElm = this.$refs.wrapper.children[0];
  19337. }
  19338. // 可访问性
  19339. if (reference) {
  19340. Object(dom_["addClass"])(reference, 'el-popover__reference');
  19341. reference.setAttribute('aria-describedby', this.tooltipId);
  19342. reference.setAttribute('tabindex', this.tabindex); // tab序列
  19343. popper.setAttribute('tabindex', 0);
  19344. if (this.trigger !== 'click') {
  19345. Object(dom_["on"])(reference, 'focusin', function () {
  19346. _this.handleFocus();
  19347. var instance = reference.__vue__;
  19348. if (instance && typeof instance.focus === 'function') {
  19349. instance.focus();
  19350. }
  19351. });
  19352. Object(dom_["on"])(popper, 'focusin', this.handleFocus);
  19353. Object(dom_["on"])(reference, 'focusout', this.handleBlur);
  19354. Object(dom_["on"])(popper, 'focusout', this.handleBlur);
  19355. }
  19356. Object(dom_["on"])(reference, 'keydown', this.handleKeydown);
  19357. Object(dom_["on"])(reference, 'click', this.handleClick);
  19358. }
  19359. if (this.trigger === 'click') {
  19360. Object(dom_["on"])(reference, 'click', this.doToggle);
  19361. Object(dom_["on"])(document, 'click', this.handleDocumentClick);
  19362. } else if (this.trigger === 'hover') {
  19363. Object(dom_["on"])(reference, 'mouseenter', this.handleMouseEnter);
  19364. Object(dom_["on"])(popper, 'mouseenter', this.handleMouseEnter);
  19365. Object(dom_["on"])(reference, 'mouseleave', this.handleMouseLeave);
  19366. Object(dom_["on"])(popper, 'mouseleave', this.handleMouseLeave);
  19367. } else if (this.trigger === 'focus') {
  19368. if (this.tabindex < 0) {
  19369. console.warn('[Element Warn][Popover]a negative taindex means that the element cannot be focused by tab key');
  19370. }
  19371. if (reference.querySelector('input, textarea')) {
  19372. Object(dom_["on"])(reference, 'focusin', this.doShow);
  19373. Object(dom_["on"])(reference, 'focusout', this.doClose);
  19374. } else {
  19375. Object(dom_["on"])(reference, 'mousedown', this.doShow);
  19376. Object(dom_["on"])(reference, 'mouseup', this.doClose);
  19377. }
  19378. }
  19379. },
  19380. beforeDestroy: function beforeDestroy() {
  19381. this.cleanup();
  19382. },
  19383. deactivated: function deactivated() {
  19384. this.cleanup();
  19385. },
  19386. methods: {
  19387. doToggle: function doToggle() {
  19388. this.showPopper = !this.showPopper;
  19389. },
  19390. doShow: function doShow() {
  19391. this.showPopper = true;
  19392. },
  19393. doClose: function doClose() {
  19394. this.showPopper = false;
  19395. },
  19396. handleFocus: function handleFocus() {
  19397. Object(dom_["addClass"])(this.referenceElm, 'focusing');
  19398. if (this.trigger === 'click' || this.trigger === 'focus') this.showPopper = true;
  19399. },
  19400. handleClick: function handleClick() {
  19401. Object(dom_["removeClass"])(this.referenceElm, 'focusing');
  19402. },
  19403. handleBlur: function handleBlur() {
  19404. Object(dom_["removeClass"])(this.referenceElm, 'focusing');
  19405. if (this.trigger === 'click' || this.trigger === 'focus') this.showPopper = false;
  19406. },
  19407. handleMouseEnter: function handleMouseEnter() {
  19408. var _this2 = this;
  19409. clearTimeout(this._timer);
  19410. if (this.openDelay) {
  19411. this._timer = setTimeout(function () {
  19412. _this2.showPopper = true;
  19413. }, this.openDelay);
  19414. } else {
  19415. this.showPopper = true;
  19416. }
  19417. },
  19418. handleKeydown: function handleKeydown(ev) {
  19419. if (ev.keyCode === 27 && this.trigger !== 'manual') {
  19420. // esc
  19421. this.doClose();
  19422. }
  19423. },
  19424. handleMouseLeave: function handleMouseLeave() {
  19425. var _this3 = this;
  19426. clearTimeout(this._timer);
  19427. if (this.closeDelay) {
  19428. this._timer = setTimeout(function () {
  19429. _this3.showPopper = false;
  19430. }, this.closeDelay);
  19431. } else {
  19432. this.showPopper = false;
  19433. }
  19434. },
  19435. handleDocumentClick: function handleDocumentClick(e) {
  19436. var reference = this.reference || this.$refs.reference;
  19437. var popper = this.popper || this.$refs.popper;
  19438. if (!reference && this.$refs.wrapper.children) {
  19439. reference = this.referenceElm = this.$refs.wrapper.children[0];
  19440. }
  19441. if (!this.$el || !reference || this.$el.contains(e.target) || reference.contains(e.target) || !popper || popper.contains(e.target)) return;
  19442. this.showPopper = false;
  19443. },
  19444. handleAfterEnter: function handleAfterEnter() {
  19445. this.$emit('after-enter');
  19446. },
  19447. handleAfterLeave: function handleAfterLeave() {
  19448. this.$emit('after-leave');
  19449. this.doDestroy();
  19450. },
  19451. cleanup: function cleanup() {
  19452. if (this.openDelay || this.closeDelay) {
  19453. clearTimeout(this._timer);
  19454. }
  19455. }
  19456. },
  19457. destroyed: function destroyed() {
  19458. var reference = this.reference;
  19459. Object(dom_["off"])(reference, 'click', this.doToggle);
  19460. Object(dom_["off"])(reference, 'mouseup', this.doClose);
  19461. Object(dom_["off"])(reference, 'mousedown', this.doShow);
  19462. Object(dom_["off"])(reference, 'focusin', this.doShow);
  19463. Object(dom_["off"])(reference, 'focusout', this.doClose);
  19464. Object(dom_["off"])(reference, 'mousedown', this.doShow);
  19465. Object(dom_["off"])(reference, 'mouseup', this.doClose);
  19466. Object(dom_["off"])(reference, 'mouseleave', this.handleMouseLeave);
  19467. Object(dom_["off"])(reference, 'mouseenter', this.handleMouseEnter);
  19468. Object(dom_["off"])(document, 'click', this.handleDocumentClick);
  19469. }
  19470. });
  19471. // CONCATENATED MODULE: ./packages/popover/src/main.vue?vue&type=script&lang=js&
  19472. /* harmony default export */ var src_mainvue_type_script_lang_js_ = (mainvue_type_script_lang_js_);
  19473. // CONCATENATED MODULE: ./packages/popover/src/main.vue
  19474. /* normalize component */
  19475. var main_component = normalizeComponent(
  19476. src_mainvue_type_script_lang_js_,
  19477. mainvue_type_template_id_52060272_render,
  19478. mainvue_type_template_id_52060272_staticRenderFns,
  19479. false,
  19480. null,
  19481. null,
  19482. null
  19483. )
  19484. /* hot reload */
  19485. if (false) { var main_api; }
  19486. main_component.options.__file = "packages/popover/src/main.vue"
  19487. /* harmony default export */ var main = (main_component.exports);
  19488. // CONCATENATED MODULE: ./packages/popover/src/directive.js
  19489. var getReference = function getReference(el, binding, vnode) {
  19490. var _ref = binding.expression ? binding.value : binding.arg;
  19491. var popper = vnode.context.$refs[_ref];
  19492. if (popper) {
  19493. if (Array.isArray(popper)) {
  19494. popper[0].$refs.reference = el;
  19495. } else {
  19496. popper.$refs.reference = el;
  19497. }
  19498. }
  19499. };
  19500. /* harmony default export */ var directive = ({
  19501. bind: function bind(el, binding, vnode) {
  19502. getReference(el, binding, vnode);
  19503. },
  19504. inserted: function inserted(el, binding, vnode) {
  19505. getReference(el, binding, vnode);
  19506. }
  19507. });
  19508. // CONCATENATED MODULE: ./packages/popover/index.js
  19509. external_vue_default.a.directive('popover', directive);
  19510. /* istanbul ignore next */
  19511. main.install = function (Vue) {
  19512. Vue.directive('popover', directive);
  19513. Vue.component(main.name, main);
  19514. };
  19515. main.directive = directive;
  19516. /* harmony default export */ var popover = (main);
  19517. // CONCATENATED MODULE: ./packages/tooltip/src/main.js
  19518. /* harmony default export */ var src_main = ({
  19519. name: 'ElTooltip',
  19520. mixins: [vue_popper_default.a],
  19521. props: {
  19522. openDelay: {
  19523. type: Number,
  19524. default: 0
  19525. },
  19526. disabled: Boolean,
  19527. manual: Boolean,
  19528. effect: {
  19529. type: String,
  19530. default: 'dark'
  19531. },
  19532. arrowOffset: {
  19533. type: Number,
  19534. default: 0
  19535. },
  19536. popperClass: String,
  19537. content: String,
  19538. visibleArrow: {
  19539. default: true
  19540. },
  19541. transition: {
  19542. type: String,
  19543. default: 'el-fade-in-linear'
  19544. },
  19545. popperOptions: {
  19546. default: function _default() {
  19547. return {
  19548. boundariesPadding: 10,
  19549. gpuAcceleration: false
  19550. };
  19551. }
  19552. },
  19553. enterable: {
  19554. type: Boolean,
  19555. default: true
  19556. },
  19557. hideAfter: {
  19558. type: Number,
  19559. default: 0
  19560. },
  19561. tabindex: {
  19562. type: Number,
  19563. default: 0
  19564. }
  19565. },
  19566. data: function data() {
  19567. return {
  19568. tooltipId: 'el-tooltip-' + Object(util_["generateId"])(),
  19569. timeoutPending: null,
  19570. focusing: false
  19571. };
  19572. },
  19573. beforeCreate: function beforeCreate() {
  19574. var _this = this;
  19575. if (this.$isServer) return;
  19576. this.popperVM = new external_vue_default.a({
  19577. data: { node: '' },
  19578. render: function render(h) {
  19579. return this.node;
  19580. }
  19581. }).$mount();
  19582. this.debounceClose = debounce_default()(200, function () {
  19583. return _this.handleClosePopper();
  19584. });
  19585. },
  19586. render: function render(h) {
  19587. var _this2 = this;
  19588. if (this.popperVM) {
  19589. this.popperVM.node = h(
  19590. 'transition',
  19591. {
  19592. attrs: {
  19593. name: this.transition
  19594. },
  19595. on: {
  19596. 'afterLeave': this.doDestroy
  19597. }
  19598. },
  19599. [h(
  19600. 'div',
  19601. {
  19602. on: {
  19603. 'mouseleave': function mouseleave() {
  19604. _this2.setExpectedState(false);_this2.debounceClose();
  19605. },
  19606. 'mouseenter': function mouseenter() {
  19607. _this2.setExpectedState(true);
  19608. }
  19609. },
  19610. ref: 'popper',
  19611. attrs: { role: 'tooltip',
  19612. id: this.tooltipId,
  19613. 'aria-hidden': this.disabled || !this.showPopper ? 'true' : 'false'
  19614. },
  19615. directives: [{
  19616. name: 'show',
  19617. value: !this.disabled && this.showPopper
  19618. }],
  19619. 'class': ['el-tooltip__popper', 'is-' + this.effect, this.popperClass] },
  19620. [this.$slots.content || this.content]
  19621. )]
  19622. );
  19623. }
  19624. var firstElement = this.getFirstElement();
  19625. if (!firstElement) return null;
  19626. var data = firstElement.data = firstElement.data || {};
  19627. data.staticClass = this.addTooltipClass(data.staticClass);
  19628. return firstElement;
  19629. },
  19630. mounted: function mounted() {
  19631. var _this3 = this;
  19632. this.referenceElm = this.$el;
  19633. if (this.$el.nodeType === 1) {
  19634. this.$el.setAttribute('aria-describedby', this.tooltipId);
  19635. this.$el.setAttribute('tabindex', this.tabindex);
  19636. Object(dom_["on"])(this.referenceElm, 'mouseenter', this.show);
  19637. Object(dom_["on"])(this.referenceElm, 'mouseleave', this.hide);
  19638. Object(dom_["on"])(this.referenceElm, 'focus', function () {
  19639. if (!_this3.$slots.default || !_this3.$slots.default.length) {
  19640. _this3.handleFocus();
  19641. return;
  19642. }
  19643. var instance = _this3.$slots.default[0].componentInstance;
  19644. if (instance && instance.focus) {
  19645. instance.focus();
  19646. } else {
  19647. _this3.handleFocus();
  19648. }
  19649. });
  19650. Object(dom_["on"])(this.referenceElm, 'blur', this.handleBlur);
  19651. Object(dom_["on"])(this.referenceElm, 'click', this.removeFocusing);
  19652. }
  19653. // fix issue https://github.com/ElemeFE/element/issues/14424
  19654. if (this.value && this.popperVM) {
  19655. this.popperVM.$nextTick(function () {
  19656. if (_this3.value) {
  19657. _this3.updatePopper();
  19658. }
  19659. });
  19660. }
  19661. },
  19662. watch: {
  19663. focusing: function focusing(val) {
  19664. if (val) {
  19665. Object(dom_["addClass"])(this.referenceElm, 'focusing');
  19666. } else {
  19667. Object(dom_["removeClass"])(this.referenceElm, 'focusing');
  19668. }
  19669. }
  19670. },
  19671. methods: {
  19672. show: function show() {
  19673. this.setExpectedState(true);
  19674. this.handleShowPopper();
  19675. },
  19676. hide: function hide() {
  19677. this.setExpectedState(false);
  19678. this.debounceClose();
  19679. },
  19680. handleFocus: function handleFocus() {
  19681. this.focusing = true;
  19682. this.show();
  19683. },
  19684. handleBlur: function handleBlur() {
  19685. this.focusing = false;
  19686. this.hide();
  19687. },
  19688. removeFocusing: function removeFocusing() {
  19689. this.focusing = false;
  19690. },
  19691. addTooltipClass: function addTooltipClass(prev) {
  19692. if (!prev) {
  19693. return 'el-tooltip';
  19694. } else {
  19695. return 'el-tooltip ' + prev.replace('el-tooltip', '');
  19696. }
  19697. },
  19698. handleShowPopper: function handleShowPopper() {
  19699. var _this4 = this;
  19700. if (!this.expectedState || this.manual) return;
  19701. clearTimeout(this.timeout);
  19702. this.timeout = setTimeout(function () {
  19703. _this4.showPopper = true;
  19704. }, this.openDelay);
  19705. if (this.hideAfter > 0) {
  19706. this.timeoutPending = setTimeout(function () {
  19707. _this4.showPopper = false;
  19708. }, this.hideAfter);
  19709. }
  19710. },
  19711. handleClosePopper: function handleClosePopper() {
  19712. if (this.enterable && this.expectedState || this.manual) return;
  19713. clearTimeout(this.timeout);
  19714. if (this.timeoutPending) {
  19715. clearTimeout(this.timeoutPending);
  19716. }
  19717. this.showPopper = false;
  19718. if (this.disabled) {
  19719. this.doDestroy();
  19720. }
  19721. },
  19722. setExpectedState: function setExpectedState(expectedState) {
  19723. if (expectedState === false) {
  19724. clearTimeout(this.timeoutPending);
  19725. }
  19726. this.expectedState = expectedState;
  19727. },
  19728. getFirstElement: function getFirstElement() {
  19729. var slots = this.$slots.default;
  19730. if (!Array.isArray(slots)) return null;
  19731. var element = null;
  19732. for (var index = 0; index < slots.length; index++) {
  19733. if (slots[index] && slots[index].tag) {
  19734. element = slots[index];
  19735. break;
  19736. };
  19737. }
  19738. return element;
  19739. }
  19740. },
  19741. beforeDestroy: function beforeDestroy() {
  19742. this.popperVM && this.popperVM.$destroy();
  19743. },
  19744. destroyed: function destroyed() {
  19745. var reference = this.referenceElm;
  19746. if (reference.nodeType === 1) {
  19747. Object(dom_["off"])(reference, 'mouseenter', this.show);
  19748. Object(dom_["off"])(reference, 'mouseleave', this.hide);
  19749. Object(dom_["off"])(reference, 'focus', this.handleFocus);
  19750. Object(dom_["off"])(reference, 'blur', this.handleBlur);
  19751. Object(dom_["off"])(reference, 'click', this.removeFocusing);
  19752. }
  19753. }
  19754. });
  19755. // CONCATENATED MODULE: ./packages/tooltip/index.js
  19756. /* istanbul ignore next */
  19757. src_main.install = function (Vue) {
  19758. Vue.component(src_main.name, src_main);
  19759. };
  19760. /* harmony default export */ var packages_tooltip = (src_main);
  19761. // 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&
  19762. var mainvue_type_template_id_6b29b012_render = function() {
  19763. var _vm = this
  19764. var _h = _vm.$createElement
  19765. var _c = _vm._self._c || _h
  19766. return _c("transition", { attrs: { name: "msgbox-fade" } }, [
  19767. _c(
  19768. "div",
  19769. {
  19770. directives: [
  19771. {
  19772. name: "show",
  19773. rawName: "v-show",
  19774. value: _vm.visible,
  19775. expression: "visible"
  19776. }
  19777. ],
  19778. staticClass: "el-message-box__wrapper",
  19779. attrs: {
  19780. tabindex: "-1",
  19781. role: "dialog",
  19782. "aria-modal": "true",
  19783. "aria-label": _vm.title || "dialog"
  19784. },
  19785. on: {
  19786. click: function($event) {
  19787. if ($event.target !== $event.currentTarget) {
  19788. return null
  19789. }
  19790. return _vm.handleWrapperClick($event)
  19791. }
  19792. }
  19793. },
  19794. [
  19795. _c(
  19796. "div",
  19797. {
  19798. staticClass: "el-message-box",
  19799. class: [_vm.customClass, _vm.center && "el-message-box--center"]
  19800. },
  19801. [
  19802. _vm.title !== null
  19803. ? _c("div", { staticClass: "el-message-box__header" }, [
  19804. _c("div", { staticClass: "el-message-box__title" }, [
  19805. _vm.icon && _vm.center
  19806. ? _c("div", {
  19807. class: ["el-message-box__status", _vm.icon]
  19808. })
  19809. : _vm._e(),
  19810. _c("span", [_vm._v(_vm._s(_vm.title))])
  19811. ]),
  19812. _vm.showClose
  19813. ? _c(
  19814. "button",
  19815. {
  19816. staticClass: "el-message-box__headerbtn",
  19817. attrs: { type: "button", "aria-label": "Close" },
  19818. on: {
  19819. click: function($event) {
  19820. _vm.handleAction(
  19821. _vm.distinguishCancelAndClose
  19822. ? "close"
  19823. : "cancel"
  19824. )
  19825. },
  19826. keydown: function($event) {
  19827. if (
  19828. !("button" in $event) &&
  19829. _vm._k(
  19830. $event.keyCode,
  19831. "enter",
  19832. 13,
  19833. $event.key,
  19834. "Enter"
  19835. )
  19836. ) {
  19837. return null
  19838. }
  19839. _vm.handleAction(
  19840. _vm.distinguishCancelAndClose
  19841. ? "close"
  19842. : "cancel"
  19843. )
  19844. }
  19845. }
  19846. },
  19847. [
  19848. _c("i", {
  19849. staticClass: "el-message-box__close el-icon-close"
  19850. })
  19851. ]
  19852. )
  19853. : _vm._e()
  19854. ])
  19855. : _vm._e(),
  19856. _c("div", { staticClass: "el-message-box__content" }, [
  19857. _c("div", { staticClass: "el-message-box__container" }, [
  19858. _vm.icon && !_vm.center && _vm.message !== ""
  19859. ? _c("div", { class: ["el-message-box__status", _vm.icon] })
  19860. : _vm._e(),
  19861. _vm.message !== ""
  19862. ? _c(
  19863. "div",
  19864. { staticClass: "el-message-box__message" },
  19865. [
  19866. _vm._t("default", [
  19867. !_vm.dangerouslyUseHTMLString
  19868. ? _c("p", [_vm._v(_vm._s(_vm.message))])
  19869. : _c("p", {
  19870. domProps: { innerHTML: _vm._s(_vm.message) }
  19871. })
  19872. ])
  19873. ],
  19874. 2
  19875. )
  19876. : _vm._e()
  19877. ]),
  19878. _c(
  19879. "div",
  19880. {
  19881. directives: [
  19882. {
  19883. name: "show",
  19884. rawName: "v-show",
  19885. value: _vm.showInput,
  19886. expression: "showInput"
  19887. }
  19888. ],
  19889. staticClass: "el-message-box__input"
  19890. },
  19891. [
  19892. _c("el-input", {
  19893. ref: "input",
  19894. attrs: {
  19895. type: _vm.inputType,
  19896. placeholder: _vm.inputPlaceholder
  19897. },
  19898. nativeOn: {
  19899. keydown: function($event) {
  19900. if (
  19901. !("button" in $event) &&
  19902. _vm._k(
  19903. $event.keyCode,
  19904. "enter",
  19905. 13,
  19906. $event.key,
  19907. "Enter"
  19908. )
  19909. ) {
  19910. return null
  19911. }
  19912. return _vm.handleInputEnter($event)
  19913. }
  19914. },
  19915. model: {
  19916. value: _vm.inputValue,
  19917. callback: function($$v) {
  19918. _vm.inputValue = $$v
  19919. },
  19920. expression: "inputValue"
  19921. }
  19922. }),
  19923. _c(
  19924. "div",
  19925. {
  19926. staticClass: "el-message-box__errormsg",
  19927. style: {
  19928. visibility: !!_vm.editorErrorMessage
  19929. ? "visible"
  19930. : "hidden"
  19931. }
  19932. },
  19933. [_vm._v(_vm._s(_vm.editorErrorMessage))]
  19934. )
  19935. ],
  19936. 1
  19937. )
  19938. ]),
  19939. _c(
  19940. "div",
  19941. { staticClass: "el-message-box__btns" },
  19942. [
  19943. _vm.showCancelButton
  19944. ? _c(
  19945. "el-button",
  19946. {
  19947. class: [_vm.cancelButtonClasses],
  19948. attrs: {
  19949. loading: _vm.cancelButtonLoading,
  19950. round: _vm.roundButton,
  19951. size: "small"
  19952. },
  19953. on: {
  19954. keydown: function($event) {
  19955. if (
  19956. !("button" in $event) &&
  19957. _vm._k(
  19958. $event.keyCode,
  19959. "enter",
  19960. 13,
  19961. $event.key,
  19962. "Enter"
  19963. )
  19964. ) {
  19965. return null
  19966. }
  19967. _vm.handleAction("cancel")
  19968. }
  19969. },
  19970. nativeOn: {
  19971. click: function($event) {
  19972. _vm.handleAction("cancel")
  19973. }
  19974. }
  19975. },
  19976. [
  19977. _vm._v(
  19978. "\n " +
  19979. _vm._s(
  19980. _vm.cancelButtonText ||
  19981. _vm.t("el.messagebox.cancel")
  19982. ) +
  19983. "\n "
  19984. )
  19985. ]
  19986. )
  19987. : _vm._e(),
  19988. _c(
  19989. "el-button",
  19990. {
  19991. directives: [
  19992. {
  19993. name: "show",
  19994. rawName: "v-show",
  19995. value: _vm.showConfirmButton,
  19996. expression: "showConfirmButton"
  19997. }
  19998. ],
  19999. ref: "confirm",
  20000. class: [_vm.confirmButtonClasses],
  20001. attrs: {
  20002. loading: _vm.confirmButtonLoading,
  20003. round: _vm.roundButton,
  20004. size: "small"
  20005. },
  20006. on: {
  20007. keydown: function($event) {
  20008. if (
  20009. !("button" in $event) &&
  20010. _vm._k(
  20011. $event.keyCode,
  20012. "enter",
  20013. 13,
  20014. $event.key,
  20015. "Enter"
  20016. )
  20017. ) {
  20018. return null
  20019. }
  20020. _vm.handleAction("confirm")
  20021. }
  20022. },
  20023. nativeOn: {
  20024. click: function($event) {
  20025. _vm.handleAction("confirm")
  20026. }
  20027. }
  20028. },
  20029. [
  20030. _vm._v(
  20031. "\n " +
  20032. _vm._s(
  20033. _vm.confirmButtonText ||
  20034. _vm.t("el.messagebox.confirm")
  20035. ) +
  20036. "\n "
  20037. )
  20038. ]
  20039. )
  20040. ],
  20041. 1
  20042. )
  20043. ]
  20044. )
  20045. ]
  20046. )
  20047. ])
  20048. }
  20049. var mainvue_type_template_id_6b29b012_staticRenderFns = []
  20050. mainvue_type_template_id_6b29b012_render._withStripped = true
  20051. // CONCATENATED MODULE: ./packages/message-box/src/main.vue?vue&type=template&id=6b29b012&
  20052. // EXTERNAL MODULE: external "element-ui/lib/locale"
  20053. var lib_locale_ = __webpack_require__(12);
  20054. var lib_locale_default = /*#__PURE__*/__webpack_require__.n(lib_locale_);
  20055. // EXTERNAL MODULE: external "element-ui/lib/utils/aria-dialog"
  20056. var aria_dialog_ = __webpack_require__(40);
  20057. var aria_dialog_default = /*#__PURE__*/__webpack_require__.n(aria_dialog_);
  20058. // 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&
  20059. //
  20060. //
  20061. //
  20062. //
  20063. //
  20064. //
  20065. //
  20066. //
  20067. //
  20068. //
  20069. //
  20070. //
  20071. //
  20072. //
  20073. //
  20074. //
  20075. //
  20076. //
  20077. //
  20078. //
  20079. //
  20080. //
  20081. //
  20082. //
  20083. //
  20084. //
  20085. //
  20086. //
  20087. //
  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. var messageBox = void 0;
  20140. var typeMap = {
  20141. success: 'success',
  20142. info: 'info',
  20143. warning: 'warning',
  20144. error: 'error'
  20145. };
  20146. /* harmony default export */ var message_box_src_mainvue_type_script_lang_js_ = ({
  20147. mixins: [popup_default.a, locale_default.a],
  20148. props: {
  20149. modal: {
  20150. default: true
  20151. },
  20152. lockScroll: {
  20153. default: true
  20154. },
  20155. showClose: {
  20156. type: Boolean,
  20157. default: true
  20158. },
  20159. closeOnClickModal: {
  20160. default: true
  20161. },
  20162. closeOnPressEscape: {
  20163. default: true
  20164. },
  20165. closeOnHashChange: {
  20166. default: true
  20167. },
  20168. center: {
  20169. default: false,
  20170. type: Boolean
  20171. },
  20172. roundButton: {
  20173. default: false,
  20174. type: Boolean
  20175. }
  20176. },
  20177. components: {
  20178. ElInput: input_default.a,
  20179. ElButton: button_default.a
  20180. },
  20181. computed: {
  20182. icon: function icon() {
  20183. var type = this.type,
  20184. iconClass = this.iconClass;
  20185. return iconClass || (type && typeMap[type] ? 'el-icon-' + typeMap[type] : '');
  20186. },
  20187. confirmButtonClasses: function confirmButtonClasses() {
  20188. return 'el-button--primary ' + this.confirmButtonClass;
  20189. },
  20190. cancelButtonClasses: function cancelButtonClasses() {
  20191. return '' + this.cancelButtonClass;
  20192. }
  20193. },
  20194. methods: {
  20195. getSafeClose: function getSafeClose() {
  20196. var _this = this;
  20197. var currentId = this.uid;
  20198. return function () {
  20199. _this.$nextTick(function () {
  20200. if (currentId === _this.uid) _this.doClose();
  20201. });
  20202. };
  20203. },
  20204. doClose: function doClose() {
  20205. var _this2 = this;
  20206. if (!this.visible) return;
  20207. this.visible = false;
  20208. this._closing = true;
  20209. this.onClose && this.onClose();
  20210. messageBox.closeDialog(); // 解绑
  20211. if (this.lockScroll) {
  20212. setTimeout(this.restoreBodyStyle, 200);
  20213. }
  20214. this.opened = false;
  20215. this.doAfterClose();
  20216. setTimeout(function () {
  20217. if (_this2.action) _this2.callback(_this2.action, _this2);
  20218. });
  20219. },
  20220. handleWrapperClick: function handleWrapperClick() {
  20221. if (this.closeOnClickModal) {
  20222. this.handleAction(this.distinguishCancelAndClose ? 'close' : 'cancel');
  20223. }
  20224. },
  20225. handleInputEnter: function handleInputEnter() {
  20226. if (this.inputType !== 'textarea') {
  20227. return this.handleAction('confirm');
  20228. }
  20229. },
  20230. handleAction: function handleAction(action) {
  20231. if (this.$type === 'prompt' && action === 'confirm' && !this.validate()) {
  20232. return;
  20233. }
  20234. this.action = action;
  20235. if (typeof this.beforeClose === 'function') {
  20236. this.close = this.getSafeClose();
  20237. this.beforeClose(action, this, this.close);
  20238. } else {
  20239. this.doClose();
  20240. }
  20241. },
  20242. validate: function validate() {
  20243. if (this.$type === 'prompt') {
  20244. var inputPattern = this.inputPattern;
  20245. if (inputPattern && !inputPattern.test(this.inputValue || '')) {
  20246. this.editorErrorMessage = this.inputErrorMessage || Object(lib_locale_["t"])('el.messagebox.error');
  20247. Object(dom_["addClass"])(this.getInputElement(), 'invalid');
  20248. return false;
  20249. }
  20250. var inputValidator = this.inputValidator;
  20251. if (typeof inputValidator === 'function') {
  20252. var validateResult = inputValidator(this.inputValue);
  20253. if (validateResult === false) {
  20254. this.editorErrorMessage = this.inputErrorMessage || Object(lib_locale_["t"])('el.messagebox.error');
  20255. Object(dom_["addClass"])(this.getInputElement(), 'invalid');
  20256. return false;
  20257. }
  20258. if (typeof validateResult === 'string') {
  20259. this.editorErrorMessage = validateResult;
  20260. Object(dom_["addClass"])(this.getInputElement(), 'invalid');
  20261. return false;
  20262. }
  20263. }
  20264. }
  20265. this.editorErrorMessage = '';
  20266. Object(dom_["removeClass"])(this.getInputElement(), 'invalid');
  20267. return true;
  20268. },
  20269. getFirstFocus: function getFirstFocus() {
  20270. var btn = this.$el.querySelector('.el-message-box__btns .el-button');
  20271. var title = this.$el.querySelector('.el-message-box__btns .el-message-box__title');
  20272. return btn || title;
  20273. },
  20274. getInputElement: function getInputElement() {
  20275. var inputRefs = this.$refs.input.$refs;
  20276. return inputRefs.input || inputRefs.textarea;
  20277. },
  20278. handleClose: function handleClose() {
  20279. this.handleAction('close');
  20280. }
  20281. },
  20282. watch: {
  20283. inputValue: {
  20284. immediate: true,
  20285. handler: function handler(val) {
  20286. var _this3 = this;
  20287. this.$nextTick(function (_) {
  20288. if (_this3.$type === 'prompt' && val !== null) {
  20289. _this3.validate();
  20290. }
  20291. });
  20292. }
  20293. },
  20294. visible: function visible(val) {
  20295. var _this4 = this;
  20296. if (val) {
  20297. this.uid++;
  20298. if (this.$type === 'alert' || this.$type === 'confirm') {
  20299. this.$nextTick(function () {
  20300. _this4.$refs.confirm.$el.focus();
  20301. });
  20302. }
  20303. this.focusAfterClosed = document.activeElement;
  20304. messageBox = new aria_dialog_default.a(this.$el, this.focusAfterClosed, this.getFirstFocus());
  20305. }
  20306. // prompt
  20307. if (this.$type !== 'prompt') return;
  20308. if (val) {
  20309. setTimeout(function () {
  20310. if (_this4.$refs.input && _this4.$refs.input.$el) {
  20311. _this4.getInputElement().focus();
  20312. }
  20313. }, 500);
  20314. } else {
  20315. this.editorErrorMessage = '';
  20316. Object(dom_["removeClass"])(this.getInputElement(), 'invalid');
  20317. }
  20318. }
  20319. },
  20320. mounted: function mounted() {
  20321. var _this5 = this;
  20322. this.$nextTick(function () {
  20323. if (_this5.closeOnHashChange) {
  20324. window.addEventListener('hashchange', _this5.close);
  20325. }
  20326. });
  20327. },
  20328. beforeDestroy: function beforeDestroy() {
  20329. if (this.closeOnHashChange) {
  20330. window.removeEventListener('hashchange', this.close);
  20331. }
  20332. setTimeout(function () {
  20333. messageBox.closeDialog();
  20334. });
  20335. },
  20336. data: function data() {
  20337. return {
  20338. uid: 1,
  20339. title: undefined,
  20340. message: '',
  20341. type: '',
  20342. iconClass: '',
  20343. customClass: '',
  20344. showInput: false,
  20345. inputValue: null,
  20346. inputPlaceholder: '',
  20347. inputType: 'text',
  20348. inputPattern: null,
  20349. inputValidator: null,
  20350. inputErrorMessage: '',
  20351. showConfirmButton: true,
  20352. showCancelButton: false,
  20353. action: '',
  20354. confirmButtonText: '',
  20355. cancelButtonText: '',
  20356. confirmButtonLoading: false,
  20357. cancelButtonLoading: false,
  20358. confirmButtonClass: '',
  20359. confirmButtonDisabled: false,
  20360. cancelButtonClass: '',
  20361. editorErrorMessage: null,
  20362. callback: null,
  20363. dangerouslyUseHTMLString: false,
  20364. focusAfterClosed: null,
  20365. isOnComposition: false,
  20366. distinguishCancelAndClose: false
  20367. };
  20368. }
  20369. });
  20370. // CONCATENATED MODULE: ./packages/message-box/src/main.vue?vue&type=script&lang=js&
  20371. /* harmony default export */ var packages_message_box_src_mainvue_type_script_lang_js_ = (message_box_src_mainvue_type_script_lang_js_);
  20372. // CONCATENATED MODULE: ./packages/message-box/src/main.vue
  20373. /* normalize component */
  20374. var src_main_component = normalizeComponent(
  20375. packages_message_box_src_mainvue_type_script_lang_js_,
  20376. mainvue_type_template_id_6b29b012_render,
  20377. mainvue_type_template_id_6b29b012_staticRenderFns,
  20378. false,
  20379. null,
  20380. null,
  20381. null
  20382. )
  20383. /* hot reload */
  20384. if (false) { var src_main_api; }
  20385. src_main_component.options.__file = "packages/message-box/src/main.vue"
  20386. /* harmony default export */ var message_box_src_main = (src_main_component.exports);
  20387. // EXTERNAL MODULE: external "element-ui/lib/utils/vdom"
  20388. var vdom_ = __webpack_require__(22);
  20389. // CONCATENATED MODULE: ./packages/message-box/src/main.js
  20390. 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; };
  20391. var main_defaults = {
  20392. title: null,
  20393. message: '',
  20394. type: '',
  20395. iconClass: '',
  20396. showInput: false,
  20397. showClose: true,
  20398. modalFade: true,
  20399. lockScroll: true,
  20400. closeOnClickModal: true,
  20401. closeOnPressEscape: true,
  20402. closeOnHashChange: true,
  20403. inputValue: null,
  20404. inputPlaceholder: '',
  20405. inputType: 'text',
  20406. inputPattern: null,
  20407. inputValidator: null,
  20408. inputErrorMessage: '',
  20409. showConfirmButton: true,
  20410. showCancelButton: false,
  20411. confirmButtonPosition: 'right',
  20412. confirmButtonHighlight: false,
  20413. cancelButtonHighlight: false,
  20414. confirmButtonText: '',
  20415. cancelButtonText: '',
  20416. confirmButtonClass: '',
  20417. cancelButtonClass: '',
  20418. customClass: '',
  20419. beforeClose: null,
  20420. dangerouslyUseHTMLString: false,
  20421. center: false,
  20422. roundButton: false,
  20423. distinguishCancelAndClose: false
  20424. };
  20425. var MessageBoxConstructor = external_vue_default.a.extend(message_box_src_main);
  20426. var currentMsg = void 0,
  20427. main_instance = void 0;
  20428. var msgQueue = [];
  20429. var defaultCallback = function defaultCallback(action) {
  20430. if (currentMsg) {
  20431. var callback = currentMsg.callback;
  20432. if (typeof callback === 'function') {
  20433. if (main_instance.showInput) {
  20434. callback(main_instance.inputValue, action);
  20435. } else {
  20436. callback(action);
  20437. }
  20438. }
  20439. if (currentMsg.resolve) {
  20440. if (action === 'confirm') {
  20441. if (main_instance.showInput) {
  20442. currentMsg.resolve({ value: main_instance.inputValue, action: action });
  20443. } else {
  20444. currentMsg.resolve(action);
  20445. }
  20446. } else if (currentMsg.reject && (action === 'cancel' || action === 'close')) {
  20447. currentMsg.reject(action);
  20448. }
  20449. }
  20450. }
  20451. };
  20452. var initInstance = function initInstance() {
  20453. main_instance = new MessageBoxConstructor({
  20454. el: document.createElement('div')
  20455. });
  20456. main_instance.callback = defaultCallback;
  20457. };
  20458. var main_showNextMsg = function showNextMsg() {
  20459. if (!main_instance) {
  20460. initInstance();
  20461. }
  20462. main_instance.action = '';
  20463. if (!main_instance.visible || main_instance.closeTimer) {
  20464. if (msgQueue.length > 0) {
  20465. currentMsg = msgQueue.shift();
  20466. var options = currentMsg.options;
  20467. for (var prop in options) {
  20468. if (options.hasOwnProperty(prop)) {
  20469. main_instance[prop] = options[prop];
  20470. }
  20471. }
  20472. if (options.callback === undefined) {
  20473. main_instance.callback = defaultCallback;
  20474. }
  20475. var oldCb = main_instance.callback;
  20476. main_instance.callback = function (action, instance) {
  20477. oldCb(action, instance);
  20478. showNextMsg();
  20479. };
  20480. if (Object(vdom_["isVNode"])(main_instance.message)) {
  20481. main_instance.$slots.default = [main_instance.message];
  20482. main_instance.message = null;
  20483. } else {
  20484. delete main_instance.$slots.default;
  20485. }
  20486. ['modal', 'showClose', 'closeOnClickModal', 'closeOnPressEscape', 'closeOnHashChange'].forEach(function (prop) {
  20487. if (main_instance[prop] === undefined) {
  20488. main_instance[prop] = true;
  20489. }
  20490. });
  20491. document.body.appendChild(main_instance.$el);
  20492. external_vue_default.a.nextTick(function () {
  20493. main_instance.visible = true;
  20494. });
  20495. }
  20496. }
  20497. };
  20498. var main_MessageBox = function MessageBox(options, callback) {
  20499. if (external_vue_default.a.prototype.$isServer) return;
  20500. if (typeof options === 'string' || Object(vdom_["isVNode"])(options)) {
  20501. options = {
  20502. message: options
  20503. };
  20504. if (typeof arguments[1] === 'string') {
  20505. options.title = arguments[1];
  20506. }
  20507. } else if (options.callback && !callback) {
  20508. callback = options.callback;
  20509. }
  20510. if (typeof Promise !== 'undefined') {
  20511. return new Promise(function (resolve, reject) {
  20512. // eslint-disable-line
  20513. msgQueue.push({
  20514. options: merge_default()({}, main_defaults, MessageBox.defaults, options),
  20515. callback: callback,
  20516. resolve: resolve,
  20517. reject: reject
  20518. });
  20519. main_showNextMsg();
  20520. });
  20521. } else {
  20522. msgQueue.push({
  20523. options: merge_default()({}, main_defaults, MessageBox.defaults, options),
  20524. callback: callback
  20525. });
  20526. main_showNextMsg();
  20527. }
  20528. };
  20529. main_MessageBox.setDefaults = function (defaults) {
  20530. main_MessageBox.defaults = defaults;
  20531. };
  20532. main_MessageBox.alert = function (message, title, options) {
  20533. if ((typeof title === 'undefined' ? 'undefined' : main_typeof(title)) === 'object') {
  20534. options = title;
  20535. title = '';
  20536. } else if (title === undefined) {
  20537. title = '';
  20538. }
  20539. return main_MessageBox(merge_default()({
  20540. title: title,
  20541. message: message,
  20542. $type: 'alert',
  20543. closeOnPressEscape: false,
  20544. closeOnClickModal: false
  20545. }, options));
  20546. };
  20547. main_MessageBox.confirm = function (message, title, options) {
  20548. if ((typeof title === 'undefined' ? 'undefined' : main_typeof(title)) === 'object') {
  20549. options = title;
  20550. title = '';
  20551. } else if (title === undefined) {
  20552. title = '';
  20553. }
  20554. return main_MessageBox(merge_default()({
  20555. title: title,
  20556. message: message,
  20557. $type: 'confirm',
  20558. showCancelButton: true
  20559. }, options));
  20560. };
  20561. main_MessageBox.prompt = 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. showCancelButton: true,
  20572. showInput: true,
  20573. $type: 'prompt'
  20574. }, options));
  20575. };
  20576. main_MessageBox.close = function () {
  20577. main_instance.doClose();
  20578. main_instance.visible = false;
  20579. msgQueue = [];
  20580. currentMsg = null;
  20581. };
  20582. /* harmony default export */ var packages_message_box_src_main = (main_MessageBox);
  20583. // CONCATENATED MODULE: ./packages/message-box/index.js
  20584. /* harmony default export */ var message_box = (packages_message_box_src_main);
  20585. // 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&
  20586. var breadcrumbvue_type_template_id_4b464c06_render = function() {
  20587. var _vm = this
  20588. var _h = _vm.$createElement
  20589. var _c = _vm._self._c || _h
  20590. return _c(
  20591. "div",
  20592. {
  20593. staticClass: "el-breadcrumb",
  20594. attrs: { "aria-label": "Breadcrumb", role: "navigation" }
  20595. },
  20596. [_vm._t("default")],
  20597. 2
  20598. )
  20599. }
  20600. var breadcrumbvue_type_template_id_4b464c06_staticRenderFns = []
  20601. breadcrumbvue_type_template_id_4b464c06_render._withStripped = true
  20602. // CONCATENATED MODULE: ./packages/breadcrumb/src/breadcrumb.vue?vue&type=template&id=4b464c06&
  20603. // 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&
  20604. //
  20605. //
  20606. //
  20607. //
  20608. //
  20609. /* harmony default export */ var breadcrumbvue_type_script_lang_js_ = ({
  20610. name: 'ElBreadcrumb',
  20611. props: {
  20612. separator: {
  20613. type: String,
  20614. default: '/'
  20615. },
  20616. separatorClass: {
  20617. type: String,
  20618. default: ''
  20619. }
  20620. },
  20621. provide: function provide() {
  20622. return {
  20623. elBreadcrumb: this
  20624. };
  20625. },
  20626. mounted: function mounted() {
  20627. var items = this.$el.querySelectorAll('.el-breadcrumb__item');
  20628. if (items.length) {
  20629. items[items.length - 1].setAttribute('aria-current', 'page');
  20630. }
  20631. }
  20632. });
  20633. // CONCATENATED MODULE: ./packages/breadcrumb/src/breadcrumb.vue?vue&type=script&lang=js&
  20634. /* harmony default export */ var src_breadcrumbvue_type_script_lang_js_ = (breadcrumbvue_type_script_lang_js_);
  20635. // CONCATENATED MODULE: ./packages/breadcrumb/src/breadcrumb.vue
  20636. /* normalize component */
  20637. var breadcrumb_component = normalizeComponent(
  20638. src_breadcrumbvue_type_script_lang_js_,
  20639. breadcrumbvue_type_template_id_4b464c06_render,
  20640. breadcrumbvue_type_template_id_4b464c06_staticRenderFns,
  20641. false,
  20642. null,
  20643. null,
  20644. null
  20645. )
  20646. /* hot reload */
  20647. if (false) { var breadcrumb_api; }
  20648. breadcrumb_component.options.__file = "packages/breadcrumb/src/breadcrumb.vue"
  20649. /* harmony default export */ var breadcrumb = (breadcrumb_component.exports);
  20650. // CONCATENATED MODULE: ./packages/breadcrumb/index.js
  20651. /* istanbul ignore next */
  20652. breadcrumb.install = function (Vue) {
  20653. Vue.component(breadcrumb.name, breadcrumb);
  20654. };
  20655. /* harmony default export */ var packages_breadcrumb = (breadcrumb);
  20656. // 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&
  20657. var breadcrumb_itemvue_type_template_id_fcf9eaac_render = function() {
  20658. var _vm = this
  20659. var _h = _vm.$createElement
  20660. var _c = _vm._self._c || _h
  20661. return _c("span", { staticClass: "el-breadcrumb__item" }, [
  20662. _c(
  20663. "span",
  20664. {
  20665. ref: "link",
  20666. class: ["el-breadcrumb__inner", _vm.to ? "is-link" : ""],
  20667. attrs: { role: "link" }
  20668. },
  20669. [_vm._t("default")],
  20670. 2
  20671. ),
  20672. _vm.separatorClass
  20673. ? _c("i", {
  20674. staticClass: "el-breadcrumb__separator",
  20675. class: _vm.separatorClass
  20676. })
  20677. : _c(
  20678. "span",
  20679. {
  20680. staticClass: "el-breadcrumb__separator",
  20681. attrs: { role: "presentation" }
  20682. },
  20683. [_vm._v(_vm._s(_vm.separator))]
  20684. )
  20685. ])
  20686. }
  20687. var breadcrumb_itemvue_type_template_id_fcf9eaac_staticRenderFns = []
  20688. breadcrumb_itemvue_type_template_id_fcf9eaac_render._withStripped = true
  20689. // CONCATENATED MODULE: ./packages/breadcrumb/src/breadcrumb-item.vue?vue&type=template&id=fcf9eaac&
  20690. // 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&
  20691. //
  20692. //
  20693. //
  20694. //
  20695. //
  20696. //
  20697. //
  20698. //
  20699. //
  20700. //
  20701. //
  20702. //
  20703. /* harmony default export */ var breadcrumb_itemvue_type_script_lang_js_ = ({
  20704. name: 'ElBreadcrumbItem',
  20705. props: {
  20706. to: {},
  20707. replace: Boolean
  20708. },
  20709. data: function data() {
  20710. return {
  20711. separator: '',
  20712. separatorClass: ''
  20713. };
  20714. },
  20715. inject: ['elBreadcrumb'],
  20716. mounted: function mounted() {
  20717. var _this = this;
  20718. this.separator = this.elBreadcrumb.separator;
  20719. this.separatorClass = this.elBreadcrumb.separatorClass;
  20720. var link = this.$refs.link;
  20721. link.setAttribute('role', 'link');
  20722. link.addEventListener('click', function (_) {
  20723. var to = _this.to,
  20724. $router = _this.$router;
  20725. if (!to || !$router) return;
  20726. _this.replace ? $router.replace(to) : $router.push(to);
  20727. });
  20728. }
  20729. });
  20730. // CONCATENATED MODULE: ./packages/breadcrumb/src/breadcrumb-item.vue?vue&type=script&lang=js&
  20731. /* harmony default export */ var src_breadcrumb_itemvue_type_script_lang_js_ = (breadcrumb_itemvue_type_script_lang_js_);
  20732. // CONCATENATED MODULE: ./packages/breadcrumb/src/breadcrumb-item.vue
  20733. /* normalize component */
  20734. var breadcrumb_item_component = normalizeComponent(
  20735. src_breadcrumb_itemvue_type_script_lang_js_,
  20736. breadcrumb_itemvue_type_template_id_fcf9eaac_render,
  20737. breadcrumb_itemvue_type_template_id_fcf9eaac_staticRenderFns,
  20738. false,
  20739. null,
  20740. null,
  20741. null
  20742. )
  20743. /* hot reload */
  20744. if (false) { var breadcrumb_item_api; }
  20745. breadcrumb_item_component.options.__file = "packages/breadcrumb/src/breadcrumb-item.vue"
  20746. /* harmony default export */ var breadcrumb_item = (breadcrumb_item_component.exports);
  20747. // CONCATENATED MODULE: ./packages/breadcrumb-item/index.js
  20748. /* istanbul ignore next */
  20749. breadcrumb_item.install = function (Vue) {
  20750. Vue.component(breadcrumb_item.name, breadcrumb_item);
  20751. };
  20752. /* harmony default export */ var packages_breadcrumb_item = (breadcrumb_item);
  20753. // 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&
  20754. var formvue_type_template_id_a1b5ff34_render = function() {
  20755. var _vm = this
  20756. var _h = _vm.$createElement
  20757. var _c = _vm._self._c || _h
  20758. return _c(
  20759. "form",
  20760. {
  20761. staticClass: "el-form",
  20762. class: [
  20763. _vm.labelPosition ? "el-form--label-" + _vm.labelPosition : "",
  20764. { "el-form--inline": _vm.inline }
  20765. ]
  20766. },
  20767. [_vm._t("default")],
  20768. 2
  20769. )
  20770. }
  20771. var formvue_type_template_id_a1b5ff34_staticRenderFns = []
  20772. formvue_type_template_id_a1b5ff34_render._withStripped = true
  20773. // CONCATENATED MODULE: ./packages/form/src/form.vue?vue&type=template&id=a1b5ff34&
  20774. // 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&
  20775. //
  20776. //
  20777. //
  20778. //
  20779. //
  20780. //
  20781. //
  20782. //
  20783. /* harmony default export */ var formvue_type_script_lang_js_ = ({
  20784. name: 'ElForm',
  20785. componentName: 'ElForm',
  20786. provide: function provide() {
  20787. return {
  20788. elForm: this
  20789. };
  20790. },
  20791. props: {
  20792. model: Object,
  20793. rules: Object,
  20794. labelPosition: String,
  20795. labelWidth: String,
  20796. labelSuffix: {
  20797. type: String,
  20798. default: ''
  20799. },
  20800. inline: Boolean,
  20801. inlineMessage: Boolean,
  20802. statusIcon: Boolean,
  20803. showMessage: {
  20804. type: Boolean,
  20805. default: true
  20806. },
  20807. size: String,
  20808. disabled: Boolean,
  20809. validateOnRuleChange: {
  20810. type: Boolean,
  20811. default: true
  20812. },
  20813. hideRequiredAsterisk: {
  20814. type: Boolean,
  20815. default: false
  20816. }
  20817. },
  20818. watch: {
  20819. rules: function rules() {
  20820. // remove then add event listeners on form-item after form rules change
  20821. this.fields.forEach(function (field) {
  20822. field.removeValidateEvents();
  20823. field.addValidateEvents();
  20824. });
  20825. if (this.validateOnRuleChange) {
  20826. this.validate(function () {});
  20827. }
  20828. }
  20829. },
  20830. computed: {
  20831. autoLabelWidth: function autoLabelWidth() {
  20832. if (!this.potentialLabelWidthArr.length) return 0;
  20833. var max = Math.max.apply(Math, this.potentialLabelWidthArr);
  20834. return max ? max + 'px' : '';
  20835. }
  20836. },
  20837. data: function data() {
  20838. return {
  20839. fields: [],
  20840. potentialLabelWidthArr: [] // use this array to calculate auto width
  20841. };
  20842. },
  20843. created: function created() {
  20844. var _this = this;
  20845. this.$on('el.form.addField', function (field) {
  20846. if (field) {
  20847. _this.fields.push(field);
  20848. }
  20849. });
  20850. /* istanbul ignore next */
  20851. this.$on('el.form.removeField', function (field) {
  20852. if (field.prop) {
  20853. _this.fields.splice(_this.fields.indexOf(field), 1);
  20854. }
  20855. });
  20856. },
  20857. methods: {
  20858. resetFields: function resetFields() {
  20859. if (!this.model) {
  20860. console.warn('[Element Warn][Form]model is required for resetFields to work.');
  20861. return;
  20862. }
  20863. this.fields.forEach(function (field) {
  20864. field.resetField();
  20865. });
  20866. },
  20867. clearValidate: function clearValidate() {
  20868. var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  20869. var fields = props.length ? typeof props === 'string' ? this.fields.filter(function (field) {
  20870. return props === field.prop;
  20871. }) : this.fields.filter(function (field) {
  20872. return props.indexOf(field.prop) > -1;
  20873. }) : this.fields;
  20874. fields.forEach(function (field) {
  20875. field.clearValidate();
  20876. });
  20877. },
  20878. validate: function validate(callback) {
  20879. var _this2 = this;
  20880. if (!this.model) {
  20881. console.warn('[Element Warn][Form]model is required for validate to work!');
  20882. return;
  20883. }
  20884. var promise = void 0;
  20885. // if no callback, return promise
  20886. if (typeof callback !== 'function' && window.Promise) {
  20887. promise = new window.Promise(function (resolve, reject) {
  20888. callback = function callback(valid, invalidFields) {
  20889. valid ? resolve(valid) : reject(invalidFields);
  20890. };
  20891. });
  20892. }
  20893. var valid = true;
  20894. var count = 0;
  20895. // 如果需要验证的fields为空,调用验证时立刻返回callback
  20896. if (this.fields.length === 0 && callback) {
  20897. callback(true);
  20898. }
  20899. var invalidFields = {};
  20900. this.fields.forEach(function (field) {
  20901. field.validate('', function (message, field) {
  20902. if (message) {
  20903. valid = false;
  20904. }
  20905. invalidFields = merge_default()({}, invalidFields, field);
  20906. if (typeof callback === 'function' && ++count === _this2.fields.length) {
  20907. callback(valid, invalidFields);
  20908. }
  20909. });
  20910. });
  20911. if (promise) {
  20912. return promise;
  20913. }
  20914. },
  20915. validateField: function validateField(props, cb) {
  20916. props = [].concat(props);
  20917. var fields = this.fields.filter(function (field) {
  20918. return props.indexOf(field.prop) !== -1;
  20919. });
  20920. if (!fields.length) {
  20921. console.warn('[Element Warn]please pass correct props!');
  20922. return;
  20923. }
  20924. fields.forEach(function (field) {
  20925. field.validate('', cb);
  20926. });
  20927. },
  20928. getLabelWidthIndex: function getLabelWidthIndex(width) {
  20929. var index = this.potentialLabelWidthArr.indexOf(width);
  20930. // it's impossible
  20931. if (index === -1) {
  20932. throw new Error('[ElementForm]unpected width ', width);
  20933. }
  20934. return index;
  20935. },
  20936. registerLabelWidth: function registerLabelWidth(val, oldVal) {
  20937. if (val && oldVal) {
  20938. var index = this.getLabelWidthIndex(oldVal);
  20939. this.potentialLabelWidthArr.splice(index, 1, val);
  20940. } else if (val) {
  20941. this.potentialLabelWidthArr.push(val);
  20942. }
  20943. },
  20944. deregisterLabelWidth: function deregisterLabelWidth(val) {
  20945. var index = this.getLabelWidthIndex(val);
  20946. this.potentialLabelWidthArr.splice(index, 1);
  20947. }
  20948. }
  20949. });
  20950. // CONCATENATED MODULE: ./packages/form/src/form.vue?vue&type=script&lang=js&
  20951. /* harmony default export */ var src_formvue_type_script_lang_js_ = (formvue_type_script_lang_js_);
  20952. // CONCATENATED MODULE: ./packages/form/src/form.vue
  20953. /* normalize component */
  20954. var form_component = normalizeComponent(
  20955. src_formvue_type_script_lang_js_,
  20956. formvue_type_template_id_a1b5ff34_render,
  20957. formvue_type_template_id_a1b5ff34_staticRenderFns,
  20958. false,
  20959. null,
  20960. null,
  20961. null
  20962. )
  20963. /* hot reload */
  20964. if (false) { var form_api; }
  20965. form_component.options.__file = "packages/form/src/form.vue"
  20966. /* harmony default export */ var src_form = (form_component.exports);
  20967. // CONCATENATED MODULE: ./packages/form/index.js
  20968. /* istanbul ignore next */
  20969. src_form.install = function (Vue) {
  20970. Vue.component(src_form.name, src_form);
  20971. };
  20972. /* harmony default export */ var packages_form = (src_form);
  20973. // 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&
  20974. var form_itemvue_type_template_id_b6f3db6c_render = function() {
  20975. var _vm = this
  20976. var _h = _vm.$createElement
  20977. var _c = _vm._self._c || _h
  20978. return _c(
  20979. "div",
  20980. {
  20981. staticClass: "el-form-item",
  20982. class: [
  20983. {
  20984. "el-form-item--feedback": _vm.elForm && _vm.elForm.statusIcon,
  20985. "is-error": _vm.validateState === "error",
  20986. "is-validating": _vm.validateState === "validating",
  20987. "is-success": _vm.validateState === "success",
  20988. "is-required": _vm.isRequired || _vm.required,
  20989. "is-no-asterisk": _vm.elForm && _vm.elForm.hideRequiredAsterisk
  20990. },
  20991. _vm.sizeClass ? "el-form-item--" + _vm.sizeClass : ""
  20992. ]
  20993. },
  20994. [
  20995. _c(
  20996. "label-wrap",
  20997. {
  20998. attrs: {
  20999. "is-auto-width": _vm.labelStyle && _vm.labelStyle.width === "auto",
  21000. "update-all": _vm.form.labelWidth === "auto"
  21001. }
  21002. },
  21003. [
  21004. _vm.label || _vm.$slots.label
  21005. ? _c(
  21006. "label",
  21007. {
  21008. staticClass: "el-form-item__label",
  21009. style: _vm.labelStyle,
  21010. attrs: { for: _vm.labelFor }
  21011. },
  21012. [
  21013. _vm._t("label", [
  21014. _vm._v(_vm._s(_vm.label + _vm.form.labelSuffix))
  21015. ])
  21016. ],
  21017. 2
  21018. )
  21019. : _vm._e()
  21020. ]
  21021. ),
  21022. _c(
  21023. "div",
  21024. { staticClass: "el-form-item__content", style: _vm.contentStyle },
  21025. [
  21026. _vm._t("default"),
  21027. _c(
  21028. "transition",
  21029. { attrs: { name: "el-zoom-in-top" } },
  21030. [
  21031. _vm.validateState === "error" &&
  21032. _vm.showMessage &&
  21033. _vm.form.showMessage
  21034. ? _vm._t(
  21035. "error",
  21036. [
  21037. _c(
  21038. "div",
  21039. {
  21040. staticClass: "el-form-item__error",
  21041. class: {
  21042. "el-form-item__error--inline":
  21043. typeof _vm.inlineMessage === "boolean"
  21044. ? _vm.inlineMessage
  21045. : (_vm.elForm && _vm.elForm.inlineMessage) ||
  21046. false
  21047. }
  21048. },
  21049. [
  21050. _vm._v(
  21051. "\n " +
  21052. _vm._s(_vm.validateMessage) +
  21053. "\n "
  21054. )
  21055. ]
  21056. )
  21057. ],
  21058. { error: _vm.validateMessage }
  21059. )
  21060. : _vm._e()
  21061. ],
  21062. 2
  21063. )
  21064. ],
  21065. 2
  21066. )
  21067. ],
  21068. 1
  21069. )
  21070. }
  21071. var form_itemvue_type_template_id_b6f3db6c_staticRenderFns = []
  21072. form_itemvue_type_template_id_b6f3db6c_render._withStripped = true
  21073. // CONCATENATED MODULE: ./packages/form/src/form-item.vue?vue&type=template&id=b6f3db6c&
  21074. // EXTERNAL MODULE: external "async-validator"
  21075. var external_async_validator_ = __webpack_require__(41);
  21076. var external_async_validator_default = /*#__PURE__*/__webpack_require__.n(external_async_validator_);
  21077. // 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&
  21078. /* harmony default export */ var label_wrapvue_type_script_lang_js_ = ({
  21079. props: {
  21080. isAutoWidth: Boolean,
  21081. updateAll: Boolean
  21082. },
  21083. inject: ['elForm', 'elFormItem'],
  21084. render: function render() {
  21085. var h = arguments[0];
  21086. var slots = this.$slots.default;
  21087. if (!slots) return null;
  21088. if (this.isAutoWidth) {
  21089. var autoLabelWidth = this.elForm.autoLabelWidth;
  21090. var style = {};
  21091. if (autoLabelWidth && autoLabelWidth !== 'auto') {
  21092. var marginLeft = parseInt(autoLabelWidth, 10) - this.computedWidth;
  21093. if (marginLeft) {
  21094. style.marginLeft = marginLeft + 'px';
  21095. }
  21096. }
  21097. return h(
  21098. 'div',
  21099. { 'class': 'el-form-item__label-wrap', style: style },
  21100. [slots]
  21101. );
  21102. } else {
  21103. return slots[0];
  21104. }
  21105. },
  21106. methods: {
  21107. getLabelWidth: function getLabelWidth() {
  21108. if (this.$el && this.$el.firstElementChild) {
  21109. var computedWidth = window.getComputedStyle(this.$el.firstElementChild).width;
  21110. return Math.ceil(parseFloat(computedWidth));
  21111. } else {
  21112. return 0;
  21113. }
  21114. },
  21115. updateLabelWidth: function updateLabelWidth() {
  21116. var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'update';
  21117. if (this.$slots.default && this.isAutoWidth && this.$el.firstElementChild) {
  21118. if (action === 'update') {
  21119. this.computedWidth = this.getLabelWidth();
  21120. } else if (action === 'remove') {
  21121. this.elForm.deregisterLabelWidth(this.computedWidth);
  21122. }
  21123. }
  21124. }
  21125. },
  21126. watch: {
  21127. computedWidth: function computedWidth(val, oldVal) {
  21128. if (this.updateAll) {
  21129. this.elForm.registerLabelWidth(val, oldVal);
  21130. this.elFormItem.updateComputedLabelWidth(val);
  21131. }
  21132. }
  21133. },
  21134. data: function data() {
  21135. return {
  21136. computedWidth: 0
  21137. };
  21138. },
  21139. mounted: function mounted() {
  21140. this.updateLabelWidth('update');
  21141. },
  21142. updated: function updated() {
  21143. this.updateLabelWidth('update');
  21144. },
  21145. beforeDestroy: function beforeDestroy() {
  21146. this.updateLabelWidth('remove');
  21147. }
  21148. });
  21149. // CONCATENATED MODULE: ./packages/form/src/label-wrap.vue?vue&type=script&lang=js&
  21150. /* harmony default export */ var src_label_wrapvue_type_script_lang_js_ = (label_wrapvue_type_script_lang_js_);
  21151. // CONCATENATED MODULE: ./packages/form/src/label-wrap.vue
  21152. var label_wrap_render, label_wrap_staticRenderFns
  21153. /* normalize component */
  21154. var label_wrap_component = normalizeComponent(
  21155. src_label_wrapvue_type_script_lang_js_,
  21156. label_wrap_render,
  21157. label_wrap_staticRenderFns,
  21158. false,
  21159. null,
  21160. null,
  21161. null
  21162. )
  21163. /* hot reload */
  21164. if (false) { var label_wrap_api; }
  21165. label_wrap_component.options.__file = "packages/form/src/label-wrap.vue"
  21166. /* harmony default export */ var label_wrap = (label_wrap_component.exports);
  21167. // 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&
  21168. //
  21169. //
  21170. //
  21171. //
  21172. //
  21173. //
  21174. //
  21175. //
  21176. //
  21177. //
  21178. //
  21179. //
  21180. //
  21181. //
  21182. //
  21183. //
  21184. //
  21185. //
  21186. //
  21187. //
  21188. //
  21189. //
  21190. //
  21191. //
  21192. //
  21193. //
  21194. //
  21195. //
  21196. //
  21197. //
  21198. //
  21199. //
  21200. //
  21201. //
  21202. //
  21203. //
  21204. //
  21205. //
  21206. //
  21207. //
  21208. /* harmony default export */ var form_itemvue_type_script_lang_js_ = ({
  21209. name: 'ElFormItem',
  21210. componentName: 'ElFormItem',
  21211. mixins: [emitter_default.a],
  21212. provide: function provide() {
  21213. return {
  21214. elFormItem: this
  21215. };
  21216. },
  21217. inject: ['elForm'],
  21218. props: {
  21219. label: String,
  21220. labelWidth: String,
  21221. prop: String,
  21222. required: {
  21223. type: Boolean,
  21224. default: undefined
  21225. },
  21226. rules: [Object, Array],
  21227. error: String,
  21228. validateStatus: String,
  21229. for: String,
  21230. inlineMessage: {
  21231. type: [String, Boolean],
  21232. default: ''
  21233. },
  21234. showMessage: {
  21235. type: Boolean,
  21236. default: true
  21237. },
  21238. size: String
  21239. },
  21240. components: {
  21241. // use this component to calculate auto width
  21242. LabelWrap: label_wrap
  21243. },
  21244. watch: {
  21245. error: {
  21246. immediate: true,
  21247. handler: function handler(value) {
  21248. this.validateMessage = value;
  21249. this.validateState = value ? 'error' : '';
  21250. }
  21251. },
  21252. validateStatus: function validateStatus(value) {
  21253. this.validateState = value;
  21254. },
  21255. rules: function rules(value) {
  21256. if ((!value || value.length === 0) && this.required === undefined) {
  21257. this.clearValidate();
  21258. }
  21259. }
  21260. },
  21261. computed: {
  21262. labelFor: function labelFor() {
  21263. return this.for || this.prop;
  21264. },
  21265. labelStyle: function labelStyle() {
  21266. var ret = {};
  21267. if (this.form.labelPosition === 'top') return ret;
  21268. var labelWidth = this.labelWidth || this.form.labelWidth;
  21269. if (labelWidth) {
  21270. ret.width = labelWidth;
  21271. }
  21272. return ret;
  21273. },
  21274. contentStyle: function contentStyle() {
  21275. var ret = {};
  21276. var label = this.label;
  21277. if (this.form.labelPosition === 'top' || this.form.inline) return ret;
  21278. if (!label && !this.labelWidth && this.isNested) return ret;
  21279. var labelWidth = this.labelWidth || this.form.labelWidth;
  21280. if (labelWidth === 'auto') {
  21281. if (this.labelWidth === 'auto') {
  21282. ret.marginLeft = this.computedLabelWidth;
  21283. } else if (this.form.labelWidth === 'auto') {
  21284. ret.marginLeft = this.elForm.autoLabelWidth;
  21285. }
  21286. } else {
  21287. ret.marginLeft = labelWidth;
  21288. }
  21289. return ret;
  21290. },
  21291. form: function form() {
  21292. var parent = this.$parent;
  21293. var parentName = parent.$options.componentName;
  21294. while (parentName !== 'ElForm') {
  21295. if (parentName === 'ElFormItem') {
  21296. this.isNested = true;
  21297. }
  21298. parent = parent.$parent;
  21299. parentName = parent.$options.componentName;
  21300. }
  21301. return parent;
  21302. },
  21303. fieldValue: function fieldValue() {
  21304. var model = this.form.model;
  21305. if (!model || !this.prop) {
  21306. return;
  21307. }
  21308. var path = this.prop;
  21309. if (path.indexOf(':') !== -1) {
  21310. path = path.replace(/:/, '.');
  21311. }
  21312. return Object(util_["getPropByPath"])(model, path, true).v;
  21313. },
  21314. isRequired: function isRequired() {
  21315. var rules = this.getRules();
  21316. var isRequired = false;
  21317. if (rules && rules.length) {
  21318. rules.every(function (rule) {
  21319. if (rule.required) {
  21320. isRequired = true;
  21321. return false;
  21322. }
  21323. return true;
  21324. });
  21325. }
  21326. return isRequired;
  21327. },
  21328. _formSize: function _formSize() {
  21329. return this.elForm.size;
  21330. },
  21331. elFormItemSize: function elFormItemSize() {
  21332. return this.size || this._formSize;
  21333. },
  21334. sizeClass: function sizeClass() {
  21335. return this.elFormItemSize || (this.$ELEMENT || {}).size;
  21336. }
  21337. },
  21338. data: function data() {
  21339. return {
  21340. validateState: '',
  21341. validateMessage: '',
  21342. validateDisabled: false,
  21343. validator: {},
  21344. isNested: false,
  21345. computedLabelWidth: ''
  21346. };
  21347. },
  21348. methods: {
  21349. validate: function validate(trigger) {
  21350. var _this = this;
  21351. var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : util_["noop"];
  21352. this.validateDisabled = false;
  21353. var rules = this.getFilteredRule(trigger);
  21354. if ((!rules || rules.length === 0) && this.required === undefined) {
  21355. callback();
  21356. return true;
  21357. }
  21358. this.validateState = 'validating';
  21359. var descriptor = {};
  21360. if (rules && rules.length > 0) {
  21361. rules.forEach(function (rule) {
  21362. delete rule.trigger;
  21363. });
  21364. }
  21365. descriptor[this.prop] = rules;
  21366. var validator = new external_async_validator_default.a(descriptor);
  21367. var model = {};
  21368. model[this.prop] = this.fieldValue;
  21369. validator.validate(model, { firstFields: true }, function (errors, invalidFields) {
  21370. _this.validateState = !errors ? 'success' : 'error';
  21371. _this.validateMessage = errors ? errors[0].message : '';
  21372. callback(_this.validateMessage, invalidFields);
  21373. _this.elForm && _this.elForm.$emit('validate', _this.prop, !errors, _this.validateMessage || null);
  21374. });
  21375. },
  21376. clearValidate: function clearValidate() {
  21377. this.validateState = '';
  21378. this.validateMessage = '';
  21379. this.validateDisabled = false;
  21380. },
  21381. resetField: function resetField() {
  21382. var _this2 = this;
  21383. this.validateState = '';
  21384. this.validateMessage = '';
  21385. var model = this.form.model;
  21386. var value = this.fieldValue;
  21387. var path = this.prop;
  21388. if (path.indexOf(':') !== -1) {
  21389. path = path.replace(/:/, '.');
  21390. }
  21391. var prop = Object(util_["getPropByPath"])(model, path, true);
  21392. this.validateDisabled = true;
  21393. if (Array.isArray(value)) {
  21394. prop.o[prop.k] = [].concat(this.initialValue);
  21395. } else {
  21396. prop.o[prop.k] = this.initialValue;
  21397. }
  21398. // reset validateDisabled after onFieldChange triggered
  21399. this.$nextTick(function () {
  21400. _this2.validateDisabled = false;
  21401. });
  21402. this.broadcast('ElTimeSelect', 'fieldReset', this.initialValue);
  21403. },
  21404. getRules: function getRules() {
  21405. var formRules = this.form.rules;
  21406. var selfRules = this.rules;
  21407. var requiredRule = this.required !== undefined ? { required: !!this.required } : [];
  21408. var prop = Object(util_["getPropByPath"])(formRules, this.prop || '');
  21409. formRules = formRules ? prop.o[this.prop || ''] || prop.v : [];
  21410. return [].concat(selfRules || formRules || []).concat(requiredRule);
  21411. },
  21412. getFilteredRule: function getFilteredRule(trigger) {
  21413. var rules = this.getRules();
  21414. return rules.filter(function (rule) {
  21415. if (!rule.trigger || trigger === '') return true;
  21416. if (Array.isArray(rule.trigger)) {
  21417. return rule.trigger.indexOf(trigger) > -1;
  21418. } else {
  21419. return rule.trigger === trigger;
  21420. }
  21421. }).map(function (rule) {
  21422. return merge_default()({}, rule);
  21423. });
  21424. },
  21425. onFieldBlur: function onFieldBlur() {
  21426. this.validate('blur');
  21427. },
  21428. onFieldChange: function onFieldChange() {
  21429. if (this.validateDisabled) {
  21430. this.validateDisabled = false;
  21431. return;
  21432. }
  21433. this.validate('change');
  21434. },
  21435. updateComputedLabelWidth: function updateComputedLabelWidth(width) {
  21436. this.computedLabelWidth = width ? width + 'px' : '';
  21437. },
  21438. addValidateEvents: function addValidateEvents() {
  21439. var rules = this.getRules();
  21440. if (rules.length || this.required !== undefined) {
  21441. this.$on('el.form.blur', this.onFieldBlur);
  21442. this.$on('el.form.change', this.onFieldChange);
  21443. }
  21444. },
  21445. removeValidateEvents: function removeValidateEvents() {
  21446. this.$off();
  21447. }
  21448. },
  21449. mounted: function mounted() {
  21450. if (this.prop) {
  21451. this.dispatch('ElForm', 'el.form.addField', [this]);
  21452. var initialValue = this.fieldValue;
  21453. if (Array.isArray(initialValue)) {
  21454. initialValue = [].concat(initialValue);
  21455. }
  21456. Object.defineProperty(this, 'initialValue', {
  21457. value: initialValue
  21458. });
  21459. this.addValidateEvents();
  21460. }
  21461. },
  21462. beforeDestroy: function beforeDestroy() {
  21463. this.dispatch('ElForm', 'el.form.removeField', [this]);
  21464. }
  21465. });
  21466. // CONCATENATED MODULE: ./packages/form/src/form-item.vue?vue&type=script&lang=js&
  21467. /* harmony default export */ var src_form_itemvue_type_script_lang_js_ = (form_itemvue_type_script_lang_js_);
  21468. // CONCATENATED MODULE: ./packages/form/src/form-item.vue
  21469. /* normalize component */
  21470. var form_item_component = normalizeComponent(
  21471. src_form_itemvue_type_script_lang_js_,
  21472. form_itemvue_type_template_id_b6f3db6c_render,
  21473. form_itemvue_type_template_id_b6f3db6c_staticRenderFns,
  21474. false,
  21475. null,
  21476. null,
  21477. null
  21478. )
  21479. /* hot reload */
  21480. if (false) { var form_item_api; }
  21481. form_item_component.options.__file = "packages/form/src/form-item.vue"
  21482. /* harmony default export */ var form_item = (form_item_component.exports);
  21483. // CONCATENATED MODULE: ./packages/form-item/index.js
  21484. /* istanbul ignore next */
  21485. form_item.install = function (Vue) {
  21486. Vue.component(form_item.name, form_item);
  21487. };
  21488. /* harmony default export */ var packages_form_item = (form_item);
  21489. // 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&
  21490. var tab_barvue_type_template_id_2031f33a_render = function() {
  21491. var _vm = this
  21492. var _h = _vm.$createElement
  21493. var _c = _vm._self._c || _h
  21494. return _c("div", {
  21495. staticClass: "el-tabs__active-bar",
  21496. class: "is-" + _vm.rootTabs.tabPosition,
  21497. style: _vm.barStyle
  21498. })
  21499. }
  21500. var tab_barvue_type_template_id_2031f33a_staticRenderFns = []
  21501. tab_barvue_type_template_id_2031f33a_render._withStripped = true
  21502. // CONCATENATED MODULE: ./packages/tabs/src/tab-bar.vue?vue&type=template&id=2031f33a&
  21503. // 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&
  21504. //
  21505. //
  21506. //
  21507. /* harmony default export */ var tab_barvue_type_script_lang_js_ = ({
  21508. name: 'TabBar',
  21509. props: {
  21510. tabs: Array
  21511. },
  21512. inject: ['rootTabs'],
  21513. computed: {
  21514. barStyle: {
  21515. get: function get() {
  21516. var _this = this;
  21517. var style = {};
  21518. var offset = 0;
  21519. var tabSize = 0;
  21520. var sizeName = ['top', 'bottom'].indexOf(this.rootTabs.tabPosition) !== -1 ? 'width' : 'height';
  21521. var sizeDir = sizeName === 'width' ? 'x' : 'y';
  21522. var firstUpperCase = function firstUpperCase(str) {
  21523. return str.toLowerCase().replace(/( |^)[a-z]/g, function (L) {
  21524. return L.toUpperCase();
  21525. });
  21526. };
  21527. this.tabs.every(function (tab, index) {
  21528. var $el = Object(util_["arrayFind"])(_this.$parent.$refs.tabs || [], function (t) {
  21529. return t.id.replace('tab-', '') === tab.paneName;
  21530. });
  21531. if (!$el) {
  21532. return false;
  21533. }
  21534. if (!tab.active) {
  21535. offset += $el['client' + firstUpperCase(sizeName)];
  21536. return true;
  21537. } else {
  21538. tabSize = $el['client' + firstUpperCase(sizeName)];
  21539. var tabStyles = window.getComputedStyle($el);
  21540. if (sizeName === 'width' && _this.tabs.length > 1) {
  21541. tabSize -= parseFloat(tabStyles.paddingLeft) + parseFloat(tabStyles.paddingRight);
  21542. }
  21543. if (sizeName === 'width') {
  21544. offset += parseFloat(tabStyles.paddingLeft);
  21545. }
  21546. return false;
  21547. }
  21548. });
  21549. var transform = 'translate' + firstUpperCase(sizeDir) + '(' + offset + 'px)';
  21550. style[sizeName] = tabSize + 'px';
  21551. style.transform = transform;
  21552. style.msTransform = transform;
  21553. style.webkitTransform = transform;
  21554. return style;
  21555. }
  21556. }
  21557. }
  21558. });
  21559. // CONCATENATED MODULE: ./packages/tabs/src/tab-bar.vue?vue&type=script&lang=js&
  21560. /* harmony default export */ var src_tab_barvue_type_script_lang_js_ = (tab_barvue_type_script_lang_js_);
  21561. // CONCATENATED MODULE: ./packages/tabs/src/tab-bar.vue
  21562. /* normalize component */
  21563. var tab_bar_component = normalizeComponent(
  21564. src_tab_barvue_type_script_lang_js_,
  21565. tab_barvue_type_template_id_2031f33a_render,
  21566. tab_barvue_type_template_id_2031f33a_staticRenderFns,
  21567. false,
  21568. null,
  21569. null,
  21570. null
  21571. )
  21572. /* hot reload */
  21573. if (false) { var tab_bar_api; }
  21574. tab_bar_component.options.__file = "packages/tabs/src/tab-bar.vue"
  21575. /* harmony default export */ var tab_bar = (tab_bar_component.exports);
  21576. // 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&
  21577. function noop() {}
  21578. var tab_navvue_type_script_lang_js_firstUpperCase = function firstUpperCase(str) {
  21579. return str.toLowerCase().replace(/( |^)[a-z]/g, function (L) {
  21580. return L.toUpperCase();
  21581. });
  21582. };
  21583. /* harmony default export */ var tab_navvue_type_script_lang_js_ = ({
  21584. name: 'TabNav',
  21585. components: {
  21586. TabBar: tab_bar
  21587. },
  21588. inject: ['rootTabs'],
  21589. props: {
  21590. panes: Array,
  21591. currentName: String,
  21592. editable: Boolean,
  21593. onTabClick: {
  21594. type: Function,
  21595. default: noop
  21596. },
  21597. onTabRemove: {
  21598. type: Function,
  21599. default: noop
  21600. },
  21601. type: String,
  21602. stretch: Boolean
  21603. },
  21604. data: function data() {
  21605. return {
  21606. scrollable: false,
  21607. navOffset: 0,
  21608. isFocus: false,
  21609. focusable: true
  21610. };
  21611. },
  21612. computed: {
  21613. navStyle: function navStyle() {
  21614. var dir = ['top', 'bottom'].indexOf(this.rootTabs.tabPosition) !== -1 ? 'X' : 'Y';
  21615. return {
  21616. transform: 'translate' + dir + '(-' + this.navOffset + 'px)'
  21617. };
  21618. },
  21619. sizeName: function sizeName() {
  21620. return ['top', 'bottom'].indexOf(this.rootTabs.tabPosition) !== -1 ? 'width' : 'height';
  21621. }
  21622. },
  21623. methods: {
  21624. scrollPrev: function scrollPrev() {
  21625. var containerSize = this.$refs.navScroll['offset' + tab_navvue_type_script_lang_js_firstUpperCase(this.sizeName)];
  21626. var currentOffset = this.navOffset;
  21627. if (!currentOffset) return;
  21628. var newOffset = currentOffset > containerSize ? currentOffset - containerSize : 0;
  21629. this.navOffset = newOffset;
  21630. },
  21631. scrollNext: function scrollNext() {
  21632. var navSize = this.$refs.nav['offset' + tab_navvue_type_script_lang_js_firstUpperCase(this.sizeName)];
  21633. var containerSize = this.$refs.navScroll['offset' + tab_navvue_type_script_lang_js_firstUpperCase(this.sizeName)];
  21634. var currentOffset = this.navOffset;
  21635. if (navSize - currentOffset <= containerSize) return;
  21636. var newOffset = navSize - currentOffset > containerSize * 2 ? currentOffset + containerSize : navSize - containerSize;
  21637. this.navOffset = newOffset;
  21638. },
  21639. scrollToActiveTab: function scrollToActiveTab() {
  21640. if (!this.scrollable) return;
  21641. var nav = this.$refs.nav;
  21642. var activeTab = this.$el.querySelector('.is-active');
  21643. if (!activeTab) return;
  21644. var navScroll = this.$refs.navScroll;
  21645. var isHorizontal = ['top', 'bottom'].indexOf(this.rootTabs.tabPosition) !== -1;
  21646. var activeTabBounding = activeTab.getBoundingClientRect();
  21647. var navScrollBounding = navScroll.getBoundingClientRect();
  21648. var maxOffset = isHorizontal ? nav.offsetWidth - navScrollBounding.width : nav.offsetHeight - navScrollBounding.height;
  21649. var currentOffset = this.navOffset;
  21650. var newOffset = currentOffset;
  21651. if (isHorizontal) {
  21652. if (activeTabBounding.left < navScrollBounding.left) {
  21653. newOffset = currentOffset - (navScrollBounding.left - activeTabBounding.left);
  21654. }
  21655. if (activeTabBounding.right > navScrollBounding.right) {
  21656. newOffset = currentOffset + activeTabBounding.right - navScrollBounding.right;
  21657. }
  21658. } else {
  21659. if (activeTabBounding.top < navScrollBounding.top) {
  21660. newOffset = currentOffset - (navScrollBounding.top - activeTabBounding.top);
  21661. }
  21662. if (activeTabBounding.bottom > navScrollBounding.bottom) {
  21663. newOffset = currentOffset + (activeTabBounding.bottom - navScrollBounding.bottom);
  21664. }
  21665. }
  21666. newOffset = Math.max(newOffset, 0);
  21667. this.navOffset = Math.min(newOffset, maxOffset);
  21668. },
  21669. update: function update() {
  21670. if (!this.$refs.nav) return;
  21671. var sizeName = this.sizeName;
  21672. var navSize = this.$refs.nav['offset' + tab_navvue_type_script_lang_js_firstUpperCase(sizeName)];
  21673. var containerSize = this.$refs.navScroll['offset' + tab_navvue_type_script_lang_js_firstUpperCase(sizeName)];
  21674. var currentOffset = this.navOffset;
  21675. if (containerSize < navSize) {
  21676. var _currentOffset = this.navOffset;
  21677. this.scrollable = this.scrollable || {};
  21678. this.scrollable.prev = _currentOffset;
  21679. this.scrollable.next = _currentOffset + containerSize < navSize;
  21680. if (navSize - _currentOffset < containerSize) {
  21681. this.navOffset = navSize - containerSize;
  21682. }
  21683. } else {
  21684. this.scrollable = false;
  21685. if (currentOffset > 0) {
  21686. this.navOffset = 0;
  21687. }
  21688. }
  21689. },
  21690. changeTab: function changeTab(e) {
  21691. var keyCode = e.keyCode;
  21692. var nextIndex = void 0;
  21693. var currentIndex = void 0,
  21694. tabList = void 0;
  21695. if ([37, 38, 39, 40].indexOf(keyCode) !== -1) {
  21696. // 左右上下键更换tab
  21697. tabList = e.currentTarget.querySelectorAll('[role=tab]');
  21698. currentIndex = Array.prototype.indexOf.call(tabList, e.target);
  21699. } else {
  21700. return;
  21701. }
  21702. if (keyCode === 37 || keyCode === 38) {
  21703. // left
  21704. if (currentIndex === 0) {
  21705. // first
  21706. nextIndex = tabList.length - 1;
  21707. } else {
  21708. nextIndex = currentIndex - 1;
  21709. }
  21710. } else {
  21711. // right
  21712. if (currentIndex < tabList.length - 1) {
  21713. // not last
  21714. nextIndex = currentIndex + 1;
  21715. } else {
  21716. nextIndex = 0;
  21717. }
  21718. }
  21719. tabList[nextIndex].focus(); // 改变焦点元素
  21720. tabList[nextIndex].click(); // 选中下一个tab
  21721. this.setFocus();
  21722. },
  21723. setFocus: function setFocus() {
  21724. if (this.focusable) {
  21725. this.isFocus = true;
  21726. }
  21727. },
  21728. removeFocus: function removeFocus() {
  21729. this.isFocus = false;
  21730. },
  21731. visibilityChangeHandler: function visibilityChangeHandler() {
  21732. var _this = this;
  21733. var visibility = document.visibilityState;
  21734. if (visibility === 'hidden') {
  21735. this.focusable = false;
  21736. } else if (visibility === 'visible') {
  21737. setTimeout(function () {
  21738. _this.focusable = true;
  21739. }, 50);
  21740. }
  21741. },
  21742. windowBlurHandler: function windowBlurHandler() {
  21743. this.focusable = false;
  21744. },
  21745. windowFocusHandler: function windowFocusHandler() {
  21746. var _this2 = this;
  21747. setTimeout(function () {
  21748. _this2.focusable = true;
  21749. }, 50);
  21750. }
  21751. },
  21752. updated: function updated() {
  21753. this.update();
  21754. },
  21755. render: function render(h) {
  21756. var _this3 = this;
  21757. var type = this.type,
  21758. panes = this.panes,
  21759. editable = this.editable,
  21760. stretch = this.stretch,
  21761. onTabClick = this.onTabClick,
  21762. onTabRemove = this.onTabRemove,
  21763. navStyle = this.navStyle,
  21764. scrollable = this.scrollable,
  21765. scrollNext = this.scrollNext,
  21766. scrollPrev = this.scrollPrev,
  21767. changeTab = this.changeTab,
  21768. setFocus = this.setFocus,
  21769. removeFocus = this.removeFocus;
  21770. var scrollBtn = scrollable ? [h(
  21771. 'span',
  21772. { 'class': ['el-tabs__nav-prev', scrollable.prev ? '' : 'is-disabled'], on: {
  21773. 'click': scrollPrev
  21774. }
  21775. },
  21776. [h('i', { 'class': 'el-icon-arrow-left' })]
  21777. ), h(
  21778. 'span',
  21779. { 'class': ['el-tabs__nav-next', scrollable.next ? '' : 'is-disabled'], on: {
  21780. 'click': scrollNext
  21781. }
  21782. },
  21783. [h('i', { 'class': 'el-icon-arrow-right' })]
  21784. )] : null;
  21785. var tabs = this._l(panes, function (pane, index) {
  21786. var _ref;
  21787. var tabName = pane.name || pane.index || index;
  21788. var closable = pane.isClosable || editable;
  21789. pane.index = '' + index;
  21790. var btnClose = closable ? h('span', { 'class': 'el-icon-close', on: {
  21791. 'click': function click(ev) {
  21792. onTabRemove(pane, ev);
  21793. }
  21794. }
  21795. }) : null;
  21796. var tabLabelContent = pane.$slots.label || pane.label;
  21797. var tabindex = pane.active ? 0 : -1;
  21798. return h(
  21799. 'div',
  21800. {
  21801. 'class': (_ref = {
  21802. 'el-tabs__item': true
  21803. }, _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),
  21804. attrs: { id: 'tab-' + tabName,
  21805. 'aria-controls': 'pane-' + tabName,
  21806. role: 'tab',
  21807. 'aria-selected': pane.active,
  21808. tabindex: tabindex
  21809. },
  21810. key: 'tab-' + tabName, ref: 'tabs', refInFor: true,
  21811. on: {
  21812. 'focus': function focus() {
  21813. setFocus();
  21814. },
  21815. 'blur': function blur() {
  21816. removeFocus();
  21817. },
  21818. 'click': function click(ev) {
  21819. removeFocus();onTabClick(pane, tabName, ev);
  21820. },
  21821. 'keydown': function keydown(ev) {
  21822. if (closable && (ev.keyCode === 46 || ev.keyCode === 8)) {
  21823. onTabRemove(pane, ev);
  21824. }
  21825. }
  21826. }
  21827. },
  21828. [tabLabelContent, btnClose]
  21829. );
  21830. });
  21831. return h(
  21832. 'div',
  21833. { 'class': ['el-tabs__nav-wrap', scrollable ? 'is-scrollable' : '', 'is-' + this.rootTabs.tabPosition] },
  21834. [scrollBtn, h(
  21835. 'div',
  21836. { 'class': ['el-tabs__nav-scroll'], ref: 'navScroll' },
  21837. [h(
  21838. 'div',
  21839. {
  21840. 'class': ['el-tabs__nav', 'is-' + this.rootTabs.tabPosition, stretch && ['top', 'bottom'].indexOf(this.rootTabs.tabPosition) !== -1 ? 'is-stretch' : ''],
  21841. ref: 'nav',
  21842. style: navStyle,
  21843. attrs: { role: 'tablist'
  21844. },
  21845. on: {
  21846. 'keydown': changeTab
  21847. }
  21848. },
  21849. [!type ? h('tab-bar', {
  21850. attrs: { tabs: panes }
  21851. }) : null, tabs]
  21852. )]
  21853. )]
  21854. );
  21855. },
  21856. mounted: function mounted() {
  21857. var _this4 = this;
  21858. Object(resize_event_["addResizeListener"])(this.$el, this.update);
  21859. document.addEventListener('visibilitychange', this.visibilityChangeHandler);
  21860. window.addEventListener('blur', this.windowBlurHandler);
  21861. window.addEventListener('focus', this.windowFocusHandler);
  21862. setTimeout(function () {
  21863. _this4.scrollToActiveTab();
  21864. }, 0);
  21865. },
  21866. beforeDestroy: function beforeDestroy() {
  21867. if (this.$el && this.update) Object(resize_event_["removeResizeListener"])(this.$el, this.update);
  21868. document.removeEventListener('visibilitychange', this.visibilityChangeHandler);
  21869. window.removeEventListener('blur', this.windowBlurHandler);
  21870. window.removeEventListener('focus', this.windowFocusHandler);
  21871. }
  21872. });
  21873. // CONCATENATED MODULE: ./packages/tabs/src/tab-nav.vue?vue&type=script&lang=js&
  21874. /* harmony default export */ var src_tab_navvue_type_script_lang_js_ = (tab_navvue_type_script_lang_js_);
  21875. // CONCATENATED MODULE: ./packages/tabs/src/tab-nav.vue
  21876. var tab_nav_render, tab_nav_staticRenderFns
  21877. /* normalize component */
  21878. var tab_nav_component = normalizeComponent(
  21879. src_tab_navvue_type_script_lang_js_,
  21880. tab_nav_render,
  21881. tab_nav_staticRenderFns,
  21882. false,
  21883. null,
  21884. null,
  21885. null
  21886. )
  21887. /* hot reload */
  21888. if (false) { var tab_nav_api; }
  21889. tab_nav_component.options.__file = "packages/tabs/src/tab-nav.vue"
  21890. /* harmony default export */ var tab_nav = (tab_nav_component.exports);
  21891. // 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&
  21892. /* harmony default export */ var tabsvue_type_script_lang_js_ = ({
  21893. name: 'ElTabs',
  21894. components: {
  21895. TabNav: tab_nav
  21896. },
  21897. props: {
  21898. type: String,
  21899. activeName: String,
  21900. closable: Boolean,
  21901. addable: Boolean,
  21902. value: {},
  21903. editable: Boolean,
  21904. tabPosition: {
  21905. type: String,
  21906. default: 'top'
  21907. },
  21908. beforeLeave: Function,
  21909. stretch: Boolean
  21910. },
  21911. provide: function provide() {
  21912. return {
  21913. rootTabs: this
  21914. };
  21915. },
  21916. data: function data() {
  21917. return {
  21918. currentName: this.value || this.activeName,
  21919. panes: []
  21920. };
  21921. },
  21922. watch: {
  21923. activeName: function activeName(value) {
  21924. this.setCurrentName(value);
  21925. },
  21926. value: function value(_value) {
  21927. this.setCurrentName(_value);
  21928. },
  21929. currentName: function currentName(value) {
  21930. var _this = this;
  21931. if (this.$refs.nav) {
  21932. this.$nextTick(function () {
  21933. _this.$refs.nav.$nextTick(function (_) {
  21934. _this.$refs.nav.scrollToActiveTab();
  21935. });
  21936. });
  21937. }
  21938. }
  21939. },
  21940. methods: {
  21941. calcPaneInstances: function calcPaneInstances() {
  21942. var _this2 = this;
  21943. var isForceUpdate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  21944. if (this.$slots.default) {
  21945. var paneSlots = this.$slots.default.filter(function (vnode) {
  21946. return vnode.tag && vnode.componentOptions && vnode.componentOptions.Ctor.options.name === 'ElTabPane';
  21947. });
  21948. // update indeed
  21949. var panes = paneSlots.map(function (_ref) {
  21950. var componentInstance = _ref.componentInstance;
  21951. return componentInstance;
  21952. });
  21953. var panesChanged = !(panes.length === this.panes.length && panes.every(function (pane, index) {
  21954. return pane === _this2.panes[index];
  21955. }));
  21956. if (isForceUpdate || panesChanged) {
  21957. this.panes = panes;
  21958. }
  21959. } else if (this.panes.length !== 0) {
  21960. this.panes = [];
  21961. }
  21962. },
  21963. handleTabClick: function handleTabClick(tab, tabName, event) {
  21964. if (tab.disabled) return;
  21965. this.setCurrentName(tabName);
  21966. this.$emit('tab-click', tab, event);
  21967. },
  21968. handleTabRemove: function handleTabRemove(pane, ev) {
  21969. if (pane.disabled) return;
  21970. ev.stopPropagation();
  21971. this.$emit('edit', pane.name, 'remove');
  21972. this.$emit('tab-remove', pane.name);
  21973. },
  21974. handleTabAdd: function handleTabAdd() {
  21975. this.$emit('edit', null, 'add');
  21976. this.$emit('tab-add');
  21977. },
  21978. setCurrentName: function setCurrentName(value) {
  21979. var _this3 = this;
  21980. var changeCurrentName = function changeCurrentName() {
  21981. _this3.currentName = value;
  21982. _this3.$emit('input', value);
  21983. };
  21984. if (this.currentName !== value && this.beforeLeave) {
  21985. var before = this.beforeLeave(value, this.currentName);
  21986. if (before && before.then) {
  21987. before.then(function () {
  21988. changeCurrentName();
  21989. _this3.$refs.nav && _this3.$refs.nav.removeFocus();
  21990. }, function () {
  21991. // https://github.com/ElemeFE/element/pull/14816
  21992. // ignore promise rejection in `before-leave` hook
  21993. });
  21994. } else if (before !== false) {
  21995. changeCurrentName();
  21996. }
  21997. } else {
  21998. changeCurrentName();
  21999. }
  22000. }
  22001. },
  22002. render: function render(h) {
  22003. var _ref2;
  22004. var type = this.type,
  22005. handleTabClick = this.handleTabClick,
  22006. handleTabRemove = this.handleTabRemove,
  22007. handleTabAdd = this.handleTabAdd,
  22008. currentName = this.currentName,
  22009. panes = this.panes,
  22010. editable = this.editable,
  22011. addable = this.addable,
  22012. tabPosition = this.tabPosition,
  22013. stretch = this.stretch;
  22014. var newButton = editable || addable ? h(
  22015. 'span',
  22016. {
  22017. 'class': 'el-tabs__new-tab',
  22018. on: {
  22019. 'click': handleTabAdd,
  22020. 'keydown': function keydown(ev) {
  22021. if (ev.keyCode === 13) {
  22022. handleTabAdd();
  22023. }
  22024. }
  22025. },
  22026. attrs: {
  22027. tabindex: '0'
  22028. }
  22029. },
  22030. [h('i', { 'class': 'el-icon-plus' })]
  22031. ) : null;
  22032. var navData = {
  22033. props: {
  22034. currentName: currentName,
  22035. onTabClick: handleTabClick,
  22036. onTabRemove: handleTabRemove,
  22037. editable: editable,
  22038. type: type,
  22039. panes: panes,
  22040. stretch: stretch
  22041. },
  22042. ref: 'nav'
  22043. };
  22044. var header = h(
  22045. 'div',
  22046. { 'class': ['el-tabs__header', 'is-' + tabPosition] },
  22047. [newButton, h('tab-nav', navData)]
  22048. );
  22049. var panels = h(
  22050. 'div',
  22051. { 'class': 'el-tabs__content' },
  22052. [this.$slots.default]
  22053. );
  22054. return h(
  22055. 'div',
  22056. { 'class': (_ref2 = {
  22057. 'el-tabs': true,
  22058. 'el-tabs--card': type === 'card'
  22059. }, _ref2['el-tabs--' + tabPosition] = true, _ref2['el-tabs--border-card'] = type === 'border-card', _ref2) },
  22060. [tabPosition !== 'bottom' ? [header, panels] : [panels, header]]
  22061. );
  22062. },
  22063. created: function created() {
  22064. if (!this.currentName) {
  22065. this.setCurrentName('0');
  22066. }
  22067. this.$on('tab-nav-update', this.calcPaneInstances.bind(null, true));
  22068. },
  22069. mounted: function mounted() {
  22070. this.calcPaneInstances();
  22071. },
  22072. updated: function updated() {
  22073. this.calcPaneInstances();
  22074. }
  22075. });
  22076. // CONCATENATED MODULE: ./packages/tabs/src/tabs.vue?vue&type=script&lang=js&
  22077. /* harmony default export */ var src_tabsvue_type_script_lang_js_ = (tabsvue_type_script_lang_js_);
  22078. // CONCATENATED MODULE: ./packages/tabs/src/tabs.vue
  22079. var tabs_render, tabs_staticRenderFns
  22080. /* normalize component */
  22081. var tabs_component = normalizeComponent(
  22082. src_tabsvue_type_script_lang_js_,
  22083. tabs_render,
  22084. tabs_staticRenderFns,
  22085. false,
  22086. null,
  22087. null,
  22088. null
  22089. )
  22090. /* hot reload */
  22091. if (false) { var tabs_api; }
  22092. tabs_component.options.__file = "packages/tabs/src/tabs.vue"
  22093. /* harmony default export */ var tabs = (tabs_component.exports);
  22094. // CONCATENATED MODULE: ./packages/tabs/index.js
  22095. /* istanbul ignore next */
  22096. tabs.install = function (Vue) {
  22097. Vue.component(tabs.name, tabs);
  22098. };
  22099. /* harmony default export */ var packages_tabs = (tabs);
  22100. // 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&
  22101. var tab_panevue_type_template_id_9145a070_render = function() {
  22102. var _vm = this
  22103. var _h = _vm.$createElement
  22104. var _c = _vm._self._c || _h
  22105. return !_vm.lazy || _vm.loaded || _vm.active
  22106. ? _c(
  22107. "div",
  22108. {
  22109. directives: [
  22110. {
  22111. name: "show",
  22112. rawName: "v-show",
  22113. value: _vm.active,
  22114. expression: "active"
  22115. }
  22116. ],
  22117. staticClass: "el-tab-pane",
  22118. attrs: {
  22119. role: "tabpanel",
  22120. "aria-hidden": !_vm.active,
  22121. id: "pane-" + _vm.paneName,
  22122. "aria-labelledby": "tab-" + _vm.paneName
  22123. }
  22124. },
  22125. [_vm._t("default")],
  22126. 2
  22127. )
  22128. : _vm._e()
  22129. }
  22130. var tab_panevue_type_template_id_9145a070_staticRenderFns = []
  22131. tab_panevue_type_template_id_9145a070_render._withStripped = true
  22132. // CONCATENATED MODULE: ./packages/tabs/src/tab-pane.vue?vue&type=template&id=9145a070&
  22133. // 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&
  22134. //
  22135. //
  22136. //
  22137. //
  22138. //
  22139. //
  22140. //
  22141. //
  22142. //
  22143. //
  22144. //
  22145. //
  22146. //
  22147. /* harmony default export */ var tab_panevue_type_script_lang_js_ = ({
  22148. name: 'ElTabPane',
  22149. componentName: 'ElTabPane',
  22150. props: {
  22151. label: String,
  22152. labelContent: Function,
  22153. name: String,
  22154. closable: Boolean,
  22155. disabled: Boolean,
  22156. lazy: Boolean
  22157. },
  22158. data: function data() {
  22159. return {
  22160. index: null,
  22161. loaded: false
  22162. };
  22163. },
  22164. computed: {
  22165. isClosable: function isClosable() {
  22166. return this.closable || this.$parent.closable;
  22167. },
  22168. active: function active() {
  22169. var active = this.$parent.currentName === (this.name || this.index);
  22170. if (active) {
  22171. this.loaded = true;
  22172. }
  22173. return active;
  22174. },
  22175. paneName: function paneName() {
  22176. return this.name || this.index;
  22177. }
  22178. },
  22179. updated: function updated() {
  22180. this.$parent.$emit('tab-nav-update');
  22181. }
  22182. });
  22183. // CONCATENATED MODULE: ./packages/tabs/src/tab-pane.vue?vue&type=script&lang=js&
  22184. /* harmony default export */ var src_tab_panevue_type_script_lang_js_ = (tab_panevue_type_script_lang_js_);
  22185. // CONCATENATED MODULE: ./packages/tabs/src/tab-pane.vue
  22186. /* normalize component */
  22187. var tab_pane_component = normalizeComponent(
  22188. src_tab_panevue_type_script_lang_js_,
  22189. tab_panevue_type_template_id_9145a070_render,
  22190. tab_panevue_type_template_id_9145a070_staticRenderFns,
  22191. false,
  22192. null,
  22193. null,
  22194. null
  22195. )
  22196. /* hot reload */
  22197. if (false) { var tab_pane_api; }
  22198. tab_pane_component.options.__file = "packages/tabs/src/tab-pane.vue"
  22199. /* harmony default export */ var tab_pane = (tab_pane_component.exports);
  22200. // CONCATENATED MODULE: ./packages/tab-pane/index.js
  22201. /* istanbul ignore next */
  22202. tab_pane.install = function (Vue) {
  22203. Vue.component(tab_pane.name, tab_pane);
  22204. };
  22205. /* harmony default export */ var packages_tab_pane = (tab_pane);
  22206. // 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&
  22207. /* harmony default export */ var tagvue_type_script_lang_js_ = ({
  22208. name: 'ElTag',
  22209. props: {
  22210. text: String,
  22211. closable: Boolean,
  22212. type: String,
  22213. hit: Boolean,
  22214. disableTransitions: Boolean,
  22215. color: String,
  22216. size: String,
  22217. effect: {
  22218. type: String,
  22219. default: 'light',
  22220. validator: function validator(val) {
  22221. return ['dark', 'light', 'plain'].indexOf(val) !== -1;
  22222. }
  22223. }
  22224. },
  22225. methods: {
  22226. handleClose: function handleClose(event) {
  22227. event.stopPropagation();
  22228. this.$emit('close', event);
  22229. },
  22230. handleClick: function handleClick(event) {
  22231. this.$emit('click', event);
  22232. }
  22233. },
  22234. computed: {
  22235. tagSize: function tagSize() {
  22236. return this.size || (this.$ELEMENT || {}).size;
  22237. }
  22238. },
  22239. render: function render(h) {
  22240. var type = this.type,
  22241. tagSize = this.tagSize,
  22242. hit = this.hit,
  22243. effect = this.effect;
  22244. var classes = ['el-tag', type ? 'el-tag--' + type : '', tagSize ? 'el-tag--' + tagSize : '', effect ? 'el-tag--' + effect : '', hit && 'is-hit'];
  22245. var tagEl = h(
  22246. 'span',
  22247. {
  22248. 'class': classes,
  22249. style: { backgroundColor: this.color },
  22250. on: {
  22251. 'click': this.handleClick
  22252. }
  22253. },
  22254. [this.$slots.default, this.closable && h('i', { 'class': 'el-tag__close el-icon-close', on: {
  22255. 'click': this.handleClose
  22256. }
  22257. })]
  22258. );
  22259. return this.disableTransitions ? tagEl : h(
  22260. 'transition',
  22261. {
  22262. attrs: { name: 'el-zoom-in-center' }
  22263. },
  22264. [tagEl]
  22265. );
  22266. }
  22267. });
  22268. // CONCATENATED MODULE: ./packages/tag/src/tag.vue?vue&type=script&lang=js&
  22269. /* harmony default export */ var src_tagvue_type_script_lang_js_ = (tagvue_type_script_lang_js_);
  22270. // CONCATENATED MODULE: ./packages/tag/src/tag.vue
  22271. var tag_render, tag_staticRenderFns
  22272. /* normalize component */
  22273. var tag_component = normalizeComponent(
  22274. src_tagvue_type_script_lang_js_,
  22275. tag_render,
  22276. tag_staticRenderFns,
  22277. false,
  22278. null,
  22279. null,
  22280. null
  22281. )
  22282. /* hot reload */
  22283. if (false) { var tag_api; }
  22284. tag_component.options.__file = "packages/tag/src/tag.vue"
  22285. /* harmony default export */ var src_tag = (tag_component.exports);
  22286. // CONCATENATED MODULE: ./packages/tag/index.js
  22287. /* istanbul ignore next */
  22288. src_tag.install = function (Vue) {
  22289. Vue.component(src_tag.name, src_tag);
  22290. };
  22291. /* harmony default export */ var packages_tag = (src_tag);
  22292. // 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&
  22293. var treevue_type_template_id_547575a6_render = function() {
  22294. var _vm = this
  22295. var _h = _vm.$createElement
  22296. var _c = _vm._self._c || _h
  22297. return _c(
  22298. "div",
  22299. {
  22300. staticClass: "el-tree",
  22301. class: {
  22302. "el-tree--highlight-current": _vm.highlightCurrent,
  22303. "is-dragging": !!_vm.dragState.draggingNode,
  22304. "is-drop-not-allow": !_vm.dragState.allowDrop,
  22305. "is-drop-inner": _vm.dragState.dropType === "inner"
  22306. },
  22307. attrs: { role: "tree" }
  22308. },
  22309. [
  22310. _vm._l(_vm.root.childNodes, function(child) {
  22311. return _c("el-tree-node", {
  22312. key: _vm.getNodeKey(child),
  22313. attrs: {
  22314. node: child,
  22315. props: _vm.props,
  22316. "render-after-expand": _vm.renderAfterExpand,
  22317. "show-checkbox": _vm.showCheckbox,
  22318. "render-content": _vm.renderContent
  22319. },
  22320. on: { "node-expand": _vm.handleNodeExpand }
  22321. })
  22322. }),
  22323. _vm.isEmpty
  22324. ? _c("div", { staticClass: "el-tree__empty-block" }, [
  22325. _c("span", { staticClass: "el-tree__empty-text" }, [
  22326. _vm._v(_vm._s(_vm.emptyText))
  22327. ])
  22328. ])
  22329. : _vm._e(),
  22330. _c("div", {
  22331. directives: [
  22332. {
  22333. name: "show",
  22334. rawName: "v-show",
  22335. value: _vm.dragState.showDropIndicator,
  22336. expression: "dragState.showDropIndicator"
  22337. }
  22338. ],
  22339. ref: "dropIndicator",
  22340. staticClass: "el-tree__drop-indicator"
  22341. })
  22342. ],
  22343. 2
  22344. )
  22345. }
  22346. var treevue_type_template_id_547575a6_staticRenderFns = []
  22347. treevue_type_template_id_547575a6_render._withStripped = true
  22348. // CONCATENATED MODULE: ./packages/tree/src/tree.vue?vue&type=template&id=547575a6&
  22349. // CONCATENATED MODULE: ./packages/tree/src/model/util.js
  22350. var NODE_KEY = '$treeNodeId';
  22351. var markNodeData = function markNodeData(node, data) {
  22352. if (!data || data[NODE_KEY]) return;
  22353. Object.defineProperty(data, NODE_KEY, {
  22354. value: node.id,
  22355. enumerable: false,
  22356. configurable: false,
  22357. writable: false
  22358. });
  22359. };
  22360. var util_getNodeKey = function getNodeKey(key, data) {
  22361. if (!key) return data[NODE_KEY];
  22362. return data[key];
  22363. };
  22364. var findNearestComponent = function findNearestComponent(element, componentName) {
  22365. var target = element;
  22366. while (target && target.tagName !== 'BODY') {
  22367. if (target.__vue__ && target.__vue__.$options.name === componentName) {
  22368. return target.__vue__;
  22369. }
  22370. target = target.parentNode;
  22371. }
  22372. return null;
  22373. };
  22374. // CONCATENATED MODULE: ./packages/tree/src/model/node.js
  22375. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  22376. function node_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22377. var getChildState = function getChildState(node) {
  22378. var all = true;
  22379. var none = true;
  22380. var allWithoutDisable = true;
  22381. for (var i = 0, j = node.length; i < j; i++) {
  22382. var n = node[i];
  22383. if (n.checked !== true || n.indeterminate) {
  22384. all = false;
  22385. if (!n.disabled) {
  22386. allWithoutDisable = false;
  22387. }
  22388. }
  22389. if (n.checked !== false || n.indeterminate) {
  22390. none = false;
  22391. }
  22392. }
  22393. return { all: all, none: none, allWithoutDisable: allWithoutDisable, half: !all && !none };
  22394. };
  22395. var reInitChecked = function reInitChecked(node) {
  22396. if (node.childNodes.length === 0 || node.loading) return;
  22397. var _getChildState = getChildState(node.childNodes),
  22398. all = _getChildState.all,
  22399. none = _getChildState.none,
  22400. half = _getChildState.half;
  22401. if (all) {
  22402. node.checked = true;
  22403. node.indeterminate = false;
  22404. } else if (half) {
  22405. node.checked = false;
  22406. node.indeterminate = true;
  22407. } else if (none) {
  22408. node.checked = false;
  22409. node.indeterminate = false;
  22410. }
  22411. var parent = node.parent;
  22412. if (!parent || parent.level === 0) return;
  22413. if (!node.store.checkStrictly) {
  22414. reInitChecked(parent);
  22415. }
  22416. };
  22417. var getPropertyFromData = function getPropertyFromData(node, prop) {
  22418. var props = node.store.props;
  22419. var data = node.data || {};
  22420. var config = props[prop];
  22421. if (typeof config === 'function') {
  22422. return config(data, node);
  22423. } else if (typeof config === 'string') {
  22424. return data[config];
  22425. } else if (typeof config === 'undefined') {
  22426. var dataProp = data[prop];
  22427. return dataProp === undefined ? '' : dataProp;
  22428. }
  22429. };
  22430. var nodeIdSeed = 0;
  22431. var node_Node = function () {
  22432. function Node(options) {
  22433. node_classCallCheck(this, Node);
  22434. this.id = nodeIdSeed++;
  22435. this.text = null;
  22436. this.checked = false;
  22437. this.indeterminate = false;
  22438. this.data = null;
  22439. this.expanded = false;
  22440. this.parent = null;
  22441. this.visible = true;
  22442. this.isCurrent = false;
  22443. for (var name in options) {
  22444. if (options.hasOwnProperty(name)) {
  22445. this[name] = options[name];
  22446. }
  22447. }
  22448. // internal
  22449. this.level = 0;
  22450. this.loaded = false;
  22451. this.childNodes = [];
  22452. this.loading = false;
  22453. if (this.parent) {
  22454. this.level = this.parent.level + 1;
  22455. }
  22456. var store = this.store;
  22457. if (!store) {
  22458. throw new Error('[Node]store is required!');
  22459. }
  22460. store.registerNode(this);
  22461. var props = store.props;
  22462. if (props && typeof props.isLeaf !== 'undefined') {
  22463. var isLeaf = getPropertyFromData(this, 'isLeaf');
  22464. if (typeof isLeaf === 'boolean') {
  22465. this.isLeafByUser = isLeaf;
  22466. }
  22467. }
  22468. if (store.lazy !== true && this.data) {
  22469. this.setData(this.data);
  22470. if (store.defaultExpandAll) {
  22471. this.expanded = true;
  22472. }
  22473. } else if (this.level > 0 && store.lazy && store.defaultExpandAll) {
  22474. this.expand();
  22475. }
  22476. if (!Array.isArray(this.data)) {
  22477. markNodeData(this, this.data);
  22478. }
  22479. if (!this.data) return;
  22480. var defaultExpandedKeys = store.defaultExpandedKeys;
  22481. var key = store.key;
  22482. if (key && defaultExpandedKeys && defaultExpandedKeys.indexOf(this.key) !== -1) {
  22483. this.expand(null, store.autoExpandParent);
  22484. }
  22485. if (key && store.currentNodeKey !== undefined && this.key === store.currentNodeKey) {
  22486. store.currentNode = this;
  22487. store.currentNode.isCurrent = true;
  22488. }
  22489. if (store.lazy) {
  22490. store._initDefaultCheckedNode(this);
  22491. }
  22492. this.updateLeafState();
  22493. }
  22494. Node.prototype.setData = function setData(data) {
  22495. if (!Array.isArray(data)) {
  22496. markNodeData(this, data);
  22497. }
  22498. this.data = data;
  22499. this.childNodes = [];
  22500. var children = void 0;
  22501. if (this.level === 0 && this.data instanceof Array) {
  22502. children = this.data;
  22503. } else {
  22504. children = getPropertyFromData(this, 'children') || [];
  22505. }
  22506. for (var i = 0, j = children.length; i < j; i++) {
  22507. this.insertChild({ data: children[i] });
  22508. }
  22509. };
  22510. Node.prototype.contains = function contains(target) {
  22511. var deep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  22512. var walk = function walk(parent) {
  22513. var children = parent.childNodes || [];
  22514. var result = false;
  22515. for (var i = 0, j = children.length; i < j; i++) {
  22516. var child = children[i];
  22517. if (child === target || deep && walk(child)) {
  22518. result = true;
  22519. break;
  22520. }
  22521. }
  22522. return result;
  22523. };
  22524. return walk(this);
  22525. };
  22526. Node.prototype.remove = function remove() {
  22527. var parent = this.parent;
  22528. if (parent) {
  22529. parent.removeChild(this);
  22530. }
  22531. };
  22532. Node.prototype.insertChild = function insertChild(child, index, batch) {
  22533. if (!child) throw new Error('insertChild error: child is required.');
  22534. if (!(child instanceof Node)) {
  22535. if (!batch) {
  22536. var children = this.getChildren(true) || [];
  22537. if (children.indexOf(child.data) === -1) {
  22538. if (typeof index === 'undefined' || index < 0) {
  22539. children.push(child.data);
  22540. } else {
  22541. children.splice(index, 0, child.data);
  22542. }
  22543. }
  22544. }
  22545. merge_default()(child, {
  22546. parent: this,
  22547. store: this.store
  22548. });
  22549. child = new Node(child);
  22550. }
  22551. child.level = this.level + 1;
  22552. if (typeof index === 'undefined' || index < 0) {
  22553. this.childNodes.push(child);
  22554. } else {
  22555. this.childNodes.splice(index, 0, child);
  22556. }
  22557. this.updateLeafState();
  22558. };
  22559. Node.prototype.insertBefore = function insertBefore(child, ref) {
  22560. var index = void 0;
  22561. if (ref) {
  22562. index = this.childNodes.indexOf(ref);
  22563. }
  22564. this.insertChild(child, index);
  22565. };
  22566. Node.prototype.insertAfter = function insertAfter(child, ref) {
  22567. var index = void 0;
  22568. if (ref) {
  22569. index = this.childNodes.indexOf(ref);
  22570. if (index !== -1) index += 1;
  22571. }
  22572. this.insertChild(child, index);
  22573. };
  22574. Node.prototype.removeChild = function removeChild(child) {
  22575. var children = this.getChildren() || [];
  22576. var dataIndex = children.indexOf(child.data);
  22577. if (dataIndex > -1) {
  22578. children.splice(dataIndex, 1);
  22579. }
  22580. var index = this.childNodes.indexOf(child);
  22581. if (index > -1) {
  22582. this.store && this.store.deregisterNode(child);
  22583. child.parent = null;
  22584. this.childNodes.splice(index, 1);
  22585. }
  22586. this.updateLeafState();
  22587. };
  22588. Node.prototype.removeChildByData = function removeChildByData(data) {
  22589. var targetNode = null;
  22590. for (var i = 0; i < this.childNodes.length; i++) {
  22591. if (this.childNodes[i].data === data) {
  22592. targetNode = this.childNodes[i];
  22593. break;
  22594. }
  22595. }
  22596. if (targetNode) {
  22597. this.removeChild(targetNode);
  22598. }
  22599. };
  22600. Node.prototype.expand = function expand(callback, expandParent) {
  22601. var _this = this;
  22602. var done = function done() {
  22603. if (expandParent) {
  22604. var parent = _this.parent;
  22605. while (parent.level > 0) {
  22606. parent.expanded = true;
  22607. parent = parent.parent;
  22608. }
  22609. }
  22610. _this.expanded = true;
  22611. if (callback) callback();
  22612. };
  22613. if (this.shouldLoadData()) {
  22614. this.loadData(function (data) {
  22615. if (data instanceof Array) {
  22616. if (_this.checked) {
  22617. _this.setChecked(true, true);
  22618. } else if (!_this.store.checkStrictly) {
  22619. reInitChecked(_this);
  22620. }
  22621. done();
  22622. }
  22623. });
  22624. } else {
  22625. done();
  22626. }
  22627. };
  22628. Node.prototype.doCreateChildren = function doCreateChildren(array) {
  22629. var _this2 = this;
  22630. var defaultProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  22631. array.forEach(function (item) {
  22632. _this2.insertChild(merge_default()({ data: item }, defaultProps), undefined, true);
  22633. });
  22634. };
  22635. Node.prototype.collapse = function collapse() {
  22636. this.expanded = false;
  22637. };
  22638. Node.prototype.shouldLoadData = function shouldLoadData() {
  22639. return this.store.lazy === true && this.store.load && !this.loaded;
  22640. };
  22641. Node.prototype.updateLeafState = function updateLeafState() {
  22642. if (this.store.lazy === true && this.loaded !== true && typeof this.isLeafByUser !== 'undefined') {
  22643. this.isLeaf = this.isLeafByUser;
  22644. return;
  22645. }
  22646. var childNodes = this.childNodes;
  22647. if (!this.store.lazy || this.store.lazy === true && this.loaded === true) {
  22648. this.isLeaf = !childNodes || childNodes.length === 0;
  22649. return;
  22650. }
  22651. this.isLeaf = false;
  22652. };
  22653. Node.prototype.setChecked = function setChecked(value, deep, recursion, passValue) {
  22654. var _this3 = this;
  22655. this.indeterminate = value === 'half';
  22656. this.checked = value === true;
  22657. if (this.store.checkStrictly) return;
  22658. if (!(this.shouldLoadData() && !this.store.checkDescendants)) {
  22659. var _getChildState2 = getChildState(this.childNodes),
  22660. all = _getChildState2.all,
  22661. allWithoutDisable = _getChildState2.allWithoutDisable;
  22662. if (!this.isLeaf && !all && allWithoutDisable) {
  22663. this.checked = false;
  22664. value = false;
  22665. }
  22666. var handleDescendants = function handleDescendants() {
  22667. if (deep) {
  22668. var childNodes = _this3.childNodes;
  22669. for (var i = 0, j = childNodes.length; i < j; i++) {
  22670. var child = childNodes[i];
  22671. passValue = passValue || value !== false;
  22672. var isCheck = child.disabled ? child.checked : passValue;
  22673. child.setChecked(isCheck, deep, true, passValue);
  22674. }
  22675. var _getChildState3 = getChildState(childNodes),
  22676. half = _getChildState3.half,
  22677. _all = _getChildState3.all;
  22678. if (!_all) {
  22679. _this3.checked = _all;
  22680. _this3.indeterminate = half;
  22681. }
  22682. }
  22683. };
  22684. if (this.shouldLoadData()) {
  22685. // Only work on lazy load data.
  22686. this.loadData(function () {
  22687. handleDescendants();
  22688. reInitChecked(_this3);
  22689. }, {
  22690. checked: value !== false
  22691. });
  22692. return;
  22693. } else {
  22694. handleDescendants();
  22695. }
  22696. }
  22697. var parent = this.parent;
  22698. if (!parent || parent.level === 0) return;
  22699. if (!recursion) {
  22700. reInitChecked(parent);
  22701. }
  22702. };
  22703. Node.prototype.getChildren = function getChildren() {
  22704. var forceInit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  22705. // this is data
  22706. if (this.level === 0) return this.data;
  22707. var data = this.data;
  22708. if (!data) return null;
  22709. var props = this.store.props;
  22710. var children = 'children';
  22711. if (props) {
  22712. children = props.children || 'children';
  22713. }
  22714. if (data[children] === undefined) {
  22715. data[children] = null;
  22716. }
  22717. if (forceInit && !data[children]) {
  22718. data[children] = [];
  22719. }
  22720. return data[children];
  22721. };
  22722. Node.prototype.updateChildren = function updateChildren() {
  22723. var _this4 = this;
  22724. var newData = this.getChildren() || [];
  22725. var oldData = this.childNodes.map(function (node) {
  22726. return node.data;
  22727. });
  22728. var newDataMap = {};
  22729. var newNodes = [];
  22730. newData.forEach(function (item, index) {
  22731. var key = item[NODE_KEY];
  22732. var isNodeExists = !!key && Object(util_["arrayFindIndex"])(oldData, function (data) {
  22733. return data[NODE_KEY] === key;
  22734. }) >= 0;
  22735. if (isNodeExists) {
  22736. newDataMap[key] = { index: index, data: item };
  22737. } else {
  22738. newNodes.push({ index: index, data: item });
  22739. }
  22740. });
  22741. if (!this.store.lazy) {
  22742. oldData.forEach(function (item) {
  22743. if (!newDataMap[item[NODE_KEY]]) _this4.removeChildByData(item);
  22744. });
  22745. }
  22746. newNodes.forEach(function (_ref) {
  22747. var index = _ref.index,
  22748. data = _ref.data;
  22749. _this4.insertChild({ data: data }, index);
  22750. });
  22751. this.updateLeafState();
  22752. };
  22753. Node.prototype.loadData = function loadData(callback) {
  22754. var _this5 = this;
  22755. var defaultProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  22756. if (this.store.lazy === true && this.store.load && !this.loaded && (!this.loading || Object.keys(defaultProps).length)) {
  22757. this.loading = true;
  22758. var resolve = function resolve(children) {
  22759. _this5.childNodes = [];
  22760. _this5.doCreateChildren(children, defaultProps);
  22761. _this5.loaded = true;
  22762. _this5.loading = false;
  22763. _this5.updateLeafState();
  22764. if (callback) {
  22765. callback.call(_this5, children);
  22766. }
  22767. };
  22768. this.store.load(this, resolve);
  22769. } else {
  22770. if (callback) {
  22771. callback.call(this);
  22772. }
  22773. }
  22774. };
  22775. _createClass(Node, [{
  22776. key: 'label',
  22777. get: function get() {
  22778. return getPropertyFromData(this, 'label');
  22779. }
  22780. }, {
  22781. key: 'key',
  22782. get: function get() {
  22783. var nodeKey = this.store.key;
  22784. if (this.data) return this.data[nodeKey];
  22785. return null;
  22786. }
  22787. }, {
  22788. key: 'disabled',
  22789. get: function get() {
  22790. return getPropertyFromData(this, 'disabled');
  22791. }
  22792. }, {
  22793. key: 'nextSibling',
  22794. get: function get() {
  22795. var parent = this.parent;
  22796. if (parent) {
  22797. var index = parent.childNodes.indexOf(this);
  22798. if (index > -1) {
  22799. return parent.childNodes[index + 1];
  22800. }
  22801. }
  22802. return null;
  22803. }
  22804. }, {
  22805. key: 'previousSibling',
  22806. get: function get() {
  22807. var parent = this.parent;
  22808. if (parent) {
  22809. var index = parent.childNodes.indexOf(this);
  22810. if (index > -1) {
  22811. return index > 0 ? parent.childNodes[index - 1] : null;
  22812. }
  22813. }
  22814. return null;
  22815. }
  22816. }]);
  22817. return Node;
  22818. }();
  22819. /* harmony default export */ var model_node = (node_Node);
  22820. // CONCATENATED MODULE: ./packages/tree/src/model/tree-store.js
  22821. 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; };
  22822. function tree_store_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22823. var tree_store_TreeStore = function () {
  22824. function TreeStore(options) {
  22825. var _this = this;
  22826. tree_store_classCallCheck(this, TreeStore);
  22827. this.currentNode = null;
  22828. this.currentNodeKey = null;
  22829. for (var option in options) {
  22830. if (options.hasOwnProperty(option)) {
  22831. this[option] = options[option];
  22832. }
  22833. }
  22834. this.nodesMap = {};
  22835. this.root = new model_node({
  22836. data: this.data,
  22837. store: this
  22838. });
  22839. if (this.lazy && this.load) {
  22840. var loadFn = this.load;
  22841. loadFn(this.root, function (data) {
  22842. _this.root.doCreateChildren(data);
  22843. _this._initDefaultCheckedNodes();
  22844. });
  22845. } else {
  22846. this._initDefaultCheckedNodes();
  22847. }
  22848. }
  22849. TreeStore.prototype.filter = function filter(value) {
  22850. var filterNodeMethod = this.filterNodeMethod;
  22851. var lazy = this.lazy;
  22852. var traverse = function traverse(node) {
  22853. var childNodes = node.root ? node.root.childNodes : node.childNodes;
  22854. childNodes.forEach(function (child) {
  22855. child.visible = filterNodeMethod.call(child, value, child.data, child);
  22856. traverse(child);
  22857. });
  22858. if (!node.visible && childNodes.length) {
  22859. var allHidden = true;
  22860. allHidden = !childNodes.some(function (child) {
  22861. return child.visible;
  22862. });
  22863. if (node.root) {
  22864. node.root.visible = allHidden === false;
  22865. } else {
  22866. node.visible = allHidden === false;
  22867. }
  22868. }
  22869. if (!value) return;
  22870. if (node.visible && !node.isLeaf && !lazy) node.expand();
  22871. };
  22872. traverse(this);
  22873. };
  22874. TreeStore.prototype.setData = function setData(newVal) {
  22875. var instanceChanged = newVal !== this.root.data;
  22876. if (instanceChanged) {
  22877. this.root.setData(newVal);
  22878. this._initDefaultCheckedNodes();
  22879. } else {
  22880. this.root.updateChildren();
  22881. }
  22882. };
  22883. TreeStore.prototype.getNode = function getNode(data) {
  22884. if (data instanceof model_node) return data;
  22885. var key = (typeof data === 'undefined' ? 'undefined' : tree_store_typeof(data)) !== 'object' ? data : util_getNodeKey(this.key, data);
  22886. return this.nodesMap[key] || null;
  22887. };
  22888. TreeStore.prototype.insertBefore = function insertBefore(data, refData) {
  22889. var refNode = this.getNode(refData);
  22890. refNode.parent.insertBefore({ data: data }, refNode);
  22891. };
  22892. TreeStore.prototype.insertAfter = function insertAfter(data, refData) {
  22893. var refNode = this.getNode(refData);
  22894. refNode.parent.insertAfter({ data: data }, refNode);
  22895. };
  22896. TreeStore.prototype.remove = function remove(data) {
  22897. var node = this.getNode(data);
  22898. if (node && node.parent) {
  22899. if (node === this.currentNode) {
  22900. this.currentNode = null;
  22901. }
  22902. node.parent.removeChild(node);
  22903. }
  22904. };
  22905. TreeStore.prototype.append = function append(data, parentData) {
  22906. var parentNode = parentData ? this.getNode(parentData) : this.root;
  22907. if (parentNode) {
  22908. parentNode.insertChild({ data: data });
  22909. }
  22910. };
  22911. TreeStore.prototype._initDefaultCheckedNodes = function _initDefaultCheckedNodes() {
  22912. var _this2 = this;
  22913. var defaultCheckedKeys = this.defaultCheckedKeys || [];
  22914. var nodesMap = this.nodesMap;
  22915. defaultCheckedKeys.forEach(function (checkedKey) {
  22916. var node = nodesMap[checkedKey];
  22917. if (node) {
  22918. node.setChecked(true, !_this2.checkStrictly);
  22919. }
  22920. });
  22921. };
  22922. TreeStore.prototype._initDefaultCheckedNode = function _initDefaultCheckedNode(node) {
  22923. var defaultCheckedKeys = this.defaultCheckedKeys || [];
  22924. if (defaultCheckedKeys.indexOf(node.key) !== -1) {
  22925. node.setChecked(true, !this.checkStrictly);
  22926. }
  22927. };
  22928. TreeStore.prototype.setDefaultCheckedKey = function setDefaultCheckedKey(newVal) {
  22929. if (newVal !== this.defaultCheckedKeys) {
  22930. this.defaultCheckedKeys = newVal;
  22931. this._initDefaultCheckedNodes();
  22932. }
  22933. };
  22934. TreeStore.prototype.registerNode = function registerNode(node) {
  22935. var key = this.key;
  22936. if (!key || !node || !node.data) return;
  22937. var nodeKey = node.key;
  22938. if (nodeKey !== undefined) this.nodesMap[node.key] = node;
  22939. };
  22940. TreeStore.prototype.deregisterNode = function deregisterNode(node) {
  22941. var _this3 = this;
  22942. var key = this.key;
  22943. if (!key || !node || !node.data) return;
  22944. node.childNodes.forEach(function (child) {
  22945. _this3.deregisterNode(child);
  22946. });
  22947. delete this.nodesMap[node.key];
  22948. };
  22949. TreeStore.prototype.getCheckedNodes = function getCheckedNodes() {
  22950. var leafOnly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  22951. var includeHalfChecked = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  22952. var checkedNodes = [];
  22953. var traverse = function traverse(node) {
  22954. var childNodes = node.root ? node.root.childNodes : node.childNodes;
  22955. childNodes.forEach(function (child) {
  22956. if ((child.checked || includeHalfChecked && child.indeterminate) && (!leafOnly || leafOnly && child.isLeaf)) {
  22957. checkedNodes.push(child.data);
  22958. }
  22959. traverse(child);
  22960. });
  22961. };
  22962. traverse(this);
  22963. return checkedNodes;
  22964. };
  22965. TreeStore.prototype.getCheckedKeys = function getCheckedKeys() {
  22966. var _this4 = this;
  22967. var leafOnly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  22968. return this.getCheckedNodes(leafOnly).map(function (data) {
  22969. return (data || {})[_this4.key];
  22970. });
  22971. };
  22972. TreeStore.prototype.getHalfCheckedNodes = function getHalfCheckedNodes() {
  22973. var nodes = [];
  22974. var traverse = function traverse(node) {
  22975. var childNodes = node.root ? node.root.childNodes : node.childNodes;
  22976. childNodes.forEach(function (child) {
  22977. if (child.indeterminate) {
  22978. nodes.push(child.data);
  22979. }
  22980. traverse(child);
  22981. });
  22982. };
  22983. traverse(this);
  22984. return nodes;
  22985. };
  22986. TreeStore.prototype.getHalfCheckedKeys = function getHalfCheckedKeys() {
  22987. var _this5 = this;
  22988. return this.getHalfCheckedNodes().map(function (data) {
  22989. return (data || {})[_this5.key];
  22990. });
  22991. };
  22992. TreeStore.prototype._getAllNodes = function _getAllNodes() {
  22993. var allNodes = [];
  22994. var nodesMap = this.nodesMap;
  22995. for (var nodeKey in nodesMap) {
  22996. if (nodesMap.hasOwnProperty(nodeKey)) {
  22997. allNodes.push(nodesMap[nodeKey]);
  22998. }
  22999. }
  23000. return allNodes;
  23001. };
  23002. TreeStore.prototype.updateChildren = function updateChildren(key, data) {
  23003. var node = this.nodesMap[key];
  23004. if (!node) return;
  23005. var childNodes = node.childNodes;
  23006. for (var i = childNodes.length - 1; i >= 0; i--) {
  23007. var child = childNodes[i];
  23008. this.remove(child.data);
  23009. }
  23010. for (var _i = 0, j = data.length; _i < j; _i++) {
  23011. var _child = data[_i];
  23012. this.append(_child, node.data);
  23013. }
  23014. };
  23015. TreeStore.prototype._setCheckedKeys = function _setCheckedKeys(key) {
  23016. var leafOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  23017. var checkedKeys = arguments[2];
  23018. var allNodes = this._getAllNodes().sort(function (a, b) {
  23019. return b.level - a.level;
  23020. });
  23021. var cache = Object.create(null);
  23022. var keys = Object.keys(checkedKeys);
  23023. allNodes.forEach(function (node) {
  23024. return node.setChecked(false, false);
  23025. });
  23026. for (var i = 0, j = allNodes.length; i < j; i++) {
  23027. var node = allNodes[i];
  23028. var nodeKey = node.data[key].toString();
  23029. var checked = keys.indexOf(nodeKey) > -1;
  23030. if (!checked) {
  23031. if (node.checked && !cache[nodeKey]) {
  23032. node.setChecked(false, false);
  23033. }
  23034. continue;
  23035. }
  23036. var parent = node.parent;
  23037. while (parent && parent.level > 0) {
  23038. cache[parent.data[key]] = true;
  23039. parent = parent.parent;
  23040. }
  23041. if (node.isLeaf || this.checkStrictly) {
  23042. node.setChecked(true, false);
  23043. continue;
  23044. }
  23045. node.setChecked(true, true);
  23046. if (leafOnly) {
  23047. (function () {
  23048. node.setChecked(false, false);
  23049. var traverse = function traverse(node) {
  23050. var childNodes = node.childNodes;
  23051. childNodes.forEach(function (child) {
  23052. if (!child.isLeaf) {
  23053. child.setChecked(false, false);
  23054. }
  23055. traverse(child);
  23056. });
  23057. };
  23058. traverse(node);
  23059. })();
  23060. }
  23061. }
  23062. };
  23063. TreeStore.prototype.setCheckedNodes = function setCheckedNodes(array) {
  23064. var leafOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  23065. var key = this.key;
  23066. var checkedKeys = {};
  23067. array.forEach(function (item) {
  23068. checkedKeys[(item || {})[key]] = true;
  23069. });
  23070. this._setCheckedKeys(key, leafOnly, checkedKeys);
  23071. };
  23072. TreeStore.prototype.setCheckedKeys = function setCheckedKeys(keys) {
  23073. var leafOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  23074. this.defaultCheckedKeys = keys;
  23075. var key = this.key;
  23076. var checkedKeys = {};
  23077. keys.forEach(function (key) {
  23078. checkedKeys[key] = true;
  23079. });
  23080. this._setCheckedKeys(key, leafOnly, checkedKeys);
  23081. };
  23082. TreeStore.prototype.setDefaultExpandedKeys = function setDefaultExpandedKeys(keys) {
  23083. var _this6 = this;
  23084. keys = keys || [];
  23085. this.defaultExpandedKeys = keys;
  23086. keys.forEach(function (key) {
  23087. var node = _this6.getNode(key);
  23088. if (node) node.expand(null, _this6.autoExpandParent);
  23089. });
  23090. };
  23091. TreeStore.prototype.setChecked = function setChecked(data, checked, deep) {
  23092. var node = this.getNode(data);
  23093. if (node) {
  23094. node.setChecked(!!checked, deep);
  23095. }
  23096. };
  23097. TreeStore.prototype.getCurrentNode = function getCurrentNode() {
  23098. return this.currentNode;
  23099. };
  23100. TreeStore.prototype.setCurrentNode = function setCurrentNode(currentNode) {
  23101. var prevCurrentNode = this.currentNode;
  23102. if (prevCurrentNode) {
  23103. prevCurrentNode.isCurrent = false;
  23104. }
  23105. this.currentNode = currentNode;
  23106. this.currentNode.isCurrent = true;
  23107. };
  23108. TreeStore.prototype.setUserCurrentNode = function setUserCurrentNode(node) {
  23109. var key = node[this.key];
  23110. var currNode = this.nodesMap[key];
  23111. this.setCurrentNode(currNode);
  23112. };
  23113. TreeStore.prototype.setCurrentNodeKey = function setCurrentNodeKey(key) {
  23114. if (key === null || key === undefined) {
  23115. this.currentNode && (this.currentNode.isCurrent = false);
  23116. this.currentNode = null;
  23117. return;
  23118. }
  23119. var node = this.getNode(key);
  23120. if (node) {
  23121. this.setCurrentNode(node);
  23122. }
  23123. };
  23124. return TreeStore;
  23125. }();
  23126. /* harmony default export */ var tree_store = (tree_store_TreeStore);
  23127. ;
  23128. // 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&
  23129. var tree_nodevue_type_template_id_3ba3ef0e_render = function() {
  23130. var this$1 = this
  23131. var _vm = this
  23132. var _h = _vm.$createElement
  23133. var _c = _vm._self._c || _h
  23134. return _c(
  23135. "div",
  23136. {
  23137. directives: [
  23138. {
  23139. name: "show",
  23140. rawName: "v-show",
  23141. value: _vm.node.visible,
  23142. expression: "node.visible"
  23143. }
  23144. ],
  23145. ref: "node",
  23146. staticClass: "el-tree-node",
  23147. class: {
  23148. "is-expanded": _vm.expanded,
  23149. "is-current": _vm.node.isCurrent,
  23150. "is-hidden": !_vm.node.visible,
  23151. "is-focusable": !_vm.node.disabled,
  23152. "is-checked": !_vm.node.disabled && _vm.node.checked
  23153. },
  23154. attrs: {
  23155. role: "treeitem",
  23156. tabindex: "-1",
  23157. "aria-expanded": _vm.expanded,
  23158. "aria-disabled": _vm.node.disabled,
  23159. "aria-checked": _vm.node.checked,
  23160. draggable: _vm.tree.draggable
  23161. },
  23162. on: {
  23163. click: function($event) {
  23164. $event.stopPropagation()
  23165. return _vm.handleClick($event)
  23166. },
  23167. contextmenu: function($event) {
  23168. return this$1.handleContextMenu($event)
  23169. },
  23170. dragstart: function($event) {
  23171. $event.stopPropagation()
  23172. return _vm.handleDragStart($event)
  23173. },
  23174. dragover: function($event) {
  23175. $event.stopPropagation()
  23176. return _vm.handleDragOver($event)
  23177. },
  23178. dragend: function($event) {
  23179. $event.stopPropagation()
  23180. return _vm.handleDragEnd($event)
  23181. },
  23182. drop: function($event) {
  23183. $event.stopPropagation()
  23184. return _vm.handleDrop($event)
  23185. }
  23186. }
  23187. },
  23188. [
  23189. _c(
  23190. "div",
  23191. {
  23192. staticClass: "el-tree-node__content",
  23193. style: {
  23194. "padding-left": (_vm.node.level - 1) * _vm.tree.indent + "px"
  23195. }
  23196. },
  23197. [
  23198. _c("span", {
  23199. class: [
  23200. {
  23201. "is-leaf": _vm.node.isLeaf,
  23202. expanded: !_vm.node.isLeaf && _vm.expanded
  23203. },
  23204. "el-tree-node__expand-icon",
  23205. _vm.tree.iconClass ? _vm.tree.iconClass : "el-icon-caret-right"
  23206. ],
  23207. on: {
  23208. click: function($event) {
  23209. $event.stopPropagation()
  23210. return _vm.handleExpandIconClick($event)
  23211. }
  23212. }
  23213. }),
  23214. _vm.showCheckbox
  23215. ? _c("el-checkbox", {
  23216. attrs: {
  23217. indeterminate: _vm.node.indeterminate,
  23218. disabled: !!_vm.node.disabled
  23219. },
  23220. on: { change: _vm.handleCheckChange },
  23221. nativeOn: {
  23222. click: function($event) {
  23223. $event.stopPropagation()
  23224. }
  23225. },
  23226. model: {
  23227. value: _vm.node.checked,
  23228. callback: function($$v) {
  23229. _vm.$set(_vm.node, "checked", $$v)
  23230. },
  23231. expression: "node.checked"
  23232. }
  23233. })
  23234. : _vm._e(),
  23235. _vm.node.loading
  23236. ? _c("span", {
  23237. staticClass: "el-tree-node__loading-icon el-icon-loading"
  23238. })
  23239. : _vm._e(),
  23240. _c("node-content", { attrs: { node: _vm.node } })
  23241. ],
  23242. 1
  23243. ),
  23244. _c("el-collapse-transition", [
  23245. !_vm.renderAfterExpand || _vm.childNodeRendered
  23246. ? _c(
  23247. "div",
  23248. {
  23249. directives: [
  23250. {
  23251. name: "show",
  23252. rawName: "v-show",
  23253. value: _vm.expanded,
  23254. expression: "expanded"
  23255. }
  23256. ],
  23257. staticClass: "el-tree-node__children",
  23258. attrs: { role: "group", "aria-expanded": _vm.expanded }
  23259. },
  23260. _vm._l(_vm.node.childNodes, function(child) {
  23261. return _c("el-tree-node", {
  23262. key: _vm.getNodeKey(child),
  23263. attrs: {
  23264. "render-content": _vm.renderContent,
  23265. "render-after-expand": _vm.renderAfterExpand,
  23266. "show-checkbox": _vm.showCheckbox,
  23267. node: child
  23268. },
  23269. on: { "node-expand": _vm.handleChildNodeExpand }
  23270. })
  23271. }),
  23272. 1
  23273. )
  23274. : _vm._e()
  23275. ])
  23276. ],
  23277. 1
  23278. )
  23279. }
  23280. var tree_nodevue_type_template_id_3ba3ef0e_staticRenderFns = []
  23281. tree_nodevue_type_template_id_3ba3ef0e_render._withStripped = true
  23282. // CONCATENATED MODULE: ./packages/tree/src/tree-node.vue?vue&type=template&id=3ba3ef0e&
  23283. // 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&
  23284. //
  23285. //
  23286. //
  23287. //
  23288. //
  23289. //
  23290. //
  23291. //
  23292. //
  23293. //
  23294. //
  23295. //
  23296. //
  23297. //
  23298. //
  23299. //
  23300. //
  23301. //
  23302. //
  23303. //
  23304. //
  23305. //
  23306. //
  23307. //
  23308. //
  23309. //
  23310. //
  23311. //
  23312. //
  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. /* harmony default export */ var tree_nodevue_type_script_lang_js_ = ({
  23358. name: 'ElTreeNode',
  23359. componentName: 'ElTreeNode',
  23360. mixins: [emitter_default.a],
  23361. props: {
  23362. node: {
  23363. default: function _default() {
  23364. return {};
  23365. }
  23366. },
  23367. props: {},
  23368. renderContent: Function,
  23369. renderAfterExpand: {
  23370. type: Boolean,
  23371. default: true
  23372. },
  23373. showCheckbox: {
  23374. type: Boolean,
  23375. default: false
  23376. }
  23377. },
  23378. components: {
  23379. ElCollapseTransition: collapse_transition_default.a,
  23380. ElCheckbox: checkbox_default.a,
  23381. NodeContent: {
  23382. props: {
  23383. node: {
  23384. required: true
  23385. }
  23386. },
  23387. render: function render(h) {
  23388. var parent = this.$parent;
  23389. var tree = parent.tree;
  23390. var node = this.node;
  23391. var data = node.data,
  23392. store = node.store;
  23393. 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(
  23394. 'span',
  23395. { 'class': 'el-tree-node__label' },
  23396. [node.label]
  23397. );
  23398. }
  23399. }
  23400. },
  23401. data: function data() {
  23402. return {
  23403. tree: null,
  23404. expanded: false,
  23405. childNodeRendered: false,
  23406. oldChecked: null,
  23407. oldIndeterminate: null
  23408. };
  23409. },
  23410. watch: {
  23411. 'node.indeterminate': function nodeIndeterminate(val) {
  23412. this.handleSelectChange(this.node.checked, val);
  23413. },
  23414. 'node.checked': function nodeChecked(val) {
  23415. this.handleSelectChange(val, this.node.indeterminate);
  23416. },
  23417. 'node.expanded': function nodeExpanded(val) {
  23418. var _this = this;
  23419. this.$nextTick(function () {
  23420. return _this.expanded = val;
  23421. });
  23422. if (val) {
  23423. this.childNodeRendered = true;
  23424. }
  23425. }
  23426. },
  23427. methods: {
  23428. getNodeKey: function getNodeKey(node) {
  23429. return util_getNodeKey(this.tree.nodeKey, node.data);
  23430. },
  23431. handleSelectChange: function handleSelectChange(checked, indeterminate) {
  23432. if (this.oldChecked !== checked && this.oldIndeterminate !== indeterminate) {
  23433. this.tree.$emit('check-change', this.node.data, checked, indeterminate);
  23434. }
  23435. this.oldChecked = checked;
  23436. this.indeterminate = indeterminate;
  23437. },
  23438. handleClick: function handleClick() {
  23439. var store = this.tree.store;
  23440. store.setCurrentNode(this.node);
  23441. this.tree.$emit('current-change', store.currentNode ? store.currentNode.data : null, store.currentNode);
  23442. this.tree.currentNode = this;
  23443. if (this.tree.expandOnClickNode) {
  23444. this.handleExpandIconClick();
  23445. }
  23446. if (this.tree.checkOnClickNode && !this.node.disabled) {
  23447. this.handleCheckChange(null, {
  23448. target: { checked: !this.node.checked }
  23449. });
  23450. }
  23451. this.tree.$emit('node-click', this.node.data, this.node, this);
  23452. },
  23453. handleContextMenu: function handleContextMenu(event) {
  23454. if (this.tree._events['node-contextmenu'] && this.tree._events['node-contextmenu'].length > 0) {
  23455. event.stopPropagation();
  23456. event.preventDefault();
  23457. }
  23458. this.tree.$emit('node-contextmenu', event, this.node.data, this.node, this);
  23459. },
  23460. handleExpandIconClick: function handleExpandIconClick() {
  23461. if (this.node.isLeaf) return;
  23462. if (this.expanded) {
  23463. this.tree.$emit('node-collapse', this.node.data, this.node, this);
  23464. this.node.collapse();
  23465. } else {
  23466. this.node.expand();
  23467. this.$emit('node-expand', this.node.data, this.node, this);
  23468. }
  23469. },
  23470. handleCheckChange: function handleCheckChange(value, ev) {
  23471. var _this2 = this;
  23472. this.node.setChecked(ev.target.checked, !this.tree.checkStrictly);
  23473. this.$nextTick(function () {
  23474. var store = _this2.tree.store;
  23475. _this2.tree.$emit('check', _this2.node.data, {
  23476. checkedNodes: store.getCheckedNodes(),
  23477. checkedKeys: store.getCheckedKeys(),
  23478. halfCheckedNodes: store.getHalfCheckedNodes(),
  23479. halfCheckedKeys: store.getHalfCheckedKeys()
  23480. });
  23481. });
  23482. },
  23483. handleChildNodeExpand: function handleChildNodeExpand(nodeData, node, instance) {
  23484. this.broadcast('ElTreeNode', 'tree-node-expand', node);
  23485. this.tree.$emit('node-expand', nodeData, node, instance);
  23486. },
  23487. handleDragStart: function handleDragStart(event) {
  23488. if (!this.tree.draggable) return;
  23489. this.tree.$emit('tree-node-drag-start', event, this);
  23490. },
  23491. handleDragOver: function handleDragOver(event) {
  23492. if (!this.tree.draggable) return;
  23493. this.tree.$emit('tree-node-drag-over', event, this);
  23494. event.preventDefault();
  23495. },
  23496. handleDrop: function handleDrop(event) {
  23497. event.preventDefault();
  23498. },
  23499. handleDragEnd: function handleDragEnd(event) {
  23500. if (!this.tree.draggable) return;
  23501. this.tree.$emit('tree-node-drag-end', event, this);
  23502. }
  23503. },
  23504. created: function created() {
  23505. var _this3 = this;
  23506. var parent = this.$parent;
  23507. if (parent.isTree) {
  23508. this.tree = parent;
  23509. } else {
  23510. this.tree = parent.tree;
  23511. }
  23512. var tree = this.tree;
  23513. if (!tree) {
  23514. console.warn('Can not find node\'s tree.');
  23515. }
  23516. var props = tree.props || {};
  23517. var childrenKey = props['children'] || 'children';
  23518. this.$watch('node.data.' + childrenKey, function () {
  23519. _this3.node.updateChildren();
  23520. });
  23521. if (this.node.expanded) {
  23522. this.expanded = true;
  23523. this.childNodeRendered = true;
  23524. }
  23525. if (this.tree.accordion) {
  23526. this.$on('tree-node-expand', function (node) {
  23527. if (_this3.node !== node) {
  23528. _this3.node.collapse();
  23529. }
  23530. });
  23531. }
  23532. }
  23533. });
  23534. // CONCATENATED MODULE: ./packages/tree/src/tree-node.vue?vue&type=script&lang=js&
  23535. /* harmony default export */ var src_tree_nodevue_type_script_lang_js_ = (tree_nodevue_type_script_lang_js_);
  23536. // CONCATENATED MODULE: ./packages/tree/src/tree-node.vue
  23537. /* normalize component */
  23538. var tree_node_component = normalizeComponent(
  23539. src_tree_nodevue_type_script_lang_js_,
  23540. tree_nodevue_type_template_id_3ba3ef0e_render,
  23541. tree_nodevue_type_template_id_3ba3ef0e_staticRenderFns,
  23542. false,
  23543. null,
  23544. null,
  23545. null
  23546. )
  23547. /* hot reload */
  23548. if (false) { var tree_node_api; }
  23549. tree_node_component.options.__file = "packages/tree/src/tree-node.vue"
  23550. /* harmony default export */ var tree_node = (tree_node_component.exports);
  23551. // 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&
  23552. //
  23553. //
  23554. //
  23555. //
  23556. //
  23557. //
  23558. //
  23559. //
  23560. //
  23561. //
  23562. //
  23563. //
  23564. //
  23565. //
  23566. //
  23567. //
  23568. //
  23569. //
  23570. //
  23571. //
  23572. //
  23573. //
  23574. //
  23575. //
  23576. //
  23577. //
  23578. //
  23579. //
  23580. //
  23581. //
  23582. //
  23583. //
  23584. /* harmony default export */ var treevue_type_script_lang_js_ = ({
  23585. name: 'ElTree',
  23586. mixins: [emitter_default.a],
  23587. components: {
  23588. ElTreeNode: tree_node
  23589. },
  23590. data: function data() {
  23591. return {
  23592. store: null,
  23593. root: null,
  23594. currentNode: null,
  23595. treeItems: null,
  23596. checkboxItems: [],
  23597. dragState: {
  23598. showDropIndicator: false,
  23599. draggingNode: null,
  23600. dropNode: null,
  23601. allowDrop: true
  23602. }
  23603. };
  23604. },
  23605. props: {
  23606. data: {
  23607. type: Array
  23608. },
  23609. emptyText: {
  23610. type: String,
  23611. default: function _default() {
  23612. return Object(lib_locale_["t"])('el.tree.emptyText');
  23613. }
  23614. },
  23615. renderAfterExpand: {
  23616. type: Boolean,
  23617. default: true
  23618. },
  23619. nodeKey: String,
  23620. checkStrictly: Boolean,
  23621. defaultExpandAll: Boolean,
  23622. expandOnClickNode: {
  23623. type: Boolean,
  23624. default: true
  23625. },
  23626. checkOnClickNode: Boolean,
  23627. checkDescendants: {
  23628. type: Boolean,
  23629. default: false
  23630. },
  23631. autoExpandParent: {
  23632. type: Boolean,
  23633. default: true
  23634. },
  23635. defaultCheckedKeys: Array,
  23636. defaultExpandedKeys: Array,
  23637. currentNodeKey: [String, Number],
  23638. renderContent: Function,
  23639. showCheckbox: {
  23640. type: Boolean,
  23641. default: false
  23642. },
  23643. draggable: {
  23644. type: Boolean,
  23645. default: false
  23646. },
  23647. allowDrag: Function,
  23648. allowDrop: Function,
  23649. props: {
  23650. default: function _default() {
  23651. return {
  23652. children: 'children',
  23653. label: 'label',
  23654. disabled: 'disabled'
  23655. };
  23656. }
  23657. },
  23658. lazy: {
  23659. type: Boolean,
  23660. default: false
  23661. },
  23662. highlightCurrent: Boolean,
  23663. load: Function,
  23664. filterNodeMethod: Function,
  23665. accordion: Boolean,
  23666. indent: {
  23667. type: Number,
  23668. default: 18
  23669. },
  23670. iconClass: String
  23671. },
  23672. computed: {
  23673. children: {
  23674. set: function set(value) {
  23675. this.data = value;
  23676. },
  23677. get: function get() {
  23678. return this.data;
  23679. }
  23680. },
  23681. treeItemArray: function treeItemArray() {
  23682. return Array.prototype.slice.call(this.treeItems);
  23683. },
  23684. isEmpty: function isEmpty() {
  23685. var childNodes = this.root.childNodes;
  23686. return !childNodes || childNodes.length === 0 || childNodes.every(function (_ref) {
  23687. var visible = _ref.visible;
  23688. return !visible;
  23689. });
  23690. }
  23691. },
  23692. watch: {
  23693. defaultCheckedKeys: function defaultCheckedKeys(newVal) {
  23694. this.store.setDefaultCheckedKey(newVal);
  23695. },
  23696. defaultExpandedKeys: function defaultExpandedKeys(newVal) {
  23697. this.store.defaultExpandedKeys = newVal;
  23698. this.store.setDefaultExpandedKeys(newVal);
  23699. },
  23700. data: function data(newVal) {
  23701. this.store.setData(newVal);
  23702. },
  23703. checkboxItems: function checkboxItems(val) {
  23704. Array.prototype.forEach.call(val, function (checkbox) {
  23705. checkbox.setAttribute('tabindex', -1);
  23706. });
  23707. },
  23708. checkStrictly: function checkStrictly(newVal) {
  23709. this.store.checkStrictly = newVal;
  23710. }
  23711. },
  23712. methods: {
  23713. filter: function filter(value) {
  23714. if (!this.filterNodeMethod) throw new Error('[Tree] filterNodeMethod is required when filter');
  23715. this.store.filter(value);
  23716. },
  23717. getNodeKey: function getNodeKey(node) {
  23718. return util_getNodeKey(this.nodeKey, node.data);
  23719. },
  23720. getNodePath: function getNodePath(data) {
  23721. if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in getNodePath');
  23722. var node = this.store.getNode(data);
  23723. if (!node) return [];
  23724. var path = [node.data];
  23725. var parent = node.parent;
  23726. while (parent && parent !== this.root) {
  23727. path.push(parent.data);
  23728. parent = parent.parent;
  23729. }
  23730. return path.reverse();
  23731. },
  23732. getCheckedNodes: function getCheckedNodes(leafOnly, includeHalfChecked) {
  23733. return this.store.getCheckedNodes(leafOnly, includeHalfChecked);
  23734. },
  23735. getCheckedKeys: function getCheckedKeys(leafOnly) {
  23736. return this.store.getCheckedKeys(leafOnly);
  23737. },
  23738. getCurrentNode: function getCurrentNode() {
  23739. var currentNode = this.store.getCurrentNode();
  23740. return currentNode ? currentNode.data : null;
  23741. },
  23742. getCurrentKey: function getCurrentKey() {
  23743. if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in getCurrentKey');
  23744. var currentNode = this.getCurrentNode();
  23745. return currentNode ? currentNode[this.nodeKey] : null;
  23746. },
  23747. setCheckedNodes: function setCheckedNodes(nodes, leafOnly) {
  23748. if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in setCheckedNodes');
  23749. this.store.setCheckedNodes(nodes, leafOnly);
  23750. },
  23751. setCheckedKeys: function setCheckedKeys(keys, leafOnly) {
  23752. if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in setCheckedKeys');
  23753. this.store.setCheckedKeys(keys, leafOnly);
  23754. },
  23755. setChecked: function setChecked(data, checked, deep) {
  23756. this.store.setChecked(data, checked, deep);
  23757. },
  23758. getHalfCheckedNodes: function getHalfCheckedNodes() {
  23759. return this.store.getHalfCheckedNodes();
  23760. },
  23761. getHalfCheckedKeys: function getHalfCheckedKeys() {
  23762. return this.store.getHalfCheckedKeys();
  23763. },
  23764. setCurrentNode: function setCurrentNode(node) {
  23765. if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in setCurrentNode');
  23766. this.store.setUserCurrentNode(node);
  23767. },
  23768. setCurrentKey: function setCurrentKey(key) {
  23769. if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in setCurrentKey');
  23770. this.store.setCurrentNodeKey(key);
  23771. },
  23772. getNode: function getNode(data) {
  23773. return this.store.getNode(data);
  23774. },
  23775. remove: function remove(data) {
  23776. this.store.remove(data);
  23777. },
  23778. append: function append(data, parentNode) {
  23779. this.store.append(data, parentNode);
  23780. },
  23781. insertBefore: function insertBefore(data, refNode) {
  23782. this.store.insertBefore(data, refNode);
  23783. },
  23784. insertAfter: function insertAfter(data, refNode) {
  23785. this.store.insertAfter(data, refNode);
  23786. },
  23787. handleNodeExpand: function handleNodeExpand(nodeData, node, instance) {
  23788. this.broadcast('ElTreeNode', 'tree-node-expand', node);
  23789. this.$emit('node-expand', nodeData, node, instance);
  23790. },
  23791. updateKeyChildren: function updateKeyChildren(key, data) {
  23792. if (!this.nodeKey) throw new Error('[Tree] nodeKey is required in updateKeyChild');
  23793. this.store.updateChildren(key, data);
  23794. },
  23795. initTabIndex: function initTabIndex() {
  23796. this.treeItems = this.$el.querySelectorAll('.is-focusable[role=treeitem]');
  23797. this.checkboxItems = this.$el.querySelectorAll('input[type=checkbox]');
  23798. var checkedItem = this.$el.querySelectorAll('.is-checked[role=treeitem]');
  23799. if (checkedItem.length) {
  23800. checkedItem[0].setAttribute('tabindex', 0);
  23801. return;
  23802. }
  23803. this.treeItems[0] && this.treeItems[0].setAttribute('tabindex', 0);
  23804. },
  23805. handleKeydown: function handleKeydown(ev) {
  23806. var currentItem = ev.target;
  23807. if (currentItem.className.indexOf('el-tree-node') === -1) return;
  23808. var keyCode = ev.keyCode;
  23809. this.treeItems = this.$el.querySelectorAll('.is-focusable[role=treeitem]');
  23810. var currentIndex = this.treeItemArray.indexOf(currentItem);
  23811. var nextIndex = void 0;
  23812. if ([38, 40].indexOf(keyCode) > -1) {
  23813. // up、down
  23814. ev.preventDefault();
  23815. if (keyCode === 38) {
  23816. // up
  23817. nextIndex = currentIndex !== 0 ? currentIndex - 1 : 0;
  23818. } else {
  23819. nextIndex = currentIndex < this.treeItemArray.length - 1 ? currentIndex + 1 : 0;
  23820. }
  23821. this.treeItemArray[nextIndex].focus(); // 选中
  23822. }
  23823. if ([37, 39].indexOf(keyCode) > -1) {
  23824. // left、right 展开
  23825. ev.preventDefault();
  23826. currentItem.click(); // 选中
  23827. }
  23828. var hasInput = currentItem.querySelector('[type="checkbox"]');
  23829. if ([13, 32].indexOf(keyCode) > -1 && hasInput) {
  23830. // space enter选中checkbox
  23831. ev.preventDefault();
  23832. hasInput.click();
  23833. }
  23834. }
  23835. },
  23836. created: function created() {
  23837. var _this = this;
  23838. this.isTree = true;
  23839. this.store = new tree_store({
  23840. key: this.nodeKey,
  23841. data: this.data,
  23842. lazy: this.lazy,
  23843. props: this.props,
  23844. load: this.load,
  23845. currentNodeKey: this.currentNodeKey,
  23846. checkStrictly: this.checkStrictly,
  23847. checkDescendants: this.checkDescendants,
  23848. defaultCheckedKeys: this.defaultCheckedKeys,
  23849. defaultExpandedKeys: this.defaultExpandedKeys,
  23850. autoExpandParent: this.autoExpandParent,
  23851. defaultExpandAll: this.defaultExpandAll,
  23852. filterNodeMethod: this.filterNodeMethod
  23853. });
  23854. this.root = this.store.root;
  23855. var dragState = this.dragState;
  23856. this.$on('tree-node-drag-start', function (event, treeNode) {
  23857. if (typeof _this.allowDrag === 'function' && !_this.allowDrag(treeNode.node)) {
  23858. event.preventDefault();
  23859. return false;
  23860. }
  23861. event.dataTransfer.effectAllowed = 'move';
  23862. // wrap in try catch to address IE's error when first param is 'text/plain'
  23863. try {
  23864. // setData is required for draggable to work in FireFox
  23865. // the content has to be '' so dragging a node out of the tree won't open a new tab in FireFox
  23866. event.dataTransfer.setData('text/plain', '');
  23867. } catch (e) {}
  23868. dragState.draggingNode = treeNode;
  23869. _this.$emit('node-drag-start', treeNode.node, event);
  23870. });
  23871. this.$on('tree-node-drag-over', function (event, treeNode) {
  23872. var dropNode = findNearestComponent(event.target, 'ElTreeNode');
  23873. var oldDropNode = dragState.dropNode;
  23874. if (oldDropNode && oldDropNode !== dropNode) {
  23875. Object(dom_["removeClass"])(oldDropNode.$el, 'is-drop-inner');
  23876. }
  23877. var draggingNode = dragState.draggingNode;
  23878. if (!draggingNode || !dropNode) return;
  23879. var dropPrev = true;
  23880. var dropInner = true;
  23881. var dropNext = true;
  23882. var userAllowDropInner = true;
  23883. if (typeof _this.allowDrop === 'function') {
  23884. dropPrev = _this.allowDrop(draggingNode.node, dropNode.node, 'prev');
  23885. userAllowDropInner = dropInner = _this.allowDrop(draggingNode.node, dropNode.node, 'inner');
  23886. dropNext = _this.allowDrop(draggingNode.node, dropNode.node, 'next');
  23887. }
  23888. event.dataTransfer.dropEffect = dropInner ? 'move' : 'none';
  23889. if ((dropPrev || dropInner || dropNext) && oldDropNode !== dropNode) {
  23890. if (oldDropNode) {
  23891. _this.$emit('node-drag-leave', draggingNode.node, oldDropNode.node, event);
  23892. }
  23893. _this.$emit('node-drag-enter', draggingNode.node, dropNode.node, event);
  23894. }
  23895. if (dropPrev || dropInner || dropNext) {
  23896. dragState.dropNode = dropNode;
  23897. }
  23898. if (dropNode.node.nextSibling === draggingNode.node) {
  23899. dropNext = false;
  23900. }
  23901. if (dropNode.node.previousSibling === draggingNode.node) {
  23902. dropPrev = false;
  23903. }
  23904. if (dropNode.node.contains(draggingNode.node, false)) {
  23905. dropInner = false;
  23906. }
  23907. if (draggingNode.node === dropNode.node || draggingNode.node.contains(dropNode.node)) {
  23908. dropPrev = false;
  23909. dropInner = false;
  23910. dropNext = false;
  23911. }
  23912. var targetPosition = dropNode.$el.getBoundingClientRect();
  23913. var treePosition = _this.$el.getBoundingClientRect();
  23914. var dropType = void 0;
  23915. var prevPercent = dropPrev ? dropInner ? 0.25 : dropNext ? 0.45 : 1 : -1;
  23916. var nextPercent = dropNext ? dropInner ? 0.75 : dropPrev ? 0.55 : 0 : 1;
  23917. var indicatorTop = -9999;
  23918. var distance = event.clientY - targetPosition.top;
  23919. if (distance < targetPosition.height * prevPercent) {
  23920. dropType = 'before';
  23921. } else if (distance > targetPosition.height * nextPercent) {
  23922. dropType = 'after';
  23923. } else if (dropInner) {
  23924. dropType = 'inner';
  23925. } else {
  23926. dropType = 'none';
  23927. }
  23928. var iconPosition = dropNode.$el.querySelector('.el-tree-node__expand-icon').getBoundingClientRect();
  23929. var dropIndicator = _this.$refs.dropIndicator;
  23930. if (dropType === 'before') {
  23931. indicatorTop = iconPosition.top - treePosition.top;
  23932. } else if (dropType === 'after') {
  23933. indicatorTop = iconPosition.bottom - treePosition.top;
  23934. }
  23935. dropIndicator.style.top = indicatorTop + 'px';
  23936. dropIndicator.style.left = iconPosition.right - treePosition.left + 'px';
  23937. if (dropType === 'inner') {
  23938. Object(dom_["addClass"])(dropNode.$el, 'is-drop-inner');
  23939. } else {
  23940. Object(dom_["removeClass"])(dropNode.$el, 'is-drop-inner');
  23941. }
  23942. dragState.showDropIndicator = dropType === 'before' || dropType === 'after';
  23943. dragState.allowDrop = dragState.showDropIndicator || userAllowDropInner;
  23944. dragState.dropType = dropType;
  23945. _this.$emit('node-drag-over', draggingNode.node, dropNode.node, event);
  23946. });
  23947. this.$on('tree-node-drag-end', function (event) {
  23948. var draggingNode = dragState.draggingNode,
  23949. dropType = dragState.dropType,
  23950. dropNode = dragState.dropNode;
  23951. event.preventDefault();
  23952. event.dataTransfer.dropEffect = 'move';
  23953. if (draggingNode && dropNode) {
  23954. var draggingNodeCopy = { data: draggingNode.node.data };
  23955. if (dropType !== 'none') {
  23956. draggingNode.node.remove();
  23957. }
  23958. if (dropType === 'before') {
  23959. dropNode.node.parent.insertBefore(draggingNodeCopy, dropNode.node);
  23960. } else if (dropType === 'after') {
  23961. dropNode.node.parent.insertAfter(draggingNodeCopy, dropNode.node);
  23962. } else if (dropType === 'inner') {
  23963. dropNode.node.insertChild(draggingNodeCopy);
  23964. }
  23965. if (dropType !== 'none') {
  23966. _this.store.registerNode(draggingNodeCopy);
  23967. }
  23968. Object(dom_["removeClass"])(dropNode.$el, 'is-drop-inner');
  23969. _this.$emit('node-drag-end', draggingNode.node, dropNode.node, dropType, event);
  23970. if (dropType !== 'none') {
  23971. _this.$emit('node-drop', draggingNode.node, dropNode.node, dropType, event);
  23972. }
  23973. }
  23974. if (draggingNode && !dropNode) {
  23975. _this.$emit('node-drag-end', draggingNode.node, null, dropType, event);
  23976. }
  23977. dragState.showDropIndicator = false;
  23978. dragState.draggingNode = null;
  23979. dragState.dropNode = null;
  23980. dragState.allowDrop = true;
  23981. });
  23982. },
  23983. mounted: function mounted() {
  23984. this.initTabIndex();
  23985. this.$el.addEventListener('keydown', this.handleKeydown);
  23986. },
  23987. updated: function updated() {
  23988. this.treeItems = this.$el.querySelectorAll('[role=treeitem]');
  23989. this.checkboxItems = this.$el.querySelectorAll('input[type=checkbox]');
  23990. }
  23991. });
  23992. // CONCATENATED MODULE: ./packages/tree/src/tree.vue?vue&type=script&lang=js&
  23993. /* harmony default export */ var src_treevue_type_script_lang_js_ = (treevue_type_script_lang_js_);
  23994. // CONCATENATED MODULE: ./packages/tree/src/tree.vue
  23995. /* normalize component */
  23996. var tree_component = normalizeComponent(
  23997. src_treevue_type_script_lang_js_,
  23998. treevue_type_template_id_547575a6_render,
  23999. treevue_type_template_id_547575a6_staticRenderFns,
  24000. false,
  24001. null,
  24002. null,
  24003. null
  24004. )
  24005. /* hot reload */
  24006. if (false) { var tree_api; }
  24007. tree_component.options.__file = "packages/tree/src/tree.vue"
  24008. /* harmony default export */ var src_tree = (tree_component.exports);
  24009. // CONCATENATED MODULE: ./packages/tree/index.js
  24010. /* istanbul ignore next */
  24011. src_tree.install = function (Vue) {
  24012. Vue.component(src_tree.name, src_tree);
  24013. };
  24014. /* harmony default export */ var packages_tree = (src_tree);
  24015. // 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&
  24016. var mainvue_type_template_id_6e53341b_render = function() {
  24017. var _vm = this
  24018. var _h = _vm.$createElement
  24019. var _c = _vm._self._c || _h
  24020. return _c("transition", { attrs: { name: "el-alert-fade" } }, [
  24021. _c(
  24022. "div",
  24023. {
  24024. directives: [
  24025. {
  24026. name: "show",
  24027. rawName: "v-show",
  24028. value: _vm.visible,
  24029. expression: "visible"
  24030. }
  24031. ],
  24032. staticClass: "el-alert",
  24033. class: [
  24034. _vm.typeClass,
  24035. _vm.center ? "is-center" : "",
  24036. "is-" + _vm.effect
  24037. ],
  24038. attrs: { role: "alert" }
  24039. },
  24040. [
  24041. _vm.showIcon
  24042. ? _c("i", {
  24043. staticClass: "el-alert__icon",
  24044. class: [_vm.iconClass, _vm.isBigIcon]
  24045. })
  24046. : _vm._e(),
  24047. _c("div", { staticClass: "el-alert__content" }, [
  24048. _vm.title || _vm.$slots.title
  24049. ? _c(
  24050. "span",
  24051. { staticClass: "el-alert__title", class: [_vm.isBoldTitle] },
  24052. [_vm._t("title", [_vm._v(_vm._s(_vm.title))])],
  24053. 2
  24054. )
  24055. : _vm._e(),
  24056. _vm.$slots.default && !_vm.description
  24057. ? _c(
  24058. "p",
  24059. { staticClass: "el-alert__description" },
  24060. [_vm._t("default")],
  24061. 2
  24062. )
  24063. : _vm._e(),
  24064. _vm.description && !_vm.$slots.default
  24065. ? _c("p", { staticClass: "el-alert__description" }, [
  24066. _vm._v(_vm._s(_vm.description))
  24067. ])
  24068. : _vm._e(),
  24069. _c(
  24070. "i",
  24071. {
  24072. directives: [
  24073. {
  24074. name: "show",
  24075. rawName: "v-show",
  24076. value: _vm.closable,
  24077. expression: "closable"
  24078. }
  24079. ],
  24080. staticClass: "el-alert__closebtn",
  24081. class: {
  24082. "is-customed": _vm.closeText !== "",
  24083. "el-icon-close": _vm.closeText === ""
  24084. },
  24085. on: {
  24086. click: function($event) {
  24087. _vm.close()
  24088. }
  24089. }
  24090. },
  24091. [_vm._v(_vm._s(_vm.closeText))]
  24092. )
  24093. ])
  24094. ]
  24095. )
  24096. ])
  24097. }
  24098. var mainvue_type_template_id_6e53341b_staticRenderFns = []
  24099. mainvue_type_template_id_6e53341b_render._withStripped = true
  24100. // CONCATENATED MODULE: ./packages/alert/src/main.vue?vue&type=template&id=6e53341b&
  24101. // 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&
  24102. //
  24103. //
  24104. //
  24105. //
  24106. //
  24107. //
  24108. //
  24109. //
  24110. //
  24111. //
  24112. //
  24113. //
  24114. //
  24115. //
  24116. //
  24117. //
  24118. //
  24119. //
  24120. //
  24121. //
  24122. //
  24123. var TYPE_CLASSES_MAP = {
  24124. 'success': 'el-icon-success',
  24125. 'warning': 'el-icon-warning',
  24126. 'error': 'el-icon-error'
  24127. };
  24128. /* harmony default export */ var alert_src_mainvue_type_script_lang_js_ = ({
  24129. name: 'ElAlert',
  24130. props: {
  24131. title: {
  24132. type: String,
  24133. default: ''
  24134. },
  24135. description: {
  24136. type: String,
  24137. default: ''
  24138. },
  24139. type: {
  24140. type: String,
  24141. default: 'info'
  24142. },
  24143. closable: {
  24144. type: Boolean,
  24145. default: true
  24146. },
  24147. closeText: {
  24148. type: String,
  24149. default: ''
  24150. },
  24151. showIcon: Boolean,
  24152. center: Boolean,
  24153. effect: {
  24154. type: String,
  24155. default: 'light',
  24156. validator: function validator(value) {
  24157. return ['light', 'dark'].indexOf(value) !== -1;
  24158. }
  24159. }
  24160. },
  24161. data: function data() {
  24162. return {
  24163. visible: true
  24164. };
  24165. },
  24166. methods: {
  24167. close: function close() {
  24168. this.visible = false;
  24169. this.$emit('close');
  24170. }
  24171. },
  24172. computed: {
  24173. typeClass: function typeClass() {
  24174. return 'el-alert--' + this.type;
  24175. },
  24176. iconClass: function iconClass() {
  24177. return TYPE_CLASSES_MAP[this.type] || 'el-icon-info';
  24178. },
  24179. isBigIcon: function isBigIcon() {
  24180. return this.description || this.$slots.default ? 'is-big' : '';
  24181. },
  24182. isBoldTitle: function isBoldTitle() {
  24183. return this.description || this.$slots.default ? 'is-bold' : '';
  24184. }
  24185. }
  24186. });
  24187. // CONCATENATED MODULE: ./packages/alert/src/main.vue?vue&type=script&lang=js&
  24188. /* harmony default export */ var packages_alert_src_mainvue_type_script_lang_js_ = (alert_src_mainvue_type_script_lang_js_);
  24189. // CONCATENATED MODULE: ./packages/alert/src/main.vue
  24190. /* normalize component */
  24191. var alert_src_main_component = normalizeComponent(
  24192. packages_alert_src_mainvue_type_script_lang_js_,
  24193. mainvue_type_template_id_6e53341b_render,
  24194. mainvue_type_template_id_6e53341b_staticRenderFns,
  24195. false,
  24196. null,
  24197. null,
  24198. null
  24199. )
  24200. /* hot reload */
  24201. if (false) { var alert_src_main_api; }
  24202. alert_src_main_component.options.__file = "packages/alert/src/main.vue"
  24203. /* harmony default export */ var alert_src_main = (alert_src_main_component.exports);
  24204. // CONCATENATED MODULE: ./packages/alert/index.js
  24205. /* istanbul ignore next */
  24206. alert_src_main.install = function (Vue) {
  24207. Vue.component(alert_src_main.name, alert_src_main);
  24208. };
  24209. /* harmony default export */ var packages_alert = (alert_src_main);
  24210. // 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&
  24211. var mainvue_type_template_id_43dbc3d8_render = function() {
  24212. var _vm = this
  24213. var _h = _vm.$createElement
  24214. var _c = _vm._self._c || _h
  24215. return _c("transition", { attrs: { name: "el-notification-fade" } }, [
  24216. _c(
  24217. "div",
  24218. {
  24219. directives: [
  24220. {
  24221. name: "show",
  24222. rawName: "v-show",
  24223. value: _vm.visible,
  24224. expression: "visible"
  24225. }
  24226. ],
  24227. class: ["el-notification", _vm.customClass, _vm.horizontalClass],
  24228. style: _vm.positionStyle,
  24229. attrs: { role: "alert" },
  24230. on: {
  24231. mouseenter: function($event) {
  24232. _vm.clearTimer()
  24233. },
  24234. mouseleave: function($event) {
  24235. _vm.startTimer()
  24236. },
  24237. click: _vm.click
  24238. }
  24239. },
  24240. [
  24241. _vm.type || _vm.iconClass
  24242. ? _c("i", {
  24243. staticClass: "el-notification__icon",
  24244. class: [_vm.typeClass, _vm.iconClass]
  24245. })
  24246. : _vm._e(),
  24247. _c(
  24248. "div",
  24249. {
  24250. staticClass: "el-notification__group",
  24251. class: { "is-with-icon": _vm.typeClass || _vm.iconClass }
  24252. },
  24253. [
  24254. _c("h2", {
  24255. staticClass: "el-notification__title",
  24256. domProps: { textContent: _vm._s(_vm.title) }
  24257. }),
  24258. _c(
  24259. "div",
  24260. {
  24261. directives: [
  24262. {
  24263. name: "show",
  24264. rawName: "v-show",
  24265. value: _vm.message,
  24266. expression: "message"
  24267. }
  24268. ],
  24269. staticClass: "el-notification__content"
  24270. },
  24271. [
  24272. _vm._t("default", [
  24273. !_vm.dangerouslyUseHTMLString
  24274. ? _c("p", [_vm._v(_vm._s(_vm.message))])
  24275. : _c("p", { domProps: { innerHTML: _vm._s(_vm.message) } })
  24276. ])
  24277. ],
  24278. 2
  24279. ),
  24280. _vm.showClose
  24281. ? _c("div", {
  24282. staticClass: "el-notification__closeBtn el-icon-close",
  24283. on: {
  24284. click: function($event) {
  24285. $event.stopPropagation()
  24286. return _vm.close($event)
  24287. }
  24288. }
  24289. })
  24290. : _vm._e()
  24291. ]
  24292. )
  24293. ]
  24294. )
  24295. ])
  24296. }
  24297. var mainvue_type_template_id_43dbc3d8_staticRenderFns = []
  24298. mainvue_type_template_id_43dbc3d8_render._withStripped = true
  24299. // CONCATENATED MODULE: ./packages/notification/src/main.vue?vue&type=template&id=43dbc3d8&
  24300. // 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&
  24301. //
  24302. //
  24303. //
  24304. //
  24305. //
  24306. //
  24307. //
  24308. //
  24309. //
  24310. //
  24311. //
  24312. //
  24313. //
  24314. //
  24315. //
  24316. //
  24317. //
  24318. //
  24319. //
  24320. //
  24321. //
  24322. //
  24323. //
  24324. //
  24325. //
  24326. //
  24327. //
  24328. //
  24329. //
  24330. //
  24331. //
  24332. //
  24333. //
  24334. var mainvue_type_script_lang_js_typeMap = {
  24335. success: 'success',
  24336. info: 'info',
  24337. warning: 'warning',
  24338. error: 'error'
  24339. };
  24340. /* harmony default export */ var notification_src_mainvue_type_script_lang_js_ = ({
  24341. data: function data() {
  24342. return {
  24343. visible: false,
  24344. title: '',
  24345. message: '',
  24346. duration: 4500,
  24347. type: '',
  24348. showClose: true,
  24349. customClass: '',
  24350. iconClass: '',
  24351. onClose: null,
  24352. onClick: null,
  24353. closed: false,
  24354. verticalOffset: 0,
  24355. timer: null,
  24356. dangerouslyUseHTMLString: false,
  24357. position: 'top-right'
  24358. };
  24359. },
  24360. computed: {
  24361. typeClass: function typeClass() {
  24362. return this.type && mainvue_type_script_lang_js_typeMap[this.type] ? 'el-icon-' + mainvue_type_script_lang_js_typeMap[this.type] : '';
  24363. },
  24364. horizontalClass: function horizontalClass() {
  24365. return this.position.indexOf('right') > -1 ? 'right' : 'left';
  24366. },
  24367. verticalProperty: function verticalProperty() {
  24368. return (/^top-/.test(this.position) ? 'top' : 'bottom'
  24369. );
  24370. },
  24371. positionStyle: function positionStyle() {
  24372. var _ref;
  24373. return _ref = {}, _ref[this.verticalProperty] = this.verticalOffset + 'px', _ref;
  24374. }
  24375. },
  24376. watch: {
  24377. closed: function closed(newVal) {
  24378. if (newVal) {
  24379. this.visible = false;
  24380. this.$el.addEventListener('transitionend', this.destroyElement);
  24381. }
  24382. }
  24383. },
  24384. methods: {
  24385. destroyElement: function destroyElement() {
  24386. this.$el.removeEventListener('transitionend', this.destroyElement);
  24387. this.$destroy(true);
  24388. this.$el.parentNode.removeChild(this.$el);
  24389. },
  24390. click: function click() {
  24391. if (typeof this.onClick === 'function') {
  24392. this.onClick();
  24393. }
  24394. },
  24395. close: function close() {
  24396. this.closed = true;
  24397. if (typeof this.onClose === 'function') {
  24398. this.onClose();
  24399. }
  24400. },
  24401. clearTimer: function clearTimer() {
  24402. clearTimeout(this.timer);
  24403. },
  24404. startTimer: function startTimer() {
  24405. var _this = this;
  24406. if (this.duration > 0) {
  24407. this.timer = setTimeout(function () {
  24408. if (!_this.closed) {
  24409. _this.close();
  24410. }
  24411. }, this.duration);
  24412. }
  24413. },
  24414. keydown: function keydown(e) {
  24415. if (e.keyCode === 46 || e.keyCode === 8) {
  24416. this.clearTimer(); // detele 取消倒计时
  24417. } else if (e.keyCode === 27) {
  24418. // esc关闭消息
  24419. if (!this.closed) {
  24420. this.close();
  24421. }
  24422. } else {
  24423. this.startTimer(); // 恢复倒计时
  24424. }
  24425. }
  24426. },
  24427. mounted: function mounted() {
  24428. var _this2 = this;
  24429. if (this.duration > 0) {
  24430. this.timer = setTimeout(function () {
  24431. if (!_this2.closed) {
  24432. _this2.close();
  24433. }
  24434. }, this.duration);
  24435. }
  24436. document.addEventListener('keydown', this.keydown);
  24437. },
  24438. beforeDestroy: function beforeDestroy() {
  24439. document.removeEventListener('keydown', this.keydown);
  24440. }
  24441. });
  24442. // CONCATENATED MODULE: ./packages/notification/src/main.vue?vue&type=script&lang=js&
  24443. /* harmony default export */ var packages_notification_src_mainvue_type_script_lang_js_ = (notification_src_mainvue_type_script_lang_js_);
  24444. // CONCATENATED MODULE: ./packages/notification/src/main.vue
  24445. /* normalize component */
  24446. var notification_src_main_component = normalizeComponent(
  24447. packages_notification_src_mainvue_type_script_lang_js_,
  24448. mainvue_type_template_id_43dbc3d8_render,
  24449. mainvue_type_template_id_43dbc3d8_staticRenderFns,
  24450. false,
  24451. null,
  24452. null,
  24453. null
  24454. )
  24455. /* hot reload */
  24456. if (false) { var notification_src_main_api; }
  24457. notification_src_main_component.options.__file = "packages/notification/src/main.vue"
  24458. /* harmony default export */ var notification_src_main = (notification_src_main_component.exports);
  24459. // CONCATENATED MODULE: ./packages/notification/src/main.js
  24460. var NotificationConstructor = external_vue_default.a.extend(notification_src_main);
  24461. var src_main_instance = void 0;
  24462. var instances = [];
  24463. var seed = 1;
  24464. var main_Notification = function Notification(options) {
  24465. if (external_vue_default.a.prototype.$isServer) return;
  24466. options = merge_default()({}, options);
  24467. var userOnClose = options.onClose;
  24468. var id = 'notification_' + seed++;
  24469. var position = options.position || 'top-right';
  24470. options.onClose = function () {
  24471. Notification.close(id, userOnClose);
  24472. };
  24473. src_main_instance = new NotificationConstructor({
  24474. data: options
  24475. });
  24476. if (Object(vdom_["isVNode"])(options.message)) {
  24477. src_main_instance.$slots.default = [options.message];
  24478. options.message = 'REPLACED_BY_VNODE';
  24479. }
  24480. src_main_instance.id = id;
  24481. src_main_instance.$mount();
  24482. document.body.appendChild(src_main_instance.$el);
  24483. src_main_instance.visible = true;
  24484. src_main_instance.dom = src_main_instance.$el;
  24485. src_main_instance.dom.style.zIndex = popup_["PopupManager"].nextZIndex();
  24486. var verticalOffset = options.offset || 0;
  24487. instances.filter(function (item) {
  24488. return item.position === position;
  24489. }).forEach(function (item) {
  24490. verticalOffset += item.$el.offsetHeight + 16;
  24491. });
  24492. verticalOffset += 16;
  24493. src_main_instance.verticalOffset = verticalOffset;
  24494. instances.push(src_main_instance);
  24495. return src_main_instance;
  24496. };
  24497. ['success', 'warning', 'info', 'error'].forEach(function (type) {
  24498. main_Notification[type] = function (options) {
  24499. if (typeof options === 'string' || Object(vdom_["isVNode"])(options)) {
  24500. options = {
  24501. message: options
  24502. };
  24503. }
  24504. options.type = type;
  24505. return main_Notification(options);
  24506. };
  24507. });
  24508. main_Notification.close = function (id, userOnClose) {
  24509. var index = -1;
  24510. var len = instances.length;
  24511. var instance = instances.filter(function (instance, i) {
  24512. if (instance.id === id) {
  24513. index = i;
  24514. return true;
  24515. }
  24516. return false;
  24517. })[0];
  24518. if (!instance) return;
  24519. if (typeof userOnClose === 'function') {
  24520. userOnClose(instance);
  24521. }
  24522. instances.splice(index, 1);
  24523. if (len <= 1) return;
  24524. var position = instance.position;
  24525. var removedHeight = instance.dom.offsetHeight;
  24526. for (var i = index; i < len - 1; i++) {
  24527. if (instances[i].position === position) {
  24528. instances[i].dom.style[instance.verticalProperty] = parseInt(instances[i].dom.style[instance.verticalProperty], 10) - removedHeight - 16 + 'px';
  24529. }
  24530. }
  24531. };
  24532. main_Notification.closeAll = function () {
  24533. for (var i = instances.length - 1; i >= 0; i--) {
  24534. instances[i].close();
  24535. }
  24536. };
  24537. /* harmony default export */ var packages_notification_src_main = (main_Notification);
  24538. // CONCATENATED MODULE: ./packages/notification/index.js
  24539. /* harmony default export */ var notification = (packages_notification_src_main);
  24540. // 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&
  24541. var mainvue_type_template_id_32708644_render = function() {
  24542. var _vm = this
  24543. var _h = _vm.$createElement
  24544. var _c = _vm._self._c || _h
  24545. return _c(
  24546. "div",
  24547. {
  24548. staticClass: "el-slider",
  24549. class: {
  24550. "is-vertical": _vm.vertical,
  24551. "el-slider--with-input": _vm.showInput
  24552. },
  24553. attrs: {
  24554. role: "slider",
  24555. "aria-valuemin": _vm.min,
  24556. "aria-valuemax": _vm.max,
  24557. "aria-orientation": _vm.vertical ? "vertical" : "horizontal",
  24558. "aria-disabled": _vm.sliderDisabled
  24559. }
  24560. },
  24561. [
  24562. _vm.showInput && !_vm.range
  24563. ? _c("el-input-number", {
  24564. ref: "input",
  24565. staticClass: "el-slider__input",
  24566. attrs: {
  24567. step: _vm.step,
  24568. disabled: _vm.sliderDisabled,
  24569. controls: _vm.showInputControls,
  24570. min: _vm.min,
  24571. max: _vm.max,
  24572. debounce: _vm.debounce,
  24573. size: _vm.inputSize
  24574. },
  24575. on: { change: _vm.emitChange },
  24576. model: {
  24577. value: _vm.firstValue,
  24578. callback: function($$v) {
  24579. _vm.firstValue = $$v
  24580. },
  24581. expression: "firstValue"
  24582. }
  24583. })
  24584. : _vm._e(),
  24585. _c(
  24586. "div",
  24587. {
  24588. ref: "slider",
  24589. staticClass: "el-slider__runway",
  24590. class: { "show-input": _vm.showInput, disabled: _vm.sliderDisabled },
  24591. style: _vm.runwayStyle,
  24592. on: { click: _vm.onSliderClick }
  24593. },
  24594. [
  24595. _c("div", { staticClass: "el-slider__bar", style: _vm.barStyle }),
  24596. _c("slider-button", {
  24597. ref: "button1",
  24598. attrs: {
  24599. vertical: _vm.vertical,
  24600. "tooltip-class": _vm.tooltipClass
  24601. },
  24602. model: {
  24603. value: _vm.firstValue,
  24604. callback: function($$v) {
  24605. _vm.firstValue = $$v
  24606. },
  24607. expression: "firstValue"
  24608. }
  24609. }),
  24610. _vm.range
  24611. ? _c("slider-button", {
  24612. ref: "button2",
  24613. attrs: {
  24614. vertical: _vm.vertical,
  24615. "tooltip-class": _vm.tooltipClass
  24616. },
  24617. model: {
  24618. value: _vm.secondValue,
  24619. callback: function($$v) {
  24620. _vm.secondValue = $$v
  24621. },
  24622. expression: "secondValue"
  24623. }
  24624. })
  24625. : _vm._e(),
  24626. _vm._l(_vm.stops, function(item, key) {
  24627. return _vm.showStops
  24628. ? _c("div", {
  24629. key: key,
  24630. staticClass: "el-slider__stop",
  24631. style: _vm.getStopStyle(item)
  24632. })
  24633. : _vm._e()
  24634. }),
  24635. _vm.markList.length > 0
  24636. ? [
  24637. _c(
  24638. "div",
  24639. _vm._l(_vm.markList, function(item, key) {
  24640. return _c("div", {
  24641. key: key,
  24642. staticClass: "el-slider__stop el-slider__marks-stop",
  24643. style: _vm.getStopStyle(item.position)
  24644. })
  24645. }),
  24646. 0
  24647. ),
  24648. _c(
  24649. "div",
  24650. { staticClass: "el-slider__marks" },
  24651. _vm._l(_vm.markList, function(item, key) {
  24652. return _c("slider-marker", {
  24653. key: key,
  24654. style: _vm.getStopStyle(item.position),
  24655. attrs: { mark: item.mark }
  24656. })
  24657. }),
  24658. 1
  24659. )
  24660. ]
  24661. : _vm._e()
  24662. ],
  24663. 2
  24664. )
  24665. ],
  24666. 1
  24667. )
  24668. }
  24669. var mainvue_type_template_id_32708644_staticRenderFns = []
  24670. mainvue_type_template_id_32708644_render._withStripped = true
  24671. // CONCATENATED MODULE: ./packages/slider/src/main.vue?vue&type=template&id=32708644&
  24672. // EXTERNAL MODULE: external "element-ui/lib/input-number"
  24673. var input_number_ = __webpack_require__(42);
  24674. var input_number_default = /*#__PURE__*/__webpack_require__.n(input_number_);
  24675. // 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&
  24676. var buttonvue_type_template_id_e72d2ad2_render = function() {
  24677. var _vm = this
  24678. var _h = _vm.$createElement
  24679. var _c = _vm._self._c || _h
  24680. return _c(
  24681. "div",
  24682. {
  24683. ref: "button",
  24684. staticClass: "el-slider__button-wrapper",
  24685. class: { hover: _vm.hovering, dragging: _vm.dragging },
  24686. style: _vm.wrapperStyle,
  24687. attrs: { tabindex: "0" },
  24688. on: {
  24689. mouseenter: _vm.handleMouseEnter,
  24690. mouseleave: _vm.handleMouseLeave,
  24691. mousedown: _vm.onButtonDown,
  24692. touchstart: _vm.onButtonDown,
  24693. focus: _vm.handleMouseEnter,
  24694. blur: _vm.handleMouseLeave,
  24695. keydown: [
  24696. function($event) {
  24697. if (
  24698. !("button" in $event) &&
  24699. _vm._k($event.keyCode, "left", 37, $event.key, [
  24700. "Left",
  24701. "ArrowLeft"
  24702. ])
  24703. ) {
  24704. return null
  24705. }
  24706. if ("button" in $event && $event.button !== 0) {
  24707. return null
  24708. }
  24709. return _vm.onLeftKeyDown($event)
  24710. },
  24711. function($event) {
  24712. if (
  24713. !("button" in $event) &&
  24714. _vm._k($event.keyCode, "right", 39, $event.key, [
  24715. "Right",
  24716. "ArrowRight"
  24717. ])
  24718. ) {
  24719. return null
  24720. }
  24721. if ("button" in $event && $event.button !== 2) {
  24722. return null
  24723. }
  24724. return _vm.onRightKeyDown($event)
  24725. },
  24726. function($event) {
  24727. if (
  24728. !("button" in $event) &&
  24729. _vm._k($event.keyCode, "down", 40, $event.key, [
  24730. "Down",
  24731. "ArrowDown"
  24732. ])
  24733. ) {
  24734. return null
  24735. }
  24736. $event.preventDefault()
  24737. return _vm.onLeftKeyDown($event)
  24738. },
  24739. function($event) {
  24740. if (
  24741. !("button" in $event) &&
  24742. _vm._k($event.keyCode, "up", 38, $event.key, ["Up", "ArrowUp"])
  24743. ) {
  24744. return null
  24745. }
  24746. $event.preventDefault()
  24747. return _vm.onRightKeyDown($event)
  24748. }
  24749. ]
  24750. }
  24751. },
  24752. [
  24753. _c(
  24754. "el-tooltip",
  24755. {
  24756. ref: "tooltip",
  24757. attrs: {
  24758. placement: "top",
  24759. "popper-class": _vm.tooltipClass,
  24760. disabled: !_vm.showTooltip
  24761. }
  24762. },
  24763. [
  24764. _c("span", { attrs: { slot: "content" }, slot: "content" }, [
  24765. _vm._v(_vm._s(_vm.formatValue))
  24766. ]),
  24767. _c("div", {
  24768. staticClass: "el-slider__button",
  24769. class: { hover: _vm.hovering, dragging: _vm.dragging }
  24770. })
  24771. ]
  24772. )
  24773. ],
  24774. 1
  24775. )
  24776. }
  24777. var buttonvue_type_template_id_e72d2ad2_staticRenderFns = []
  24778. buttonvue_type_template_id_e72d2ad2_render._withStripped = true
  24779. // CONCATENATED MODULE: ./packages/slider/src/button.vue?vue&type=template&id=e72d2ad2&
  24780. // 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&
  24781. //
  24782. //
  24783. //
  24784. //
  24785. //
  24786. //
  24787. //
  24788. //
  24789. //
  24790. //
  24791. //
  24792. //
  24793. //
  24794. //
  24795. //
  24796. //
  24797. //
  24798. //
  24799. //
  24800. //
  24801. //
  24802. //
  24803. //
  24804. //
  24805. //
  24806. //
  24807. //
  24808. //
  24809. //
  24810. /* harmony default export */ var slider_src_buttonvue_type_script_lang_js_ = ({
  24811. name: 'ElSliderButton',
  24812. components: {
  24813. ElTooltip: tooltip_default.a
  24814. },
  24815. props: {
  24816. value: {
  24817. type: Number,
  24818. default: 0
  24819. },
  24820. vertical: {
  24821. type: Boolean,
  24822. default: false
  24823. },
  24824. tooltipClass: String
  24825. },
  24826. data: function data() {
  24827. return {
  24828. hovering: false,
  24829. dragging: false,
  24830. isClick: false,
  24831. startX: 0,
  24832. currentX: 0,
  24833. startY: 0,
  24834. currentY: 0,
  24835. startPosition: 0,
  24836. newPosition: null,
  24837. oldValue: this.value
  24838. };
  24839. },
  24840. computed: {
  24841. disabled: function disabled() {
  24842. return this.$parent.sliderDisabled;
  24843. },
  24844. max: function max() {
  24845. return this.$parent.max;
  24846. },
  24847. min: function min() {
  24848. return this.$parent.min;
  24849. },
  24850. step: function step() {
  24851. return this.$parent.step;
  24852. },
  24853. showTooltip: function showTooltip() {
  24854. return this.$parent.showTooltip;
  24855. },
  24856. precision: function precision() {
  24857. return this.$parent.precision;
  24858. },
  24859. currentPosition: function currentPosition() {
  24860. return (this.value - this.min) / (this.max - this.min) * 100 + '%';
  24861. },
  24862. enableFormat: function enableFormat() {
  24863. return this.$parent.formatTooltip instanceof Function;
  24864. },
  24865. formatValue: function formatValue() {
  24866. return this.enableFormat && this.$parent.formatTooltip(this.value) || this.value;
  24867. },
  24868. wrapperStyle: function wrapperStyle() {
  24869. return this.vertical ? { bottom: this.currentPosition } : { left: this.currentPosition };
  24870. }
  24871. },
  24872. watch: {
  24873. dragging: function dragging(val) {
  24874. this.$parent.dragging = val;
  24875. }
  24876. },
  24877. methods: {
  24878. displayTooltip: function displayTooltip() {
  24879. this.$refs.tooltip && (this.$refs.tooltip.showPopper = true);
  24880. },
  24881. hideTooltip: function hideTooltip() {
  24882. this.$refs.tooltip && (this.$refs.tooltip.showPopper = false);
  24883. },
  24884. handleMouseEnter: function handleMouseEnter() {
  24885. this.hovering = true;
  24886. this.displayTooltip();
  24887. },
  24888. handleMouseLeave: function handleMouseLeave() {
  24889. this.hovering = false;
  24890. this.hideTooltip();
  24891. },
  24892. onButtonDown: function onButtonDown(event) {
  24893. if (this.disabled) return;
  24894. event.preventDefault();
  24895. this.onDragStart(event);
  24896. window.addEventListener('mousemove', this.onDragging);
  24897. window.addEventListener('touchmove', this.onDragging);
  24898. window.addEventListener('mouseup', this.onDragEnd);
  24899. window.addEventListener('touchend', this.onDragEnd);
  24900. window.addEventListener('contextmenu', this.onDragEnd);
  24901. },
  24902. onLeftKeyDown: function onLeftKeyDown() {
  24903. if (this.disabled) return;
  24904. this.newPosition = parseFloat(this.currentPosition) - this.step / (this.max - this.min) * 100;
  24905. this.setPosition(this.newPosition);
  24906. this.$parent.emitChange();
  24907. },
  24908. onRightKeyDown: function onRightKeyDown() {
  24909. if (this.disabled) return;
  24910. this.newPosition = parseFloat(this.currentPosition) + this.step / (this.max - this.min) * 100;
  24911. this.setPosition(this.newPosition);
  24912. this.$parent.emitChange();
  24913. },
  24914. onDragStart: function onDragStart(event) {
  24915. this.dragging = true;
  24916. this.isClick = true;
  24917. if (event.type === 'touchstart') {
  24918. event.clientY = event.touches[0].clientY;
  24919. event.clientX = event.touches[0].clientX;
  24920. }
  24921. if (this.vertical) {
  24922. this.startY = event.clientY;
  24923. } else {
  24924. this.startX = event.clientX;
  24925. }
  24926. this.startPosition = parseFloat(this.currentPosition);
  24927. this.newPosition = this.startPosition;
  24928. },
  24929. onDragging: function onDragging(event) {
  24930. if (this.dragging) {
  24931. this.isClick = false;
  24932. this.displayTooltip();
  24933. this.$parent.resetSize();
  24934. var diff = 0;
  24935. if (event.type === 'touchmove') {
  24936. event.clientY = event.touches[0].clientY;
  24937. event.clientX = event.touches[0].clientX;
  24938. }
  24939. if (this.vertical) {
  24940. this.currentY = event.clientY;
  24941. diff = (this.startY - this.currentY) / this.$parent.sliderSize * 100;
  24942. } else {
  24943. this.currentX = event.clientX;
  24944. diff = (this.currentX - this.startX) / this.$parent.sliderSize * 100;
  24945. }
  24946. this.newPosition = this.startPosition + diff;
  24947. this.setPosition(this.newPosition);
  24948. }
  24949. },
  24950. onDragEnd: function onDragEnd() {
  24951. var _this = this;
  24952. if (this.dragging) {
  24953. /*
  24954. * 防止在 mouseup 后立即触发 click,导致滑块有几率产生一小段位移
  24955. * 不使用 preventDefault 是因为 mouseup 和 click 没有注册在同一个 DOM 上
  24956. */
  24957. setTimeout(function () {
  24958. _this.dragging = false;
  24959. _this.hideTooltip();
  24960. if (!_this.isClick) {
  24961. _this.setPosition(_this.newPosition);
  24962. _this.$parent.emitChange();
  24963. }
  24964. }, 0);
  24965. window.removeEventListener('mousemove', this.onDragging);
  24966. window.removeEventListener('touchmove', this.onDragging);
  24967. window.removeEventListener('mouseup', this.onDragEnd);
  24968. window.removeEventListener('touchend', this.onDragEnd);
  24969. window.removeEventListener('contextmenu', this.onDragEnd);
  24970. }
  24971. },
  24972. setPosition: function setPosition(newPosition) {
  24973. var _this2 = this;
  24974. if (newPosition === null || isNaN(newPosition)) return;
  24975. if (newPosition < 0) {
  24976. newPosition = 0;
  24977. } else if (newPosition > 100) {
  24978. newPosition = 100;
  24979. }
  24980. var lengthPerStep = 100 / ((this.max - this.min) / this.step);
  24981. var steps = Math.round(newPosition / lengthPerStep);
  24982. var value = steps * lengthPerStep * (this.max - this.min) * 0.01 + this.min;
  24983. value = parseFloat(value.toFixed(this.precision));
  24984. this.$emit('input', value);
  24985. this.$nextTick(function () {
  24986. _this2.displayTooltip();
  24987. _this2.$refs.tooltip && _this2.$refs.tooltip.updatePopper();
  24988. });
  24989. if (!this.dragging && this.value !== this.oldValue) {
  24990. this.oldValue = this.value;
  24991. }
  24992. }
  24993. }
  24994. });
  24995. // CONCATENATED MODULE: ./packages/slider/src/button.vue?vue&type=script&lang=js&
  24996. /* harmony default export */ var packages_slider_src_buttonvue_type_script_lang_js_ = (slider_src_buttonvue_type_script_lang_js_);
  24997. // CONCATENATED MODULE: ./packages/slider/src/button.vue
  24998. /* normalize component */
  24999. var src_button_component = normalizeComponent(
  25000. packages_slider_src_buttonvue_type_script_lang_js_,
  25001. buttonvue_type_template_id_e72d2ad2_render,
  25002. buttonvue_type_template_id_e72d2ad2_staticRenderFns,
  25003. false,
  25004. null,
  25005. null,
  25006. null
  25007. )
  25008. /* hot reload */
  25009. if (false) { var src_button_api; }
  25010. src_button_component.options.__file = "packages/slider/src/button.vue"
  25011. /* harmony default export */ var slider_src_button = (src_button_component.exports);
  25012. // CONCATENATED MODULE: ./packages/slider/src/marker.js
  25013. /* harmony default export */ var marker = ({
  25014. name: 'ElMarker',
  25015. props: {
  25016. mark: {
  25017. type: [String, Object]
  25018. }
  25019. },
  25020. render: function render() {
  25021. var h = arguments[0];
  25022. var label = typeof this.mark === 'string' ? this.mark : this.mark.label;
  25023. return h(
  25024. 'div',
  25025. { 'class': 'el-slider__marks-text', style: this.mark.style || {} },
  25026. [label]
  25027. );
  25028. }
  25029. });
  25030. // 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&
  25031. //
  25032. //
  25033. //
  25034. //
  25035. //
  25036. //
  25037. //
  25038. //
  25039. //
  25040. //
  25041. //
  25042. //
  25043. //
  25044. //
  25045. //
  25046. //
  25047. //
  25048. //
  25049. //
  25050. //
  25051. //
  25052. //
  25053. //
  25054. //
  25055. //
  25056. //
  25057. //
  25058. //
  25059. //
  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. /* harmony default export */ var slider_src_mainvue_type_script_lang_js_ = ({
  25107. name: 'ElSlider',
  25108. mixins: [emitter_default.a],
  25109. inject: {
  25110. elForm: {
  25111. default: ''
  25112. }
  25113. },
  25114. props: {
  25115. min: {
  25116. type: Number,
  25117. default: 0
  25118. },
  25119. max: {
  25120. type: Number,
  25121. default: 100
  25122. },
  25123. step: {
  25124. type: Number,
  25125. default: 1
  25126. },
  25127. value: {
  25128. type: [Number, Array],
  25129. default: 0
  25130. },
  25131. showInput: {
  25132. type: Boolean,
  25133. default: false
  25134. },
  25135. showInputControls: {
  25136. type: Boolean,
  25137. default: true
  25138. },
  25139. inputSize: {
  25140. type: String,
  25141. default: 'small'
  25142. },
  25143. showStops: {
  25144. type: Boolean,
  25145. default: false
  25146. },
  25147. showTooltip: {
  25148. type: Boolean,
  25149. default: true
  25150. },
  25151. formatTooltip: Function,
  25152. disabled: {
  25153. type: Boolean,
  25154. default: false
  25155. },
  25156. range: {
  25157. type: Boolean,
  25158. default: false
  25159. },
  25160. vertical: {
  25161. type: Boolean,
  25162. default: false
  25163. },
  25164. height: {
  25165. type: String
  25166. },
  25167. debounce: {
  25168. type: Number,
  25169. default: 300
  25170. },
  25171. label: {
  25172. type: String
  25173. },
  25174. tooltipClass: String,
  25175. marks: Object
  25176. },
  25177. components: {
  25178. ElInputNumber: input_number_default.a,
  25179. SliderButton: slider_src_button,
  25180. SliderMarker: marker
  25181. },
  25182. data: function data() {
  25183. return {
  25184. firstValue: null,
  25185. secondValue: null,
  25186. oldValue: null,
  25187. dragging: false,
  25188. sliderSize: 1
  25189. };
  25190. },
  25191. watch: {
  25192. value: function value(val, oldVal) {
  25193. if (this.dragging || Array.isArray(val) && Array.isArray(oldVal) && val.every(function (item, index) {
  25194. return item === oldVal[index];
  25195. })) {
  25196. return;
  25197. }
  25198. this.setValues();
  25199. },
  25200. dragging: function dragging(val) {
  25201. if (!val) {
  25202. this.setValues();
  25203. }
  25204. },
  25205. firstValue: function firstValue(val) {
  25206. if (this.range) {
  25207. this.$emit('input', [this.minValue, this.maxValue]);
  25208. } else {
  25209. this.$emit('input', val);
  25210. }
  25211. },
  25212. secondValue: function secondValue() {
  25213. if (this.range) {
  25214. this.$emit('input', [this.minValue, this.maxValue]);
  25215. }
  25216. },
  25217. min: function min() {
  25218. this.setValues();
  25219. },
  25220. max: function max() {
  25221. this.setValues();
  25222. }
  25223. },
  25224. methods: {
  25225. valueChanged: function valueChanged() {
  25226. var _this = this;
  25227. if (this.range) {
  25228. return ![this.minValue, this.maxValue].every(function (item, index) {
  25229. return item === _this.oldValue[index];
  25230. });
  25231. } else {
  25232. return this.value !== this.oldValue;
  25233. }
  25234. },
  25235. setValues: function setValues() {
  25236. if (this.min > this.max) {
  25237. console.error('[Element Error][Slider]min should not be greater than max.');
  25238. return;
  25239. }
  25240. var val = this.value;
  25241. if (this.range && Array.isArray(val)) {
  25242. if (val[1] < this.min) {
  25243. this.$emit('input', [this.min, this.min]);
  25244. } else if (val[0] > this.max) {
  25245. this.$emit('input', [this.max, this.max]);
  25246. } else if (val[0] < this.min) {
  25247. this.$emit('input', [this.min, val[1]]);
  25248. } else if (val[1] > this.max) {
  25249. this.$emit('input', [val[0], this.max]);
  25250. } else {
  25251. this.firstValue = val[0];
  25252. this.secondValue = val[1];
  25253. if (this.valueChanged()) {
  25254. this.dispatch('ElFormItem', 'el.form.change', [this.minValue, this.maxValue]);
  25255. this.oldValue = val.slice();
  25256. }
  25257. }
  25258. } else if (!this.range && typeof val === 'number' && !isNaN(val)) {
  25259. if (val < this.min) {
  25260. this.$emit('input', this.min);
  25261. } else if (val > this.max) {
  25262. this.$emit('input', this.max);
  25263. } else {
  25264. this.firstValue = val;
  25265. if (this.valueChanged()) {
  25266. this.dispatch('ElFormItem', 'el.form.change', val);
  25267. this.oldValue = val;
  25268. }
  25269. }
  25270. }
  25271. },
  25272. setPosition: function setPosition(percent) {
  25273. var targetValue = this.min + percent * (this.max - this.min) / 100;
  25274. if (!this.range) {
  25275. this.$refs.button1.setPosition(percent);
  25276. return;
  25277. }
  25278. var button = void 0;
  25279. if (Math.abs(this.minValue - targetValue) < Math.abs(this.maxValue - targetValue)) {
  25280. button = this.firstValue < this.secondValue ? 'button1' : 'button2';
  25281. } else {
  25282. button = this.firstValue > this.secondValue ? 'button1' : 'button2';
  25283. }
  25284. this.$refs[button].setPosition(percent);
  25285. },
  25286. onSliderClick: function onSliderClick(event) {
  25287. if (this.sliderDisabled || this.dragging) return;
  25288. this.resetSize();
  25289. if (this.vertical) {
  25290. var sliderOffsetBottom = this.$refs.slider.getBoundingClientRect().bottom;
  25291. this.setPosition((sliderOffsetBottom - event.clientY) / this.sliderSize * 100);
  25292. } else {
  25293. var sliderOffsetLeft = this.$refs.slider.getBoundingClientRect().left;
  25294. this.setPosition((event.clientX - sliderOffsetLeft) / this.sliderSize * 100);
  25295. }
  25296. this.emitChange();
  25297. },
  25298. resetSize: function resetSize() {
  25299. if (this.$refs.slider) {
  25300. this.sliderSize = this.$refs.slider['client' + (this.vertical ? 'Height' : 'Width')];
  25301. }
  25302. },
  25303. emitChange: function emitChange() {
  25304. var _this2 = this;
  25305. this.$nextTick(function () {
  25306. _this2.$emit('change', _this2.range ? [_this2.minValue, _this2.maxValue] : _this2.value);
  25307. });
  25308. },
  25309. getStopStyle: function getStopStyle(position) {
  25310. return this.vertical ? { 'bottom': position + '%' } : { 'left': position + '%' };
  25311. }
  25312. },
  25313. computed: {
  25314. stops: function stops() {
  25315. var _this3 = this;
  25316. if (!this.showStops || this.min > this.max) return [];
  25317. if (this.step === 0) {
  25318. false && false;
  25319. return [];
  25320. }
  25321. var stopCount = (this.max - this.min) / this.step;
  25322. var stepWidth = 100 * this.step / (this.max - this.min);
  25323. var result = [];
  25324. for (var i = 1; i < stopCount; i++) {
  25325. result.push(i * stepWidth);
  25326. }
  25327. if (this.range) {
  25328. return result.filter(function (step) {
  25329. return step < 100 * (_this3.minValue - _this3.min) / (_this3.max - _this3.min) || step > 100 * (_this3.maxValue - _this3.min) / (_this3.max - _this3.min);
  25330. });
  25331. } else {
  25332. return result.filter(function (step) {
  25333. return step > 100 * (_this3.firstValue - _this3.min) / (_this3.max - _this3.min);
  25334. });
  25335. }
  25336. },
  25337. markList: function markList() {
  25338. var _this4 = this;
  25339. if (!this.marks) {
  25340. return [];
  25341. }
  25342. var marksKeys = Object.keys(this.marks);
  25343. return marksKeys.map(parseFloat).sort(function (a, b) {
  25344. return a - b;
  25345. }).filter(function (point) {
  25346. return point <= _this4.max && point >= _this4.min;
  25347. }).map(function (point) {
  25348. return {
  25349. point: point,
  25350. position: (point - _this4.min) * 100 / (_this4.max - _this4.min),
  25351. mark: _this4.marks[point]
  25352. };
  25353. });
  25354. },
  25355. minValue: function minValue() {
  25356. return Math.min(this.firstValue, this.secondValue);
  25357. },
  25358. maxValue: function maxValue() {
  25359. return Math.max(this.firstValue, this.secondValue);
  25360. },
  25361. barSize: function barSize() {
  25362. return this.range ? 100 * (this.maxValue - this.minValue) / (this.max - this.min) + '%' : 100 * (this.firstValue - this.min) / (this.max - this.min) + '%';
  25363. },
  25364. barStart: function barStart() {
  25365. return this.range ? 100 * (this.minValue - this.min) / (this.max - this.min) + '%' : '0%';
  25366. },
  25367. precision: function precision() {
  25368. var precisions = [this.min, this.max, this.step].map(function (item) {
  25369. var decimal = ('' + item).split('.')[1];
  25370. return decimal ? decimal.length : 0;
  25371. });
  25372. return Math.max.apply(null, precisions);
  25373. },
  25374. runwayStyle: function runwayStyle() {
  25375. return this.vertical ? { height: this.height } : {};
  25376. },
  25377. barStyle: function barStyle() {
  25378. return this.vertical ? {
  25379. height: this.barSize,
  25380. bottom: this.barStart
  25381. } : {
  25382. width: this.barSize,
  25383. left: this.barStart
  25384. };
  25385. },
  25386. sliderDisabled: function sliderDisabled() {
  25387. return this.disabled || (this.elForm || {}).disabled;
  25388. }
  25389. },
  25390. mounted: function mounted() {
  25391. var valuetext = void 0;
  25392. if (this.range) {
  25393. if (Array.isArray(this.value)) {
  25394. this.firstValue = Math.max(this.min, this.value[0]);
  25395. this.secondValue = Math.min(this.max, this.value[1]);
  25396. } else {
  25397. this.firstValue = this.min;
  25398. this.secondValue = this.max;
  25399. }
  25400. this.oldValue = [this.firstValue, this.secondValue];
  25401. valuetext = this.firstValue + '-' + this.secondValue;
  25402. } else {
  25403. if (typeof this.value !== 'number' || isNaN(this.value)) {
  25404. this.firstValue = this.min;
  25405. } else {
  25406. this.firstValue = Math.min(this.max, Math.max(this.min, this.value));
  25407. }
  25408. this.oldValue = this.firstValue;
  25409. valuetext = this.firstValue;
  25410. }
  25411. this.$el.setAttribute('aria-valuetext', valuetext);
  25412. // label screen reader
  25413. this.$el.setAttribute('aria-label', this.label ? this.label : 'slider between ' + this.min + ' and ' + this.max);
  25414. this.resetSize();
  25415. window.addEventListener('resize', this.resetSize);
  25416. },
  25417. beforeDestroy: function beforeDestroy() {
  25418. window.removeEventListener('resize', this.resetSize);
  25419. }
  25420. });
  25421. // CONCATENATED MODULE: ./packages/slider/src/main.vue?vue&type=script&lang=js&
  25422. /* harmony default export */ var packages_slider_src_mainvue_type_script_lang_js_ = (slider_src_mainvue_type_script_lang_js_);
  25423. // CONCATENATED MODULE: ./packages/slider/src/main.vue
  25424. /* normalize component */
  25425. var slider_src_main_component = normalizeComponent(
  25426. packages_slider_src_mainvue_type_script_lang_js_,
  25427. mainvue_type_template_id_32708644_render,
  25428. mainvue_type_template_id_32708644_staticRenderFns,
  25429. false,
  25430. null,
  25431. null,
  25432. null
  25433. )
  25434. /* hot reload */
  25435. if (false) { var slider_src_main_api; }
  25436. slider_src_main_component.options.__file = "packages/slider/src/main.vue"
  25437. /* harmony default export */ var slider_src_main = (slider_src_main_component.exports);
  25438. // CONCATENATED MODULE: ./packages/slider/index.js
  25439. /* istanbul ignore next */
  25440. slider_src_main.install = function (Vue) {
  25441. Vue.component(slider_src_main.name, slider_src_main);
  25442. };
  25443. /* harmony default export */ var slider = (slider_src_main);
  25444. // 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&
  25445. var loadingvue_type_template_id_eee0a7ac_render = function() {
  25446. var _vm = this
  25447. var _h = _vm.$createElement
  25448. var _c = _vm._self._c || _h
  25449. return _c(
  25450. "transition",
  25451. {
  25452. attrs: { name: "el-loading-fade" },
  25453. on: { "after-leave": _vm.handleAfterLeave }
  25454. },
  25455. [
  25456. _c(
  25457. "div",
  25458. {
  25459. directives: [
  25460. {
  25461. name: "show",
  25462. rawName: "v-show",
  25463. value: _vm.visible,
  25464. expression: "visible"
  25465. }
  25466. ],
  25467. staticClass: "el-loading-mask",
  25468. class: [_vm.customClass, { "is-fullscreen": _vm.fullscreen }],
  25469. style: { backgroundColor: _vm.background || "" }
  25470. },
  25471. [
  25472. _c("div", { staticClass: "el-loading-spinner" }, [
  25473. !_vm.spinner
  25474. ? _c(
  25475. "svg",
  25476. {
  25477. staticClass: "circular",
  25478. attrs: { viewBox: "25 25 50 50" }
  25479. },
  25480. [
  25481. _c("circle", {
  25482. staticClass: "path",
  25483. attrs: { cx: "50", cy: "50", r: "20", fill: "none" }
  25484. })
  25485. ]
  25486. )
  25487. : _c("i", { class: _vm.spinner }),
  25488. _vm.text
  25489. ? _c("p", { staticClass: "el-loading-text" }, [
  25490. _vm._v(_vm._s(_vm.text))
  25491. ])
  25492. : _vm._e()
  25493. ])
  25494. ]
  25495. )
  25496. ]
  25497. )
  25498. }
  25499. var loadingvue_type_template_id_eee0a7ac_staticRenderFns = []
  25500. loadingvue_type_template_id_eee0a7ac_render._withStripped = true
  25501. // CONCATENATED MODULE: ./packages/loading/src/loading.vue?vue&type=template&id=eee0a7ac&
  25502. // 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&
  25503. //
  25504. //
  25505. //
  25506. //
  25507. //
  25508. //
  25509. //
  25510. //
  25511. //
  25512. //
  25513. //
  25514. //
  25515. //
  25516. //
  25517. //
  25518. //
  25519. //
  25520. //
  25521. /* harmony default export */ var loadingvue_type_script_lang_js_ = ({
  25522. data: function data() {
  25523. return {
  25524. text: null,
  25525. spinner: null,
  25526. background: null,
  25527. fullscreen: true,
  25528. visible: false,
  25529. customClass: ''
  25530. };
  25531. },
  25532. methods: {
  25533. handleAfterLeave: function handleAfterLeave() {
  25534. this.$emit('after-leave');
  25535. },
  25536. setText: function setText(text) {
  25537. this.text = text;
  25538. }
  25539. }
  25540. });
  25541. // CONCATENATED MODULE: ./packages/loading/src/loading.vue?vue&type=script&lang=js&
  25542. /* harmony default export */ var src_loadingvue_type_script_lang_js_ = (loadingvue_type_script_lang_js_);
  25543. // CONCATENATED MODULE: ./packages/loading/src/loading.vue
  25544. /* normalize component */
  25545. var loading_component = normalizeComponent(
  25546. src_loadingvue_type_script_lang_js_,
  25547. loadingvue_type_template_id_eee0a7ac_render,
  25548. loadingvue_type_template_id_eee0a7ac_staticRenderFns,
  25549. false,
  25550. null,
  25551. null,
  25552. null
  25553. )
  25554. /* hot reload */
  25555. if (false) { var loading_api; }
  25556. loading_component.options.__file = "packages/loading/src/loading.vue"
  25557. /* harmony default export */ var loading = (loading_component.exports);
  25558. // EXTERNAL MODULE: external "element-ui/lib/utils/after-leave"
  25559. var after_leave_ = __webpack_require__(33);
  25560. var after_leave_default = /*#__PURE__*/__webpack_require__.n(after_leave_);
  25561. // CONCATENATED MODULE: ./packages/loading/src/directive.js
  25562. var Mask = external_vue_default.a.extend(loading);
  25563. var loadingDirective = {};
  25564. loadingDirective.install = function (Vue) {
  25565. if (Vue.prototype.$isServer) return;
  25566. var toggleLoading = function toggleLoading(el, binding) {
  25567. if (binding.value) {
  25568. Vue.nextTick(function () {
  25569. if (binding.modifiers.fullscreen) {
  25570. el.originalPosition = Object(dom_["getStyle"])(document.body, 'position');
  25571. el.originalOverflow = Object(dom_["getStyle"])(document.body, 'overflow');
  25572. el.maskStyle.zIndex = popup_["PopupManager"].nextZIndex();
  25573. Object(dom_["addClass"])(el.mask, 'is-fullscreen');
  25574. insertDom(document.body, el, binding);
  25575. } else {
  25576. Object(dom_["removeClass"])(el.mask, 'is-fullscreen');
  25577. if (binding.modifiers.body) {
  25578. el.originalPosition = Object(dom_["getStyle"])(document.body, 'position');
  25579. ['top', 'left'].forEach(function (property) {
  25580. var scroll = property === 'top' ? 'scrollTop' : 'scrollLeft';
  25581. el.maskStyle[property] = el.getBoundingClientRect()[property] + document.body[scroll] + document.documentElement[scroll] - parseInt(Object(dom_["getStyle"])(document.body, 'margin-' + property), 10) + 'px';
  25582. });
  25583. ['height', 'width'].forEach(function (property) {
  25584. el.maskStyle[property] = el.getBoundingClientRect()[property] + 'px';
  25585. });
  25586. insertDom(document.body, el, binding);
  25587. } else {
  25588. el.originalPosition = Object(dom_["getStyle"])(el, 'position');
  25589. insertDom(el, el, binding);
  25590. }
  25591. }
  25592. });
  25593. } else {
  25594. after_leave_default()(el.instance, function (_) {
  25595. if (!el.instance.hiding) return;
  25596. el.domVisible = false;
  25597. var target = binding.modifiers.fullscreen || binding.modifiers.body ? document.body : el;
  25598. Object(dom_["removeClass"])(target, 'el-loading-parent--relative');
  25599. Object(dom_["removeClass"])(target, 'el-loading-parent--hidden');
  25600. el.instance.hiding = false;
  25601. }, 300, true);
  25602. el.instance.visible = false;
  25603. el.instance.hiding = true;
  25604. }
  25605. };
  25606. var insertDom = function insertDom(parent, el, binding) {
  25607. if (!el.domVisible && Object(dom_["getStyle"])(el, 'display') !== 'none' && Object(dom_["getStyle"])(el, 'visibility') !== 'hidden') {
  25608. Object.keys(el.maskStyle).forEach(function (property) {
  25609. el.mask.style[property] = el.maskStyle[property];
  25610. });
  25611. if (el.originalPosition !== 'absolute' && el.originalPosition !== 'fixed' && el.originalPosition !== 'sticky') {
  25612. Object(dom_["addClass"])(parent, 'el-loading-parent--relative');
  25613. }
  25614. if (binding.modifiers.fullscreen && binding.modifiers.lock) {
  25615. Object(dom_["addClass"])(parent, 'el-loading-parent--hidden');
  25616. }
  25617. el.domVisible = true;
  25618. parent.appendChild(el.mask);
  25619. Vue.nextTick(function () {
  25620. if (el.instance.hiding) {
  25621. el.instance.$emit('after-leave');
  25622. } else {
  25623. el.instance.visible = true;
  25624. }
  25625. });
  25626. el.domInserted = true;
  25627. } else if (el.domVisible && el.instance.hiding === true) {
  25628. el.instance.visible = true;
  25629. el.instance.hiding = false;
  25630. }
  25631. };
  25632. Vue.directive('loading', {
  25633. bind: function bind(el, binding, vnode) {
  25634. var textExr = el.getAttribute('element-loading-text');
  25635. var spinnerExr = el.getAttribute('element-loading-spinner');
  25636. var backgroundExr = el.getAttribute('element-loading-background');
  25637. var customClassExr = el.getAttribute('element-loading-custom-class');
  25638. var vm = vnode.context;
  25639. var mask = new Mask({
  25640. el: document.createElement('div'),
  25641. data: {
  25642. text: vm && vm[textExr] || textExr,
  25643. spinner: vm && vm[spinnerExr] || spinnerExr,
  25644. background: vm && vm[backgroundExr] || backgroundExr,
  25645. customClass: vm && vm[customClassExr] || customClassExr,
  25646. fullscreen: !!binding.modifiers.fullscreen
  25647. }
  25648. });
  25649. el.instance = mask;
  25650. el.mask = mask.$el;
  25651. el.maskStyle = {};
  25652. binding.value && toggleLoading(el, binding);
  25653. },
  25654. update: function update(el, binding) {
  25655. el.instance.setText(el.getAttribute('element-loading-text'));
  25656. if (binding.oldValue !== binding.value) {
  25657. toggleLoading(el, binding);
  25658. }
  25659. },
  25660. unbind: function unbind(el, binding) {
  25661. if (el.domInserted) {
  25662. el.mask && el.mask.parentNode && el.mask.parentNode.removeChild(el.mask);
  25663. toggleLoading(el, { value: false, modifiers: binding.modifiers });
  25664. }
  25665. el.instance && el.instance.$destroy();
  25666. }
  25667. });
  25668. };
  25669. /* harmony default export */ var src_directive = (loadingDirective);
  25670. // CONCATENATED MODULE: ./packages/loading/src/index.js
  25671. var LoadingConstructor = external_vue_default.a.extend(loading);
  25672. var src_defaults = {
  25673. text: null,
  25674. fullscreen: true,
  25675. body: false,
  25676. lock: false,
  25677. customClass: ''
  25678. };
  25679. var fullscreenLoading = void 0;
  25680. LoadingConstructor.prototype.originalPosition = '';
  25681. LoadingConstructor.prototype.originalOverflow = '';
  25682. LoadingConstructor.prototype.close = function () {
  25683. var _this = this;
  25684. if (this.fullscreen) {
  25685. fullscreenLoading = undefined;
  25686. }
  25687. after_leave_default()(this, function (_) {
  25688. var target = _this.fullscreen || _this.body ? document.body : _this.target;
  25689. Object(dom_["removeClass"])(target, 'el-loading-parent--relative');
  25690. Object(dom_["removeClass"])(target, 'el-loading-parent--hidden');
  25691. if (_this.$el && _this.$el.parentNode) {
  25692. _this.$el.parentNode.removeChild(_this.$el);
  25693. }
  25694. _this.$destroy();
  25695. }, 300);
  25696. this.visible = false;
  25697. };
  25698. var src_addStyle = function addStyle(options, parent, instance) {
  25699. var maskStyle = {};
  25700. if (options.fullscreen) {
  25701. instance.originalPosition = Object(dom_["getStyle"])(document.body, 'position');
  25702. instance.originalOverflow = Object(dom_["getStyle"])(document.body, 'overflow');
  25703. maskStyle.zIndex = popup_["PopupManager"].nextZIndex();
  25704. } else if (options.body) {
  25705. instance.originalPosition = Object(dom_["getStyle"])(document.body, 'position');
  25706. ['top', 'left'].forEach(function (property) {
  25707. var scroll = property === 'top' ? 'scrollTop' : 'scrollLeft';
  25708. maskStyle[property] = options.target.getBoundingClientRect()[property] + document.body[scroll] + document.documentElement[scroll] + 'px';
  25709. });
  25710. ['height', 'width'].forEach(function (property) {
  25711. maskStyle[property] = options.target.getBoundingClientRect()[property] + 'px';
  25712. });
  25713. } else {
  25714. instance.originalPosition = Object(dom_["getStyle"])(parent, 'position');
  25715. }
  25716. Object.keys(maskStyle).forEach(function (property) {
  25717. instance.$el.style[property] = maskStyle[property];
  25718. });
  25719. };
  25720. var src_Loading = function Loading() {
  25721. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  25722. if (external_vue_default.a.prototype.$isServer) return;
  25723. options = merge_default()({}, src_defaults, options);
  25724. if (typeof options.target === 'string') {
  25725. options.target = document.querySelector(options.target);
  25726. }
  25727. options.target = options.target || document.body;
  25728. if (options.target !== document.body) {
  25729. options.fullscreen = false;
  25730. } else {
  25731. options.body = true;
  25732. }
  25733. if (options.fullscreen && fullscreenLoading) {
  25734. return fullscreenLoading;
  25735. }
  25736. var parent = options.body ? document.body : options.target;
  25737. var instance = new LoadingConstructor({
  25738. el: document.createElement('div'),
  25739. data: options
  25740. });
  25741. src_addStyle(options, parent, instance);
  25742. if (instance.originalPosition !== 'absolute' && instance.originalPosition !== 'fixed' && instance.originalPosition !== 'sticky') {
  25743. Object(dom_["addClass"])(parent, 'el-loading-parent--relative');
  25744. }
  25745. if (options.fullscreen && options.lock) {
  25746. Object(dom_["addClass"])(parent, 'el-loading-parent--hidden');
  25747. }
  25748. parent.appendChild(instance.$el);
  25749. external_vue_default.a.nextTick(function () {
  25750. instance.visible = true;
  25751. });
  25752. if (options.fullscreen) {
  25753. fullscreenLoading = instance;
  25754. }
  25755. return instance;
  25756. };
  25757. /* harmony default export */ var src = (src_Loading);
  25758. // CONCATENATED MODULE: ./packages/loading/index.js
  25759. /* harmony default export */ var packages_loading = ({
  25760. install: function install(Vue) {
  25761. Vue.use(src_directive);
  25762. Vue.prototype.$loading = src;
  25763. },
  25764. directive: src_directive,
  25765. service: src
  25766. });
  25767. // 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&
  25768. var iconvue_type_template_id_cb3fe7f4_render = function() {
  25769. var _vm = this
  25770. var _h = _vm.$createElement
  25771. var _c = _vm._self._c || _h
  25772. return _c("i", { class: "el-icon-" + _vm.name })
  25773. }
  25774. var iconvue_type_template_id_cb3fe7f4_staticRenderFns = []
  25775. iconvue_type_template_id_cb3fe7f4_render._withStripped = true
  25776. // CONCATENATED MODULE: ./packages/icon/src/icon.vue?vue&type=template&id=cb3fe7f4&
  25777. // 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&
  25778. //
  25779. //
  25780. //
  25781. //
  25782. /* harmony default export */ var iconvue_type_script_lang_js_ = ({
  25783. name: 'ElIcon',
  25784. props: {
  25785. name: String
  25786. }
  25787. });
  25788. // CONCATENATED MODULE: ./packages/icon/src/icon.vue?vue&type=script&lang=js&
  25789. /* harmony default export */ var src_iconvue_type_script_lang_js_ = (iconvue_type_script_lang_js_);
  25790. // CONCATENATED MODULE: ./packages/icon/src/icon.vue
  25791. /* normalize component */
  25792. var icon_component = normalizeComponent(
  25793. src_iconvue_type_script_lang_js_,
  25794. iconvue_type_template_id_cb3fe7f4_render,
  25795. iconvue_type_template_id_cb3fe7f4_staticRenderFns,
  25796. false,
  25797. null,
  25798. null,
  25799. null
  25800. )
  25801. /* hot reload */
  25802. if (false) { var icon_api; }
  25803. icon_component.options.__file = "packages/icon/src/icon.vue"
  25804. /* harmony default export */ var icon = (icon_component.exports);
  25805. // CONCATENATED MODULE: ./packages/icon/index.js
  25806. /* istanbul ignore next */
  25807. icon.install = function (Vue) {
  25808. Vue.component(icon.name, icon);
  25809. };
  25810. /* harmony default export */ var packages_icon = (icon);
  25811. // CONCATENATED MODULE: ./packages/row/src/row.js
  25812. /* harmony default export */ var src_row = ({
  25813. name: 'ElRow',
  25814. componentName: 'ElRow',
  25815. props: {
  25816. tag: {
  25817. type: String,
  25818. default: 'div'
  25819. },
  25820. gutter: Number,
  25821. type: String,
  25822. justify: {
  25823. type: String,
  25824. default: 'start'
  25825. },
  25826. align: String
  25827. },
  25828. computed: {
  25829. style: function style() {
  25830. var ret = {};
  25831. if (this.gutter) {
  25832. ret.marginLeft = '-' + this.gutter / 2 + 'px';
  25833. ret.marginRight = ret.marginLeft;
  25834. }
  25835. return ret;
  25836. }
  25837. },
  25838. render: function render(h) {
  25839. return h(this.tag, {
  25840. class: ['el-row', this.justify !== 'start' ? 'is-justify-' + this.justify : '', this.align ? 'is-align-' + this.align : '', { 'el-row--flex': this.type === 'flex' }],
  25841. style: this.style
  25842. }, this.$slots.default);
  25843. }
  25844. });
  25845. // CONCATENATED MODULE: ./packages/row/index.js
  25846. /* istanbul ignore next */
  25847. src_row.install = function (Vue) {
  25848. Vue.component(src_row.name, src_row);
  25849. };
  25850. /* harmony default export */ var packages_row = (src_row);
  25851. // CONCATENATED MODULE: ./packages/col/src/col.js
  25852. 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; };
  25853. /* harmony default export */ var col = ({
  25854. name: 'ElCol',
  25855. props: {
  25856. span: {
  25857. type: Number,
  25858. default: 24
  25859. },
  25860. tag: {
  25861. type: String,
  25862. default: 'div'
  25863. },
  25864. offset: Number,
  25865. pull: Number,
  25866. push: Number,
  25867. xs: [Number, Object],
  25868. sm: [Number, Object],
  25869. md: [Number, Object],
  25870. lg: [Number, Object],
  25871. xl: [Number, Object]
  25872. },
  25873. computed: {
  25874. gutter: function gutter() {
  25875. var parent = this.$parent;
  25876. while (parent && parent.$options.componentName !== 'ElRow') {
  25877. parent = parent.$parent;
  25878. }
  25879. return parent ? parent.gutter : 0;
  25880. }
  25881. },
  25882. render: function render(h) {
  25883. var _this = this;
  25884. var classList = [];
  25885. var style = {};
  25886. if (this.gutter) {
  25887. style.paddingLeft = this.gutter / 2 + 'px';
  25888. style.paddingRight = style.paddingLeft;
  25889. }
  25890. ['span', 'offset', 'pull', 'push'].forEach(function (prop) {
  25891. if (_this[prop] || _this[prop] === 0) {
  25892. classList.push(prop !== 'span' ? 'el-col-' + prop + '-' + _this[prop] : 'el-col-' + _this[prop]);
  25893. }
  25894. });
  25895. ['xs', 'sm', 'md', 'lg', 'xl'].forEach(function (size) {
  25896. if (typeof _this[size] === 'number') {
  25897. classList.push('el-col-' + size + '-' + _this[size]);
  25898. } else if (col_typeof(_this[size]) === 'object') {
  25899. var props = _this[size];
  25900. Object.keys(props).forEach(function (prop) {
  25901. classList.push(prop !== 'span' ? 'el-col-' + size + '-' + prop + '-' + props[prop] : 'el-col-' + size + '-' + props[prop]);
  25902. });
  25903. }
  25904. });
  25905. return h(this.tag, {
  25906. class: ['el-col', classList],
  25907. style: style
  25908. }, this.$slots.default);
  25909. }
  25910. });
  25911. // CONCATENATED MODULE: ./packages/col/index.js
  25912. /* istanbul ignore next */
  25913. col.install = function (Vue) {
  25914. Vue.component(col.name, col);
  25915. };
  25916. /* harmony default export */ var packages_col = (col);
  25917. // 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&
  25918. var upload_listvue_type_template_id_173fedf5_render = function() {
  25919. var _vm = this
  25920. var _h = _vm.$createElement
  25921. var _c = _vm._self._c || _h
  25922. return _c(
  25923. "transition-group",
  25924. {
  25925. class: [
  25926. "el-upload-list",
  25927. "el-upload-list--" + _vm.listType,
  25928. { "is-disabled": _vm.disabled }
  25929. ],
  25930. attrs: { tag: "ul", name: "el-list" }
  25931. },
  25932. _vm._l(_vm.files, function(file) {
  25933. return _c(
  25934. "li",
  25935. {
  25936. key: file.uid,
  25937. class: [
  25938. "el-upload-list__item",
  25939. "is-" + file.status,
  25940. _vm.focusing ? "focusing" : ""
  25941. ],
  25942. attrs: { tabindex: "0" },
  25943. on: {
  25944. keydown: function($event) {
  25945. if (
  25946. !("button" in $event) &&
  25947. _vm._k($event.keyCode, "delete", [8, 46], $event.key, [
  25948. "Backspace",
  25949. "Delete",
  25950. "Del"
  25951. ])
  25952. ) {
  25953. return null
  25954. }
  25955. !_vm.disabled && _vm.$emit("remove", file)
  25956. },
  25957. focus: function($event) {
  25958. _vm.focusing = true
  25959. },
  25960. blur: function($event) {
  25961. _vm.focusing = false
  25962. },
  25963. click: function($event) {
  25964. _vm.focusing = false
  25965. }
  25966. }
  25967. },
  25968. [
  25969. _vm._t(
  25970. "default",
  25971. [
  25972. file.status !== "uploading" &&
  25973. ["picture-card", "picture"].indexOf(_vm.listType) > -1
  25974. ? _c("img", {
  25975. staticClass: "el-upload-list__item-thumbnail",
  25976. attrs: { src: file.url, alt: "" }
  25977. })
  25978. : _vm._e(),
  25979. _c(
  25980. "a",
  25981. {
  25982. staticClass: "el-upload-list__item-name",
  25983. on: {
  25984. click: function($event) {
  25985. _vm.handleClick(file)
  25986. }
  25987. }
  25988. },
  25989. [
  25990. _c("i", { staticClass: "el-icon-document" }),
  25991. _vm._v(_vm._s(file.name) + "\n ")
  25992. ]
  25993. ),
  25994. _c(
  25995. "label",
  25996. { staticClass: "el-upload-list__item-status-label" },
  25997. [
  25998. _c("i", {
  25999. class: {
  26000. "el-icon-upload-success": true,
  26001. "el-icon-circle-check": _vm.listType === "text",
  26002. "el-icon-check":
  26003. ["picture-card", "picture"].indexOf(_vm.listType) > -1
  26004. }
  26005. })
  26006. ]
  26007. ),
  26008. !_vm.disabled
  26009. ? _c("i", {
  26010. staticClass: "el-icon-close",
  26011. on: {
  26012. click: function($event) {
  26013. _vm.$emit("remove", file)
  26014. }
  26015. }
  26016. })
  26017. : _vm._e(),
  26018. !_vm.disabled
  26019. ? _c("i", { staticClass: "el-icon-close-tip" }, [
  26020. _vm._v(_vm._s(_vm.t("el.upload.deleteTip")))
  26021. ])
  26022. : _vm._e(),
  26023. file.status === "uploading"
  26024. ? _c("el-progress", {
  26025. attrs: {
  26026. type: _vm.listType === "picture-card" ? "circle" : "line",
  26027. "stroke-width": _vm.listType === "picture-card" ? 6 : 2,
  26028. percentage: _vm.parsePercentage(file.percentage)
  26029. }
  26030. })
  26031. : _vm._e(),
  26032. _vm.listType === "picture-card"
  26033. ? _c("span", { staticClass: "el-upload-list__item-actions" }, [
  26034. _vm.handlePreview && _vm.listType === "picture-card"
  26035. ? _c(
  26036. "span",
  26037. {
  26038. staticClass: "el-upload-list__item-preview",
  26039. on: {
  26040. click: function($event) {
  26041. _vm.handlePreview(file)
  26042. }
  26043. }
  26044. },
  26045. [_c("i", { staticClass: "el-icon-zoom-in" })]
  26046. )
  26047. : _vm._e(),
  26048. !_vm.disabled
  26049. ? _c(
  26050. "span",
  26051. {
  26052. staticClass: "el-upload-list__item-delete",
  26053. on: {
  26054. click: function($event) {
  26055. _vm.$emit("remove", file)
  26056. }
  26057. }
  26058. },
  26059. [_c("i", { staticClass: "el-icon-delete" })]
  26060. )
  26061. : _vm._e()
  26062. ])
  26063. : _vm._e()
  26064. ],
  26065. { file: file }
  26066. )
  26067. ],
  26068. 2
  26069. )
  26070. }),
  26071. 0
  26072. )
  26073. }
  26074. var upload_listvue_type_template_id_173fedf5_staticRenderFns = []
  26075. upload_listvue_type_template_id_173fedf5_render._withStripped = true
  26076. // CONCATENATED MODULE: ./packages/upload/src/upload-list.vue?vue&type=template&id=173fedf5&
  26077. // EXTERNAL MODULE: external "element-ui/lib/progress"
  26078. var progress_ = __webpack_require__(34);
  26079. var progress_default = /*#__PURE__*/__webpack_require__.n(progress_);
  26080. // 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&
  26081. //
  26082. //
  26083. //
  26084. //
  26085. //
  26086. //
  26087. //
  26088. //
  26089. //
  26090. //
  26091. //
  26092. //
  26093. //
  26094. //
  26095. //
  26096. //
  26097. //
  26098. //
  26099. //
  26100. //
  26101. //
  26102. //
  26103. //
  26104. //
  26105. //
  26106. //
  26107. //
  26108. //
  26109. //
  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. /* harmony default export */ var upload_listvue_type_script_lang_js_ = ({
  26146. name: 'ElUploadList',
  26147. mixins: [locale_default.a],
  26148. data: function data() {
  26149. return {
  26150. focusing: false
  26151. };
  26152. },
  26153. components: { ElProgress: progress_default.a },
  26154. props: {
  26155. files: {
  26156. type: Array,
  26157. default: function _default() {
  26158. return [];
  26159. }
  26160. },
  26161. disabled: {
  26162. type: Boolean,
  26163. default: false
  26164. },
  26165. handlePreview: Function,
  26166. listType: String
  26167. },
  26168. methods: {
  26169. parsePercentage: function parsePercentage(val) {
  26170. return parseInt(val, 10);
  26171. },
  26172. handleClick: function handleClick(file) {
  26173. this.handlePreview && this.handlePreview(file);
  26174. }
  26175. }
  26176. });
  26177. // CONCATENATED MODULE: ./packages/upload/src/upload-list.vue?vue&type=script&lang=js&
  26178. /* harmony default export */ var src_upload_listvue_type_script_lang_js_ = (upload_listvue_type_script_lang_js_);
  26179. // CONCATENATED MODULE: ./packages/upload/src/upload-list.vue
  26180. /* normalize component */
  26181. var upload_list_component = normalizeComponent(
  26182. src_upload_listvue_type_script_lang_js_,
  26183. upload_listvue_type_template_id_173fedf5_render,
  26184. upload_listvue_type_template_id_173fedf5_staticRenderFns,
  26185. false,
  26186. null,
  26187. null,
  26188. null
  26189. )
  26190. /* hot reload */
  26191. if (false) { var upload_list_api; }
  26192. upload_list_component.options.__file = "packages/upload/src/upload-list.vue"
  26193. /* harmony default export */ var upload_list = (upload_list_component.exports);
  26194. // EXTERNAL MODULE: external "babel-helper-vue-jsx-merge-props"
  26195. var external_babel_helper_vue_jsx_merge_props_ = __webpack_require__(24);
  26196. var external_babel_helper_vue_jsx_merge_props_default = /*#__PURE__*/__webpack_require__.n(external_babel_helper_vue_jsx_merge_props_);
  26197. // CONCATENATED MODULE: ./packages/upload/src/ajax.js
  26198. function getError(action, option, xhr) {
  26199. var msg = void 0;
  26200. if (xhr.response) {
  26201. msg = '' + (xhr.response.error || xhr.response);
  26202. } else if (xhr.responseText) {
  26203. msg = '' + xhr.responseText;
  26204. } else {
  26205. msg = 'fail to post ' + action + ' ' + xhr.status;
  26206. }
  26207. var err = new Error(msg);
  26208. err.status = xhr.status;
  26209. err.method = 'post';
  26210. err.url = action;
  26211. return err;
  26212. }
  26213. function getBody(xhr) {
  26214. var text = xhr.responseText || xhr.response;
  26215. if (!text) {
  26216. return text;
  26217. }
  26218. try {
  26219. return JSON.parse(text);
  26220. } catch (e) {
  26221. return text;
  26222. }
  26223. }
  26224. function upload(option) {
  26225. if (typeof XMLHttpRequest === 'undefined') {
  26226. return;
  26227. }
  26228. var xhr = new XMLHttpRequest();
  26229. var action = option.action;
  26230. if (xhr.upload) {
  26231. xhr.upload.onprogress = function progress(e) {
  26232. if (e.total > 0) {
  26233. e.percent = e.loaded / e.total * 100;
  26234. }
  26235. option.onProgress(e);
  26236. };
  26237. }
  26238. var formData = new FormData();
  26239. if (option.data) {
  26240. Object.keys(option.data).forEach(function (key) {
  26241. formData.append(key, option.data[key]);
  26242. });
  26243. }
  26244. formData.append(option.filename, option.file, option.file.name);
  26245. xhr.onerror = function error(e) {
  26246. option.onError(e);
  26247. };
  26248. xhr.onload = function onload() {
  26249. if (xhr.status < 200 || xhr.status >= 300) {
  26250. return option.onError(getError(action, option, xhr));
  26251. }
  26252. option.onSuccess(getBody(xhr));
  26253. };
  26254. xhr.open('post', action, true);
  26255. if (option.withCredentials && 'withCredentials' in xhr) {
  26256. xhr.withCredentials = true;
  26257. }
  26258. var headers = option.headers || {};
  26259. for (var item in headers) {
  26260. if (headers.hasOwnProperty(item) && headers[item] !== null) {
  26261. xhr.setRequestHeader(item, headers[item]);
  26262. }
  26263. }
  26264. xhr.send(formData);
  26265. return xhr;
  26266. }
  26267. // 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&
  26268. var upload_draggervue_type_template_id_7ebbf219_render = function() {
  26269. var _vm = this
  26270. var _h = _vm.$createElement
  26271. var _c = _vm._self._c || _h
  26272. return _c(
  26273. "div",
  26274. {
  26275. staticClass: "el-upload-dragger",
  26276. class: {
  26277. "is-dragover": _vm.dragover
  26278. },
  26279. on: {
  26280. drop: function($event) {
  26281. $event.preventDefault()
  26282. return _vm.onDrop($event)
  26283. },
  26284. dragover: function($event) {
  26285. $event.preventDefault()
  26286. return _vm.onDragover($event)
  26287. },
  26288. dragleave: function($event) {
  26289. $event.preventDefault()
  26290. _vm.dragover = false
  26291. }
  26292. }
  26293. },
  26294. [_vm._t("default")],
  26295. 2
  26296. )
  26297. }
  26298. var upload_draggervue_type_template_id_7ebbf219_staticRenderFns = []
  26299. upload_draggervue_type_template_id_7ebbf219_render._withStripped = true
  26300. // CONCATENATED MODULE: ./packages/upload/src/upload-dragger.vue?vue&type=template&id=7ebbf219&
  26301. // 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&
  26302. //
  26303. //
  26304. //
  26305. //
  26306. //
  26307. //
  26308. //
  26309. //
  26310. //
  26311. //
  26312. //
  26313. //
  26314. //
  26315. /* harmony default export */ var upload_draggervue_type_script_lang_js_ = ({
  26316. name: 'ElUploadDrag',
  26317. props: {
  26318. disabled: Boolean
  26319. },
  26320. inject: {
  26321. uploader: {
  26322. default: ''
  26323. }
  26324. },
  26325. data: function data() {
  26326. return {
  26327. dragover: false
  26328. };
  26329. },
  26330. methods: {
  26331. onDragover: function onDragover() {
  26332. if (!this.disabled) {
  26333. this.dragover = true;
  26334. }
  26335. },
  26336. onDrop: function onDrop(e) {
  26337. if (this.disabled || !this.uploader) return;
  26338. var accept = this.uploader.accept;
  26339. this.dragover = false;
  26340. if (!accept) {
  26341. this.$emit('file', e.dataTransfer.files);
  26342. return;
  26343. }
  26344. this.$emit('file', [].slice.call(e.dataTransfer.files).filter(function (file) {
  26345. var type = file.type,
  26346. name = file.name;
  26347. var extension = name.indexOf('.') > -1 ? '.' + name.split('.').pop() : '';
  26348. var baseType = type.replace(/\/.*$/, '');
  26349. return accept.split(',').map(function (type) {
  26350. return type.trim();
  26351. }).filter(function (type) {
  26352. return type;
  26353. }).some(function (acceptedType) {
  26354. if (/\..+$/.test(acceptedType)) {
  26355. return extension === acceptedType;
  26356. }
  26357. if (/\/\*$/.test(acceptedType)) {
  26358. return baseType === acceptedType.replace(/\/\*$/, '');
  26359. }
  26360. if (/^[^\/]+\/[^\/]+$/.test(acceptedType)) {
  26361. return type === acceptedType;
  26362. }
  26363. return false;
  26364. });
  26365. }));
  26366. }
  26367. }
  26368. });
  26369. // CONCATENATED MODULE: ./packages/upload/src/upload-dragger.vue?vue&type=script&lang=js&
  26370. /* harmony default export */ var src_upload_draggervue_type_script_lang_js_ = (upload_draggervue_type_script_lang_js_);
  26371. // CONCATENATED MODULE: ./packages/upload/src/upload-dragger.vue
  26372. /* normalize component */
  26373. var upload_dragger_component = normalizeComponent(
  26374. src_upload_draggervue_type_script_lang_js_,
  26375. upload_draggervue_type_template_id_7ebbf219_render,
  26376. upload_draggervue_type_template_id_7ebbf219_staticRenderFns,
  26377. false,
  26378. null,
  26379. null,
  26380. null
  26381. )
  26382. /* hot reload */
  26383. if (false) { var upload_dragger_api; }
  26384. upload_dragger_component.options.__file = "packages/upload/src/upload-dragger.vue"
  26385. /* harmony default export */ var upload_dragger = (upload_dragger_component.exports);
  26386. // 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&
  26387. /* harmony default export */ var uploadvue_type_script_lang_js_ = ({
  26388. inject: ['uploader'],
  26389. components: {
  26390. UploadDragger: upload_dragger
  26391. },
  26392. props: {
  26393. type: String,
  26394. action: {
  26395. type: String,
  26396. required: true
  26397. },
  26398. name: {
  26399. type: String,
  26400. default: 'file'
  26401. },
  26402. data: Object,
  26403. headers: Object,
  26404. withCredentials: Boolean,
  26405. multiple: Boolean,
  26406. accept: String,
  26407. onStart: Function,
  26408. onProgress: Function,
  26409. onSuccess: Function,
  26410. onError: Function,
  26411. beforeUpload: Function,
  26412. drag: Boolean,
  26413. onPreview: {
  26414. type: Function,
  26415. default: function _default() {}
  26416. },
  26417. onRemove: {
  26418. type: Function,
  26419. default: function _default() {}
  26420. },
  26421. fileList: Array,
  26422. autoUpload: Boolean,
  26423. listType: String,
  26424. httpRequest: {
  26425. type: Function,
  26426. default: upload
  26427. },
  26428. disabled: Boolean,
  26429. limit: Number,
  26430. onExceed: Function
  26431. },
  26432. data: function data() {
  26433. return {
  26434. mouseover: false,
  26435. reqs: {}
  26436. };
  26437. },
  26438. methods: {
  26439. isImage: function isImage(str) {
  26440. return str.indexOf('image') !== -1;
  26441. },
  26442. handleChange: function handleChange(ev) {
  26443. var files = ev.target.files;
  26444. if (!files) return;
  26445. this.uploadFiles(files);
  26446. },
  26447. uploadFiles: function uploadFiles(files) {
  26448. var _this = this;
  26449. if (this.limit && this.fileList.length + files.length > this.limit) {
  26450. this.onExceed && this.onExceed(files, this.fileList);
  26451. return;
  26452. }
  26453. var postFiles = Array.prototype.slice.call(files);
  26454. if (!this.multiple) {
  26455. postFiles = postFiles.slice(0, 1);
  26456. }
  26457. if (postFiles.length === 0) {
  26458. return;
  26459. }
  26460. postFiles.forEach(function (rawFile) {
  26461. _this.onStart(rawFile);
  26462. if (_this.autoUpload) _this.upload(rawFile);
  26463. });
  26464. },
  26465. upload: function upload(rawFile) {
  26466. var _this2 = this;
  26467. this.$refs.input.value = null;
  26468. if (!this.beforeUpload) {
  26469. return this.post(rawFile);
  26470. }
  26471. var before = this.beforeUpload(rawFile);
  26472. if (before && before.then) {
  26473. before.then(function (processedFile) {
  26474. var fileType = Object.prototype.toString.call(processedFile);
  26475. if (fileType === '[object File]' || fileType === '[object Blob]') {
  26476. if (fileType === '[object Blob]') {
  26477. processedFile = new File([processedFile], rawFile.name, {
  26478. type: rawFile.type
  26479. });
  26480. }
  26481. for (var p in rawFile) {
  26482. if (rawFile.hasOwnProperty(p)) {
  26483. processedFile[p] = rawFile[p];
  26484. }
  26485. }
  26486. _this2.post(processedFile);
  26487. } else {
  26488. _this2.post(rawFile);
  26489. }
  26490. }, function () {
  26491. _this2.onRemove(null, rawFile);
  26492. });
  26493. } else if (before !== false) {
  26494. this.post(rawFile);
  26495. } else {
  26496. this.onRemove(null, rawFile);
  26497. }
  26498. },
  26499. abort: function abort(file) {
  26500. var reqs = this.reqs;
  26501. if (file) {
  26502. var uid = file;
  26503. if (file.uid) uid = file.uid;
  26504. if (reqs[uid]) {
  26505. reqs[uid].abort();
  26506. }
  26507. } else {
  26508. Object.keys(reqs).forEach(function (uid) {
  26509. if (reqs[uid]) reqs[uid].abort();
  26510. delete reqs[uid];
  26511. });
  26512. }
  26513. },
  26514. post: function post(rawFile) {
  26515. var _this3 = this;
  26516. var uid = rawFile.uid;
  26517. var options = {
  26518. headers: this.headers,
  26519. withCredentials: this.withCredentials,
  26520. file: rawFile,
  26521. data: this.data,
  26522. filename: this.name,
  26523. action: this.action,
  26524. onProgress: function onProgress(e) {
  26525. _this3.onProgress(e, rawFile);
  26526. },
  26527. onSuccess: function onSuccess(res) {
  26528. _this3.onSuccess(res, rawFile);
  26529. delete _this3.reqs[uid];
  26530. },
  26531. onError: function onError(err) {
  26532. _this3.onError(err, rawFile);
  26533. delete _this3.reqs[uid];
  26534. }
  26535. };
  26536. var req = this.httpRequest(options);
  26537. this.reqs[uid] = req;
  26538. if (req && req.then) {
  26539. req.then(options.onSuccess, options.onError);
  26540. }
  26541. },
  26542. handleClick: function handleClick() {
  26543. if (!this.disabled) {
  26544. this.$refs.input.value = null;
  26545. this.$refs.input.click();
  26546. }
  26547. },
  26548. handleKeydown: function handleKeydown(e) {
  26549. if (e.target !== e.currentTarget) return;
  26550. if (e.keyCode === 13 || e.keyCode === 32) {
  26551. this.handleClick();
  26552. }
  26553. }
  26554. },
  26555. render: function render(h) {
  26556. var handleClick = this.handleClick,
  26557. drag = this.drag,
  26558. name = this.name,
  26559. handleChange = this.handleChange,
  26560. multiple = this.multiple,
  26561. accept = this.accept,
  26562. listType = this.listType,
  26563. uploadFiles = this.uploadFiles,
  26564. disabled = this.disabled,
  26565. handleKeydown = this.handleKeydown;
  26566. var data = {
  26567. class: {
  26568. 'el-upload': true
  26569. },
  26570. on: {
  26571. click: handleClick,
  26572. keydown: handleKeydown
  26573. }
  26574. };
  26575. data.class['el-upload--' + listType] = true;
  26576. return h(
  26577. 'div',
  26578. external_babel_helper_vue_jsx_merge_props_default()([data, {
  26579. attrs: { tabindex: '0' }
  26580. }]),
  26581. [drag ? h(
  26582. 'upload-dragger',
  26583. {
  26584. attrs: { disabled: disabled },
  26585. on: {
  26586. 'file': uploadFiles
  26587. }
  26588. },
  26589. [this.$slots.default]
  26590. ) : this.$slots.default, h('input', { 'class': 'el-upload__input', attrs: { type: 'file', name: name, multiple: multiple, accept: accept },
  26591. ref: 'input', on: {
  26592. 'change': handleChange
  26593. }
  26594. })]
  26595. );
  26596. }
  26597. });
  26598. // CONCATENATED MODULE: ./packages/upload/src/upload.vue?vue&type=script&lang=js&
  26599. /* harmony default export */ var src_uploadvue_type_script_lang_js_ = (uploadvue_type_script_lang_js_);
  26600. // CONCATENATED MODULE: ./packages/upload/src/upload.vue
  26601. var upload_render, upload_staticRenderFns
  26602. /* normalize component */
  26603. var upload_component = normalizeComponent(
  26604. src_uploadvue_type_script_lang_js_,
  26605. upload_render,
  26606. upload_staticRenderFns,
  26607. false,
  26608. null,
  26609. null,
  26610. null
  26611. )
  26612. /* hot reload */
  26613. if (false) { var upload_api; }
  26614. upload_component.options.__file = "packages/upload/src/upload.vue"
  26615. /* harmony default export */ var src_upload = (upload_component.exports);
  26616. // 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&
  26617. function srcvue_type_script_lang_js_noop() {}
  26618. /* harmony default export */ var srcvue_type_script_lang_js_ = ({
  26619. name: 'ElUpload',
  26620. mixins: [migrating_default.a],
  26621. components: {
  26622. ElProgress: progress_default.a,
  26623. UploadList: upload_list,
  26624. Upload: src_upload
  26625. },
  26626. provide: function provide() {
  26627. return {
  26628. uploader: this
  26629. };
  26630. },
  26631. inject: {
  26632. elForm: {
  26633. default: ''
  26634. }
  26635. },
  26636. props: {
  26637. action: {
  26638. type: String,
  26639. required: true
  26640. },
  26641. headers: {
  26642. type: Object,
  26643. default: function _default() {
  26644. return {};
  26645. }
  26646. },
  26647. data: Object,
  26648. multiple: Boolean,
  26649. name: {
  26650. type: String,
  26651. default: 'file'
  26652. },
  26653. drag: Boolean,
  26654. dragger: Boolean,
  26655. withCredentials: Boolean,
  26656. showFileList: {
  26657. type: Boolean,
  26658. default: true
  26659. },
  26660. accept: String,
  26661. type: {
  26662. type: String,
  26663. default: 'select'
  26664. },
  26665. beforeUpload: Function,
  26666. beforeRemove: Function,
  26667. onRemove: {
  26668. type: Function,
  26669. default: srcvue_type_script_lang_js_noop
  26670. },
  26671. onChange: {
  26672. type: Function,
  26673. default: srcvue_type_script_lang_js_noop
  26674. },
  26675. onPreview: {
  26676. type: Function
  26677. },
  26678. onSuccess: {
  26679. type: Function,
  26680. default: srcvue_type_script_lang_js_noop
  26681. },
  26682. onProgress: {
  26683. type: Function,
  26684. default: srcvue_type_script_lang_js_noop
  26685. },
  26686. onError: {
  26687. type: Function,
  26688. default: srcvue_type_script_lang_js_noop
  26689. },
  26690. fileList: {
  26691. type: Array,
  26692. default: function _default() {
  26693. return [];
  26694. }
  26695. },
  26696. autoUpload: {
  26697. type: Boolean,
  26698. default: true
  26699. },
  26700. listType: {
  26701. type: String,
  26702. default: 'text' // text,picture,picture-card
  26703. },
  26704. httpRequest: Function,
  26705. disabled: Boolean,
  26706. limit: Number,
  26707. onExceed: {
  26708. type: Function,
  26709. default: srcvue_type_script_lang_js_noop
  26710. }
  26711. },
  26712. data: function data() {
  26713. return {
  26714. uploadFiles: [],
  26715. dragOver: false,
  26716. draging: false,
  26717. tempIndex: 1
  26718. };
  26719. },
  26720. computed: {
  26721. uploadDisabled: function uploadDisabled() {
  26722. return this.disabled || (this.elForm || {}).disabled;
  26723. }
  26724. },
  26725. watch: {
  26726. listType: function listType(type) {
  26727. if (type === 'picture-card' || type === 'picture') {
  26728. this.uploadFiles = this.uploadFiles.map(function (file) {
  26729. if (!file.url && file.raw) {
  26730. try {
  26731. file.url = URL.createObjectURL(file.raw);
  26732. } catch (err) {
  26733. console.error('[Element Error][Upload]', err);
  26734. }
  26735. }
  26736. return file;
  26737. });
  26738. }
  26739. },
  26740. fileList: {
  26741. immediate: true,
  26742. handler: function handler(fileList) {
  26743. var _this = this;
  26744. this.uploadFiles = fileList.map(function (item) {
  26745. item.uid = item.uid || Date.now() + _this.tempIndex++;
  26746. item.status = item.status || 'success';
  26747. return item;
  26748. });
  26749. }
  26750. }
  26751. },
  26752. methods: {
  26753. handleStart: function handleStart(rawFile) {
  26754. rawFile.uid = Date.now() + this.tempIndex++;
  26755. var file = {
  26756. status: 'ready',
  26757. name: rawFile.name,
  26758. size: rawFile.size,
  26759. percentage: 0,
  26760. uid: rawFile.uid,
  26761. raw: rawFile
  26762. };
  26763. if (this.listType === 'picture-card' || this.listType === 'picture') {
  26764. try {
  26765. file.url = URL.createObjectURL(rawFile);
  26766. } catch (err) {
  26767. console.error('[Element Error][Upload]', err);
  26768. return;
  26769. }
  26770. }
  26771. this.uploadFiles.push(file);
  26772. this.onChange(file, this.uploadFiles);
  26773. },
  26774. handleProgress: function handleProgress(ev, rawFile) {
  26775. var file = this.getFile(rawFile);
  26776. this.onProgress(ev, file, this.uploadFiles);
  26777. file.status = 'uploading';
  26778. file.percentage = ev.percent || 0;
  26779. },
  26780. handleSuccess: function handleSuccess(res, rawFile) {
  26781. var file = this.getFile(rawFile);
  26782. if (file) {
  26783. file.status = 'success';
  26784. file.response = res;
  26785. this.onSuccess(res, file, this.uploadFiles);
  26786. this.onChange(file, this.uploadFiles);
  26787. }
  26788. },
  26789. handleError: function handleError(err, rawFile) {
  26790. var file = this.getFile(rawFile);
  26791. var fileList = this.uploadFiles;
  26792. file.status = 'fail';
  26793. fileList.splice(fileList.indexOf(file), 1);
  26794. this.onError(err, file, this.uploadFiles);
  26795. this.onChange(file, this.uploadFiles);
  26796. },
  26797. handleRemove: function handleRemove(file, raw) {
  26798. var _this2 = this;
  26799. if (raw) {
  26800. file = this.getFile(raw);
  26801. }
  26802. var doRemove = function doRemove() {
  26803. _this2.abort(file);
  26804. var fileList = _this2.uploadFiles;
  26805. fileList.splice(fileList.indexOf(file), 1);
  26806. _this2.onRemove(file, fileList);
  26807. };
  26808. if (!this.beforeRemove) {
  26809. doRemove();
  26810. } else if (typeof this.beforeRemove === 'function') {
  26811. var before = this.beforeRemove(file, this.uploadFiles);
  26812. if (before && before.then) {
  26813. before.then(function () {
  26814. doRemove();
  26815. }, srcvue_type_script_lang_js_noop);
  26816. } else if (before !== false) {
  26817. doRemove();
  26818. }
  26819. }
  26820. },
  26821. getFile: function getFile(rawFile) {
  26822. var fileList = this.uploadFiles;
  26823. var target = void 0;
  26824. fileList.every(function (item) {
  26825. target = rawFile.uid === item.uid ? item : null;
  26826. return !target;
  26827. });
  26828. return target;
  26829. },
  26830. abort: function abort(file) {
  26831. this.$refs['upload-inner'].abort(file);
  26832. },
  26833. clearFiles: function clearFiles() {
  26834. this.uploadFiles = [];
  26835. },
  26836. submit: function submit() {
  26837. var _this3 = this;
  26838. this.uploadFiles.filter(function (file) {
  26839. return file.status === 'ready';
  26840. }).forEach(function (file) {
  26841. _this3.$refs['upload-inner'].upload(file.raw);
  26842. });
  26843. },
  26844. getMigratingConfig: function getMigratingConfig() {
  26845. return {
  26846. props: {
  26847. 'default-file-list': 'default-file-list is renamed to file-list.',
  26848. 'show-upload-list': 'show-upload-list is renamed to show-file-list.',
  26849. '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'
  26850. }
  26851. };
  26852. }
  26853. },
  26854. beforeDestroy: function beforeDestroy() {
  26855. this.uploadFiles.forEach(function (file) {
  26856. if (file.url && file.url.indexOf('blob:') === 0) {
  26857. URL.revokeObjectURL(file.url);
  26858. }
  26859. });
  26860. },
  26861. render: function render(h) {
  26862. var _this4 = this;
  26863. var uploadList = void 0;
  26864. if (this.showFileList) {
  26865. uploadList = h(
  26866. upload_list,
  26867. {
  26868. attrs: {
  26869. disabled: this.uploadDisabled,
  26870. listType: this.listType,
  26871. files: this.uploadFiles,
  26872. handlePreview: this.onPreview },
  26873. on: {
  26874. 'remove': this.handleRemove
  26875. }
  26876. },
  26877. [function (props) {
  26878. if (_this4.$scopedSlots.file) {
  26879. return _this4.$scopedSlots.file({
  26880. file: props.file
  26881. });
  26882. }
  26883. }]
  26884. );
  26885. }
  26886. var uploadData = {
  26887. props: {
  26888. type: this.type,
  26889. drag: this.drag,
  26890. action: this.action,
  26891. multiple: this.multiple,
  26892. 'before-upload': this.beforeUpload,
  26893. 'with-credentials': this.withCredentials,
  26894. headers: this.headers,
  26895. name: this.name,
  26896. data: this.data,
  26897. accept: this.accept,
  26898. fileList: this.uploadFiles,
  26899. autoUpload: this.autoUpload,
  26900. listType: this.listType,
  26901. disabled: this.uploadDisabled,
  26902. limit: this.limit,
  26903. 'on-exceed': this.onExceed,
  26904. 'on-start': this.handleStart,
  26905. 'on-progress': this.handleProgress,
  26906. 'on-success': this.handleSuccess,
  26907. 'on-error': this.handleError,
  26908. 'on-preview': this.onPreview,
  26909. 'on-remove': this.handleRemove,
  26910. 'http-request': this.httpRequest
  26911. },
  26912. ref: 'upload-inner'
  26913. };
  26914. var trigger = this.$slots.trigger || this.$slots.default;
  26915. var uploadComponent = h(
  26916. 'upload',
  26917. uploadData,
  26918. [trigger]
  26919. );
  26920. return h('div', [this.listType === 'picture-card' ? uploadList : '', this.$slots.trigger ? [uploadComponent, this.$slots.default] : uploadComponent, this.$slots.tip, this.listType !== 'picture-card' ? uploadList : '']);
  26921. }
  26922. });
  26923. // CONCATENATED MODULE: ./packages/upload/src/index.vue?vue&type=script&lang=js&
  26924. /* harmony default export */ var upload_srcvue_type_script_lang_js_ = (srcvue_type_script_lang_js_);
  26925. // CONCATENATED MODULE: ./packages/upload/src/index.vue
  26926. var src_render, src_staticRenderFns
  26927. /* normalize component */
  26928. var upload_src_component = normalizeComponent(
  26929. upload_srcvue_type_script_lang_js_,
  26930. src_render,
  26931. src_staticRenderFns,
  26932. false,
  26933. null,
  26934. null,
  26935. null
  26936. )
  26937. /* hot reload */
  26938. if (false) { var src_api; }
  26939. upload_src_component.options.__file = "packages/upload/src/index.vue"
  26940. /* harmony default export */ var upload_src = (upload_src_component.exports);
  26941. // CONCATENATED MODULE: ./packages/upload/index.js
  26942. /* istanbul ignore next */
  26943. upload_src.install = function (Vue) {
  26944. Vue.component(upload_src.name, upload_src);
  26945. };
  26946. /* harmony default export */ var packages_upload = (upload_src);
  26947. // 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&
  26948. var progressvue_type_template_id_229ee406_render = function() {
  26949. var _vm = this
  26950. var _h = _vm.$createElement
  26951. var _c = _vm._self._c || _h
  26952. return _c(
  26953. "div",
  26954. {
  26955. staticClass: "el-progress",
  26956. class: [
  26957. "el-progress--" + _vm.type,
  26958. _vm.status ? "is-" + _vm.status : "",
  26959. {
  26960. "el-progress--without-text": !_vm.showText,
  26961. "el-progress--text-inside": _vm.textInside
  26962. }
  26963. ],
  26964. attrs: {
  26965. role: "progressbar",
  26966. "aria-valuenow": _vm.percentage,
  26967. "aria-valuemin": "0",
  26968. "aria-valuemax": "100"
  26969. }
  26970. },
  26971. [
  26972. _vm.type === "line"
  26973. ? _c("div", { staticClass: "el-progress-bar" }, [
  26974. _c(
  26975. "div",
  26976. {
  26977. staticClass: "el-progress-bar__outer",
  26978. style: {
  26979. height: _vm.strokeWidth + "px",
  26980. backgroundColor: _vm.defineBackColor
  26981. }
  26982. },
  26983. [
  26984. _c(
  26985. "div",
  26986. {
  26987. staticClass: "el-progress-bar__inner",
  26988. style: _vm.barStyle
  26989. },
  26990. [
  26991. _vm.showText && _vm.textInside
  26992. ? _c(
  26993. "div",
  26994. {
  26995. staticClass: "el-progress-bar__innerText",
  26996. style: { color: _vm.textColor }
  26997. },
  26998. [_vm._v(_vm._s(_vm.content))]
  26999. )
  27000. : _vm._e()
  27001. ]
  27002. )
  27003. ]
  27004. )
  27005. ])
  27006. : _c(
  27007. "div",
  27008. {
  27009. staticClass: "el-progress-circle",
  27010. style: { height: _vm.width + "px", width: _vm.width + "px" }
  27011. },
  27012. [
  27013. _c("svg", { attrs: { viewBox: "0 0 100 100" } }, [
  27014. _c("path", {
  27015. staticClass: "el-progress-circle__track",
  27016. style: _vm.trailPathStyle,
  27017. attrs: {
  27018. d: _vm.trackPath,
  27019. stroke: _vm.defineBackColor,
  27020. "stroke-width": _vm.relativeStrokeWidth,
  27021. fill: "none"
  27022. }
  27023. }),
  27024. _c("path", {
  27025. staticClass: "el-progress-circle__path",
  27026. style: _vm.circlePathStyle,
  27027. attrs: {
  27028. d: _vm.trackPath,
  27029. stroke: _vm.stroke,
  27030. fill: "none",
  27031. "stroke-linecap": _vm.strokeLinecap,
  27032. "stroke-width": _vm.percentage ? _vm.relativeStrokeWidth : 0
  27033. }
  27034. })
  27035. ])
  27036. ]
  27037. ),
  27038. _vm.showText && !_vm.textInside
  27039. ? _c(
  27040. "div",
  27041. {
  27042. staticClass: "el-progress__text",
  27043. style: {
  27044. fontSize: _vm.progressTextSize + "px",
  27045. color: _vm.textColor
  27046. }
  27047. },
  27048. [
  27049. !_vm.status
  27050. ? [_vm._v(_vm._s(_vm.content))]
  27051. : _c("i", { class: _vm.iconClass })
  27052. ],
  27053. 2
  27054. )
  27055. : _vm._e()
  27056. ]
  27057. )
  27058. }
  27059. var progressvue_type_template_id_229ee406_staticRenderFns = []
  27060. progressvue_type_template_id_229ee406_render._withStripped = true
  27061. // CONCATENATED MODULE: ./packages/progress/src/progress.vue?vue&type=template&id=229ee406&
  27062. // 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&
  27063. //
  27064. //
  27065. //
  27066. //
  27067. //
  27068. //
  27069. //
  27070. //
  27071. //
  27072. //
  27073. //
  27074. //
  27075. //
  27076. //
  27077. //
  27078. //
  27079. //
  27080. //
  27081. //
  27082. //
  27083. //
  27084. //
  27085. //
  27086. //
  27087. //
  27088. //
  27089. //
  27090. //
  27091. //
  27092. //
  27093. //
  27094. //
  27095. //
  27096. //
  27097. //
  27098. //
  27099. //
  27100. //
  27101. //
  27102. //
  27103. //
  27104. //
  27105. //
  27106. //
  27107. //
  27108. //
  27109. //
  27110. //
  27111. //
  27112. //
  27113. //
  27114. //
  27115. /* harmony default export */ var progressvue_type_script_lang_js_ = ({
  27116. name: 'ElProgress',
  27117. props: {
  27118. type: {
  27119. type: String,
  27120. default: 'line',
  27121. validator: function validator(val) {
  27122. return ['line', 'circle', 'dashboard'].indexOf(val) > -1;
  27123. }
  27124. },
  27125. percentage: {
  27126. type: Number,
  27127. default: 0,
  27128. required: true,
  27129. validator: function validator(val) {
  27130. return val >= 0 && val <= 100;
  27131. }
  27132. },
  27133. status: {
  27134. type: String,
  27135. validator: function validator(val) {
  27136. return ['success', 'exception', 'warning'].indexOf(val) > -1;
  27137. }
  27138. },
  27139. strokeWidth: {
  27140. type: Number,
  27141. default: 6
  27142. },
  27143. strokeLinecap: {
  27144. type: String,
  27145. default: 'round'
  27146. },
  27147. textInside: {
  27148. type: Boolean,
  27149. default: false
  27150. },
  27151. width: {
  27152. type: Number,
  27153. default: 126
  27154. },
  27155. showText: {
  27156. type: Boolean,
  27157. default: true
  27158. },
  27159. color: {
  27160. type: [String, Array, Function],
  27161. default: ''
  27162. },
  27163. defineBackColor: {
  27164. type: [String, Array, Function],
  27165. default: '#ebeef5'
  27166. },
  27167. textColor: {
  27168. type: [String, Array, Function],
  27169. default: '#606266'
  27170. },
  27171. format: Function
  27172. },
  27173. computed: {
  27174. barStyle: function barStyle() {
  27175. var style = {};
  27176. style.width = this.percentage + '%';
  27177. style.backgroundColor = this.getCurrentColor(this.percentage);
  27178. return style;
  27179. },
  27180. relativeStrokeWidth: function relativeStrokeWidth() {
  27181. return (this.strokeWidth / this.width * 100).toFixed(1);
  27182. },
  27183. radius: function radius() {
  27184. if (this.type === 'circle' || this.type === 'dashboard') {
  27185. return parseInt(50 - parseFloat(this.relativeStrokeWidth) / 2, 10);
  27186. } else {
  27187. return 0;
  27188. }
  27189. },
  27190. trackPath: function trackPath() {
  27191. var radius = this.radius;
  27192. var isDashboard = this.type === 'dashboard';
  27193. 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 ';
  27194. },
  27195. perimeter: function perimeter() {
  27196. return 2 * Math.PI * this.radius;
  27197. },
  27198. rate: function rate() {
  27199. return this.type === 'dashboard' ? 0.75 : 1;
  27200. },
  27201. strokeDashoffset: function strokeDashoffset() {
  27202. var offset = -1 * this.perimeter * (1 - this.rate) / 2;
  27203. return offset + 'px';
  27204. },
  27205. trailPathStyle: function trailPathStyle() {
  27206. return {
  27207. strokeDasharray: this.perimeter * this.rate + 'px, ' + this.perimeter + 'px',
  27208. strokeDashoffset: this.strokeDashoffset
  27209. };
  27210. },
  27211. circlePathStyle: function circlePathStyle() {
  27212. return {
  27213. strokeDasharray: this.perimeter * this.rate * (this.percentage / 100) + 'px, ' + this.perimeter + 'px',
  27214. strokeDashoffset: this.strokeDashoffset,
  27215. transition: 'stroke-dasharray 0.6s ease 0s, stroke 0.6s ease'
  27216. };
  27217. },
  27218. stroke: function stroke() {
  27219. var ret = void 0;
  27220. if (this.color) {
  27221. ret = this.getCurrentColor(this.percentage);
  27222. } else {
  27223. switch (this.status) {
  27224. case 'success':
  27225. ret = '#13ce66';
  27226. break;
  27227. case 'exception':
  27228. ret = '#ff4949';
  27229. break;
  27230. case 'warning':
  27231. ret = '#e6a23c';
  27232. break;
  27233. default:
  27234. ret = '#20a0ff';
  27235. }
  27236. }
  27237. return ret;
  27238. },
  27239. iconClass: function iconClass() {
  27240. if (this.status === 'warning') {
  27241. return 'el-icon-warning';
  27242. }
  27243. if (this.type === 'line') {
  27244. return this.status === 'success' ? 'el-icon-circle-check' : 'el-icon-circle-close';
  27245. } else {
  27246. return this.status === 'success' ? 'el-icon-check' : 'el-icon-close';
  27247. }
  27248. },
  27249. progressTextSize: function progressTextSize() {
  27250. return this.type === 'line' ? 12 + this.strokeWidth * 0.4 : this.width * 0.111111 + 2;
  27251. },
  27252. content: function content() {
  27253. if (typeof this.format === 'function') {
  27254. return this.format(this.percentage) || '';
  27255. } else {
  27256. return this.percentage + '%';
  27257. }
  27258. }
  27259. },
  27260. methods: {
  27261. getCurrentColor: function getCurrentColor(percentage) {
  27262. if (typeof this.color === 'function') {
  27263. return this.color(percentage);
  27264. } else if (typeof this.color === 'string') {
  27265. return this.color;
  27266. } else {
  27267. return this.getLevelColor(percentage);
  27268. }
  27269. },
  27270. getLevelColor: function getLevelColor(percentage) {
  27271. var colorArray = this.getColorArray().sort(function (a, b) {
  27272. return a.percentage - b.percentage;
  27273. });
  27274. for (var i = 0; i < colorArray.length; i++) {
  27275. if (colorArray[i].percentage > percentage) {
  27276. return colorArray[i].color;
  27277. }
  27278. }
  27279. return colorArray[colorArray.length - 1].color;
  27280. },
  27281. getColorArray: function getColorArray() {
  27282. var color = this.color;
  27283. var span = 100 / color.length;
  27284. return color.map(function (seriesColor, index) {
  27285. if (typeof seriesColor === 'string') {
  27286. return {
  27287. color: seriesColor,
  27288. percentage: (index + 1) * span
  27289. };
  27290. }
  27291. return seriesColor;
  27292. });
  27293. }
  27294. }
  27295. });
  27296. // CONCATENATED MODULE: ./packages/progress/src/progress.vue?vue&type=script&lang=js&
  27297. /* harmony default export */ var src_progressvue_type_script_lang_js_ = (progressvue_type_script_lang_js_);
  27298. // CONCATENATED MODULE: ./packages/progress/src/progress.vue
  27299. /* normalize component */
  27300. var progress_component = normalizeComponent(
  27301. src_progressvue_type_script_lang_js_,
  27302. progressvue_type_template_id_229ee406_render,
  27303. progressvue_type_template_id_229ee406_staticRenderFns,
  27304. false,
  27305. null,
  27306. null,
  27307. null
  27308. )
  27309. /* hot reload */
  27310. if (false) { var progress_api; }
  27311. progress_component.options.__file = "packages/progress/src/progress.vue"
  27312. /* harmony default export */ var progress = (progress_component.exports);
  27313. // CONCATENATED MODULE: ./packages/progress/index.js
  27314. /* istanbul ignore next */
  27315. progress.install = function (Vue) {
  27316. Vue.component(progress.name, progress);
  27317. };
  27318. /* harmony default export */ var packages_progress = (progress);
  27319. // 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&
  27320. var spinnervue_type_template_id_697b8538_render = function() {
  27321. var _vm = this
  27322. var _h = _vm.$createElement
  27323. var _c = _vm._self._c || _h
  27324. return _c("span", { staticClass: "el-spinner" }, [
  27325. _c(
  27326. "svg",
  27327. {
  27328. staticClass: "el-spinner-inner",
  27329. style: { width: _vm.radius / 2 + "px", height: _vm.radius / 2 + "px" },
  27330. attrs: { viewBox: "0 0 50 50" }
  27331. },
  27332. [
  27333. _c("circle", {
  27334. staticClass: "path",
  27335. attrs: {
  27336. cx: "25",
  27337. cy: "25",
  27338. r: "20",
  27339. fill: "none",
  27340. stroke: _vm.strokeColor,
  27341. "stroke-width": _vm.strokeWidth
  27342. }
  27343. })
  27344. ]
  27345. )
  27346. ])
  27347. }
  27348. var spinnervue_type_template_id_697b8538_staticRenderFns = []
  27349. spinnervue_type_template_id_697b8538_render._withStripped = true
  27350. // CONCATENATED MODULE: ./packages/spinner/src/spinner.vue?vue&type=template&id=697b8538&
  27351. // 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&
  27352. //
  27353. //
  27354. //
  27355. //
  27356. //
  27357. //
  27358. //
  27359. /* harmony default export */ var spinnervue_type_script_lang_js_ = ({
  27360. name: 'ElSpinner',
  27361. props: {
  27362. type: String,
  27363. radius: {
  27364. type: Number,
  27365. default: 100
  27366. },
  27367. strokeWidth: {
  27368. type: Number,
  27369. default: 5
  27370. },
  27371. strokeColor: {
  27372. type: String,
  27373. default: '#efefef'
  27374. }
  27375. }
  27376. });
  27377. // CONCATENATED MODULE: ./packages/spinner/src/spinner.vue?vue&type=script&lang=js&
  27378. /* harmony default export */ var src_spinnervue_type_script_lang_js_ = (spinnervue_type_script_lang_js_);
  27379. // CONCATENATED MODULE: ./packages/spinner/src/spinner.vue
  27380. /* normalize component */
  27381. var spinner_component = normalizeComponent(
  27382. src_spinnervue_type_script_lang_js_,
  27383. spinnervue_type_template_id_697b8538_render,
  27384. spinnervue_type_template_id_697b8538_staticRenderFns,
  27385. false,
  27386. null,
  27387. null,
  27388. null
  27389. )
  27390. /* hot reload */
  27391. if (false) { var spinner_api; }
  27392. spinner_component.options.__file = "packages/spinner/src/spinner.vue"
  27393. /* harmony default export */ var spinner = (spinner_component.exports);
  27394. // CONCATENATED MODULE: ./packages/spinner/index.js
  27395. /* istanbul ignore next */
  27396. spinner.install = function (Vue) {
  27397. Vue.component(spinner.name, spinner);
  27398. };
  27399. /* harmony default export */ var packages_spinner = (spinner);
  27400. // 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&
  27401. var mainvue_type_template_id_455b9f60_render = function() {
  27402. var _vm = this
  27403. var _h = _vm.$createElement
  27404. var _c = _vm._self._c || _h
  27405. return _c(
  27406. "transition",
  27407. {
  27408. attrs: { name: "el-message-fade" },
  27409. on: { "after-leave": _vm.handleAfterLeave }
  27410. },
  27411. [
  27412. _c(
  27413. "div",
  27414. {
  27415. directives: [
  27416. {
  27417. name: "show",
  27418. rawName: "v-show",
  27419. value: _vm.visible,
  27420. expression: "visible"
  27421. }
  27422. ],
  27423. class: [
  27424. "el-message",
  27425. _vm.type && !_vm.iconClass ? "el-message--" + _vm.type : "",
  27426. _vm.center ? "is-center" : "",
  27427. _vm.showClose ? "is-closable" : "",
  27428. _vm.customClass
  27429. ],
  27430. style: _vm.positionStyle,
  27431. attrs: { role: "alert" },
  27432. on: { mouseenter: _vm.clearTimer, mouseleave: _vm.startTimer }
  27433. },
  27434. [
  27435. _vm.iconClass
  27436. ? _c("i", { class: _vm.iconClass })
  27437. : _c("i", { class: _vm.typeClass }),
  27438. _vm._t("default", [
  27439. !_vm.dangerouslyUseHTMLString
  27440. ? _c("p", { staticClass: "el-message__content" }, [
  27441. _vm._v(_vm._s(_vm.message))
  27442. ])
  27443. : _c("p", {
  27444. staticClass: "el-message__content",
  27445. domProps: { innerHTML: _vm._s(_vm.message) }
  27446. })
  27447. ]),
  27448. _vm.showClose
  27449. ? _c("i", {
  27450. staticClass: "el-message__closeBtn el-icon-close",
  27451. on: { click: _vm.close }
  27452. })
  27453. : _vm._e()
  27454. ],
  27455. 2
  27456. )
  27457. ]
  27458. )
  27459. }
  27460. var mainvue_type_template_id_455b9f60_staticRenderFns = []
  27461. mainvue_type_template_id_455b9f60_render._withStripped = true
  27462. // CONCATENATED MODULE: ./packages/message/src/main.vue?vue&type=template&id=455b9f60&
  27463. // 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&
  27464. //
  27465. //
  27466. //
  27467. //
  27468. //
  27469. //
  27470. //
  27471. //
  27472. //
  27473. //
  27474. //
  27475. //
  27476. //
  27477. //
  27478. //
  27479. //
  27480. //
  27481. //
  27482. //
  27483. //
  27484. //
  27485. //
  27486. //
  27487. //
  27488. //
  27489. //
  27490. var src_mainvue_type_script_lang_js_typeMap = {
  27491. success: 'success',
  27492. info: 'info',
  27493. warning: 'warning',
  27494. error: 'error'
  27495. };
  27496. /* harmony default export */ var message_src_mainvue_type_script_lang_js_ = ({
  27497. data: function data() {
  27498. return {
  27499. visible: false,
  27500. message: '',
  27501. duration: 3000,
  27502. type: 'info',
  27503. iconClass: '',
  27504. customClass: '',
  27505. onClose: null,
  27506. showClose: false,
  27507. closed: false,
  27508. verticalOffset: 20,
  27509. timer: null,
  27510. dangerouslyUseHTMLString: false,
  27511. center: false
  27512. };
  27513. },
  27514. computed: {
  27515. typeClass: function typeClass() {
  27516. return this.type && !this.iconClass ? 'el-message__icon el-icon-' + src_mainvue_type_script_lang_js_typeMap[this.type] : '';
  27517. },
  27518. positionStyle: function positionStyle() {
  27519. return {
  27520. 'top': this.verticalOffset + 'px'
  27521. };
  27522. }
  27523. },
  27524. watch: {
  27525. closed: function closed(newVal) {
  27526. if (newVal) {
  27527. this.visible = false;
  27528. }
  27529. }
  27530. },
  27531. methods: {
  27532. handleAfterLeave: function handleAfterLeave() {
  27533. this.$destroy(true);
  27534. this.$el.parentNode.removeChild(this.$el);
  27535. },
  27536. close: function close() {
  27537. this.closed = true;
  27538. if (typeof this.onClose === 'function') {
  27539. this.onClose(this);
  27540. }
  27541. },
  27542. clearTimer: function clearTimer() {
  27543. clearTimeout(this.timer);
  27544. },
  27545. startTimer: function startTimer() {
  27546. var _this = this;
  27547. if (this.duration > 0) {
  27548. this.timer = setTimeout(function () {
  27549. if (!_this.closed) {
  27550. _this.close();
  27551. }
  27552. }, this.duration);
  27553. }
  27554. },
  27555. keydown: function keydown(e) {
  27556. if (e.keyCode === 27) {
  27557. // esc关闭消息
  27558. if (!this.closed) {
  27559. this.close();
  27560. }
  27561. }
  27562. }
  27563. },
  27564. mounted: function mounted() {
  27565. this.startTimer();
  27566. document.addEventListener('keydown', this.keydown);
  27567. },
  27568. beforeDestroy: function beforeDestroy() {
  27569. document.removeEventListener('keydown', this.keydown);
  27570. }
  27571. });
  27572. // CONCATENATED MODULE: ./packages/message/src/main.vue?vue&type=script&lang=js&
  27573. /* harmony default export */ var packages_message_src_mainvue_type_script_lang_js_ = (message_src_mainvue_type_script_lang_js_);
  27574. // CONCATENATED MODULE: ./packages/message/src/main.vue
  27575. /* normalize component */
  27576. var message_src_main_component = normalizeComponent(
  27577. packages_message_src_mainvue_type_script_lang_js_,
  27578. mainvue_type_template_id_455b9f60_render,
  27579. mainvue_type_template_id_455b9f60_staticRenderFns,
  27580. false,
  27581. null,
  27582. null,
  27583. null
  27584. )
  27585. /* hot reload */
  27586. if (false) { var message_src_main_api; }
  27587. message_src_main_component.options.__file = "packages/message/src/main.vue"
  27588. /* harmony default export */ var message_src_main = (message_src_main_component.exports);
  27589. // EXTERNAL MODULE: external "element-ui/lib/utils/types"
  27590. var types_ = __webpack_require__(16);
  27591. // CONCATENATED MODULE: ./packages/message/src/main.js
  27592. 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; };
  27593. var MessageConstructor = external_vue_default.a.extend(message_src_main);
  27594. var message_src_main_instance = void 0;
  27595. var main_instances = [];
  27596. var main_seed = 1;
  27597. var main_Message = function Message(options) {
  27598. if (external_vue_default.a.prototype.$isServer) return;
  27599. options = options || {};
  27600. if (typeof options === 'string') {
  27601. options = {
  27602. message: options
  27603. };
  27604. }
  27605. var userOnClose = options.onClose;
  27606. var id = 'message_' + main_seed++;
  27607. options.onClose = function () {
  27608. Message.close(id, userOnClose);
  27609. };
  27610. message_src_main_instance = new MessageConstructor({
  27611. data: options
  27612. });
  27613. message_src_main_instance.id = id;
  27614. if (Object(vdom_["isVNode"])(message_src_main_instance.message)) {
  27615. message_src_main_instance.$slots.default = [message_src_main_instance.message];
  27616. message_src_main_instance.message = null;
  27617. }
  27618. message_src_main_instance.$mount();
  27619. document.body.appendChild(message_src_main_instance.$el);
  27620. var verticalOffset = options.offset || 20;
  27621. main_instances.forEach(function (item) {
  27622. verticalOffset += item.$el.offsetHeight + 16;
  27623. });
  27624. message_src_main_instance.verticalOffset = verticalOffset;
  27625. message_src_main_instance.visible = true;
  27626. message_src_main_instance.$el.style.zIndex = popup_["PopupManager"].nextZIndex();
  27627. main_instances.push(message_src_main_instance);
  27628. return message_src_main_instance;
  27629. };
  27630. ['success', 'warning', 'info', 'error'].forEach(function (type) {
  27631. main_Message[type] = function (options) {
  27632. if (Object(types_["isObject"])(options) && !Object(vdom_["isVNode"])(options)) {
  27633. return main_Message(main_extends({}, options, {
  27634. type: type
  27635. }));
  27636. }
  27637. return main_Message({
  27638. type: type,
  27639. message: options
  27640. });
  27641. };
  27642. });
  27643. main_Message.close = function (id, userOnClose) {
  27644. var len = main_instances.length;
  27645. var index = -1;
  27646. var removedHeight = void 0;
  27647. for (var i = 0; i < len; i++) {
  27648. if (id === main_instances[i].id) {
  27649. removedHeight = main_instances[i].$el.offsetHeight;
  27650. index = i;
  27651. if (typeof userOnClose === 'function') {
  27652. userOnClose(main_instances[i]);
  27653. }
  27654. main_instances.splice(i, 1);
  27655. break;
  27656. }
  27657. }
  27658. if (len <= 1 || index === -1 || index > main_instances.length - 1) return;
  27659. for (var _i = index; _i < len - 1; _i++) {
  27660. var dom = main_instances[_i].$el;
  27661. dom.style['top'] = parseInt(dom.style['top'], 10) - removedHeight - 16 + 'px';
  27662. }
  27663. };
  27664. main_Message.closeAll = function () {
  27665. for (var i = main_instances.length - 1; i >= 0; i--) {
  27666. main_instances[i].close();
  27667. }
  27668. };
  27669. /* harmony default export */ var packages_message_src_main = (main_Message);
  27670. // CONCATENATED MODULE: ./packages/message/index.js
  27671. /* harmony default export */ var packages_message = (packages_message_src_main);
  27672. // 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&
  27673. var mainvue_type_template_id_7ccb6598_render = function() {
  27674. var _vm = this
  27675. var _h = _vm.$createElement
  27676. var _c = _vm._self._c || _h
  27677. return _c(
  27678. "div",
  27679. { staticClass: "el-badge" },
  27680. [
  27681. _vm._t("default"),
  27682. _c("transition", { attrs: { name: "el-zoom-in-center" } }, [
  27683. _c("sup", {
  27684. directives: [
  27685. {
  27686. name: "show",
  27687. rawName: "v-show",
  27688. value:
  27689. !_vm.hidden && (_vm.content || _vm.content === 0 || _vm.isDot),
  27690. expression: "!hidden && (content || content === 0 || isDot)"
  27691. }
  27692. ],
  27693. staticClass: "el-badge__content",
  27694. class: [
  27695. _vm.type ? "el-badge__content--" + _vm.type : null,
  27696. {
  27697. "is-fixed": _vm.$slots.default,
  27698. "is-dot": _vm.isDot
  27699. }
  27700. ],
  27701. domProps: { textContent: _vm._s(_vm.content) }
  27702. })
  27703. ])
  27704. ],
  27705. 2
  27706. )
  27707. }
  27708. var mainvue_type_template_id_7ccb6598_staticRenderFns = []
  27709. mainvue_type_template_id_7ccb6598_render._withStripped = true
  27710. // CONCATENATED MODULE: ./packages/badge/src/main.vue?vue&type=template&id=7ccb6598&
  27711. // 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&
  27712. //
  27713. //
  27714. //
  27715. //
  27716. //
  27717. //
  27718. //
  27719. //
  27720. //
  27721. //
  27722. //
  27723. //
  27724. //
  27725. //
  27726. //
  27727. //
  27728. //
  27729. //
  27730. //
  27731. //
  27732. /* harmony default export */ var badge_src_mainvue_type_script_lang_js_ = ({
  27733. name: 'ElBadge',
  27734. props: {
  27735. value: [String, Number],
  27736. max: Number,
  27737. isDot: Boolean,
  27738. hidden: Boolean,
  27739. type: {
  27740. type: String,
  27741. validator: function validator(val) {
  27742. return ['primary', 'success', 'warning', 'info', 'danger'].indexOf(val) > -1;
  27743. }
  27744. }
  27745. },
  27746. computed: {
  27747. content: function content() {
  27748. if (this.isDot) return;
  27749. var value = this.value;
  27750. var max = this.max;
  27751. if (typeof value === 'number' && typeof max === 'number') {
  27752. return max < value ? max + '+' : value;
  27753. }
  27754. return value;
  27755. }
  27756. }
  27757. });
  27758. // CONCATENATED MODULE: ./packages/badge/src/main.vue?vue&type=script&lang=js&
  27759. /* harmony default export */ var packages_badge_src_mainvue_type_script_lang_js_ = (badge_src_mainvue_type_script_lang_js_);
  27760. // CONCATENATED MODULE: ./packages/badge/src/main.vue
  27761. /* normalize component */
  27762. var badge_src_main_component = normalizeComponent(
  27763. packages_badge_src_mainvue_type_script_lang_js_,
  27764. mainvue_type_template_id_7ccb6598_render,
  27765. mainvue_type_template_id_7ccb6598_staticRenderFns,
  27766. false,
  27767. null,
  27768. null,
  27769. null
  27770. )
  27771. /* hot reload */
  27772. if (false) { var badge_src_main_api; }
  27773. badge_src_main_component.options.__file = "packages/badge/src/main.vue"
  27774. /* harmony default export */ var badge_src_main = (badge_src_main_component.exports);
  27775. // CONCATENATED MODULE: ./packages/badge/index.js
  27776. /* istanbul ignore next */
  27777. badge_src_main.install = function (Vue) {
  27778. Vue.component(badge_src_main.name, badge_src_main);
  27779. };
  27780. /* harmony default export */ var badge = (badge_src_main);
  27781. // 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&
  27782. var mainvue_type_template_id_59a4a40f_render = function() {
  27783. var _vm = this
  27784. var _h = _vm.$createElement
  27785. var _c = _vm._self._c || _h
  27786. return _c(
  27787. "div",
  27788. {
  27789. staticClass: "el-card",
  27790. class: _vm.shadow ? "is-" + _vm.shadow + "-shadow" : "is-always-shadow"
  27791. },
  27792. [
  27793. _vm.$slots.header || _vm.header
  27794. ? _c(
  27795. "div",
  27796. { staticClass: "el-card__header" },
  27797. [_vm._t("header", [_vm._v(_vm._s(_vm.header))])],
  27798. 2
  27799. )
  27800. : _vm._e(),
  27801. _c(
  27802. "div",
  27803. { staticClass: "el-card__body", style: _vm.bodyStyle },
  27804. [_vm._t("default")],
  27805. 2
  27806. )
  27807. ]
  27808. )
  27809. }
  27810. var mainvue_type_template_id_59a4a40f_staticRenderFns = []
  27811. mainvue_type_template_id_59a4a40f_render._withStripped = true
  27812. // CONCATENATED MODULE: ./packages/card/src/main.vue?vue&type=template&id=59a4a40f&
  27813. // 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&
  27814. //
  27815. //
  27816. //
  27817. //
  27818. //
  27819. //
  27820. //
  27821. //
  27822. //
  27823. //
  27824. //
  27825. /* harmony default export */ var card_src_mainvue_type_script_lang_js_ = ({
  27826. name: 'ElCard',
  27827. props: {
  27828. header: {},
  27829. bodyStyle: {},
  27830. shadow: {
  27831. type: String
  27832. }
  27833. }
  27834. });
  27835. // CONCATENATED MODULE: ./packages/card/src/main.vue?vue&type=script&lang=js&
  27836. /* harmony default export */ var packages_card_src_mainvue_type_script_lang_js_ = (card_src_mainvue_type_script_lang_js_);
  27837. // CONCATENATED MODULE: ./packages/card/src/main.vue
  27838. /* normalize component */
  27839. var card_src_main_component = normalizeComponent(
  27840. packages_card_src_mainvue_type_script_lang_js_,
  27841. mainvue_type_template_id_59a4a40f_render,
  27842. mainvue_type_template_id_59a4a40f_staticRenderFns,
  27843. false,
  27844. null,
  27845. null,
  27846. null
  27847. )
  27848. /* hot reload */
  27849. if (false) { var card_src_main_api; }
  27850. card_src_main_component.options.__file = "packages/card/src/main.vue"
  27851. /* harmony default export */ var card_src_main = (card_src_main_component.exports);
  27852. // CONCATENATED MODULE: ./packages/card/index.js
  27853. /* istanbul ignore next */
  27854. card_src_main.install = function (Vue) {
  27855. Vue.component(card_src_main.name, card_src_main);
  27856. };
  27857. /* harmony default export */ var card = (card_src_main);
  27858. // 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&
  27859. var mainvue_type_template_id_ada57782_render = function() {
  27860. var _vm = this
  27861. var _h = _vm.$createElement
  27862. var _c = _vm._self._c || _h
  27863. return _c(
  27864. "div",
  27865. {
  27866. staticClass: "el-rate",
  27867. attrs: {
  27868. role: "slider",
  27869. "aria-valuenow": _vm.currentValue,
  27870. "aria-valuetext": _vm.text,
  27871. "aria-valuemin": "0",
  27872. "aria-valuemax": _vm.max,
  27873. tabindex: "0"
  27874. },
  27875. on: { keydown: _vm.handleKey }
  27876. },
  27877. [
  27878. _vm._l(_vm.max, function(item, key) {
  27879. return _c(
  27880. "span",
  27881. {
  27882. key: key,
  27883. staticClass: "el-rate__item",
  27884. style: { cursor: _vm.rateDisabled ? "auto" : "pointer" },
  27885. on: {
  27886. mousemove: function($event) {
  27887. _vm.setCurrentValue(item, $event)
  27888. },
  27889. mouseleave: _vm.resetCurrentValue,
  27890. click: function($event) {
  27891. _vm.selectValue(item)
  27892. }
  27893. }
  27894. },
  27895. [
  27896. _c(
  27897. "i",
  27898. {
  27899. staticClass: "el-rate__icon",
  27900. class: [
  27901. _vm.classes[item - 1],
  27902. { hover: _vm.hoverIndex === item }
  27903. ],
  27904. style: _vm.getIconStyle(item)
  27905. },
  27906. [
  27907. _vm.showDecimalIcon(item)
  27908. ? _c("i", {
  27909. staticClass: "el-rate__decimal",
  27910. class: _vm.decimalIconClass,
  27911. style: _vm.decimalStyle
  27912. })
  27913. : _vm._e()
  27914. ]
  27915. )
  27916. ]
  27917. )
  27918. }),
  27919. _vm.showText || _vm.showScore
  27920. ? _c(
  27921. "span",
  27922. { staticClass: "el-rate__text", style: { color: _vm.textColor } },
  27923. [_vm._v(_vm._s(_vm.text))]
  27924. )
  27925. : _vm._e()
  27926. ],
  27927. 2
  27928. )
  27929. }
  27930. var mainvue_type_template_id_ada57782_staticRenderFns = []
  27931. mainvue_type_template_id_ada57782_render._withStripped = true
  27932. // CONCATENATED MODULE: ./packages/rate/src/main.vue?vue&type=template&id=ada57782&
  27933. // 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&
  27934. //
  27935. //
  27936. //
  27937. //
  27938. //
  27939. //
  27940. //
  27941. //
  27942. //
  27943. //
  27944. //
  27945. //
  27946. //
  27947. //
  27948. //
  27949. //
  27950. //
  27951. //
  27952. //
  27953. //
  27954. //
  27955. //
  27956. //
  27957. //
  27958. //
  27959. //
  27960. //
  27961. //
  27962. //
  27963. //
  27964. //
  27965. //
  27966. //
  27967. //
  27968. /* harmony default export */ var rate_src_mainvue_type_script_lang_js_ = ({
  27969. name: 'ElRate',
  27970. mixins: [migrating_default.a],
  27971. inject: {
  27972. elForm: {
  27973. default: ''
  27974. }
  27975. },
  27976. data: function data() {
  27977. return {
  27978. pointerAtLeftHalf: true,
  27979. currentValue: this.value,
  27980. hoverIndex: -1
  27981. };
  27982. },
  27983. props: {
  27984. value: {
  27985. type: Number,
  27986. default: 0
  27987. },
  27988. lowThreshold: {
  27989. type: Number,
  27990. default: 2
  27991. },
  27992. highThreshold: {
  27993. type: Number,
  27994. default: 4
  27995. },
  27996. max: {
  27997. type: Number,
  27998. default: 5
  27999. },
  28000. colors: {
  28001. type: [Array, Object],
  28002. default: function _default() {
  28003. return ['#F7BA2A', '#F7BA2A', '#F7BA2A'];
  28004. }
  28005. },
  28006. voidColor: {
  28007. type: String,
  28008. default: '#C6D1DE'
  28009. },
  28010. disabledVoidColor: {
  28011. type: String,
  28012. default: '#EFF2F7'
  28013. },
  28014. iconClasses: {
  28015. type: [Array, Object],
  28016. default: function _default() {
  28017. return ['el-icon-star-on', 'el-icon-star-on', 'el-icon-star-on'];
  28018. }
  28019. },
  28020. voidIconClass: {
  28021. type: String,
  28022. default: 'el-icon-star-off'
  28023. },
  28024. disabledVoidIconClass: {
  28025. type: String,
  28026. default: 'el-icon-star-on'
  28027. },
  28028. disabled: {
  28029. type: Boolean,
  28030. default: false
  28031. },
  28032. allowHalf: {
  28033. type: Boolean,
  28034. default: false
  28035. },
  28036. showText: {
  28037. type: Boolean,
  28038. default: false
  28039. },
  28040. showScore: {
  28041. type: Boolean,
  28042. default: false
  28043. },
  28044. textColor: {
  28045. type: String,
  28046. default: '#1f2d3d'
  28047. },
  28048. texts: {
  28049. type: Array,
  28050. default: function _default() {
  28051. return ['极差', '失望', '一般', '满意', '惊喜'];
  28052. }
  28053. },
  28054. scoreTemplate: {
  28055. type: String,
  28056. default: '{value}'
  28057. }
  28058. },
  28059. computed: {
  28060. text: function text() {
  28061. var result = '';
  28062. if (this.showScore) {
  28063. result = this.scoreTemplate.replace(/\{\s*value\s*\}/, this.rateDisabled ? this.value : this.currentValue);
  28064. } else if (this.showText) {
  28065. result = this.texts[Math.ceil(this.currentValue) - 1];
  28066. }
  28067. return result;
  28068. },
  28069. decimalStyle: function decimalStyle() {
  28070. var width = '';
  28071. if (this.rateDisabled) {
  28072. width = this.valueDecimal + '%';
  28073. } else if (this.allowHalf) {
  28074. width = '50%';
  28075. }
  28076. return {
  28077. color: this.activeColor,
  28078. width: width
  28079. };
  28080. },
  28081. valueDecimal: function valueDecimal() {
  28082. return this.value * 100 - Math.floor(this.value) * 100;
  28083. },
  28084. classMap: function classMap() {
  28085. var _ref;
  28086. 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;
  28087. },
  28088. decimalIconClass: function decimalIconClass() {
  28089. return this.getValueFromMap(this.value, this.classMap);
  28090. },
  28091. voidClass: function voidClass() {
  28092. return this.rateDisabled ? this.disabledVoidIconClass : this.voidIconClass;
  28093. },
  28094. activeClass: function activeClass() {
  28095. return this.getValueFromMap(this.currentValue, this.classMap);
  28096. },
  28097. colorMap: function colorMap() {
  28098. var _ref2;
  28099. 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;
  28100. },
  28101. activeColor: function activeColor() {
  28102. return this.getValueFromMap(this.currentValue, this.colorMap);
  28103. },
  28104. classes: function classes() {
  28105. var result = [];
  28106. var i = 0;
  28107. var threshold = this.currentValue;
  28108. if (this.allowHalf && this.currentValue !== Math.floor(this.currentValue)) {
  28109. threshold--;
  28110. }
  28111. for (; i < threshold; i++) {
  28112. result.push(this.activeClass);
  28113. }
  28114. for (; i < this.max; i++) {
  28115. result.push(this.voidClass);
  28116. }
  28117. return result;
  28118. },
  28119. rateDisabled: function rateDisabled() {
  28120. return this.disabled || (this.elForm || {}).disabled;
  28121. }
  28122. },
  28123. watch: {
  28124. value: function value(val) {
  28125. this.currentValue = val;
  28126. this.pointerAtLeftHalf = this.value !== Math.floor(this.value);
  28127. }
  28128. },
  28129. methods: {
  28130. getMigratingConfig: function getMigratingConfig() {
  28131. return {
  28132. props: {
  28133. 'text-template': 'text-template is renamed to score-template.'
  28134. }
  28135. };
  28136. },
  28137. getValueFromMap: function getValueFromMap(value, map) {
  28138. var matchedKeys = Object.keys(map).filter(function (key) {
  28139. var val = map[key];
  28140. var excluded = Object(types_["isObject"])(val) ? val.excluded : false;
  28141. return excluded ? value < key : value <= key;
  28142. }).sort(function (a, b) {
  28143. return a - b;
  28144. });
  28145. var matchedValue = map[matchedKeys[0]];
  28146. return Object(types_["isObject"])(matchedValue) ? matchedValue.value : matchedValue || '';
  28147. },
  28148. showDecimalIcon: function showDecimalIcon(item) {
  28149. var showWhenDisabled = this.rateDisabled && this.valueDecimal > 0 && item - 1 < this.value && item > this.value;
  28150. /* istanbul ignore next */
  28151. var showWhenAllowHalf = this.allowHalf && this.pointerAtLeftHalf && item - 0.5 <= this.currentValue && item > this.currentValue;
  28152. return showWhenDisabled || showWhenAllowHalf;
  28153. },
  28154. getIconStyle: function getIconStyle(item) {
  28155. var voidColor = this.rateDisabled ? this.disabledVoidColor : this.voidColor;
  28156. return {
  28157. color: item <= this.currentValue ? this.activeColor : voidColor
  28158. };
  28159. },
  28160. selectValue: function selectValue(value) {
  28161. if (this.rateDisabled) {
  28162. return;
  28163. }
  28164. if (this.allowHalf && this.pointerAtLeftHalf) {
  28165. this.$emit('input', this.currentValue);
  28166. this.$emit('change', this.currentValue);
  28167. } else {
  28168. this.$emit('input', value);
  28169. this.$emit('change', value);
  28170. }
  28171. },
  28172. handleKey: function handleKey(e) {
  28173. if (this.rateDisabled) {
  28174. return;
  28175. }
  28176. var currentValue = this.currentValue;
  28177. var keyCode = e.keyCode;
  28178. if (keyCode === 38 || keyCode === 39) {
  28179. // left / down
  28180. if (this.allowHalf) {
  28181. currentValue += 0.5;
  28182. } else {
  28183. currentValue += 1;
  28184. }
  28185. e.stopPropagation();
  28186. e.preventDefault();
  28187. } else if (keyCode === 37 || keyCode === 40) {
  28188. if (this.allowHalf) {
  28189. currentValue -= 0.5;
  28190. } else {
  28191. currentValue -= 1;
  28192. }
  28193. e.stopPropagation();
  28194. e.preventDefault();
  28195. }
  28196. currentValue = currentValue < 0 ? 0 : currentValue;
  28197. currentValue = currentValue > this.max ? this.max : currentValue;
  28198. this.$emit('input', currentValue);
  28199. this.$emit('change', currentValue);
  28200. },
  28201. setCurrentValue: function setCurrentValue(value, event) {
  28202. if (this.rateDisabled) {
  28203. return;
  28204. }
  28205. /* istanbul ignore if */
  28206. if (this.allowHalf) {
  28207. var target = event.target;
  28208. if (Object(dom_["hasClass"])(target, 'el-rate__item')) {
  28209. target = target.querySelector('.el-rate__icon');
  28210. }
  28211. if (Object(dom_["hasClass"])(target, 'el-rate__decimal')) {
  28212. target = target.parentNode;
  28213. }
  28214. this.pointerAtLeftHalf = event.offsetX * 2 <= target.clientWidth;
  28215. this.currentValue = this.pointerAtLeftHalf ? value - 0.5 : value;
  28216. } else {
  28217. this.currentValue = value;
  28218. }
  28219. this.hoverIndex = value;
  28220. },
  28221. resetCurrentValue: function resetCurrentValue() {
  28222. if (this.rateDisabled) {
  28223. return;
  28224. }
  28225. if (this.allowHalf) {
  28226. this.pointerAtLeftHalf = this.value !== Math.floor(this.value);
  28227. }
  28228. this.currentValue = this.value;
  28229. this.hoverIndex = -1;
  28230. }
  28231. },
  28232. created: function created() {
  28233. if (!this.value) {
  28234. this.$emit('input', 0);
  28235. }
  28236. }
  28237. });
  28238. // CONCATENATED MODULE: ./packages/rate/src/main.vue?vue&type=script&lang=js&
  28239. /* harmony default export */ var packages_rate_src_mainvue_type_script_lang_js_ = (rate_src_mainvue_type_script_lang_js_);
  28240. // CONCATENATED MODULE: ./packages/rate/src/main.vue
  28241. /* normalize component */
  28242. var rate_src_main_component = normalizeComponent(
  28243. packages_rate_src_mainvue_type_script_lang_js_,
  28244. mainvue_type_template_id_ada57782_render,
  28245. mainvue_type_template_id_ada57782_staticRenderFns,
  28246. false,
  28247. null,
  28248. null,
  28249. null
  28250. )
  28251. /* hot reload */
  28252. if (false) { var rate_src_main_api; }
  28253. rate_src_main_component.options.__file = "packages/rate/src/main.vue"
  28254. /* harmony default export */ var rate_src_main = (rate_src_main_component.exports);
  28255. // CONCATENATED MODULE: ./packages/rate/index.js
  28256. /* istanbul ignore next */
  28257. rate_src_main.install = function (Vue) {
  28258. Vue.component(rate_src_main.name, rate_src_main);
  28259. };
  28260. /* harmony default export */ var packages_rate = (rate_src_main);
  28261. // 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&
  28262. var stepsvue_type_template_id_3c6b6dc0_render = function() {
  28263. var _vm = this
  28264. var _h = _vm.$createElement
  28265. var _c = _vm._self._c || _h
  28266. return _c(
  28267. "div",
  28268. {
  28269. staticClass: "el-steps",
  28270. class: [
  28271. !_vm.simple && "el-steps--" + _vm.direction,
  28272. _vm.simple && "el-steps--simple"
  28273. ]
  28274. },
  28275. [_vm._t("default")],
  28276. 2
  28277. )
  28278. }
  28279. var stepsvue_type_template_id_3c6b6dc0_staticRenderFns = []
  28280. stepsvue_type_template_id_3c6b6dc0_render._withStripped = true
  28281. // CONCATENATED MODULE: ./packages/steps/src/steps.vue?vue&type=template&id=3c6b6dc0&
  28282. // 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&
  28283. //
  28284. //
  28285. //
  28286. //
  28287. //
  28288. //
  28289. //
  28290. //
  28291. //
  28292. //
  28293. //
  28294. /* harmony default export */ var stepsvue_type_script_lang_js_ = ({
  28295. name: 'ElSteps',
  28296. mixins: [migrating_default.a],
  28297. props: {
  28298. space: [Number, String],
  28299. active: Number,
  28300. direction: {
  28301. type: String,
  28302. default: 'horizontal'
  28303. },
  28304. alignCenter: Boolean,
  28305. simple: Boolean,
  28306. finishStatus: {
  28307. type: String,
  28308. default: 'finish'
  28309. },
  28310. processStatus: {
  28311. type: String,
  28312. default: 'process'
  28313. }
  28314. },
  28315. data: function data() {
  28316. return {
  28317. steps: [],
  28318. stepOffset: 0
  28319. };
  28320. },
  28321. methods: {
  28322. getMigratingConfig: function getMigratingConfig() {
  28323. return {
  28324. props: {
  28325. 'center': 'center is removed.'
  28326. }
  28327. };
  28328. }
  28329. },
  28330. watch: {
  28331. active: function active(newVal, oldVal) {
  28332. this.$emit('change', newVal, oldVal);
  28333. },
  28334. steps: function steps(_steps) {
  28335. _steps.forEach(function (child, index) {
  28336. child.index = index;
  28337. });
  28338. }
  28339. }
  28340. });
  28341. // CONCATENATED MODULE: ./packages/steps/src/steps.vue?vue&type=script&lang=js&
  28342. /* harmony default export */ var src_stepsvue_type_script_lang_js_ = (stepsvue_type_script_lang_js_);
  28343. // CONCATENATED MODULE: ./packages/steps/src/steps.vue
  28344. /* normalize component */
  28345. var steps_component = normalizeComponent(
  28346. src_stepsvue_type_script_lang_js_,
  28347. stepsvue_type_template_id_3c6b6dc0_render,
  28348. stepsvue_type_template_id_3c6b6dc0_staticRenderFns,
  28349. false,
  28350. null,
  28351. null,
  28352. null
  28353. )
  28354. /* hot reload */
  28355. if (false) { var steps_api; }
  28356. steps_component.options.__file = "packages/steps/src/steps.vue"
  28357. /* harmony default export */ var steps = (steps_component.exports);
  28358. // CONCATENATED MODULE: ./packages/steps/index.js
  28359. /* istanbul ignore next */
  28360. steps.install = function (Vue) {
  28361. Vue.component(steps.name, steps);
  28362. };
  28363. /* harmony default export */ var packages_steps = (steps);
  28364. // 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&
  28365. var stepvue_type_template_id_f414a87a_render = function() {
  28366. var _vm = this
  28367. var _h = _vm.$createElement
  28368. var _c = _vm._self._c || _h
  28369. return _c(
  28370. "div",
  28371. {
  28372. staticClass: "el-step",
  28373. class: [
  28374. !_vm.isSimple && "is-" + _vm.$parent.direction,
  28375. _vm.isSimple && "is-simple",
  28376. _vm.isLast && !_vm.space && !_vm.isCenter && "is-flex",
  28377. _vm.isCenter && !_vm.isVertical && !_vm.isSimple && "is-center"
  28378. ],
  28379. style: _vm.style
  28380. },
  28381. [
  28382. _c(
  28383. "div",
  28384. { staticClass: "el-step__head", class: "is-" + _vm.currentStatus },
  28385. [
  28386. _c(
  28387. "div",
  28388. {
  28389. staticClass: "el-step__line",
  28390. style: _vm.isLast
  28391. ? ""
  28392. : { marginRight: _vm.$parent.stepOffset + "px" }
  28393. },
  28394. [
  28395. _c("i", {
  28396. staticClass: "el-step__line-inner",
  28397. style: _vm.lineStyle
  28398. })
  28399. ]
  28400. ),
  28401. _c(
  28402. "div",
  28403. {
  28404. staticClass: "el-step__icon",
  28405. class: "is-" + (_vm.icon ? "icon" : "text")
  28406. },
  28407. [
  28408. _vm.currentStatus !== "success" && _vm.currentStatus !== "error"
  28409. ? _vm._t("icon", [
  28410. _vm.icon
  28411. ? _c("i", {
  28412. staticClass: "el-step__icon-inner",
  28413. class: [_vm.icon]
  28414. })
  28415. : _vm._e(),
  28416. !_vm.icon && !_vm.isSimple
  28417. ? _c("div", { staticClass: "el-step__icon-inner" }, [
  28418. _vm._v(_vm._s(_vm.index + 1))
  28419. ])
  28420. : _vm._e()
  28421. ])
  28422. : _c("i", {
  28423. staticClass: "el-step__icon-inner is-status",
  28424. class: [
  28425. "el-icon-" +
  28426. (_vm.currentStatus === "success" ? "check" : "close")
  28427. ]
  28428. })
  28429. ],
  28430. 2
  28431. )
  28432. ]
  28433. ),
  28434. _c("div", { staticClass: "el-step__main" }, [
  28435. _c(
  28436. "div",
  28437. {
  28438. ref: "title",
  28439. staticClass: "el-step__title",
  28440. class: ["is-" + _vm.currentStatus]
  28441. },
  28442. [_vm._t("title", [_vm._v(_vm._s(_vm.title))])],
  28443. 2
  28444. ),
  28445. _vm.isSimple
  28446. ? _c("div", { staticClass: "el-step__arrow" })
  28447. : _c(
  28448. "div",
  28449. {
  28450. staticClass: "el-step__description",
  28451. class: ["is-" + _vm.currentStatus]
  28452. },
  28453. [_vm._t("description", [_vm._v(_vm._s(_vm.description))])],
  28454. 2
  28455. )
  28456. ])
  28457. ]
  28458. )
  28459. }
  28460. var stepvue_type_template_id_f414a87a_staticRenderFns = []
  28461. stepvue_type_template_id_f414a87a_render._withStripped = true
  28462. // CONCATENATED MODULE: ./packages/steps/src/step.vue?vue&type=template&id=f414a87a&
  28463. // 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&
  28464. //
  28465. //
  28466. //
  28467. //
  28468. //
  28469. //
  28470. //
  28471. //
  28472. //
  28473. //
  28474. //
  28475. //
  28476. //
  28477. //
  28478. //
  28479. //
  28480. //
  28481. //
  28482. //
  28483. //
  28484. //
  28485. //
  28486. //
  28487. //
  28488. //
  28489. //
  28490. //
  28491. //
  28492. //
  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. /* harmony default export */ var stepvue_type_script_lang_js_ = ({
  28520. name: 'ElStep',
  28521. props: {
  28522. title: String,
  28523. icon: String,
  28524. description: String,
  28525. status: String
  28526. },
  28527. data: function data() {
  28528. return {
  28529. index: -1,
  28530. lineStyle: {},
  28531. internalStatus: ''
  28532. };
  28533. },
  28534. beforeCreate: function beforeCreate() {
  28535. this.$parent.steps.push(this);
  28536. },
  28537. beforeDestroy: function beforeDestroy() {
  28538. var steps = this.$parent.steps;
  28539. var index = steps.indexOf(this);
  28540. if (index >= 0) {
  28541. steps.splice(index, 1);
  28542. }
  28543. },
  28544. computed: {
  28545. currentStatus: function currentStatus() {
  28546. return this.status || this.internalStatus;
  28547. },
  28548. prevStatus: function prevStatus() {
  28549. var prevStep = this.$parent.steps[this.index - 1];
  28550. return prevStep ? prevStep.currentStatus : 'wait';
  28551. },
  28552. isCenter: function isCenter() {
  28553. return this.$parent.alignCenter;
  28554. },
  28555. isVertical: function isVertical() {
  28556. return this.$parent.direction === 'vertical';
  28557. },
  28558. isSimple: function isSimple() {
  28559. return this.$parent.simple;
  28560. },
  28561. isLast: function isLast() {
  28562. var parent = this.$parent;
  28563. return parent.steps[parent.steps.length - 1] === this;
  28564. },
  28565. stepsCount: function stepsCount() {
  28566. return this.$parent.steps.length;
  28567. },
  28568. space: function space() {
  28569. var isSimple = this.isSimple,
  28570. space = this.$parent.space;
  28571. return isSimple ? '' : space;
  28572. },
  28573. style: function style() {
  28574. var style = {};
  28575. var parent = this.$parent;
  28576. var len = parent.steps.length;
  28577. var space = typeof this.space === 'number' ? this.space + 'px' : this.space ? this.space : 100 / (len - (this.isCenter ? 0 : 1)) + '%';
  28578. style.flexBasis = space;
  28579. if (this.isVertical) return style;
  28580. if (this.isLast) {
  28581. style.maxWidth = 100 / this.stepsCount + '%';
  28582. } else {
  28583. style.marginRight = -this.$parent.stepOffset + 'px';
  28584. }
  28585. return style;
  28586. }
  28587. },
  28588. methods: {
  28589. updateStatus: function updateStatus(val) {
  28590. var prevChild = this.$parent.$children[this.index - 1];
  28591. if (val > this.index) {
  28592. this.internalStatus = this.$parent.finishStatus;
  28593. } else if (val === this.index && this.prevStatus !== 'error') {
  28594. this.internalStatus = this.$parent.processStatus;
  28595. } else {
  28596. this.internalStatus = 'wait';
  28597. }
  28598. if (prevChild) prevChild.calcProgress(this.internalStatus);
  28599. },
  28600. calcProgress: function calcProgress(status) {
  28601. var step = 100;
  28602. var style = {};
  28603. style.transitionDelay = 150 * this.index + 'ms';
  28604. if (status === this.$parent.processStatus) {
  28605. step = this.currentStatus !== 'error' ? 0 : 0;
  28606. } else if (status === 'wait') {
  28607. step = 0;
  28608. style.transitionDelay = -150 * this.index + 'ms';
  28609. }
  28610. style.borderWidth = step && !this.isSimple ? '1px' : 0;
  28611. this.$parent.direction === 'vertical' ? style.height = step + '%' : style.width = step + '%';
  28612. this.lineStyle = style;
  28613. }
  28614. },
  28615. mounted: function mounted() {
  28616. var _this = this;
  28617. var unwatch = this.$watch('index', function (val) {
  28618. _this.$watch('$parent.active', _this.updateStatus, { immediate: true });
  28619. _this.$watch('$parent.processStatus', function () {
  28620. var activeIndex = _this.$parent.active;
  28621. _this.updateStatus(activeIndex);
  28622. }, { immediate: true });
  28623. unwatch();
  28624. });
  28625. }
  28626. });
  28627. // CONCATENATED MODULE: ./packages/steps/src/step.vue?vue&type=script&lang=js&
  28628. /* harmony default export */ var src_stepvue_type_script_lang_js_ = (stepvue_type_script_lang_js_);
  28629. // CONCATENATED MODULE: ./packages/steps/src/step.vue
  28630. /* normalize component */
  28631. var step_component = normalizeComponent(
  28632. src_stepvue_type_script_lang_js_,
  28633. stepvue_type_template_id_f414a87a_render,
  28634. stepvue_type_template_id_f414a87a_staticRenderFns,
  28635. false,
  28636. null,
  28637. null,
  28638. null
  28639. )
  28640. /* hot reload */
  28641. if (false) { var step_api; }
  28642. step_component.options.__file = "packages/steps/src/step.vue"
  28643. /* harmony default export */ var step = (step_component.exports);
  28644. // CONCATENATED MODULE: ./packages/step/index.js
  28645. /* istanbul ignore next */
  28646. step.install = function (Vue) {
  28647. Vue.component(step.name, step);
  28648. };
  28649. /* harmony default export */ var packages_step = (step);
  28650. // 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&
  28651. var mainvue_type_template_id_5d5d1482_render = function() {
  28652. var _vm = this
  28653. var _h = _vm.$createElement
  28654. var _c = _vm._self._c || _h
  28655. return _c(
  28656. "div",
  28657. {
  28658. class: _vm.carouselClasses,
  28659. on: {
  28660. mouseenter: function($event) {
  28661. $event.stopPropagation()
  28662. return _vm.handleMouseEnter($event)
  28663. },
  28664. mouseleave: function($event) {
  28665. $event.stopPropagation()
  28666. return _vm.handleMouseLeave($event)
  28667. }
  28668. }
  28669. },
  28670. [
  28671. _c(
  28672. "div",
  28673. {
  28674. staticClass: "el-carousel__container",
  28675. style: { height: _vm.height }
  28676. },
  28677. [
  28678. _vm.arrowDisplay
  28679. ? _c("transition", { attrs: { name: "carousel-arrow-left" } }, [
  28680. _c(
  28681. "button",
  28682. {
  28683. directives: [
  28684. {
  28685. name: "show",
  28686. rawName: "v-show",
  28687. value:
  28688. (_vm.arrow === "always" || _vm.hover) &&
  28689. (_vm.loop || _vm.activeIndex > 0),
  28690. expression:
  28691. "(arrow === 'always' || hover) && (loop || activeIndex > 0)"
  28692. }
  28693. ],
  28694. staticClass: "el-carousel__arrow el-carousel__arrow--left",
  28695. attrs: { type: "button" },
  28696. on: {
  28697. mouseenter: function($event) {
  28698. _vm.handleButtonEnter("left")
  28699. },
  28700. mouseleave: _vm.handleButtonLeave,
  28701. click: function($event) {
  28702. $event.stopPropagation()
  28703. _vm.throttledArrowClick(_vm.activeIndex - 1)
  28704. }
  28705. }
  28706. },
  28707. [_c("i", { staticClass: "el-icon-arrow-left" })]
  28708. )
  28709. ])
  28710. : _vm._e(),
  28711. _vm.arrowDisplay
  28712. ? _c("transition", { attrs: { name: "carousel-arrow-right" } }, [
  28713. _c(
  28714. "button",
  28715. {
  28716. directives: [
  28717. {
  28718. name: "show",
  28719. rawName: "v-show",
  28720. value:
  28721. (_vm.arrow === "always" || _vm.hover) &&
  28722. (_vm.loop || _vm.activeIndex < _vm.items.length - 1),
  28723. expression:
  28724. "(arrow === 'always' || hover) && (loop || activeIndex < items.length - 1)"
  28725. }
  28726. ],
  28727. staticClass: "el-carousel__arrow el-carousel__arrow--right",
  28728. attrs: { type: "button" },
  28729. on: {
  28730. mouseenter: function($event) {
  28731. _vm.handleButtonEnter("right")
  28732. },
  28733. mouseleave: _vm.handleButtonLeave,
  28734. click: function($event) {
  28735. $event.stopPropagation()
  28736. _vm.throttledArrowClick(_vm.activeIndex + 1)
  28737. }
  28738. }
  28739. },
  28740. [_c("i", { staticClass: "el-icon-arrow-right" })]
  28741. )
  28742. ])
  28743. : _vm._e(),
  28744. _vm._t("default")
  28745. ],
  28746. 2
  28747. ),
  28748. _vm.indicatorPosition !== "none"
  28749. ? _c(
  28750. "ul",
  28751. { class: _vm.indicatorsClasses },
  28752. _vm._l(_vm.items, function(item, index) {
  28753. return _c(
  28754. "li",
  28755. {
  28756. key: index,
  28757. class: [
  28758. "el-carousel__indicator",
  28759. "el-carousel__indicator--" + _vm.direction,
  28760. { "is-active": index === _vm.activeIndex }
  28761. ],
  28762. on: {
  28763. mouseenter: function($event) {
  28764. _vm.throttledIndicatorHover(index)
  28765. },
  28766. click: function($event) {
  28767. $event.stopPropagation()
  28768. _vm.handleIndicatorClick(index)
  28769. }
  28770. }
  28771. },
  28772. [
  28773. _c("button", { staticClass: "el-carousel__button" }, [
  28774. _vm.hasLabel
  28775. ? _c("span", [_vm._v(_vm._s(item.label))])
  28776. : _vm._e()
  28777. ])
  28778. ]
  28779. )
  28780. }),
  28781. 0
  28782. )
  28783. : _vm._e()
  28784. ]
  28785. )
  28786. }
  28787. var mainvue_type_template_id_5d5d1482_staticRenderFns = []
  28788. mainvue_type_template_id_5d5d1482_render._withStripped = true
  28789. // CONCATENATED MODULE: ./packages/carousel/src/main.vue?vue&type=template&id=5d5d1482&
  28790. // EXTERNAL MODULE: external "throttle-debounce/throttle"
  28791. var throttle_ = __webpack_require__(25);
  28792. var throttle_default = /*#__PURE__*/__webpack_require__.n(throttle_);
  28793. // 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&
  28794. //
  28795. //
  28796. //
  28797. //
  28798. //
  28799. //
  28800. //
  28801. //
  28802. //
  28803. //
  28804. //
  28805. //
  28806. //
  28807. //
  28808. //
  28809. //
  28810. //
  28811. //
  28812. //
  28813. //
  28814. //
  28815. //
  28816. //
  28817. //
  28818. //
  28819. //
  28820. //
  28821. //
  28822. //
  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. /* harmony default export */ var carousel_src_mainvue_type_script_lang_js_ = ({
  28851. name: 'ElCarousel',
  28852. props: {
  28853. initialIndex: {
  28854. type: Number,
  28855. default: 0
  28856. },
  28857. height: String,
  28858. trigger: {
  28859. type: String,
  28860. default: 'hover'
  28861. },
  28862. autoplay: {
  28863. type: Boolean,
  28864. default: true
  28865. },
  28866. interval: {
  28867. type: Number,
  28868. default: 3000
  28869. },
  28870. indicatorPosition: String,
  28871. indicator: {
  28872. type: Boolean,
  28873. default: true
  28874. },
  28875. arrow: {
  28876. type: String,
  28877. default: 'hover'
  28878. },
  28879. type: String,
  28880. loop: {
  28881. type: Boolean,
  28882. default: true
  28883. },
  28884. direction: {
  28885. type: String,
  28886. default: 'horizontal',
  28887. validator: function validator(val) {
  28888. return ['horizontal', 'vertical'].indexOf(val) !== -1;
  28889. }
  28890. }
  28891. },
  28892. data: function data() {
  28893. return {
  28894. items: [],
  28895. activeIndex: -1,
  28896. containerWidth: 0,
  28897. timer: null,
  28898. hover: false
  28899. };
  28900. },
  28901. computed: {
  28902. arrowDisplay: function arrowDisplay() {
  28903. return this.arrow !== 'never' && this.direction !== 'vertical';
  28904. },
  28905. hasLabel: function hasLabel() {
  28906. return this.items.some(function (item) {
  28907. return item.label.toString().length > 0;
  28908. });
  28909. },
  28910. carouselClasses: function carouselClasses() {
  28911. var classes = ['el-carousel', 'el-carousel--' + this.direction];
  28912. if (this.type === 'card') {
  28913. classes.push('el-carousel--card');
  28914. }
  28915. return classes;
  28916. },
  28917. indicatorsClasses: function indicatorsClasses() {
  28918. var classes = ['el-carousel__indicators', 'el-carousel__indicators--' + this.direction];
  28919. if (this.hasLabel) {
  28920. classes.push('el-carousel__indicators--labels');
  28921. }
  28922. if (this.indicatorPosition === 'outside' || this.type === 'card') {
  28923. classes.push('el-carousel__indicators--outside');
  28924. }
  28925. return classes;
  28926. }
  28927. },
  28928. watch: {
  28929. items: function items(val) {
  28930. if (val.length > 0) this.setActiveItem(this.initialIndex);
  28931. },
  28932. activeIndex: function activeIndex(val, oldVal) {
  28933. this.resetItemPosition(oldVal);
  28934. if (oldVal > -1) {
  28935. this.$emit('change', val, oldVal);
  28936. }
  28937. },
  28938. autoplay: function autoplay(val) {
  28939. val ? this.startTimer() : this.pauseTimer();
  28940. },
  28941. loop: function loop() {
  28942. this.setActiveItem(this.activeIndex);
  28943. },
  28944. interval: function interval() {
  28945. this.pauseTimer();
  28946. this.startTimer();
  28947. }
  28948. },
  28949. methods: {
  28950. handleMouseEnter: function handleMouseEnter() {
  28951. this.hover = true;
  28952. this.pauseTimer();
  28953. },
  28954. handleMouseLeave: function handleMouseLeave() {
  28955. this.hover = false;
  28956. this.startTimer();
  28957. },
  28958. itemInStage: function itemInStage(item, index) {
  28959. var length = this.items.length;
  28960. if (index === length - 1 && item.inStage && this.items[0].active || item.inStage && this.items[index + 1] && this.items[index + 1].active) {
  28961. return 'left';
  28962. } else if (index === 0 && item.inStage && this.items[length - 1].active || item.inStage && this.items[index - 1] && this.items[index - 1].active) {
  28963. return 'right';
  28964. }
  28965. return false;
  28966. },
  28967. handleButtonEnter: function handleButtonEnter(arrow) {
  28968. var _this = this;
  28969. if (this.direction === 'vertical') return;
  28970. this.items.forEach(function (item, index) {
  28971. if (arrow === _this.itemInStage(item, index)) {
  28972. item.hover = true;
  28973. }
  28974. });
  28975. },
  28976. handleButtonLeave: function handleButtonLeave() {
  28977. if (this.direction === 'vertical') return;
  28978. this.items.forEach(function (item) {
  28979. item.hover = false;
  28980. });
  28981. },
  28982. updateItems: function updateItems() {
  28983. this.items = this.$children.filter(function (child) {
  28984. return child.$options.name === 'ElCarouselItem';
  28985. });
  28986. },
  28987. resetItemPosition: function resetItemPosition(oldIndex) {
  28988. var _this2 = this;
  28989. this.items.forEach(function (item, index) {
  28990. item.translateItem(index, _this2.activeIndex, oldIndex);
  28991. });
  28992. },
  28993. playSlides: function playSlides() {
  28994. if (this.activeIndex < this.items.length - 1) {
  28995. this.activeIndex++;
  28996. } else if (this.loop) {
  28997. this.activeIndex = 0;
  28998. }
  28999. },
  29000. pauseTimer: function pauseTimer() {
  29001. if (this.timer) {
  29002. clearInterval(this.timer);
  29003. this.timer = null;
  29004. }
  29005. },
  29006. startTimer: function startTimer() {
  29007. if (this.interval <= 0 || !this.autoplay || this.timer) return;
  29008. this.timer = setInterval(this.playSlides, this.interval);
  29009. },
  29010. resetTimer: function resetTimer() {
  29011. this.pauseTimer();
  29012. this.startTimer();
  29013. },
  29014. setActiveItem: function setActiveItem(index) {
  29015. if (typeof index === 'string') {
  29016. var filteredItems = this.items.filter(function (item) {
  29017. return item.name === index;
  29018. });
  29019. if (filteredItems.length > 0) {
  29020. index = this.items.indexOf(filteredItems[0]);
  29021. }
  29022. }
  29023. index = Number(index);
  29024. if (isNaN(index) || index !== Math.floor(index)) {
  29025. console.warn('[Element Warn][Carousel]index must be an integer.');
  29026. return;
  29027. }
  29028. var length = this.items.length;
  29029. var oldIndex = this.activeIndex;
  29030. if (index < 0) {
  29031. this.activeIndex = this.loop ? length - 1 : 0;
  29032. } else if (index >= length) {
  29033. this.activeIndex = this.loop ? 0 : length - 1;
  29034. } else {
  29035. this.activeIndex = index;
  29036. }
  29037. if (oldIndex === this.activeIndex) {
  29038. this.resetItemPosition(oldIndex);
  29039. }
  29040. this.resetTimer();
  29041. },
  29042. prev: function prev() {
  29043. this.setActiveItem(this.activeIndex - 1);
  29044. },
  29045. next: function next() {
  29046. this.setActiveItem(this.activeIndex + 1);
  29047. },
  29048. handleIndicatorClick: function handleIndicatorClick(index) {
  29049. this.activeIndex = index;
  29050. },
  29051. handleIndicatorHover: function handleIndicatorHover(index) {
  29052. if (this.trigger === 'hover' && index !== this.activeIndex) {
  29053. this.activeIndex = index;
  29054. }
  29055. }
  29056. },
  29057. created: function created() {
  29058. var _this3 = this;
  29059. this.throttledArrowClick = throttle_default()(300, true, function (index) {
  29060. _this3.setActiveItem(index);
  29061. });
  29062. this.throttledIndicatorHover = throttle_default()(300, function (index) {
  29063. _this3.handleIndicatorHover(index);
  29064. });
  29065. },
  29066. mounted: function mounted() {
  29067. var _this4 = this;
  29068. this.updateItems();
  29069. this.$nextTick(function () {
  29070. Object(resize_event_["addResizeListener"])(_this4.$el, _this4.resetItemPosition);
  29071. if (_this4.initialIndex < _this4.items.length && _this4.initialIndex >= 0) {
  29072. _this4.activeIndex = _this4.initialIndex;
  29073. }
  29074. _this4.startTimer();
  29075. });
  29076. },
  29077. beforeDestroy: function beforeDestroy() {
  29078. if (this.$el) Object(resize_event_["removeResizeListener"])(this.$el, this.resetItemPosition);
  29079. this.pauseTimer();
  29080. }
  29081. });
  29082. // CONCATENATED MODULE: ./packages/carousel/src/main.vue?vue&type=script&lang=js&
  29083. /* harmony default export */ var packages_carousel_src_mainvue_type_script_lang_js_ = (carousel_src_mainvue_type_script_lang_js_);
  29084. // CONCATENATED MODULE: ./packages/carousel/src/main.vue
  29085. /* normalize component */
  29086. var carousel_src_main_component = normalizeComponent(
  29087. packages_carousel_src_mainvue_type_script_lang_js_,
  29088. mainvue_type_template_id_5d5d1482_render,
  29089. mainvue_type_template_id_5d5d1482_staticRenderFns,
  29090. false,
  29091. null,
  29092. null,
  29093. null
  29094. )
  29095. /* hot reload */
  29096. if (false) { var carousel_src_main_api; }
  29097. carousel_src_main_component.options.__file = "packages/carousel/src/main.vue"
  29098. /* harmony default export */ var carousel_src_main = (carousel_src_main_component.exports);
  29099. // CONCATENATED MODULE: ./packages/carousel/index.js
  29100. /* istanbul ignore next */
  29101. carousel_src_main.install = function (Vue) {
  29102. Vue.component(carousel_src_main.name, carousel_src_main);
  29103. };
  29104. /* harmony default export */ var carousel = (carousel_src_main);
  29105. // CONCATENATED MODULE: ./packages/scrollbar/src/util.js
  29106. var BAR_MAP = {
  29107. vertical: {
  29108. offset: 'offsetHeight',
  29109. scroll: 'scrollTop',
  29110. scrollSize: 'scrollHeight',
  29111. size: 'height',
  29112. key: 'vertical',
  29113. axis: 'Y',
  29114. client: 'clientY',
  29115. direction: 'top'
  29116. },
  29117. horizontal: {
  29118. offset: 'offsetWidth',
  29119. scroll: 'scrollLeft',
  29120. scrollSize: 'scrollWidth',
  29121. size: 'width',
  29122. key: 'horizontal',
  29123. axis: 'X',
  29124. client: 'clientX',
  29125. direction: 'left'
  29126. }
  29127. };
  29128. function renderThumbStyle(_ref) {
  29129. var move = _ref.move,
  29130. size = _ref.size,
  29131. bar = _ref.bar;
  29132. var style = {};
  29133. var translate = 'translate' + bar.axis + '(' + move + '%)';
  29134. style[bar.size] = size;
  29135. style.transform = translate;
  29136. style.msTransform = translate;
  29137. style.webkitTransform = translate;
  29138. return style;
  29139. };
  29140. // CONCATENATED MODULE: ./packages/scrollbar/src/bar.js
  29141. /* istanbul ignore next */
  29142. /* harmony default export */ var src_bar = ({
  29143. name: 'Bar',
  29144. props: {
  29145. vertical: Boolean,
  29146. size: String,
  29147. move: Number
  29148. },
  29149. computed: {
  29150. bar: function bar() {
  29151. return BAR_MAP[this.vertical ? 'vertical' : 'horizontal'];
  29152. },
  29153. wrap: function wrap() {
  29154. return this.$parent.wrap;
  29155. }
  29156. },
  29157. render: function render(h) {
  29158. var size = this.size,
  29159. move = this.move,
  29160. bar = this.bar;
  29161. return h(
  29162. 'div',
  29163. {
  29164. 'class': ['el-scrollbar__bar', 'is-' + bar.key],
  29165. on: {
  29166. 'mousedown': this.clickTrackHandler
  29167. }
  29168. },
  29169. [h('div', {
  29170. ref: 'thumb',
  29171. 'class': 'el-scrollbar__thumb',
  29172. on: {
  29173. 'mousedown': this.clickThumbHandler
  29174. },
  29175. style: renderThumbStyle({ size: size, move: move, bar: bar }) })]
  29176. );
  29177. },
  29178. methods: {
  29179. clickThumbHandler: function clickThumbHandler(e) {
  29180. // prevent click event of right button
  29181. if (e.ctrlKey || e.button === 2) {
  29182. return;
  29183. }
  29184. this.startDrag(e);
  29185. this[this.bar.axis] = e.currentTarget[this.bar.offset] - (e[this.bar.client] - e.currentTarget.getBoundingClientRect()[this.bar.direction]);
  29186. },
  29187. clickTrackHandler: function clickTrackHandler(e) {
  29188. var offset = Math.abs(e.target.getBoundingClientRect()[this.bar.direction] - e[this.bar.client]);
  29189. var thumbHalf = this.$refs.thumb[this.bar.offset] / 2;
  29190. var thumbPositionPercentage = (offset - thumbHalf) * 100 / this.$el[this.bar.offset];
  29191. this.wrap[this.bar.scroll] = thumbPositionPercentage * this.wrap[this.bar.scrollSize] / 100;
  29192. },
  29193. startDrag: function startDrag(e) {
  29194. e.stopImmediatePropagation();
  29195. this.cursorDown = true;
  29196. Object(dom_["on"])(document, 'mousemove', this.mouseMoveDocumentHandler);
  29197. Object(dom_["on"])(document, 'mouseup', this.mouseUpDocumentHandler);
  29198. document.onselectstart = function () {
  29199. return false;
  29200. };
  29201. },
  29202. mouseMoveDocumentHandler: function mouseMoveDocumentHandler(e) {
  29203. if (this.cursorDown === false) return;
  29204. var prevPage = this[this.bar.axis];
  29205. if (!prevPage) return;
  29206. var offset = (this.$el.getBoundingClientRect()[this.bar.direction] - e[this.bar.client]) * -1;
  29207. var thumbClickPosition = this.$refs.thumb[this.bar.offset] - prevPage;
  29208. var thumbPositionPercentage = (offset - thumbClickPosition) * 100 / this.$el[this.bar.offset];
  29209. this.wrap[this.bar.scroll] = thumbPositionPercentage * this.wrap[this.bar.scrollSize] / 100;
  29210. },
  29211. mouseUpDocumentHandler: function mouseUpDocumentHandler(e) {
  29212. this.cursorDown = false;
  29213. this[this.bar.axis] = 0;
  29214. Object(dom_["off"])(document, 'mousemove', this.mouseMoveDocumentHandler);
  29215. document.onselectstart = null;
  29216. }
  29217. },
  29218. destroyed: function destroyed() {
  29219. Object(dom_["off"])(document, 'mouseup', this.mouseUpDocumentHandler);
  29220. }
  29221. });
  29222. // CONCATENATED MODULE: ./packages/scrollbar/src/main.js
  29223. // reference https://github.com/noeldelgado/gemini-scrollbar/blob/master/index.js
  29224. /* istanbul ignore next */
  29225. /* harmony default export */ var scrollbar_src_main = ({
  29226. name: 'ElScrollbar',
  29227. components: { Bar: src_bar },
  29228. props: {
  29229. native: Boolean,
  29230. wrapStyle: {},
  29231. wrapClass: {},
  29232. viewClass: {},
  29233. viewStyle: {},
  29234. noresize: Boolean, // 如果 container 尺寸不会发生变化,最好设置它可以优化性能
  29235. tag: {
  29236. type: String,
  29237. default: 'div'
  29238. }
  29239. },
  29240. data: function data() {
  29241. return {
  29242. sizeWidth: '0',
  29243. sizeHeight: '0',
  29244. moveX: 0,
  29245. moveY: 0
  29246. };
  29247. },
  29248. computed: {
  29249. wrap: function wrap() {
  29250. return this.$refs.wrap;
  29251. }
  29252. },
  29253. render: function render(h) {
  29254. var gutter = scrollbar_width_default()();
  29255. var style = this.wrapStyle;
  29256. if (gutter) {
  29257. var gutterWith = '-' + gutter + 'px';
  29258. var gutterStyle = 'margin-bottom: ' + gutterWith + '; margin-right: ' + gutterWith + ';';
  29259. if (Array.isArray(this.wrapStyle)) {
  29260. style = Object(util_["toObject"])(this.wrapStyle);
  29261. style.marginRight = style.marginBottom = gutterWith;
  29262. } else if (typeof this.wrapStyle === 'string') {
  29263. style += gutterStyle;
  29264. } else {
  29265. style = gutterStyle;
  29266. }
  29267. }
  29268. var view = h(this.tag, {
  29269. class: ['el-scrollbar__view', this.viewClass],
  29270. style: this.viewStyle,
  29271. ref: 'resize'
  29272. }, this.$slots.default);
  29273. var wrap = h(
  29274. 'div',
  29275. {
  29276. ref: 'wrap',
  29277. style: style,
  29278. on: {
  29279. 'scroll': this.handleScroll
  29280. },
  29281. 'class': [this.wrapClass, 'el-scrollbar__wrap', gutter ? '' : 'el-scrollbar__wrap--hidden-default'] },
  29282. [[view]]
  29283. );
  29284. var nodes = void 0;
  29285. if (!this.native) {
  29286. nodes = [wrap, h(src_bar, {
  29287. attrs: {
  29288. move: this.moveX,
  29289. size: this.sizeWidth }
  29290. }), h(src_bar, {
  29291. attrs: {
  29292. vertical: true,
  29293. move: this.moveY,
  29294. size: this.sizeHeight }
  29295. })];
  29296. } else {
  29297. nodes = [h(
  29298. 'div',
  29299. {
  29300. ref: 'wrap',
  29301. 'class': [this.wrapClass, 'el-scrollbar__wrap'],
  29302. style: style },
  29303. [[view]]
  29304. )];
  29305. }
  29306. return h('div', { class: 'el-scrollbar' }, nodes);
  29307. },
  29308. methods: {
  29309. handleScroll: function handleScroll() {
  29310. var wrap = this.wrap;
  29311. this.moveY = wrap.scrollTop * 100 / wrap.clientHeight;
  29312. this.moveX = wrap.scrollLeft * 100 / wrap.clientWidth;
  29313. },
  29314. update: function update() {
  29315. var heightPercentage = void 0,
  29316. widthPercentage = void 0;
  29317. var wrap = this.wrap;
  29318. if (!wrap) return;
  29319. heightPercentage = wrap.clientHeight * 100 / wrap.scrollHeight;
  29320. widthPercentage = wrap.clientWidth * 100 / wrap.scrollWidth;
  29321. this.sizeHeight = heightPercentage < 100 ? heightPercentage + '%' : '';
  29322. this.sizeWidth = widthPercentage < 100 ? widthPercentage + '%' : '';
  29323. }
  29324. },
  29325. mounted: function mounted() {
  29326. if (this.native) return;
  29327. this.$nextTick(this.update);
  29328. !this.noresize && Object(resize_event_["addResizeListener"])(this.$refs.resize, this.update);
  29329. },
  29330. beforeDestroy: function beforeDestroy() {
  29331. if (this.native) return;
  29332. !this.noresize && Object(resize_event_["removeResizeListener"])(this.$refs.resize, this.update);
  29333. }
  29334. });
  29335. // CONCATENATED MODULE: ./packages/scrollbar/index.js
  29336. /* istanbul ignore next */
  29337. scrollbar_src_main.install = function (Vue) {
  29338. Vue.component(scrollbar_src_main.name, scrollbar_src_main);
  29339. };
  29340. /* harmony default export */ var scrollbar = (scrollbar_src_main);
  29341. // 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&
  29342. var itemvue_type_template_id_1801ae19_render = function() {
  29343. var _vm = this
  29344. var _h = _vm.$createElement
  29345. var _c = _vm._self._c || _h
  29346. return _c(
  29347. "div",
  29348. {
  29349. directives: [
  29350. {
  29351. name: "show",
  29352. rawName: "v-show",
  29353. value: _vm.ready,
  29354. expression: "ready"
  29355. }
  29356. ],
  29357. staticClass: "el-carousel__item",
  29358. class: {
  29359. "is-active": _vm.active,
  29360. "el-carousel__item--card": _vm.$parent.type === "card",
  29361. "is-in-stage": _vm.inStage,
  29362. "is-hover": _vm.hover,
  29363. "is-animating": _vm.animating
  29364. },
  29365. style: _vm.itemStyle,
  29366. on: { click: _vm.handleItemClick }
  29367. },
  29368. [
  29369. _vm.$parent.type === "card"
  29370. ? _c("div", {
  29371. directives: [
  29372. {
  29373. name: "show",
  29374. rawName: "v-show",
  29375. value: !_vm.active,
  29376. expression: "!active"
  29377. }
  29378. ],
  29379. staticClass: "el-carousel__mask"
  29380. })
  29381. : _vm._e(),
  29382. _vm._t("default")
  29383. ],
  29384. 2
  29385. )
  29386. }
  29387. var itemvue_type_template_id_1801ae19_staticRenderFns = []
  29388. itemvue_type_template_id_1801ae19_render._withStripped = true
  29389. // CONCATENATED MODULE: ./packages/carousel/src/item.vue?vue&type=template&id=1801ae19&
  29390. // 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&
  29391. //
  29392. //
  29393. //
  29394. //
  29395. //
  29396. //
  29397. //
  29398. //
  29399. //
  29400. //
  29401. //
  29402. //
  29403. //
  29404. //
  29405. //
  29406. //
  29407. //
  29408. //
  29409. //
  29410. //
  29411. //
  29412. //
  29413. var CARD_SCALE = 0.83;
  29414. /* harmony default export */ var itemvue_type_script_lang_js_ = ({
  29415. name: 'ElCarouselItem',
  29416. props: {
  29417. name: String,
  29418. label: {
  29419. type: [String, Number],
  29420. default: ''
  29421. }
  29422. },
  29423. data: function data() {
  29424. return {
  29425. hover: false,
  29426. translate: 0,
  29427. scale: 1,
  29428. active: false,
  29429. ready: false,
  29430. inStage: false,
  29431. animating: false
  29432. };
  29433. },
  29434. methods: {
  29435. processIndex: function processIndex(index, activeIndex, length) {
  29436. if (activeIndex === 0 && index === length - 1) {
  29437. return -1;
  29438. } else if (activeIndex === length - 1 && index === 0) {
  29439. return length;
  29440. } else if (index < activeIndex - 1 && activeIndex - index >= length / 2) {
  29441. return length + 1;
  29442. } else if (index > activeIndex + 1 && index - activeIndex >= length / 2) {
  29443. return -2;
  29444. }
  29445. return index;
  29446. },
  29447. calcCardTranslate: function calcCardTranslate(index, activeIndex) {
  29448. var parentWidth = this.$parent.$el.offsetWidth;
  29449. if (this.inStage) {
  29450. return parentWidth * ((2 - CARD_SCALE) * (index - activeIndex) + 1) / 4;
  29451. } else if (index < activeIndex) {
  29452. return -(1 + CARD_SCALE) * parentWidth / 4;
  29453. } else {
  29454. return (3 + CARD_SCALE) * parentWidth / 4;
  29455. }
  29456. },
  29457. calcTranslate: function calcTranslate(index, activeIndex, isVertical) {
  29458. var distance = this.$parent.$el[isVertical ? 'offsetHeight' : 'offsetWidth'];
  29459. return distance * (index - activeIndex);
  29460. },
  29461. translateItem: function translateItem(index, activeIndex, oldIndex) {
  29462. var parentType = this.$parent.type;
  29463. var parentDirection = this.parentDirection;
  29464. var length = this.$parent.items.length;
  29465. if (parentType !== 'card' && oldIndex !== undefined) {
  29466. this.animating = index === activeIndex || index === oldIndex;
  29467. }
  29468. if (index !== activeIndex && length > 2 && this.$parent.loop) {
  29469. index = this.processIndex(index, activeIndex, length);
  29470. }
  29471. if (parentType === 'card') {
  29472. if (parentDirection === 'vertical') {
  29473. console.warn('[Element Warn][Carousel]vertical direction is not supported in card mode');
  29474. }
  29475. this.inStage = Math.round(Math.abs(index - activeIndex)) <= 1;
  29476. this.active = index === activeIndex;
  29477. this.translate = this.calcCardTranslate(index, activeIndex);
  29478. this.scale = this.active ? 1 : CARD_SCALE;
  29479. } else {
  29480. this.active = index === activeIndex;
  29481. var isVertical = parentDirection === 'vertical';
  29482. this.translate = this.calcTranslate(index, activeIndex, isVertical);
  29483. this.scale = 1;
  29484. }
  29485. this.ready = true;
  29486. },
  29487. handleItemClick: function handleItemClick() {
  29488. var parent = this.$parent;
  29489. if (parent && parent.type === 'card') {
  29490. var index = parent.items.indexOf(this);
  29491. parent.setActiveItem(index);
  29492. }
  29493. }
  29494. },
  29495. computed: {
  29496. parentDirection: function parentDirection() {
  29497. return this.$parent.direction;
  29498. },
  29499. itemStyle: function itemStyle() {
  29500. var translateType = this.parentDirection === 'vertical' ? 'translateY' : 'translateX';
  29501. var value = translateType + '(' + this.translate + 'px) scale(' + this.scale + ')';
  29502. var style = {
  29503. transform: value
  29504. };
  29505. return Object(util_["autoprefixer"])(style);
  29506. }
  29507. },
  29508. created: function created() {
  29509. this.$parent && this.$parent.updateItems();
  29510. },
  29511. destroyed: function destroyed() {
  29512. this.$parent && this.$parent.updateItems();
  29513. }
  29514. });
  29515. // CONCATENATED MODULE: ./packages/carousel/src/item.vue?vue&type=script&lang=js&
  29516. /* harmony default export */ var src_itemvue_type_script_lang_js_ = (itemvue_type_script_lang_js_);
  29517. // CONCATENATED MODULE: ./packages/carousel/src/item.vue
  29518. /* normalize component */
  29519. var item_component = normalizeComponent(
  29520. src_itemvue_type_script_lang_js_,
  29521. itemvue_type_template_id_1801ae19_render,
  29522. itemvue_type_template_id_1801ae19_staticRenderFns,
  29523. false,
  29524. null,
  29525. null,
  29526. null
  29527. )
  29528. /* hot reload */
  29529. if (false) { var item_api; }
  29530. item_component.options.__file = "packages/carousel/src/item.vue"
  29531. /* harmony default export */ var src_item = (item_component.exports);
  29532. // CONCATENATED MODULE: ./packages/carousel-item/index.js
  29533. /* istanbul ignore next */
  29534. src_item.install = function (Vue) {
  29535. Vue.component(src_item.name, src_item);
  29536. };
  29537. /* harmony default export */ var carousel_item = (src_item);
  29538. // 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&
  29539. var collapsevue_type_template_id_461d57f4_render = function() {
  29540. var _vm = this
  29541. var _h = _vm.$createElement
  29542. var _c = _vm._self._c || _h
  29543. return _c(
  29544. "div",
  29545. {
  29546. staticClass: "el-collapse",
  29547. attrs: { role: "tablist", "aria-multiselectable": "true" }
  29548. },
  29549. [_vm._t("default")],
  29550. 2
  29551. )
  29552. }
  29553. var collapsevue_type_template_id_461d57f4_staticRenderFns = []
  29554. collapsevue_type_template_id_461d57f4_render._withStripped = true
  29555. // CONCATENATED MODULE: ./packages/collapse/src/collapse.vue?vue&type=template&id=461d57f4&
  29556. // 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&
  29557. //
  29558. //
  29559. //
  29560. //
  29561. //
  29562. /* harmony default export */ var collapsevue_type_script_lang_js_ = ({
  29563. name: 'ElCollapse',
  29564. componentName: 'ElCollapse',
  29565. props: {
  29566. accordion: Boolean,
  29567. value: {
  29568. type: [Array, String, Number],
  29569. default: function _default() {
  29570. return [];
  29571. }
  29572. }
  29573. },
  29574. data: function data() {
  29575. return {
  29576. activeNames: [].concat(this.value)
  29577. };
  29578. },
  29579. provide: function provide() {
  29580. return {
  29581. collapse: this
  29582. };
  29583. },
  29584. watch: {
  29585. value: function value(_value) {
  29586. this.activeNames = [].concat(_value);
  29587. }
  29588. },
  29589. methods: {
  29590. setActiveNames: function setActiveNames(activeNames) {
  29591. activeNames = [].concat(activeNames);
  29592. var value = this.accordion ? activeNames[0] : activeNames;
  29593. this.activeNames = activeNames;
  29594. this.$emit('input', value);
  29595. this.$emit('change', value);
  29596. },
  29597. handleItemClick: function handleItemClick(item) {
  29598. if (this.accordion) {
  29599. this.setActiveNames((this.activeNames[0] || this.activeNames[0] === 0) && this.activeNames[0] === item.name ? '' : item.name);
  29600. } else {
  29601. var activeNames = this.activeNames.slice(0);
  29602. var index = activeNames.indexOf(item.name);
  29603. if (index > -1) {
  29604. activeNames.splice(index, 1);
  29605. } else {
  29606. activeNames.push(item.name);
  29607. }
  29608. this.setActiveNames(activeNames);
  29609. }
  29610. }
  29611. },
  29612. created: function created() {
  29613. this.$on('item-click', this.handleItemClick);
  29614. }
  29615. });
  29616. // CONCATENATED MODULE: ./packages/collapse/src/collapse.vue?vue&type=script&lang=js&
  29617. /* harmony default export */ var src_collapsevue_type_script_lang_js_ = (collapsevue_type_script_lang_js_);
  29618. // CONCATENATED MODULE: ./packages/collapse/src/collapse.vue
  29619. /* normalize component */
  29620. var collapse_component = normalizeComponent(
  29621. src_collapsevue_type_script_lang_js_,
  29622. collapsevue_type_template_id_461d57f4_render,
  29623. collapsevue_type_template_id_461d57f4_staticRenderFns,
  29624. false,
  29625. null,
  29626. null,
  29627. null
  29628. )
  29629. /* hot reload */
  29630. if (false) { var collapse_api; }
  29631. collapse_component.options.__file = "packages/collapse/src/collapse.vue"
  29632. /* harmony default export */ var collapse = (collapse_component.exports);
  29633. // CONCATENATED MODULE: ./packages/collapse/index.js
  29634. /* istanbul ignore next */
  29635. collapse.install = function (Vue) {
  29636. Vue.component(collapse.name, collapse);
  29637. };
  29638. /* harmony default export */ var packages_collapse = (collapse);
  29639. // 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&
  29640. var collapse_itemvue_type_template_id_2d05faac_render = function() {
  29641. var _vm = this
  29642. var _h = _vm.$createElement
  29643. var _c = _vm._self._c || _h
  29644. return _c(
  29645. "div",
  29646. {
  29647. staticClass: "el-collapse-item",
  29648. class: { "is-active": _vm.isActive, "is-disabled": _vm.disabled }
  29649. },
  29650. [
  29651. _c(
  29652. "div",
  29653. {
  29654. attrs: {
  29655. role: "tab",
  29656. "aria-expanded": _vm.isActive,
  29657. "aria-controls": "el-collapse-content-" + _vm.id,
  29658. "aria-describedby": "el-collapse-content-" + _vm.id
  29659. }
  29660. },
  29661. [
  29662. _c(
  29663. "div",
  29664. {
  29665. staticClass: "el-collapse-item__header",
  29666. class: {
  29667. focusing: _vm.focusing,
  29668. "is-active": _vm.isActive
  29669. },
  29670. attrs: {
  29671. role: "button",
  29672. id: "el-collapse-head-" + _vm.id,
  29673. tabindex: _vm.disabled ? undefined : 0
  29674. },
  29675. on: {
  29676. click: _vm.handleHeaderClick,
  29677. keyup: function($event) {
  29678. if (
  29679. !("button" in $event) &&
  29680. _vm._k($event.keyCode, "space", 32, $event.key, [
  29681. " ",
  29682. "Spacebar"
  29683. ]) &&
  29684. _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")
  29685. ) {
  29686. return null
  29687. }
  29688. $event.stopPropagation()
  29689. return _vm.handleEnterClick($event)
  29690. },
  29691. focus: _vm.handleFocus,
  29692. blur: function($event) {
  29693. _vm.focusing = false
  29694. }
  29695. }
  29696. },
  29697. [
  29698. _vm._t("title", [_vm._v(_vm._s(_vm.title))]),
  29699. _c("i", {
  29700. staticClass: "el-collapse-item__arrow el-icon-arrow-right",
  29701. class: { "is-active": _vm.isActive }
  29702. })
  29703. ],
  29704. 2
  29705. )
  29706. ]
  29707. ),
  29708. _c("el-collapse-transition", [
  29709. _c(
  29710. "div",
  29711. {
  29712. directives: [
  29713. {
  29714. name: "show",
  29715. rawName: "v-show",
  29716. value: _vm.isActive,
  29717. expression: "isActive"
  29718. }
  29719. ],
  29720. staticClass: "el-collapse-item__wrap",
  29721. attrs: {
  29722. role: "tabpanel",
  29723. "aria-hidden": !_vm.isActive,
  29724. "aria-labelledby": "el-collapse-head-" + _vm.id,
  29725. id: "el-collapse-content-" + _vm.id
  29726. }
  29727. },
  29728. [
  29729. _c(
  29730. "div",
  29731. { staticClass: "el-collapse-item__content" },
  29732. [_vm._t("default")],
  29733. 2
  29734. )
  29735. ]
  29736. )
  29737. ])
  29738. ],
  29739. 1
  29740. )
  29741. }
  29742. var collapse_itemvue_type_template_id_2d05faac_staticRenderFns = []
  29743. collapse_itemvue_type_template_id_2d05faac_render._withStripped = true
  29744. // CONCATENATED MODULE: ./packages/collapse/src/collapse-item.vue?vue&type=template&id=2d05faac&
  29745. // 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&
  29746. //
  29747. //
  29748. //
  29749. //
  29750. //
  29751. //
  29752. //
  29753. //
  29754. //
  29755. //
  29756. //
  29757. //
  29758. //
  29759. //
  29760. //
  29761. //
  29762. //
  29763. //
  29764. //
  29765. //
  29766. //
  29767. //
  29768. //
  29769. //
  29770. //
  29771. //
  29772. //
  29773. //
  29774. //
  29775. //
  29776. //
  29777. //
  29778. //
  29779. //
  29780. //
  29781. //
  29782. //
  29783. //
  29784. //
  29785. //
  29786. //
  29787. //
  29788. //
  29789. //
  29790. //
  29791. //
  29792. /* harmony default export */ var collapse_itemvue_type_script_lang_js_ = ({
  29793. name: 'ElCollapseItem',
  29794. componentName: 'ElCollapseItem',
  29795. mixins: [emitter_default.a],
  29796. components: { ElCollapseTransition: collapse_transition_default.a },
  29797. data: function data() {
  29798. return {
  29799. contentWrapStyle: {
  29800. height: 'auto',
  29801. display: 'block'
  29802. },
  29803. contentHeight: 0,
  29804. focusing: false,
  29805. isClick: false,
  29806. id: Object(util_["generateId"])()
  29807. };
  29808. },
  29809. inject: ['collapse'],
  29810. props: {
  29811. title: String,
  29812. name: {
  29813. type: [String, Number],
  29814. default: function _default() {
  29815. return this._uid;
  29816. }
  29817. },
  29818. disabled: Boolean
  29819. },
  29820. computed: {
  29821. isActive: function isActive() {
  29822. return this.collapse.activeNames.indexOf(this.name) > -1;
  29823. }
  29824. },
  29825. methods: {
  29826. handleFocus: function handleFocus() {
  29827. var _this = this;
  29828. setTimeout(function () {
  29829. if (!_this.isClick) {
  29830. _this.focusing = true;
  29831. } else {
  29832. _this.isClick = false;
  29833. }
  29834. }, 50);
  29835. },
  29836. handleHeaderClick: function handleHeaderClick() {
  29837. if (this.disabled) return;
  29838. this.dispatch('ElCollapse', 'item-click', this);
  29839. this.focusing = false;
  29840. this.isClick = true;
  29841. },
  29842. handleEnterClick: function handleEnterClick() {
  29843. this.dispatch('ElCollapse', 'item-click', this);
  29844. }
  29845. }
  29846. });
  29847. // CONCATENATED MODULE: ./packages/collapse/src/collapse-item.vue?vue&type=script&lang=js&
  29848. /* harmony default export */ var src_collapse_itemvue_type_script_lang_js_ = (collapse_itemvue_type_script_lang_js_);
  29849. // CONCATENATED MODULE: ./packages/collapse/src/collapse-item.vue
  29850. /* normalize component */
  29851. var collapse_item_component = normalizeComponent(
  29852. src_collapse_itemvue_type_script_lang_js_,
  29853. collapse_itemvue_type_template_id_2d05faac_render,
  29854. collapse_itemvue_type_template_id_2d05faac_staticRenderFns,
  29855. false,
  29856. null,
  29857. null,
  29858. null
  29859. )
  29860. /* hot reload */
  29861. if (false) { var collapse_item_api; }
  29862. collapse_item_component.options.__file = "packages/collapse/src/collapse-item.vue"
  29863. /* harmony default export */ var collapse_item = (collapse_item_component.exports);
  29864. // CONCATENATED MODULE: ./packages/collapse-item/index.js
  29865. /* istanbul ignore next */
  29866. collapse_item.install = function (Vue) {
  29867. Vue.component(collapse_item.name, collapse_item);
  29868. };
  29869. /* harmony default export */ var packages_collapse_item = (collapse_item);
  29870. // 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&
  29871. var cascadervue_type_template_id_032537a6_render = function() {
  29872. var _vm = this
  29873. var _h = _vm.$createElement
  29874. var _c = _vm._self._c || _h
  29875. return _c(
  29876. "div",
  29877. {
  29878. directives: [
  29879. {
  29880. name: "clickoutside",
  29881. rawName: "v-clickoutside",
  29882. value: function() {
  29883. return _vm.toggleDropDownVisible(false)
  29884. },
  29885. expression: "() => toggleDropDownVisible(false)"
  29886. }
  29887. ],
  29888. ref: "reference",
  29889. class: [
  29890. "el-cascader",
  29891. _vm.realSize && "el-cascader--" + _vm.realSize,
  29892. { "is-disabled": _vm.isDisabled }
  29893. ],
  29894. on: {
  29895. mouseenter: function($event) {
  29896. _vm.inputHover = true
  29897. },
  29898. mouseleave: function($event) {
  29899. _vm.inputHover = false
  29900. },
  29901. click: function() {
  29902. return _vm.toggleDropDownVisible(_vm.readonly ? undefined : true)
  29903. },
  29904. keydown: _vm.handleKeyDown
  29905. }
  29906. },
  29907. [
  29908. _c(
  29909. "el-input",
  29910. {
  29911. ref: "input",
  29912. class: { "is-focus": _vm.dropDownVisible },
  29913. attrs: {
  29914. size: _vm.realSize,
  29915. placeholder: _vm.placeholder,
  29916. readonly: _vm.readonly,
  29917. disabled: _vm.isDisabled,
  29918. "validate-event": false
  29919. },
  29920. on: {
  29921. focus: _vm.handleFocus,
  29922. blur: _vm.handleBlur,
  29923. input: _vm.handleInput
  29924. },
  29925. model: {
  29926. value: _vm.multiple ? _vm.presentText : _vm.inputValue,
  29927. callback: function($$v) {
  29928. _vm.multiple ? _vm.presentText : (_vm.inputValue = $$v)
  29929. },
  29930. expression: "multiple ? presentText : inputValue"
  29931. }
  29932. },
  29933. [
  29934. _c("template", { slot: "suffix" }, [
  29935. _vm.clearBtnVisible
  29936. ? _c("i", {
  29937. key: "clear",
  29938. staticClass: "el-input__icon el-icon-circle-close",
  29939. on: {
  29940. click: function($event) {
  29941. $event.stopPropagation()
  29942. return _vm.handleClear($event)
  29943. }
  29944. }
  29945. })
  29946. : _c("i", {
  29947. key: "arrow-down",
  29948. class: [
  29949. "el-input__icon",
  29950. "el-icon-arrow-down",
  29951. _vm.dropDownVisible && "is-reverse"
  29952. ],
  29953. on: {
  29954. click: function($event) {
  29955. $event.stopPropagation()
  29956. _vm.toggleDropDownVisible()
  29957. }
  29958. }
  29959. })
  29960. ])
  29961. ],
  29962. 2
  29963. ),
  29964. _vm.multiple
  29965. ? _c(
  29966. "div",
  29967. { staticClass: "el-cascader__tags" },
  29968. [
  29969. _vm._l(_vm.presentTags, function(tag) {
  29970. return _c(
  29971. "el-tag",
  29972. {
  29973. key: tag.key,
  29974. attrs: {
  29975. type: "info",
  29976. size: _vm.tagSize,
  29977. hit: tag.hitState,
  29978. closable: tag.closable,
  29979. "disable-transitions": ""
  29980. },
  29981. on: {
  29982. close: function($event) {
  29983. _vm.deleteTag(tag)
  29984. }
  29985. }
  29986. },
  29987. [_c("span", [_vm._v(_vm._s(tag.text))])]
  29988. )
  29989. }),
  29990. _vm.filterable && !_vm.isDisabled
  29991. ? _c("input", {
  29992. directives: [
  29993. {
  29994. name: "model",
  29995. rawName: "v-model.trim",
  29996. value: _vm.inputValue,
  29997. expression: "inputValue",
  29998. modifiers: { trim: true }
  29999. }
  30000. ],
  30001. staticClass: "el-cascader__search-input",
  30002. attrs: {
  30003. type: "text",
  30004. placeholder: _vm.presentTags.length ? "" : _vm.placeholder
  30005. },
  30006. domProps: { value: _vm.inputValue },
  30007. on: {
  30008. input: [
  30009. function($event) {
  30010. if ($event.target.composing) {
  30011. return
  30012. }
  30013. _vm.inputValue = $event.target.value.trim()
  30014. },
  30015. function(e) {
  30016. return _vm.handleInput(_vm.inputValue, e)
  30017. }
  30018. ],
  30019. click: function($event) {
  30020. $event.stopPropagation()
  30021. _vm.toggleDropDownVisible(true)
  30022. },
  30023. keydown: function($event) {
  30024. if (
  30025. !("button" in $event) &&
  30026. _vm._k(
  30027. $event.keyCode,
  30028. "delete",
  30029. [8, 46],
  30030. $event.key,
  30031. ["Backspace", "Delete", "Del"]
  30032. )
  30033. ) {
  30034. return null
  30035. }
  30036. return _vm.handleDelete($event)
  30037. },
  30038. blur: function($event) {
  30039. _vm.$forceUpdate()
  30040. }
  30041. }
  30042. })
  30043. : _vm._e()
  30044. ],
  30045. 2
  30046. )
  30047. : _vm._e(),
  30048. _c(
  30049. "transition",
  30050. {
  30051. attrs: { name: "el-zoom-in-top" },
  30052. on: { "after-leave": _vm.handleDropdownLeave }
  30053. },
  30054. [
  30055. _c(
  30056. "div",
  30057. {
  30058. directives: [
  30059. {
  30060. name: "show",
  30061. rawName: "v-show",
  30062. value: _vm.dropDownVisible,
  30063. expression: "dropDownVisible"
  30064. }
  30065. ],
  30066. ref: "popper",
  30067. class: ["el-popper", "el-cascader__dropdown", _vm.popperClass]
  30068. },
  30069. [
  30070. _c("el-cascader-panel", {
  30071. directives: [
  30072. {
  30073. name: "show",
  30074. rawName: "v-show",
  30075. value: !_vm.filtering,
  30076. expression: "!filtering"
  30077. }
  30078. ],
  30079. ref: "panel",
  30080. attrs: {
  30081. options: _vm.options,
  30082. props: _vm.config,
  30083. border: false,
  30084. "render-label": _vm.$scopedSlots.default
  30085. },
  30086. on: {
  30087. "expand-change": _vm.handleExpandChange,
  30088. close: function($event) {
  30089. _vm.toggleDropDownVisible(false)
  30090. }
  30091. },
  30092. model: {
  30093. value: _vm.checkedValue,
  30094. callback: function($$v) {
  30095. _vm.checkedValue = $$v
  30096. },
  30097. expression: "checkedValue"
  30098. }
  30099. }),
  30100. _vm.filterable
  30101. ? _c(
  30102. "el-scrollbar",
  30103. {
  30104. directives: [
  30105. {
  30106. name: "show",
  30107. rawName: "v-show",
  30108. value: _vm.filtering,
  30109. expression: "filtering"
  30110. }
  30111. ],
  30112. ref: "suggestionPanel",
  30113. staticClass: "el-cascader__suggestion-panel",
  30114. attrs: {
  30115. tag: "ul",
  30116. "view-class": "el-cascader__suggestion-list"
  30117. },
  30118. nativeOn: {
  30119. keydown: function($event) {
  30120. return _vm.handleSuggestionKeyDown($event)
  30121. }
  30122. }
  30123. },
  30124. [
  30125. _vm.suggestions.length
  30126. ? _vm._l(_vm.suggestions, function(item, index) {
  30127. return _c(
  30128. "li",
  30129. {
  30130. key: item.uid,
  30131. class: [
  30132. "el-cascader__suggestion-item",
  30133. item.checked && "is-checked"
  30134. ],
  30135. attrs: { tabindex: -1 },
  30136. on: {
  30137. click: function($event) {
  30138. _vm.handleSuggestionClick(index)
  30139. }
  30140. }
  30141. },
  30142. [
  30143. _c("span", [_vm._v(_vm._s(item.text))]),
  30144. item.checked
  30145. ? _c("i", { staticClass: "el-icon-check" })
  30146. : _vm._e()
  30147. ]
  30148. )
  30149. })
  30150. : _vm._t("empty", [
  30151. _c(
  30152. "li",
  30153. { staticClass: "el-cascader__empty-text" },
  30154. [_vm._v(_vm._s(_vm.t("el.cascader.noMatch")))]
  30155. )
  30156. ])
  30157. ],
  30158. 2
  30159. )
  30160. : _vm._e()
  30161. ],
  30162. 1
  30163. )
  30164. ]
  30165. )
  30166. ],
  30167. 1
  30168. )
  30169. }
  30170. var cascadervue_type_template_id_032537a6_staticRenderFns = []
  30171. cascadervue_type_template_id_032537a6_render._withStripped = true
  30172. // CONCATENATED MODULE: ./packages/cascader/src/cascader.vue?vue&type=template&id=032537a6&
  30173. // EXTERNAL MODULE: external "element-ui/lib/cascader-panel"
  30174. var cascader_panel_ = __webpack_require__(43);
  30175. var cascader_panel_default = /*#__PURE__*/__webpack_require__.n(cascader_panel_);
  30176. // EXTERNAL MODULE: external "element-ui/lib/utils/aria-utils"
  30177. var aria_utils_ = __webpack_require__(35);
  30178. var aria_utils_default = /*#__PURE__*/__webpack_require__.n(aria_utils_);
  30179. // 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&
  30180. //
  30181. //
  30182. //
  30183. //
  30184. //
  30185. //
  30186. //
  30187. //
  30188. //
  30189. //
  30190. //
  30191. //
  30192. //
  30193. //
  30194. //
  30195. //
  30196. //
  30197. //
  30198. //
  30199. //
  30200. //
  30201. //
  30202. //
  30203. //
  30204. //
  30205. //
  30206. //
  30207. //
  30208. //
  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. var KeyCode = aria_utils_default.a.keys;
  30294. var MigratingProps = {
  30295. expandTrigger: {
  30296. newProp: 'expandTrigger',
  30297. type: String
  30298. },
  30299. changeOnSelect: {
  30300. newProp: 'checkStrictly',
  30301. type: Boolean
  30302. },
  30303. hoverThreshold: {
  30304. newProp: 'hoverThreshold',
  30305. type: Number
  30306. }
  30307. };
  30308. var PopperMixin = {
  30309. props: {
  30310. placement: {
  30311. type: String,
  30312. default: 'bottom-start'
  30313. },
  30314. appendToBody: vue_popper_default.a.props.appendToBody,
  30315. visibleArrow: {
  30316. type: Boolean,
  30317. default: true
  30318. },
  30319. arrowOffset: vue_popper_default.a.props.arrowOffset,
  30320. offset: vue_popper_default.a.props.offset,
  30321. boundariesPadding: vue_popper_default.a.props.boundariesPadding,
  30322. popperOptions: vue_popper_default.a.props.popperOptions,
  30323. transformOrigin: vue_popper_default.a.props.transformOrigin
  30324. },
  30325. methods: vue_popper_default.a.methods,
  30326. data: vue_popper_default.a.data,
  30327. beforeDestroy: vue_popper_default.a.beforeDestroy
  30328. };
  30329. var InputSizeMap = {
  30330. medium: 36,
  30331. small: 32,
  30332. mini: 28
  30333. };
  30334. /* harmony default export */ var cascadervue_type_script_lang_js_ = ({
  30335. name: 'ElCascader',
  30336. directives: { Clickoutside: clickoutside_default.a },
  30337. mixins: [PopperMixin, emitter_default.a, locale_default.a, migrating_default.a],
  30338. inject: {
  30339. elForm: {
  30340. default: ''
  30341. },
  30342. elFormItem: {
  30343. default: ''
  30344. }
  30345. },
  30346. components: {
  30347. ElInput: input_default.a,
  30348. ElTag: tag_default.a,
  30349. ElScrollbar: scrollbar_default.a,
  30350. ElCascaderPanel: cascader_panel_default.a
  30351. },
  30352. props: {
  30353. value: {},
  30354. options: Array,
  30355. props: Object,
  30356. size: String,
  30357. placeholder: {
  30358. type: String,
  30359. default: function _default() {
  30360. return Object(lib_locale_["t"])('el.cascader.placeholder');
  30361. }
  30362. },
  30363. disabled: Boolean,
  30364. clearable: Boolean,
  30365. filterable: Boolean,
  30366. filterMethod: Function,
  30367. separator: {
  30368. type: String,
  30369. default: ' / '
  30370. },
  30371. showAllLevels: {
  30372. type: Boolean,
  30373. default: true
  30374. },
  30375. collapseTags: Boolean,
  30376. debounce: {
  30377. type: Number,
  30378. default: 300
  30379. },
  30380. beforeFilter: {
  30381. type: Function,
  30382. default: function _default() {
  30383. return function () {};
  30384. }
  30385. },
  30386. popperClass: String
  30387. },
  30388. data: function data() {
  30389. return {
  30390. dropDownVisible: false,
  30391. checkedValue: this.value,
  30392. inputHover: false,
  30393. inputValue: null,
  30394. presentText: null,
  30395. presentTags: [],
  30396. checkedNodes: [],
  30397. filtering: false,
  30398. suggestions: [],
  30399. inputInitialHeight: 0,
  30400. pressDeleteCount: 0
  30401. };
  30402. },
  30403. computed: {
  30404. realSize: function realSize() {
  30405. var _elFormItemSize = (this.elFormItem || {}).elFormItemSize;
  30406. return this.size || _elFormItemSize || (this.$ELEMENT || {}).size;
  30407. },
  30408. tagSize: function tagSize() {
  30409. return ['small', 'mini'].indexOf(this.realSize) > -1 ? 'mini' : 'small';
  30410. },
  30411. isDisabled: function isDisabled() {
  30412. return this.disabled || (this.elForm || {}).disabled;
  30413. },
  30414. config: function config() {
  30415. var config = this.props || {};
  30416. var $attrs = this.$attrs;
  30417. Object.keys(MigratingProps).forEach(function (oldProp) {
  30418. var _MigratingProps$oldPr = MigratingProps[oldProp],
  30419. newProp = _MigratingProps$oldPr.newProp,
  30420. type = _MigratingProps$oldPr.type;
  30421. var oldValue = $attrs[oldProp] || $attrs[Object(util_["kebabCase"])(oldProp)];
  30422. if (Object(shared_["isDef"])(oldProp) && !Object(shared_["isDef"])(config[newProp])) {
  30423. if (type === Boolean && oldValue === '') {
  30424. oldValue = true;
  30425. }
  30426. config[newProp] = oldValue;
  30427. }
  30428. });
  30429. return config;
  30430. },
  30431. multiple: function multiple() {
  30432. return this.config.multiple;
  30433. },
  30434. leafOnly: function leafOnly() {
  30435. return !this.config.checkStrictly;
  30436. },
  30437. readonly: function readonly() {
  30438. return !this.filterable || this.multiple;
  30439. },
  30440. clearBtnVisible: function clearBtnVisible() {
  30441. if (!this.clearable || this.isDisabled || this.filtering || !this.inputHover) {
  30442. return false;
  30443. }
  30444. return this.multiple ? !!this.checkedNodes.filter(function (node) {
  30445. return !node.isDisabled;
  30446. }).length : !!this.presentText;
  30447. },
  30448. panel: function panel() {
  30449. return this.$refs.panel;
  30450. }
  30451. },
  30452. watch: {
  30453. disabled: function disabled() {
  30454. this.computePresentContent();
  30455. },
  30456. value: function value(val) {
  30457. if (!Object(util_["isEqual"])(val, this.checkedValue)) {
  30458. this.checkedValue = val;
  30459. this.computePresentContent();
  30460. }
  30461. },
  30462. checkedValue: function checkedValue(val) {
  30463. var value = this.value,
  30464. dropDownVisible = this.dropDownVisible;
  30465. var _config = this.config,
  30466. checkStrictly = _config.checkStrictly,
  30467. multiple = _config.multiple;
  30468. if (!Object(util_["isEqual"])(val, value) || Object(types_["isUndefined"])(value)) {
  30469. this.computePresentContent();
  30470. // hide dropdown when single mode
  30471. if (!multiple && !checkStrictly && dropDownVisible) {
  30472. this.toggleDropDownVisible(false);
  30473. }
  30474. this.$emit('input', val);
  30475. this.$emit('change', val);
  30476. this.dispatch('ElFormItem', 'el.form.change', [val]);
  30477. }
  30478. },
  30479. options: {
  30480. handler: function handler() {
  30481. this.$nextTick(this.computePresentContent);
  30482. },
  30483. deep: true
  30484. },
  30485. presentText: function presentText(val) {
  30486. this.inputValue = val;
  30487. },
  30488. presentTags: function presentTags(val, oldVal) {
  30489. if (this.multiple && (val.length || oldVal.length)) {
  30490. this.$nextTick(this.updateStyle);
  30491. }
  30492. },
  30493. filtering: function filtering(val) {
  30494. this.$nextTick(this.updatePopper);
  30495. }
  30496. },
  30497. mounted: function mounted() {
  30498. var _this = this;
  30499. var input = this.$refs.input;
  30500. if (input && input.$el) {
  30501. this.inputInitialHeight = input.$el.offsetHeight || InputSizeMap[this.realSize] || 40;
  30502. }
  30503. if (!this.isEmptyValue(this.value)) {
  30504. this.computePresentContent();
  30505. }
  30506. this.filterHandler = debounce_default()(this.debounce, function () {
  30507. var inputValue = _this.inputValue;
  30508. if (!inputValue) {
  30509. _this.filtering = false;
  30510. return;
  30511. }
  30512. var before = _this.beforeFilter(inputValue);
  30513. if (before && before.then) {
  30514. before.then(_this.getSuggestions);
  30515. } else if (before !== false) {
  30516. _this.getSuggestions();
  30517. } else {
  30518. _this.filtering = false;
  30519. }
  30520. });
  30521. Object(resize_event_["addResizeListener"])(this.$el, this.updateStyle);
  30522. },
  30523. beforeDestroy: function beforeDestroy() {
  30524. Object(resize_event_["removeResizeListener"])(this.$el, this.updateStyle);
  30525. },
  30526. methods: {
  30527. getMigratingConfig: function getMigratingConfig() {
  30528. return {
  30529. props: {
  30530. 'expand-trigger': 'expand-trigger is removed, use `props.expandTrigger` instead.',
  30531. 'change-on-select': 'change-on-select is removed, use `props.checkStrictly` instead.',
  30532. 'hover-threshold': 'hover-threshold is removed, use `props.hoverThreshold` instead'
  30533. },
  30534. events: {
  30535. 'active-item-change': 'active-item-change is renamed to expand-change'
  30536. }
  30537. };
  30538. },
  30539. toggleDropDownVisible: function toggleDropDownVisible(visible) {
  30540. var _this2 = this;
  30541. if (this.isDisabled) return;
  30542. var dropDownVisible = this.dropDownVisible;
  30543. var input = this.$refs.input;
  30544. visible = Object(shared_["isDef"])(visible) ? visible : !dropDownVisible;
  30545. if (visible !== dropDownVisible) {
  30546. this.dropDownVisible = visible;
  30547. if (visible) {
  30548. this.$nextTick(function () {
  30549. _this2.updatePopper();
  30550. _this2.panel.scrollIntoView();
  30551. });
  30552. }
  30553. input.$refs.input.setAttribute('aria-expanded', visible);
  30554. this.$emit('visible-change', visible);
  30555. }
  30556. },
  30557. handleDropdownLeave: function handleDropdownLeave() {
  30558. this.filtering = false;
  30559. this.inputValue = this.presentText;
  30560. this.doDestroy();
  30561. },
  30562. handleKeyDown: function handleKeyDown(event) {
  30563. switch (event.keyCode) {
  30564. case KeyCode.enter:
  30565. this.toggleDropDownVisible();
  30566. break;
  30567. case KeyCode.down:
  30568. this.toggleDropDownVisible(true);
  30569. this.focusFirstNode();
  30570. event.preventDefault();
  30571. break;
  30572. case KeyCode.esc:
  30573. case KeyCode.tab:
  30574. this.toggleDropDownVisible(false);
  30575. break;
  30576. }
  30577. },
  30578. handleFocus: function handleFocus(e) {
  30579. this.$emit('focus', e);
  30580. },
  30581. handleBlur: function handleBlur(e) {
  30582. this.$emit('blur', e);
  30583. },
  30584. handleInput: function handleInput(val, event) {
  30585. !this.dropDownVisible && this.toggleDropDownVisible(true);
  30586. if (event && event.isComposing) return;
  30587. if (val) {
  30588. this.filterHandler();
  30589. } else {
  30590. this.filtering = false;
  30591. }
  30592. },
  30593. handleClear: function handleClear() {
  30594. this.presentText = '';
  30595. this.panel.clearCheckedNodes();
  30596. },
  30597. handleExpandChange: function handleExpandChange(value) {
  30598. this.$nextTick(this.updatePopper.bind(this));
  30599. this.$emit('expand-change', value);
  30600. this.$emit('active-item-change', value); // Deprecated
  30601. },
  30602. focusFirstNode: function focusFirstNode() {
  30603. var _this3 = this;
  30604. this.$nextTick(function () {
  30605. var filtering = _this3.filtering;
  30606. var _$refs = _this3.$refs,
  30607. popper = _$refs.popper,
  30608. suggestionPanel = _$refs.suggestionPanel;
  30609. var firstNode = null;
  30610. if (filtering && suggestionPanel) {
  30611. firstNode = suggestionPanel.$el.querySelector('.el-cascader__suggestion-item');
  30612. } else {
  30613. var firstMenu = popper.querySelector('.el-cascader-menu');
  30614. firstNode = firstMenu.querySelector('.el-cascader-node[tabindex="-1"]');
  30615. }
  30616. if (firstNode) {
  30617. firstNode.focus();
  30618. !filtering && firstNode.click();
  30619. }
  30620. });
  30621. },
  30622. computePresentContent: function computePresentContent() {
  30623. var _this4 = this;
  30624. // nextTick is required, because checked nodes may not change right now
  30625. this.$nextTick(function () {
  30626. if (_this4.config.multiple) {
  30627. _this4.computePresentTags();
  30628. _this4.presentText = _this4.presentTags.length ? ' ' : null;
  30629. } else {
  30630. _this4.computePresentText();
  30631. }
  30632. });
  30633. },
  30634. isEmptyValue: function isEmptyValue(val) {
  30635. var multiple = this.multiple;
  30636. var emitPath = this.panel.config.emitPath;
  30637. if (multiple || emitPath) {
  30638. return Object(util_["isEmpty"])(val);
  30639. }
  30640. return false;
  30641. },
  30642. computePresentText: function computePresentText() {
  30643. var checkedValue = this.checkedValue,
  30644. config = this.config;
  30645. if (!this.isEmptyValue(checkedValue)) {
  30646. var node = this.panel.getNodeByValue(checkedValue);
  30647. if (node && (config.checkStrictly || node.isLeaf)) {
  30648. this.presentText = node.getText(this.showAllLevels, this.separator);
  30649. return;
  30650. }
  30651. }
  30652. this.presentText = null;
  30653. },
  30654. computePresentTags: function computePresentTags() {
  30655. var isDisabled = this.isDisabled,
  30656. leafOnly = this.leafOnly,
  30657. showAllLevels = this.showAllLevels,
  30658. separator = this.separator,
  30659. collapseTags = this.collapseTags;
  30660. var checkedNodes = this.getCheckedNodes(leafOnly);
  30661. var tags = [];
  30662. var genTag = function genTag(node) {
  30663. return {
  30664. node: node,
  30665. key: node.uid,
  30666. text: node.getText(showAllLevels, separator),
  30667. hitState: false,
  30668. closable: !isDisabled && !node.isDisabled
  30669. };
  30670. };
  30671. if (checkedNodes.length) {
  30672. var first = checkedNodes[0],
  30673. rest = checkedNodes.slice(1);
  30674. var restCount = rest.length;
  30675. tags.push(genTag(first));
  30676. if (restCount) {
  30677. if (collapseTags) {
  30678. tags.push({
  30679. key: -1,
  30680. text: '+ ' + restCount,
  30681. closable: false
  30682. });
  30683. } else {
  30684. rest.forEach(function (node) {
  30685. return tags.push(genTag(node));
  30686. });
  30687. }
  30688. }
  30689. }
  30690. this.checkedNodes = checkedNodes;
  30691. this.presentTags = tags;
  30692. },
  30693. getSuggestions: function getSuggestions() {
  30694. var _this5 = this;
  30695. var filterMethod = this.filterMethod;
  30696. if (!Object(types_["isFunction"])(filterMethod)) {
  30697. filterMethod = function filterMethod(node, keyword) {
  30698. return node.text.includes(keyword);
  30699. };
  30700. }
  30701. var suggestions = this.panel.getFlattedNodes(this.leafOnly).filter(function (node) {
  30702. if (node.isDisabled) return false;
  30703. node.text = node.getText(_this5.showAllLevels, _this5.separator) || '';
  30704. return filterMethod(node, _this5.inputValue);
  30705. });
  30706. if (this.multiple) {
  30707. this.presentTags.forEach(function (tag) {
  30708. tag.hitState = false;
  30709. });
  30710. } else {
  30711. suggestions.forEach(function (node) {
  30712. node.checked = Object(util_["isEqual"])(_this5.checkedValue, node.getValueByOption());
  30713. });
  30714. }
  30715. this.filtering = true;
  30716. this.suggestions = suggestions;
  30717. this.$nextTick(this.updatePopper);
  30718. },
  30719. handleSuggestionKeyDown: function handleSuggestionKeyDown(event) {
  30720. var keyCode = event.keyCode,
  30721. target = event.target;
  30722. switch (keyCode) {
  30723. case KeyCode.enter:
  30724. target.click();
  30725. break;
  30726. case KeyCode.up:
  30727. var prev = target.previousElementSibling;
  30728. prev && prev.focus();
  30729. break;
  30730. case KeyCode.down:
  30731. var next = target.nextElementSibling;
  30732. next && next.focus();
  30733. break;
  30734. case KeyCode.esc:
  30735. case KeyCode.tab:
  30736. this.toggleDropDownVisible(false);
  30737. break;
  30738. }
  30739. },
  30740. handleDelete: function handleDelete() {
  30741. var inputValue = this.inputValue,
  30742. pressDeleteCount = this.pressDeleteCount,
  30743. presentTags = this.presentTags;
  30744. var lastIndex = presentTags.length - 1;
  30745. var lastTag = presentTags[lastIndex];
  30746. this.pressDeleteCount = inputValue ? 0 : pressDeleteCount + 1;
  30747. if (!lastTag) return;
  30748. if (this.pressDeleteCount) {
  30749. if (lastTag.hitState) {
  30750. this.deleteTag(lastTag);
  30751. } else {
  30752. lastTag.hitState = true;
  30753. }
  30754. }
  30755. },
  30756. handleSuggestionClick: function handleSuggestionClick(index) {
  30757. var multiple = this.multiple;
  30758. var targetNode = this.suggestions[index];
  30759. if (multiple) {
  30760. var checked = targetNode.checked;
  30761. targetNode.doCheck(!checked);
  30762. this.panel.calculateMultiCheckedValue();
  30763. } else {
  30764. this.checkedValue = targetNode.getValueByOption();
  30765. this.toggleDropDownVisible(false);
  30766. }
  30767. },
  30768. deleteTag: function deleteTag(tag) {
  30769. var checkedValue = this.checkedValue;
  30770. var current = tag.node.getValueByOption();
  30771. var val = checkedValue.find(function (n) {
  30772. return Object(util_["isEqual"])(n, current);
  30773. });
  30774. this.checkedValue = checkedValue.filter(function (n) {
  30775. return !Object(util_["isEqual"])(n, current);
  30776. });
  30777. this.$emit('remove-tag', val);
  30778. },
  30779. updateStyle: function updateStyle() {
  30780. var $el = this.$el,
  30781. inputInitialHeight = this.inputInitialHeight;
  30782. if (this.$isServer || !$el) return;
  30783. var suggestionPanel = this.$refs.suggestionPanel;
  30784. var inputInner = $el.querySelector('.el-input__inner');
  30785. if (!inputInner) return;
  30786. var tags = $el.querySelector('.el-cascader__tags');
  30787. var suggestionPanelEl = null;
  30788. if (suggestionPanel && (suggestionPanelEl = suggestionPanel.$el)) {
  30789. var suggestionList = suggestionPanelEl.querySelector('.el-cascader__suggestion-list');
  30790. suggestionList.style.minWidth = inputInner.offsetWidth + 'px';
  30791. }
  30792. if (tags) {
  30793. var offsetHeight = Math.round(tags.getBoundingClientRect().height);
  30794. var height = Math.max(offsetHeight + 6, inputInitialHeight) + 'px';
  30795. inputInner.style.height = height;
  30796. if (this.dropDownVisible) {
  30797. this.updatePopper();
  30798. }
  30799. }
  30800. },
  30801. /**
  30802. * public methods
  30803. */
  30804. getCheckedNodes: function getCheckedNodes(leafOnly) {
  30805. return this.panel.getCheckedNodes(leafOnly);
  30806. }
  30807. }
  30808. });
  30809. // CONCATENATED MODULE: ./packages/cascader/src/cascader.vue?vue&type=script&lang=js&
  30810. /* harmony default export */ var src_cascadervue_type_script_lang_js_ = (cascadervue_type_script_lang_js_);
  30811. // CONCATENATED MODULE: ./packages/cascader/src/cascader.vue
  30812. /* normalize component */
  30813. var cascader_component = normalizeComponent(
  30814. src_cascadervue_type_script_lang_js_,
  30815. cascadervue_type_template_id_032537a6_render,
  30816. cascadervue_type_template_id_032537a6_staticRenderFns,
  30817. false,
  30818. null,
  30819. null,
  30820. null
  30821. )
  30822. /* hot reload */
  30823. if (false) { var cascader_api; }
  30824. cascader_component.options.__file = "packages/cascader/src/cascader.vue"
  30825. /* harmony default export */ var cascader = (cascader_component.exports);
  30826. // CONCATENATED MODULE: ./packages/cascader/index.js
  30827. /* istanbul ignore next */
  30828. cascader.install = function (Vue) {
  30829. Vue.component(cascader.name, cascader);
  30830. };
  30831. /* harmony default export */ var packages_cascader = (cascader);
  30832. // 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&
  30833. var mainvue_type_template_id_55c8ade7_render = function() {
  30834. var _vm = this
  30835. var _h = _vm.$createElement
  30836. var _c = _vm._self._c || _h
  30837. return _c(
  30838. "div",
  30839. {
  30840. directives: [
  30841. {
  30842. name: "clickoutside",
  30843. rawName: "v-clickoutside",
  30844. value: _vm.hide,
  30845. expression: "hide"
  30846. }
  30847. ],
  30848. class: [
  30849. "el-color-picker",
  30850. _vm.colorDisabled ? "is-disabled" : "",
  30851. _vm.colorSize ? "el-color-picker--" + _vm.colorSize : ""
  30852. ]
  30853. },
  30854. [
  30855. _vm.colorDisabled
  30856. ? _c("div", { staticClass: "el-color-picker__mask" })
  30857. : _vm._e(),
  30858. _c(
  30859. "div",
  30860. {
  30861. staticClass: "el-color-picker__trigger",
  30862. on: { click: _vm.handleTrigger }
  30863. },
  30864. [
  30865. _c(
  30866. "span",
  30867. {
  30868. staticClass: "el-color-picker__color",
  30869. class: { "is-alpha": _vm.showAlpha }
  30870. },
  30871. [
  30872. _c("span", {
  30873. staticClass: "el-color-picker__color-inner",
  30874. style: {
  30875. backgroundColor: _vm.displayedColor
  30876. }
  30877. }),
  30878. !_vm.value && !_vm.showPanelColor
  30879. ? _c("span", {
  30880. staticClass: "el-color-picker__empty el-icon-close"
  30881. })
  30882. : _vm._e()
  30883. ]
  30884. ),
  30885. _c("span", {
  30886. directives: [
  30887. {
  30888. name: "show",
  30889. rawName: "v-show",
  30890. value: _vm.value || _vm.showPanelColor,
  30891. expression: "value || showPanelColor"
  30892. }
  30893. ],
  30894. staticClass: "el-color-picker__icon el-icon-arrow-down"
  30895. })
  30896. ]
  30897. ),
  30898. _c("picker-dropdown", {
  30899. ref: "dropdown",
  30900. class: ["el-color-picker__panel", _vm.popperClass || ""],
  30901. attrs: {
  30902. color: _vm.color,
  30903. "show-alpha": _vm.showAlpha,
  30904. predefine: _vm.predefine
  30905. },
  30906. on: { pick: _vm.confirmValue, clear: _vm.clearValue },
  30907. model: {
  30908. value: _vm.showPicker,
  30909. callback: function($$v) {
  30910. _vm.showPicker = $$v
  30911. },
  30912. expression: "showPicker"
  30913. }
  30914. })
  30915. ],
  30916. 1
  30917. )
  30918. }
  30919. var mainvue_type_template_id_55c8ade7_staticRenderFns = []
  30920. mainvue_type_template_id_55c8ade7_render._withStripped = true
  30921. // CONCATENATED MODULE: ./packages/color-picker/src/main.vue?vue&type=template&id=55c8ade7&
  30922. // CONCATENATED MODULE: ./packages/color-picker/src/color.js
  30923. 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; };
  30924. function color_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30925. var hsv2hsl = function hsv2hsl(hue, sat, val) {
  30926. return [hue, sat * val / ((hue = (2 - sat) * val) < 1 ? hue : 2 - hue) || 0, hue / 2];
  30927. };
  30928. // Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1
  30929. // <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>
  30930. var isOnePointZero = function isOnePointZero(n) {
  30931. return typeof n === 'string' && n.indexOf('.') !== -1 && parseFloat(n) === 1;
  30932. };
  30933. var isPercentage = function isPercentage(n) {
  30934. return typeof n === 'string' && n.indexOf('%') !== -1;
  30935. };
  30936. // Take input from [0, n] and return it as [0, 1]
  30937. var bound01 = function bound01(value, max) {
  30938. if (isOnePointZero(value)) value = '100%';
  30939. var processPercent = isPercentage(value);
  30940. value = Math.min(max, Math.max(0, parseFloat(value)));
  30941. // Automatically convert percentage into number
  30942. if (processPercent) {
  30943. value = parseInt(value * max, 10) / 100;
  30944. }
  30945. // Handle floating point rounding errors
  30946. if (Math.abs(value - max) < 0.000001) {
  30947. return 1;
  30948. }
  30949. // Convert into [0, 1] range if it isn't already
  30950. return value % max / parseFloat(max);
  30951. };
  30952. var INT_HEX_MAP = { 10: 'A', 11: 'B', 12: 'C', 13: 'D', 14: 'E', 15: 'F' };
  30953. var toHex = function toHex(_ref) {
  30954. var r = _ref.r,
  30955. g = _ref.g,
  30956. b = _ref.b;
  30957. var hexOne = function hexOne(value) {
  30958. value = Math.min(Math.round(value), 255);
  30959. var high = Math.floor(value / 16);
  30960. var low = value % 16;
  30961. return '' + (INT_HEX_MAP[high] || high) + (INT_HEX_MAP[low] || low);
  30962. };
  30963. if (isNaN(r) || isNaN(g) || isNaN(b)) return '';
  30964. return '#' + hexOne(r) + hexOne(g) + hexOne(b);
  30965. };
  30966. var HEX_INT_MAP = { A: 10, B: 11, C: 12, D: 13, E: 14, F: 15 };
  30967. var parseHexChannel = function parseHexChannel(hex) {
  30968. if (hex.length === 2) {
  30969. return (HEX_INT_MAP[hex[0].toUpperCase()] || +hex[0]) * 16 + (HEX_INT_MAP[hex[1].toUpperCase()] || +hex[1]);
  30970. }
  30971. return HEX_INT_MAP[hex[1].toUpperCase()] || +hex[1];
  30972. };
  30973. var hsl2hsv = function hsl2hsv(hue, sat, light) {
  30974. sat = sat / 100;
  30975. light = light / 100;
  30976. var smin = sat;
  30977. var lmin = Math.max(light, 0.01);
  30978. var sv = void 0;
  30979. var v = void 0;
  30980. light *= 2;
  30981. sat *= light <= 1 ? light : 2 - light;
  30982. smin *= lmin <= 1 ? lmin : 2 - lmin;
  30983. v = (light + sat) / 2;
  30984. sv = light === 0 ? 2 * smin / (lmin + smin) : 2 * sat / (light + sat);
  30985. return {
  30986. h: hue,
  30987. s: sv * 100,
  30988. v: v * 100
  30989. };
  30990. };
  30991. // `rgbToHsv`
  30992. // Converts an RGB color value to HSV
  30993. // *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]
  30994. // *Returns:* { h, s, v } in [0,1]
  30995. var rgb2hsv = function rgb2hsv(r, g, b) {
  30996. r = bound01(r, 255);
  30997. g = bound01(g, 255);
  30998. b = bound01(b, 255);
  30999. var max = Math.max(r, g, b);
  31000. var min = Math.min(r, g, b);
  31001. var h = void 0,
  31002. s = void 0;
  31003. var v = max;
  31004. var d = max - min;
  31005. s = max === 0 ? 0 : d / max;
  31006. if (max === min) {
  31007. h = 0; // achromatic
  31008. } else {
  31009. switch (max) {
  31010. case r:
  31011. h = (g - b) / d + (g < b ? 6 : 0);
  31012. break;
  31013. case g:
  31014. h = (b - r) / d + 2;
  31015. break;
  31016. case b:
  31017. h = (r - g) / d + 4;
  31018. break;
  31019. }
  31020. h /= 6;
  31021. }
  31022. return { h: h * 360, s: s * 100, v: v * 100 };
  31023. };
  31024. // `hsvToRgb`
  31025. // Converts an HSV color value to RGB.
  31026. // *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]
  31027. // *Returns:* { r, g, b } in the set [0, 255]
  31028. var hsv2rgb = function hsv2rgb(h, s, v) {
  31029. h = bound01(h, 360) * 6;
  31030. s = bound01(s, 100);
  31031. v = bound01(v, 100);
  31032. var i = Math.floor(h);
  31033. var f = h - i;
  31034. var p = v * (1 - s);
  31035. var q = v * (1 - f * s);
  31036. var t = v * (1 - (1 - f) * s);
  31037. var mod = i % 6;
  31038. var r = [v, q, p, p, t, v][mod];
  31039. var g = [t, v, v, q, p, p][mod];
  31040. var b = [p, p, t, v, v, q][mod];
  31041. return {
  31042. r: Math.round(r * 255),
  31043. g: Math.round(g * 255),
  31044. b: Math.round(b * 255)
  31045. };
  31046. };
  31047. var Color = function () {
  31048. function Color(options) {
  31049. color_classCallCheck(this, Color);
  31050. this._hue = 0;
  31051. this._saturation = 100;
  31052. this._value = 100;
  31053. this._alpha = 100;
  31054. this.enableAlpha = false;
  31055. this.format = 'hex';
  31056. this.value = '';
  31057. options = options || {};
  31058. for (var option in options) {
  31059. if (options.hasOwnProperty(option)) {
  31060. this[option] = options[option];
  31061. }
  31062. }
  31063. this.doOnChange();
  31064. }
  31065. Color.prototype.set = function set(prop, value) {
  31066. if (arguments.length === 1 && (typeof prop === 'undefined' ? 'undefined' : color_typeof(prop)) === 'object') {
  31067. for (var p in prop) {
  31068. if (prop.hasOwnProperty(p)) {
  31069. this.set(p, prop[p]);
  31070. }
  31071. }
  31072. return;
  31073. }
  31074. this['_' + prop] = value;
  31075. this.doOnChange();
  31076. };
  31077. Color.prototype.get = function get(prop) {
  31078. return this['_' + prop];
  31079. };
  31080. Color.prototype.toRgb = function toRgb() {
  31081. return hsv2rgb(this._hue, this._saturation, this._value);
  31082. };
  31083. Color.prototype.fromString = function fromString(value) {
  31084. var _this = this;
  31085. if (!value) {
  31086. this._hue = 0;
  31087. this._saturation = 100;
  31088. this._value = 100;
  31089. this.doOnChange();
  31090. return;
  31091. }
  31092. var fromHSV = function fromHSV(h, s, v) {
  31093. _this._hue = Math.max(0, Math.min(360, h));
  31094. _this._saturation = Math.max(0, Math.min(100, s));
  31095. _this._value = Math.max(0, Math.min(100, v));
  31096. _this.doOnChange();
  31097. };
  31098. if (value.indexOf('hsl') !== -1) {
  31099. var parts = value.replace(/hsla|hsl|\(|\)/gm, '').split(/\s|,/g).filter(function (val) {
  31100. return val !== '';
  31101. }).map(function (val, index) {
  31102. return index > 2 ? parseFloat(val) : parseInt(val, 10);
  31103. });
  31104. if (parts.length === 4) {
  31105. this._alpha = Math.floor(parseFloat(parts[3]) * 100);
  31106. } else if (parts.length === 3) {
  31107. this._alpha = 100;
  31108. }
  31109. if (parts.length >= 3) {
  31110. var _hsl2hsv = hsl2hsv(parts[0], parts[1], parts[2]),
  31111. h = _hsl2hsv.h,
  31112. s = _hsl2hsv.s,
  31113. v = _hsl2hsv.v;
  31114. fromHSV(h, s, v);
  31115. }
  31116. } else if (value.indexOf('hsv') !== -1) {
  31117. var _parts = value.replace(/hsva|hsv|\(|\)/gm, '').split(/\s|,/g).filter(function (val) {
  31118. return val !== '';
  31119. }).map(function (val, index) {
  31120. return index > 2 ? parseFloat(val) : parseInt(val, 10);
  31121. });
  31122. if (_parts.length === 4) {
  31123. this._alpha = Math.floor(parseFloat(_parts[3]) * 100);
  31124. } else if (_parts.length === 3) {
  31125. this._alpha = 100;
  31126. }
  31127. if (_parts.length >= 3) {
  31128. fromHSV(_parts[0], _parts[1], _parts[2]);
  31129. }
  31130. } else if (value.indexOf('rgb') !== -1) {
  31131. var _parts2 = value.replace(/rgba|rgb|\(|\)/gm, '').split(/\s|,/g).filter(function (val) {
  31132. return val !== '';
  31133. }).map(function (val, index) {
  31134. return index > 2 ? parseFloat(val) : parseInt(val, 10);
  31135. });
  31136. if (_parts2.length === 4) {
  31137. this._alpha = Math.floor(parseFloat(_parts2[3]) * 100);
  31138. } else if (_parts2.length === 3) {
  31139. this._alpha = 100;
  31140. }
  31141. if (_parts2.length >= 3) {
  31142. var _rgb2hsv = rgb2hsv(_parts2[0], _parts2[1], _parts2[2]),
  31143. _h = _rgb2hsv.h,
  31144. _s = _rgb2hsv.s,
  31145. _v = _rgb2hsv.v;
  31146. fromHSV(_h, _s, _v);
  31147. }
  31148. } else if (value.indexOf('#') !== -1) {
  31149. var hex = value.replace('#', '').trim();
  31150. if (!/^(?:[0-9a-fA-F]{3}){1,2}|[0-9a-fA-F]{8}$/.test(hex)) return;
  31151. var r = void 0,
  31152. g = void 0,
  31153. b = void 0;
  31154. if (hex.length === 3) {
  31155. r = parseHexChannel(hex[0] + hex[0]);
  31156. g = parseHexChannel(hex[1] + hex[1]);
  31157. b = parseHexChannel(hex[2] + hex[2]);
  31158. } else if (hex.length === 6 || hex.length === 8) {
  31159. r = parseHexChannel(hex.substring(0, 2));
  31160. g = parseHexChannel(hex.substring(2, 4));
  31161. b = parseHexChannel(hex.substring(4, 6));
  31162. }
  31163. if (hex.length === 8) {
  31164. this._alpha = Math.floor(parseHexChannel(hex.substring(6)) / 255 * 100);
  31165. } else if (hex.length === 3 || hex.length === 6) {
  31166. this._alpha = 100;
  31167. }
  31168. var _rgb2hsv2 = rgb2hsv(r, g, b),
  31169. _h2 = _rgb2hsv2.h,
  31170. _s2 = _rgb2hsv2.s,
  31171. _v2 = _rgb2hsv2.v;
  31172. fromHSV(_h2, _s2, _v2);
  31173. }
  31174. };
  31175. Color.prototype.compare = function compare(color) {
  31176. 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;
  31177. };
  31178. Color.prototype.doOnChange = function doOnChange() {
  31179. var _hue = this._hue,
  31180. _saturation = this._saturation,
  31181. _value = this._value,
  31182. _alpha = this._alpha,
  31183. format = this.format;
  31184. if (this.enableAlpha) {
  31185. switch (format) {
  31186. case 'hsl':
  31187. var hsl = hsv2hsl(_hue, _saturation / 100, _value / 100);
  31188. this.value = 'hsla(' + _hue + ', ' + Math.round(hsl[1] * 100) + '%, ' + Math.round(hsl[2] * 100) + '%, ' + _alpha / 100 + ')';
  31189. break;
  31190. case 'hsv':
  31191. this.value = 'hsva(' + _hue + ', ' + Math.round(_saturation) + '%, ' + Math.round(_value) + '%, ' + _alpha / 100 + ')';
  31192. break;
  31193. default:
  31194. var _hsv2rgb = hsv2rgb(_hue, _saturation, _value),
  31195. r = _hsv2rgb.r,
  31196. g = _hsv2rgb.g,
  31197. b = _hsv2rgb.b;
  31198. this.value = 'rgba(' + r + ', ' + g + ', ' + b + ', ' + _alpha / 100 + ')';
  31199. }
  31200. } else {
  31201. switch (format) {
  31202. case 'hsl':
  31203. var _hsl = hsv2hsl(_hue, _saturation / 100, _value / 100);
  31204. this.value = 'hsl(' + _hue + ', ' + Math.round(_hsl[1] * 100) + '%, ' + Math.round(_hsl[2] * 100) + '%)';
  31205. break;
  31206. case 'hsv':
  31207. this.value = 'hsv(' + _hue + ', ' + Math.round(_saturation) + '%, ' + Math.round(_value) + '%)';
  31208. break;
  31209. case 'rgb':
  31210. var _hsv2rgb2 = hsv2rgb(_hue, _saturation, _value),
  31211. _r = _hsv2rgb2.r,
  31212. _g = _hsv2rgb2.g,
  31213. _b = _hsv2rgb2.b;
  31214. this.value = 'rgb(' + _r + ', ' + _g + ', ' + _b + ')';
  31215. break;
  31216. default:
  31217. this.value = toHex(hsv2rgb(_hue, _saturation, _value));
  31218. }
  31219. }
  31220. };
  31221. return Color;
  31222. }();
  31223. /* harmony default export */ var src_color = (Color);
  31224. ;
  31225. // 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&
  31226. var picker_dropdownvue_type_template_id_06601625_render = function() {
  31227. var _vm = this
  31228. var _h = _vm.$createElement
  31229. var _c = _vm._self._c || _h
  31230. return _c(
  31231. "transition",
  31232. { attrs: { name: "el-zoom-in-top" }, on: { "after-leave": _vm.doDestroy } },
  31233. [
  31234. _c(
  31235. "div",
  31236. {
  31237. directives: [
  31238. {
  31239. name: "show",
  31240. rawName: "v-show",
  31241. value: _vm.showPopper,
  31242. expression: "showPopper"
  31243. }
  31244. ],
  31245. staticClass: "el-color-dropdown"
  31246. },
  31247. [
  31248. _c(
  31249. "div",
  31250. { staticClass: "el-color-dropdown__main-wrapper" },
  31251. [
  31252. _c("hue-slider", {
  31253. ref: "hue",
  31254. staticStyle: { float: "right" },
  31255. attrs: { color: _vm.color, vertical: "" }
  31256. }),
  31257. _c("sv-panel", { ref: "sl", attrs: { color: _vm.color } })
  31258. ],
  31259. 1
  31260. ),
  31261. _vm.showAlpha
  31262. ? _c("alpha-slider", { ref: "alpha", attrs: { color: _vm.color } })
  31263. : _vm._e(),
  31264. _vm.predefine
  31265. ? _c("predefine", {
  31266. attrs: { color: _vm.color, colors: _vm.predefine }
  31267. })
  31268. : _vm._e(),
  31269. _c(
  31270. "div",
  31271. { staticClass: "el-color-dropdown__btns" },
  31272. [
  31273. _c(
  31274. "span",
  31275. { staticClass: "el-color-dropdown__value" },
  31276. [
  31277. _c("el-input", {
  31278. attrs: { "validate-event": false, size: "mini" },
  31279. on: { blur: _vm.handleConfirm },
  31280. nativeOn: {
  31281. keyup: function($event) {
  31282. if (
  31283. !("button" in $event) &&
  31284. _vm._k(
  31285. $event.keyCode,
  31286. "enter",
  31287. 13,
  31288. $event.key,
  31289. "Enter"
  31290. )
  31291. ) {
  31292. return null
  31293. }
  31294. return _vm.handleConfirm($event)
  31295. }
  31296. },
  31297. model: {
  31298. value: _vm.customInput,
  31299. callback: function($$v) {
  31300. _vm.customInput = $$v
  31301. },
  31302. expression: "customInput"
  31303. }
  31304. })
  31305. ],
  31306. 1
  31307. ),
  31308. _c(
  31309. "el-button",
  31310. {
  31311. staticClass: "el-color-dropdown__link-btn",
  31312. attrs: { size: "mini", type: "text" },
  31313. on: {
  31314. click: function($event) {
  31315. _vm.$emit("clear")
  31316. }
  31317. }
  31318. },
  31319. [
  31320. _vm._v(
  31321. "\n " +
  31322. _vm._s(_vm.t("el.colorpicker.clear")) +
  31323. "\n "
  31324. )
  31325. ]
  31326. ),
  31327. _c(
  31328. "el-button",
  31329. {
  31330. staticClass: "el-color-dropdown__btn",
  31331. attrs: { plain: "", size: "mini" },
  31332. on: { click: _vm.confirmValue }
  31333. },
  31334. [
  31335. _vm._v(
  31336. "\n " +
  31337. _vm._s(_vm.t("el.colorpicker.confirm")) +
  31338. "\n "
  31339. )
  31340. ]
  31341. )
  31342. ],
  31343. 1
  31344. )
  31345. ],
  31346. 1
  31347. )
  31348. ]
  31349. )
  31350. }
  31351. var picker_dropdownvue_type_template_id_06601625_staticRenderFns = []
  31352. picker_dropdownvue_type_template_id_06601625_render._withStripped = true
  31353. // CONCATENATED MODULE: ./packages/color-picker/src/components/picker-dropdown.vue?vue&type=template&id=06601625&
  31354. // 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&
  31355. var sv_panelvue_type_template_id_d8583596_render = function() {
  31356. var _vm = this
  31357. var _h = _vm.$createElement
  31358. var _c = _vm._self._c || _h
  31359. return _c(
  31360. "div",
  31361. {
  31362. staticClass: "el-color-svpanel",
  31363. style: {
  31364. backgroundColor: _vm.background
  31365. }
  31366. },
  31367. [
  31368. _c("div", { staticClass: "el-color-svpanel__white" }),
  31369. _c("div", { staticClass: "el-color-svpanel__black" }),
  31370. _c(
  31371. "div",
  31372. {
  31373. staticClass: "el-color-svpanel__cursor",
  31374. style: {
  31375. top: _vm.cursorTop + "px",
  31376. left: _vm.cursorLeft + "px"
  31377. }
  31378. },
  31379. [_c("div")]
  31380. )
  31381. ]
  31382. )
  31383. }
  31384. var sv_panelvue_type_template_id_d8583596_staticRenderFns = []
  31385. sv_panelvue_type_template_id_d8583596_render._withStripped = true
  31386. // CONCATENATED MODULE: ./packages/color-picker/src/components/sv-panel.vue?vue&type=template&id=d8583596&
  31387. // CONCATENATED MODULE: ./packages/color-picker/src/draggable.js
  31388. var isDragging = false;
  31389. /* harmony default export */ var draggable = (function (element, options) {
  31390. if (external_vue_default.a.prototype.$isServer) return;
  31391. var moveFn = function moveFn(event) {
  31392. if (options.drag) {
  31393. options.drag(event);
  31394. }
  31395. };
  31396. var upFn = function upFn(event) {
  31397. document.removeEventListener('mousemove', moveFn);
  31398. document.removeEventListener('mouseup', upFn);
  31399. document.onselectstart = null;
  31400. document.ondragstart = null;
  31401. isDragging = false;
  31402. if (options.end) {
  31403. options.end(event);
  31404. }
  31405. };
  31406. element.addEventListener('mousedown', function (event) {
  31407. if (isDragging) return;
  31408. document.onselectstart = function () {
  31409. return false;
  31410. };
  31411. document.ondragstart = function () {
  31412. return false;
  31413. };
  31414. document.addEventListener('mousemove', moveFn);
  31415. document.addEventListener('mouseup', upFn);
  31416. isDragging = true;
  31417. if (options.start) {
  31418. options.start(event);
  31419. }
  31420. });
  31421. });
  31422. // 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&
  31423. //
  31424. //
  31425. //
  31426. //
  31427. //
  31428. //
  31429. //
  31430. //
  31431. //
  31432. //
  31433. //
  31434. //
  31435. //
  31436. //
  31437. //
  31438. //
  31439. //
  31440. /* harmony default export */ var sv_panelvue_type_script_lang_js_ = ({
  31441. name: 'el-sl-panel',
  31442. props: {
  31443. color: {
  31444. required: true
  31445. }
  31446. },
  31447. computed: {
  31448. colorValue: function colorValue() {
  31449. var hue = this.color.get('hue');
  31450. var value = this.color.get('value');
  31451. return { hue: hue, value: value };
  31452. }
  31453. },
  31454. watch: {
  31455. colorValue: function colorValue() {
  31456. this.update();
  31457. }
  31458. },
  31459. methods: {
  31460. update: function update() {
  31461. var saturation = this.color.get('saturation');
  31462. var value = this.color.get('value');
  31463. var el = this.$el;
  31464. var width = el.clientWidth,
  31465. height = el.clientHeight;
  31466. this.cursorLeft = saturation * width / 100;
  31467. this.cursorTop = (100 - value) * height / 100;
  31468. this.background = 'hsl(' + this.color.get('hue') + ', 100%, 50%)';
  31469. },
  31470. handleDrag: function handleDrag(event) {
  31471. var el = this.$el;
  31472. var rect = el.getBoundingClientRect();
  31473. var left = event.clientX - rect.left;
  31474. var top = event.clientY - rect.top;
  31475. left = Math.max(0, left);
  31476. left = Math.min(left, rect.width);
  31477. top = Math.max(0, top);
  31478. top = Math.min(top, rect.height);
  31479. this.cursorLeft = left;
  31480. this.cursorTop = top;
  31481. this.color.set({
  31482. saturation: left / rect.width * 100,
  31483. value: 100 - top / rect.height * 100
  31484. });
  31485. }
  31486. },
  31487. mounted: function mounted() {
  31488. var _this = this;
  31489. draggable(this.$el, {
  31490. drag: function drag(event) {
  31491. _this.handleDrag(event);
  31492. },
  31493. end: function end(event) {
  31494. _this.handleDrag(event);
  31495. }
  31496. });
  31497. this.update();
  31498. },
  31499. data: function data() {
  31500. return {
  31501. cursorTop: 0,
  31502. cursorLeft: 0,
  31503. background: 'hsl(0, 100%, 50%)'
  31504. };
  31505. }
  31506. });
  31507. // CONCATENATED MODULE: ./packages/color-picker/src/components/sv-panel.vue?vue&type=script&lang=js&
  31508. /* harmony default export */ var components_sv_panelvue_type_script_lang_js_ = (sv_panelvue_type_script_lang_js_);
  31509. // CONCATENATED MODULE: ./packages/color-picker/src/components/sv-panel.vue
  31510. /* normalize component */
  31511. var sv_panel_component = normalizeComponent(
  31512. components_sv_panelvue_type_script_lang_js_,
  31513. sv_panelvue_type_template_id_d8583596_render,
  31514. sv_panelvue_type_template_id_d8583596_staticRenderFns,
  31515. false,
  31516. null,
  31517. null,
  31518. null
  31519. )
  31520. /* hot reload */
  31521. if (false) { var sv_panel_api; }
  31522. sv_panel_component.options.__file = "packages/color-picker/src/components/sv-panel.vue"
  31523. /* harmony default export */ var sv_panel = (sv_panel_component.exports);
  31524. // 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&
  31525. var hue_slidervue_type_template_id_5cdc43b1_render = function() {
  31526. var _vm = this
  31527. var _h = _vm.$createElement
  31528. var _c = _vm._self._c || _h
  31529. return _c(
  31530. "div",
  31531. {
  31532. staticClass: "el-color-hue-slider",
  31533. class: { "is-vertical": _vm.vertical }
  31534. },
  31535. [
  31536. _c("div", {
  31537. ref: "bar",
  31538. staticClass: "el-color-hue-slider__bar",
  31539. on: { click: _vm.handleClick }
  31540. }),
  31541. _c("div", {
  31542. ref: "thumb",
  31543. staticClass: "el-color-hue-slider__thumb",
  31544. style: {
  31545. left: _vm.thumbLeft + "px",
  31546. top: _vm.thumbTop + "px"
  31547. }
  31548. })
  31549. ]
  31550. )
  31551. }
  31552. var hue_slidervue_type_template_id_5cdc43b1_staticRenderFns = []
  31553. hue_slidervue_type_template_id_5cdc43b1_render._withStripped = true
  31554. // CONCATENATED MODULE: ./packages/color-picker/src/components/hue-slider.vue?vue&type=template&id=5cdc43b1&
  31555. // 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&
  31556. //
  31557. //
  31558. //
  31559. //
  31560. //
  31561. //
  31562. //
  31563. //
  31564. //
  31565. //
  31566. //
  31567. //
  31568. //
  31569. /* harmony default export */ var hue_slidervue_type_script_lang_js_ = ({
  31570. name: 'el-color-hue-slider',
  31571. props: {
  31572. color: {
  31573. required: true
  31574. },
  31575. vertical: Boolean
  31576. },
  31577. data: function data() {
  31578. return {
  31579. thumbLeft: 0,
  31580. thumbTop: 0
  31581. };
  31582. },
  31583. computed: {
  31584. hueValue: function hueValue() {
  31585. var hue = this.color.get('hue');
  31586. return hue;
  31587. }
  31588. },
  31589. watch: {
  31590. hueValue: function hueValue() {
  31591. this.update();
  31592. }
  31593. },
  31594. methods: {
  31595. handleClick: function handleClick(event) {
  31596. var thumb = this.$refs.thumb;
  31597. var target = event.target;
  31598. if (target !== thumb) {
  31599. this.handleDrag(event);
  31600. }
  31601. },
  31602. handleDrag: function handleDrag(event) {
  31603. var rect = this.$el.getBoundingClientRect();
  31604. var thumb = this.$refs.thumb;
  31605. var hue = void 0;
  31606. if (!this.vertical) {
  31607. var left = event.clientX - rect.left;
  31608. left = Math.min(left, rect.width - thumb.offsetWidth / 2);
  31609. left = Math.max(thumb.offsetWidth / 2, left);
  31610. hue = Math.round((left - thumb.offsetWidth / 2) / (rect.width - thumb.offsetWidth) * 360);
  31611. } else {
  31612. var top = event.clientY - rect.top;
  31613. top = Math.min(top, rect.height - thumb.offsetHeight / 2);
  31614. top = Math.max(thumb.offsetHeight / 2, top);
  31615. hue = Math.round((top - thumb.offsetHeight / 2) / (rect.height - thumb.offsetHeight) * 360);
  31616. }
  31617. this.color.set('hue', hue);
  31618. },
  31619. getThumbLeft: function getThumbLeft() {
  31620. if (this.vertical) return 0;
  31621. var el = this.$el;
  31622. var hue = this.color.get('hue');
  31623. if (!el) return 0;
  31624. var thumb = this.$refs.thumb;
  31625. return Math.round(hue * (el.offsetWidth - thumb.offsetWidth / 2) / 360);
  31626. },
  31627. getThumbTop: function getThumbTop() {
  31628. if (!this.vertical) return 0;
  31629. var el = this.$el;
  31630. var hue = this.color.get('hue');
  31631. if (!el) return 0;
  31632. var thumb = this.$refs.thumb;
  31633. return Math.round(hue * (el.offsetHeight - thumb.offsetHeight / 2) / 360);
  31634. },
  31635. update: function update() {
  31636. this.thumbLeft = this.getThumbLeft();
  31637. this.thumbTop = this.getThumbTop();
  31638. }
  31639. },
  31640. mounted: function mounted() {
  31641. var _this = this;
  31642. var _$refs = this.$refs,
  31643. bar = _$refs.bar,
  31644. thumb = _$refs.thumb;
  31645. var dragConfig = {
  31646. drag: function drag(event) {
  31647. _this.handleDrag(event);
  31648. },
  31649. end: function end(event) {
  31650. _this.handleDrag(event);
  31651. }
  31652. };
  31653. draggable(bar, dragConfig);
  31654. draggable(thumb, dragConfig);
  31655. this.update();
  31656. }
  31657. });
  31658. // CONCATENATED MODULE: ./packages/color-picker/src/components/hue-slider.vue?vue&type=script&lang=js&
  31659. /* harmony default export */ var components_hue_slidervue_type_script_lang_js_ = (hue_slidervue_type_script_lang_js_);
  31660. // CONCATENATED MODULE: ./packages/color-picker/src/components/hue-slider.vue
  31661. /* normalize component */
  31662. var hue_slider_component = normalizeComponent(
  31663. components_hue_slidervue_type_script_lang_js_,
  31664. hue_slidervue_type_template_id_5cdc43b1_render,
  31665. hue_slidervue_type_template_id_5cdc43b1_staticRenderFns,
  31666. false,
  31667. null,
  31668. null,
  31669. null
  31670. )
  31671. /* hot reload */
  31672. if (false) { var hue_slider_api; }
  31673. hue_slider_component.options.__file = "packages/color-picker/src/components/hue-slider.vue"
  31674. /* harmony default export */ var hue_slider = (hue_slider_component.exports);
  31675. // 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&
  31676. var alpha_slidervue_type_template_id_068c66cb_render = function() {
  31677. var _vm = this
  31678. var _h = _vm.$createElement
  31679. var _c = _vm._self._c || _h
  31680. return _c(
  31681. "div",
  31682. {
  31683. staticClass: "el-color-alpha-slider",
  31684. class: { "is-vertical": _vm.vertical }
  31685. },
  31686. [
  31687. _c("div", {
  31688. ref: "bar",
  31689. staticClass: "el-color-alpha-slider__bar",
  31690. style: {
  31691. background: _vm.background
  31692. },
  31693. on: { click: _vm.handleClick }
  31694. }),
  31695. _c("div", {
  31696. ref: "thumb",
  31697. staticClass: "el-color-alpha-slider__thumb",
  31698. style: {
  31699. left: _vm.thumbLeft + "px",
  31700. top: _vm.thumbTop + "px"
  31701. }
  31702. })
  31703. ]
  31704. )
  31705. }
  31706. var alpha_slidervue_type_template_id_068c66cb_staticRenderFns = []
  31707. alpha_slidervue_type_template_id_068c66cb_render._withStripped = true
  31708. // CONCATENATED MODULE: ./packages/color-picker/src/components/alpha-slider.vue?vue&type=template&id=068c66cb&
  31709. // 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&
  31710. //
  31711. //
  31712. //
  31713. //
  31714. //
  31715. //
  31716. //
  31717. //
  31718. //
  31719. //
  31720. //
  31721. //
  31722. //
  31723. //
  31724. //
  31725. //
  31726. //
  31727. //
  31728. //
  31729. /* harmony default export */ var alpha_slidervue_type_script_lang_js_ = ({
  31730. name: 'el-color-alpha-slider',
  31731. props: {
  31732. color: {
  31733. required: true
  31734. },
  31735. vertical: Boolean
  31736. },
  31737. watch: {
  31738. 'color._alpha': function color_alpha() {
  31739. this.update();
  31740. },
  31741. 'color.value': function colorValue() {
  31742. this.update();
  31743. }
  31744. },
  31745. methods: {
  31746. handleClick: function handleClick(event) {
  31747. var thumb = this.$refs.thumb;
  31748. var target = event.target;
  31749. if (target !== thumb) {
  31750. this.handleDrag(event);
  31751. }
  31752. },
  31753. handleDrag: function handleDrag(event) {
  31754. var rect = this.$el.getBoundingClientRect();
  31755. var thumb = this.$refs.thumb;
  31756. if (!this.vertical) {
  31757. var left = event.clientX - rect.left;
  31758. left = Math.max(thumb.offsetWidth / 2, left);
  31759. left = Math.min(left, rect.width - thumb.offsetWidth / 2);
  31760. this.color.set('alpha', Math.round((left - thumb.offsetWidth / 2) / (rect.width - thumb.offsetWidth) * 100));
  31761. } else {
  31762. var top = event.clientY - rect.top;
  31763. top = Math.max(thumb.offsetHeight / 2, top);
  31764. top = Math.min(top, rect.height - thumb.offsetHeight / 2);
  31765. this.color.set('alpha', Math.round((top - thumb.offsetHeight / 2) / (rect.height - thumb.offsetHeight) * 100));
  31766. }
  31767. },
  31768. getThumbLeft: function getThumbLeft() {
  31769. if (this.vertical) return 0;
  31770. var el = this.$el;
  31771. var alpha = this.color._alpha;
  31772. if (!el) return 0;
  31773. var thumb = this.$refs.thumb;
  31774. return Math.round(alpha * (el.offsetWidth - thumb.offsetWidth / 2) / 100);
  31775. },
  31776. getThumbTop: function getThumbTop() {
  31777. if (!this.vertical) return 0;
  31778. var el = this.$el;
  31779. var alpha = this.color._alpha;
  31780. if (!el) return 0;
  31781. var thumb = this.$refs.thumb;
  31782. return Math.round(alpha * (el.offsetHeight - thumb.offsetHeight / 2) / 100);
  31783. },
  31784. getBackground: function getBackground() {
  31785. if (this.color && this.color.value) {
  31786. var _color$toRgb = this.color.toRgb(),
  31787. r = _color$toRgb.r,
  31788. g = _color$toRgb.g,
  31789. b = _color$toRgb.b;
  31790. return 'linear-gradient(to right, rgba(' + r + ', ' + g + ', ' + b + ', 0) 0%, rgba(' + r + ', ' + g + ', ' + b + ', 1) 100%)';
  31791. }
  31792. return null;
  31793. },
  31794. update: function update() {
  31795. this.thumbLeft = this.getThumbLeft();
  31796. this.thumbTop = this.getThumbTop();
  31797. this.background = this.getBackground();
  31798. }
  31799. },
  31800. data: function data() {
  31801. return {
  31802. thumbLeft: 0,
  31803. thumbTop: 0,
  31804. background: null
  31805. };
  31806. },
  31807. mounted: function mounted() {
  31808. var _this = this;
  31809. var _$refs = this.$refs,
  31810. bar = _$refs.bar,
  31811. thumb = _$refs.thumb;
  31812. var dragConfig = {
  31813. drag: function drag(event) {
  31814. _this.handleDrag(event);
  31815. },
  31816. end: function end(event) {
  31817. _this.handleDrag(event);
  31818. }
  31819. };
  31820. draggable(bar, dragConfig);
  31821. draggable(thumb, dragConfig);
  31822. this.update();
  31823. }
  31824. });
  31825. // CONCATENATED MODULE: ./packages/color-picker/src/components/alpha-slider.vue?vue&type=script&lang=js&
  31826. /* harmony default export */ var components_alpha_slidervue_type_script_lang_js_ = (alpha_slidervue_type_script_lang_js_);
  31827. // CONCATENATED MODULE: ./packages/color-picker/src/components/alpha-slider.vue
  31828. /* normalize component */
  31829. var alpha_slider_component = normalizeComponent(
  31830. components_alpha_slidervue_type_script_lang_js_,
  31831. alpha_slidervue_type_template_id_068c66cb_render,
  31832. alpha_slidervue_type_template_id_068c66cb_staticRenderFns,
  31833. false,
  31834. null,
  31835. null,
  31836. null
  31837. )
  31838. /* hot reload */
  31839. if (false) { var alpha_slider_api; }
  31840. alpha_slider_component.options.__file = "packages/color-picker/src/components/alpha-slider.vue"
  31841. /* harmony default export */ var alpha_slider = (alpha_slider_component.exports);
  31842. // 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&
  31843. var predefinevue_type_template_id_06e03093_render = function() {
  31844. var _vm = this
  31845. var _h = _vm.$createElement
  31846. var _c = _vm._self._c || _h
  31847. return _c("div", { staticClass: "el-color-predefine" }, [
  31848. _c(
  31849. "div",
  31850. { staticClass: "el-color-predefine__colors" },
  31851. _vm._l(_vm.rgbaColors, function(item, index) {
  31852. return _c(
  31853. "div",
  31854. {
  31855. key: _vm.colors[index],
  31856. staticClass: "el-color-predefine__color-selector",
  31857. class: { selected: item.selected, "is-alpha": item._alpha < 100 },
  31858. on: {
  31859. click: function($event) {
  31860. _vm.handleSelect(index)
  31861. }
  31862. }
  31863. },
  31864. [_c("div", { style: { "background-color": item.value } })]
  31865. )
  31866. }),
  31867. 0
  31868. )
  31869. ])
  31870. }
  31871. var predefinevue_type_template_id_06e03093_staticRenderFns = []
  31872. predefinevue_type_template_id_06e03093_render._withStripped = true
  31873. // CONCATENATED MODULE: ./packages/color-picker/src/components/predefine.vue?vue&type=template&id=06e03093&
  31874. // 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&
  31875. //
  31876. //
  31877. //
  31878. //
  31879. //
  31880. //
  31881. //
  31882. //
  31883. //
  31884. //
  31885. //
  31886. //
  31887. //
  31888. //
  31889. //
  31890. /* harmony default export */ var predefinevue_type_script_lang_js_ = ({
  31891. props: {
  31892. colors: { type: Array, required: true },
  31893. color: { required: true }
  31894. },
  31895. data: function data() {
  31896. return {
  31897. rgbaColors: this.parseColors(this.colors, this.color)
  31898. };
  31899. },
  31900. methods: {
  31901. handleSelect: function handleSelect(index) {
  31902. this.color.fromString(this.colors[index]);
  31903. },
  31904. parseColors: function parseColors(colors, color) {
  31905. return colors.map(function (value) {
  31906. var c = new src_color();
  31907. c.enableAlpha = true;
  31908. c.format = 'rgba';
  31909. c.fromString(value);
  31910. c.selected = c.value === color.value;
  31911. return c;
  31912. });
  31913. }
  31914. },
  31915. watch: {
  31916. '$parent.currentColor': function $parentCurrentColor(val) {
  31917. var color = new src_color();
  31918. color.fromString(val);
  31919. this.rgbaColors.forEach(function (item) {
  31920. item.selected = color.compare(item);
  31921. });
  31922. },
  31923. colors: function colors(newVal) {
  31924. this.rgbaColors = this.parseColors(newVal, this.color);
  31925. },
  31926. color: function color(newVal) {
  31927. this.rgbaColors = this.parseColors(this.colors, newVal);
  31928. }
  31929. }
  31930. });
  31931. // CONCATENATED MODULE: ./packages/color-picker/src/components/predefine.vue?vue&type=script&lang=js&
  31932. /* harmony default export */ var components_predefinevue_type_script_lang_js_ = (predefinevue_type_script_lang_js_);
  31933. // CONCATENATED MODULE: ./packages/color-picker/src/components/predefine.vue
  31934. /* normalize component */
  31935. var predefine_component = normalizeComponent(
  31936. components_predefinevue_type_script_lang_js_,
  31937. predefinevue_type_template_id_06e03093_render,
  31938. predefinevue_type_template_id_06e03093_staticRenderFns,
  31939. false,
  31940. null,
  31941. null,
  31942. null
  31943. )
  31944. /* hot reload */
  31945. if (false) { var predefine_api; }
  31946. predefine_component.options.__file = "packages/color-picker/src/components/predefine.vue"
  31947. /* harmony default export */ var predefine = (predefine_component.exports);
  31948. // 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&
  31949. //
  31950. //
  31951. //
  31952. //
  31953. //
  31954. //
  31955. //
  31956. //
  31957. //
  31958. //
  31959. //
  31960. //
  31961. //
  31962. //
  31963. //
  31964. //
  31965. //
  31966. //
  31967. //
  31968. //
  31969. //
  31970. //
  31971. //
  31972. //
  31973. //
  31974. //
  31975. //
  31976. //
  31977. //
  31978. //
  31979. //
  31980. //
  31981. //
  31982. //
  31983. //
  31984. //
  31985. //
  31986. //
  31987. //
  31988. //
  31989. /* harmony default export */ var picker_dropdownvue_type_script_lang_js_ = ({
  31990. name: 'el-color-picker-dropdown',
  31991. mixins: [vue_popper_default.a, locale_default.a],
  31992. components: {
  31993. SvPanel: sv_panel,
  31994. HueSlider: hue_slider,
  31995. AlphaSlider: alpha_slider,
  31996. ElInput: input_default.a,
  31997. ElButton: button_default.a,
  31998. Predefine: predefine
  31999. },
  32000. props: {
  32001. color: {
  32002. required: true
  32003. },
  32004. showAlpha: Boolean,
  32005. predefine: Array
  32006. },
  32007. data: function data() {
  32008. return {
  32009. customInput: ''
  32010. };
  32011. },
  32012. computed: {
  32013. currentColor: function currentColor() {
  32014. var parent = this.$parent;
  32015. return !parent.value && !parent.showPanelColor ? '' : parent.color.value;
  32016. }
  32017. },
  32018. methods: {
  32019. confirmValue: function confirmValue() {
  32020. this.$emit('pick');
  32021. },
  32022. handleConfirm: function handleConfirm() {
  32023. this.color.fromString(this.customInput);
  32024. }
  32025. },
  32026. mounted: function mounted() {
  32027. this.$parent.popperElm = this.popperElm = this.$el;
  32028. this.referenceElm = this.$parent.$el;
  32029. },
  32030. watch: {
  32031. showPopper: function showPopper(val) {
  32032. var _this = this;
  32033. if (val === true) {
  32034. this.$nextTick(function () {
  32035. var _$refs = _this.$refs,
  32036. sl = _$refs.sl,
  32037. hue = _$refs.hue,
  32038. alpha = _$refs.alpha;
  32039. sl && sl.update();
  32040. hue && hue.update();
  32041. alpha && alpha.update();
  32042. });
  32043. }
  32044. },
  32045. currentColor: {
  32046. immediate: true,
  32047. handler: function handler(val) {
  32048. this.customInput = val;
  32049. }
  32050. }
  32051. }
  32052. });
  32053. // CONCATENATED MODULE: ./packages/color-picker/src/components/picker-dropdown.vue?vue&type=script&lang=js&
  32054. /* harmony default export */ var components_picker_dropdownvue_type_script_lang_js_ = (picker_dropdownvue_type_script_lang_js_);
  32055. // CONCATENATED MODULE: ./packages/color-picker/src/components/picker-dropdown.vue
  32056. /* normalize component */
  32057. var picker_dropdown_component = normalizeComponent(
  32058. components_picker_dropdownvue_type_script_lang_js_,
  32059. picker_dropdownvue_type_template_id_06601625_render,
  32060. picker_dropdownvue_type_template_id_06601625_staticRenderFns,
  32061. false,
  32062. null,
  32063. null,
  32064. null
  32065. )
  32066. /* hot reload */
  32067. if (false) { var picker_dropdown_api; }
  32068. picker_dropdown_component.options.__file = "packages/color-picker/src/components/picker-dropdown.vue"
  32069. /* harmony default export */ var picker_dropdown = (picker_dropdown_component.exports);
  32070. // 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&
  32071. //
  32072. //
  32073. //
  32074. //
  32075. //
  32076. //
  32077. //
  32078. //
  32079. //
  32080. //
  32081. //
  32082. //
  32083. //
  32084. //
  32085. //
  32086. //
  32087. //
  32088. //
  32089. //
  32090. //
  32091. //
  32092. //
  32093. //
  32094. //
  32095. //
  32096. //
  32097. //
  32098. //
  32099. //
  32100. //
  32101. //
  32102. //
  32103. /* harmony default export */ var color_picker_src_mainvue_type_script_lang_js_ = ({
  32104. name: 'ElColorPicker',
  32105. mixins: [emitter_default.a],
  32106. props: {
  32107. value: String,
  32108. showAlpha: Boolean,
  32109. colorFormat: String,
  32110. disabled: Boolean,
  32111. size: String,
  32112. popperClass: String,
  32113. predefine: Array
  32114. },
  32115. inject: {
  32116. elForm: {
  32117. default: ''
  32118. },
  32119. elFormItem: {
  32120. default: ''
  32121. }
  32122. },
  32123. directives: { Clickoutside: clickoutside_default.a },
  32124. computed: {
  32125. displayedColor: function displayedColor() {
  32126. if (!this.value && !this.showPanelColor) {
  32127. return 'transparent';
  32128. }
  32129. return this.displayedRgb(this.color, this.showAlpha);
  32130. },
  32131. _elFormItemSize: function _elFormItemSize() {
  32132. return (this.elFormItem || {}).elFormItemSize;
  32133. },
  32134. colorSize: function colorSize() {
  32135. return this.size || this._elFormItemSize || (this.$ELEMENT || {}).size;
  32136. },
  32137. colorDisabled: function colorDisabled() {
  32138. return this.disabled || (this.elForm || {}).disabled;
  32139. }
  32140. },
  32141. watch: {
  32142. value: function value(val) {
  32143. if (!val) {
  32144. this.showPanelColor = false;
  32145. } else if (val && val !== this.color.value) {
  32146. this.color.fromString(val);
  32147. }
  32148. },
  32149. color: {
  32150. deep: true,
  32151. handler: function handler() {
  32152. this.showPanelColor = true;
  32153. }
  32154. },
  32155. displayedColor: function displayedColor(val) {
  32156. if (!this.showPicker) return;
  32157. var currentValueColor = new src_color({
  32158. enableAlpha: this.showAlpha,
  32159. format: this.colorFormat
  32160. });
  32161. currentValueColor.fromString(this.value);
  32162. var currentValueColorRgb = this.displayedRgb(currentValueColor, this.showAlpha);
  32163. if (val !== currentValueColorRgb) {
  32164. this.$emit('active-change', val);
  32165. }
  32166. }
  32167. },
  32168. methods: {
  32169. handleTrigger: function handleTrigger() {
  32170. if (this.colorDisabled) return;
  32171. this.showPicker = !this.showPicker;
  32172. },
  32173. confirmValue: function confirmValue() {
  32174. var value = this.color.value;
  32175. this.$emit('input', value);
  32176. this.$emit('change', value);
  32177. this.dispatch('ElFormItem', 'el.form.change', value);
  32178. this.showPicker = false;
  32179. },
  32180. clearValue: function clearValue() {
  32181. this.$emit('input', null);
  32182. this.$emit('change', null);
  32183. if (this.value !== null) {
  32184. this.dispatch('ElFormItem', 'el.form.change', null);
  32185. }
  32186. this.showPanelColor = false;
  32187. this.showPicker = false;
  32188. this.resetColor();
  32189. },
  32190. hide: function hide() {
  32191. this.showPicker = false;
  32192. this.resetColor();
  32193. },
  32194. resetColor: function resetColor() {
  32195. var _this = this;
  32196. this.$nextTick(function (_) {
  32197. if (_this.value) {
  32198. _this.color.fromString(_this.value);
  32199. } else {
  32200. _this.showPanelColor = false;
  32201. }
  32202. });
  32203. },
  32204. displayedRgb: function displayedRgb(color, showAlpha) {
  32205. if (!(color instanceof src_color)) {
  32206. throw Error('color should be instance of Color Class');
  32207. }
  32208. var _color$toRgb = color.toRgb(),
  32209. r = _color$toRgb.r,
  32210. g = _color$toRgb.g,
  32211. b = _color$toRgb.b;
  32212. return showAlpha ? 'rgba(' + r + ', ' + g + ', ' + b + ', ' + color.get('alpha') / 100 + ')' : 'rgb(' + r + ', ' + g + ', ' + b + ')';
  32213. }
  32214. },
  32215. mounted: function mounted() {
  32216. var value = this.value;
  32217. if (value) {
  32218. this.color.fromString(value);
  32219. }
  32220. this.popperElm = this.$refs.dropdown.$el;
  32221. },
  32222. data: function data() {
  32223. var color = new src_color({
  32224. enableAlpha: this.showAlpha,
  32225. format: this.colorFormat
  32226. });
  32227. return {
  32228. color: color,
  32229. showPicker: false,
  32230. showPanelColor: false
  32231. };
  32232. },
  32233. components: {
  32234. PickerDropdown: picker_dropdown
  32235. }
  32236. });
  32237. // CONCATENATED MODULE: ./packages/color-picker/src/main.vue?vue&type=script&lang=js&
  32238. /* harmony default export */ var packages_color_picker_src_mainvue_type_script_lang_js_ = (color_picker_src_mainvue_type_script_lang_js_);
  32239. // CONCATENATED MODULE: ./packages/color-picker/src/main.vue
  32240. /* normalize component */
  32241. var color_picker_src_main_component = normalizeComponent(
  32242. packages_color_picker_src_mainvue_type_script_lang_js_,
  32243. mainvue_type_template_id_55c8ade7_render,
  32244. mainvue_type_template_id_55c8ade7_staticRenderFns,
  32245. false,
  32246. null,
  32247. null,
  32248. null
  32249. )
  32250. /* hot reload */
  32251. if (false) { var color_picker_src_main_api; }
  32252. color_picker_src_main_component.options.__file = "packages/color-picker/src/main.vue"
  32253. /* harmony default export */ var color_picker_src_main = (color_picker_src_main_component.exports);
  32254. // CONCATENATED MODULE: ./packages/color-picker/index.js
  32255. /* istanbul ignore next */
  32256. color_picker_src_main.install = function (Vue) {
  32257. Vue.component(color_picker_src_main.name, color_picker_src_main);
  32258. };
  32259. /* harmony default export */ var color_picker = (color_picker_src_main);
  32260. // 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&
  32261. var mainvue_type_template_id_5c654dd8_render = function() {
  32262. var _vm = this
  32263. var _h = _vm.$createElement
  32264. var _c = _vm._self._c || _h
  32265. return _c(
  32266. "div",
  32267. { staticClass: "el-transfer" },
  32268. [
  32269. _c(
  32270. "transfer-panel",
  32271. _vm._b(
  32272. {
  32273. ref: "leftPanel",
  32274. attrs: {
  32275. data: _vm.sourceData,
  32276. title: _vm.titles[0] || _vm.t("el.transfer.titles.0"),
  32277. "default-checked": _vm.leftDefaultChecked,
  32278. placeholder:
  32279. _vm.filterPlaceholder || _vm.t("el.transfer.filterPlaceholder")
  32280. },
  32281. on: { "checked-change": _vm.onSourceCheckedChange }
  32282. },
  32283. "transfer-panel",
  32284. _vm.$props,
  32285. false
  32286. ),
  32287. [_vm._t("left-footer")],
  32288. 2
  32289. ),
  32290. _c(
  32291. "div",
  32292. { staticClass: "el-transfer__buttons" },
  32293. [
  32294. _c(
  32295. "el-button",
  32296. {
  32297. class: [
  32298. "el-transfer__button",
  32299. _vm.hasButtonTexts ? "is-with-texts" : ""
  32300. ],
  32301. attrs: {
  32302. type: "primary",
  32303. disabled: _vm.rightChecked.length === 0
  32304. },
  32305. nativeOn: {
  32306. click: function($event) {
  32307. return _vm.addToLeft($event)
  32308. }
  32309. }
  32310. },
  32311. [
  32312. _c("i", { staticClass: "el-icon-arrow-left" }),
  32313. _vm.buttonTexts[0] !== undefined
  32314. ? _c("span", [_vm._v(_vm._s(_vm.buttonTexts[0]))])
  32315. : _vm._e()
  32316. ]
  32317. ),
  32318. _c(
  32319. "el-button",
  32320. {
  32321. class: [
  32322. "el-transfer__button",
  32323. _vm.hasButtonTexts ? "is-with-texts" : ""
  32324. ],
  32325. attrs: {
  32326. type: "primary",
  32327. disabled: _vm.leftChecked.length === 0
  32328. },
  32329. nativeOn: {
  32330. click: function($event) {
  32331. return _vm.addToRight($event)
  32332. }
  32333. }
  32334. },
  32335. [
  32336. _vm.buttonTexts[1] !== undefined
  32337. ? _c("span", [_vm._v(_vm._s(_vm.buttonTexts[1]))])
  32338. : _vm._e(),
  32339. _c("i", { staticClass: "el-icon-arrow-right" })
  32340. ]
  32341. )
  32342. ],
  32343. 1
  32344. ),
  32345. _c(
  32346. "transfer-panel",
  32347. _vm._b(
  32348. {
  32349. ref: "rightPanel",
  32350. attrs: {
  32351. data: _vm.targetData,
  32352. title: _vm.titles[1] || _vm.t("el.transfer.titles.1"),
  32353. "default-checked": _vm.rightDefaultChecked,
  32354. placeholder:
  32355. _vm.filterPlaceholder || _vm.t("el.transfer.filterPlaceholder")
  32356. },
  32357. on: { "checked-change": _vm.onTargetCheckedChange }
  32358. },
  32359. "transfer-panel",
  32360. _vm.$props,
  32361. false
  32362. ),
  32363. [_vm._t("right-footer")],
  32364. 2
  32365. )
  32366. ],
  32367. 1
  32368. )
  32369. }
  32370. var mainvue_type_template_id_5c654dd8_staticRenderFns = []
  32371. mainvue_type_template_id_5c654dd8_render._withStripped = true
  32372. // CONCATENATED MODULE: ./packages/transfer/src/main.vue?vue&type=template&id=5c654dd8&
  32373. // 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&
  32374. var transfer_panelvue_type_template_id_2ddab8bd_render = function() {
  32375. var _vm = this
  32376. var _h = _vm.$createElement
  32377. var _c = _vm._self._c || _h
  32378. return _c("div", { staticClass: "el-transfer-panel" }, [
  32379. _c(
  32380. "p",
  32381. { staticClass: "el-transfer-panel__header" },
  32382. [
  32383. _c(
  32384. "el-checkbox",
  32385. {
  32386. attrs: { indeterminate: _vm.isIndeterminate },
  32387. on: { change: _vm.handleAllCheckedChange },
  32388. model: {
  32389. value: _vm.allChecked,
  32390. callback: function($$v) {
  32391. _vm.allChecked = $$v
  32392. },
  32393. expression: "allChecked"
  32394. }
  32395. },
  32396. [
  32397. _vm._v("\n " + _vm._s(_vm.title) + "\n "),
  32398. _c("span", [_vm._v(_vm._s(_vm.checkedSummary))])
  32399. ]
  32400. )
  32401. ],
  32402. 1
  32403. ),
  32404. _c(
  32405. "div",
  32406. {
  32407. class: [
  32408. "el-transfer-panel__body",
  32409. _vm.hasFooter ? "is-with-footer" : ""
  32410. ]
  32411. },
  32412. [
  32413. _vm.filterable
  32414. ? _c(
  32415. "el-input",
  32416. {
  32417. staticClass: "el-transfer-panel__filter",
  32418. attrs: { size: "small", placeholder: _vm.placeholder },
  32419. nativeOn: {
  32420. mouseenter: function($event) {
  32421. _vm.inputHover = true
  32422. },
  32423. mouseleave: function($event) {
  32424. _vm.inputHover = false
  32425. }
  32426. },
  32427. model: {
  32428. value: _vm.query,
  32429. callback: function($$v) {
  32430. _vm.query = $$v
  32431. },
  32432. expression: "query"
  32433. }
  32434. },
  32435. [
  32436. _c("i", {
  32437. class: ["el-input__icon", "el-icon-" + _vm.inputIcon],
  32438. attrs: { slot: "prefix" },
  32439. on: { click: _vm.clearQuery },
  32440. slot: "prefix"
  32441. })
  32442. ]
  32443. )
  32444. : _vm._e(),
  32445. _c(
  32446. "el-checkbox-group",
  32447. {
  32448. directives: [
  32449. {
  32450. name: "show",
  32451. rawName: "v-show",
  32452. value: !_vm.hasNoMatch && _vm.data.length > 0,
  32453. expression: "!hasNoMatch && data.length > 0"
  32454. }
  32455. ],
  32456. staticClass: "el-transfer-panel__list",
  32457. class: { "is-filterable": _vm.filterable },
  32458. model: {
  32459. value: _vm.checked,
  32460. callback: function($$v) {
  32461. _vm.checked = $$v
  32462. },
  32463. expression: "checked"
  32464. }
  32465. },
  32466. _vm._l(_vm.filteredData, function(item) {
  32467. return _c(
  32468. "el-checkbox",
  32469. {
  32470. key: item[_vm.keyProp],
  32471. staticClass: "el-transfer-panel__item",
  32472. attrs: {
  32473. label: item[_vm.keyProp],
  32474. disabled: item[_vm.disabledProp]
  32475. }
  32476. },
  32477. [_c("option-content", { attrs: { option: item } })],
  32478. 1
  32479. )
  32480. }),
  32481. 1
  32482. ),
  32483. _c(
  32484. "p",
  32485. {
  32486. directives: [
  32487. {
  32488. name: "show",
  32489. rawName: "v-show",
  32490. value: _vm.hasNoMatch,
  32491. expression: "hasNoMatch"
  32492. }
  32493. ],
  32494. staticClass: "el-transfer-panel__empty"
  32495. },
  32496. [_vm._v(_vm._s(_vm.t("el.transfer.noMatch")))]
  32497. ),
  32498. _c(
  32499. "p",
  32500. {
  32501. directives: [
  32502. {
  32503. name: "show",
  32504. rawName: "v-show",
  32505. value: _vm.data.length === 0 && !_vm.hasNoMatch,
  32506. expression: "data.length === 0 && !hasNoMatch"
  32507. }
  32508. ],
  32509. staticClass: "el-transfer-panel__empty"
  32510. },
  32511. [_vm._v(_vm._s(_vm.t("el.transfer.noData")))]
  32512. )
  32513. ],
  32514. 1
  32515. ),
  32516. _vm.hasFooter
  32517. ? _c(
  32518. "p",
  32519. { staticClass: "el-transfer-panel__footer" },
  32520. [_vm._t("default")],
  32521. 2
  32522. )
  32523. : _vm._e()
  32524. ])
  32525. }
  32526. var transfer_panelvue_type_template_id_2ddab8bd_staticRenderFns = []
  32527. transfer_panelvue_type_template_id_2ddab8bd_render._withStripped = true
  32528. // CONCATENATED MODULE: ./packages/transfer/src/transfer-panel.vue?vue&type=template&id=2ddab8bd&
  32529. // 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&
  32530. //
  32531. //
  32532. //
  32533. //
  32534. //
  32535. //
  32536. //
  32537. //
  32538. //
  32539. //
  32540. //
  32541. //
  32542. //
  32543. //
  32544. //
  32545. //
  32546. //
  32547. //
  32548. //
  32549. //
  32550. //
  32551. //
  32552. //
  32553. //
  32554. //
  32555. //
  32556. //
  32557. //
  32558. //
  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. /* harmony default export */ var transfer_panelvue_type_script_lang_js_ = ({
  32584. mixins: [locale_default.a],
  32585. name: 'ElTransferPanel',
  32586. componentName: 'ElTransferPanel',
  32587. components: {
  32588. ElCheckboxGroup: checkbox_group_default.a,
  32589. ElCheckbox: checkbox_default.a,
  32590. ElInput: input_default.a,
  32591. OptionContent: {
  32592. props: {
  32593. option: Object
  32594. },
  32595. render: function render(h) {
  32596. var getParent = function getParent(vm) {
  32597. if (vm.$options.componentName === 'ElTransferPanel') {
  32598. return vm;
  32599. } else if (vm.$parent) {
  32600. return getParent(vm.$parent);
  32601. } else {
  32602. return vm;
  32603. }
  32604. };
  32605. var panel = getParent(this);
  32606. var transfer = panel.$parent || panel;
  32607. 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]]);
  32608. }
  32609. }
  32610. },
  32611. props: {
  32612. data: {
  32613. type: Array,
  32614. default: function _default() {
  32615. return [];
  32616. }
  32617. },
  32618. renderContent: Function,
  32619. placeholder: String,
  32620. title: String,
  32621. filterable: Boolean,
  32622. format: Object,
  32623. filterMethod: Function,
  32624. defaultChecked: Array,
  32625. props: Object
  32626. },
  32627. data: function data() {
  32628. return {
  32629. checked: [],
  32630. allChecked: false,
  32631. query: '',
  32632. inputHover: false,
  32633. checkChangeByUser: true
  32634. };
  32635. },
  32636. watch: {
  32637. checked: function checked(val, oldVal) {
  32638. this.updateAllChecked();
  32639. if (this.checkChangeByUser) {
  32640. var movedKeys = val.concat(oldVal).filter(function (v) {
  32641. return val.indexOf(v) === -1 || oldVal.indexOf(v) === -1;
  32642. });
  32643. this.$emit('checked-change', val, movedKeys);
  32644. } else {
  32645. this.$emit('checked-change', val);
  32646. this.checkChangeByUser = true;
  32647. }
  32648. },
  32649. data: function data() {
  32650. var _this = this;
  32651. var checked = [];
  32652. var filteredDataKeys = this.filteredData.map(function (item) {
  32653. return item[_this.keyProp];
  32654. });
  32655. this.checked.forEach(function (item) {
  32656. if (filteredDataKeys.indexOf(item) > -1) {
  32657. checked.push(item);
  32658. }
  32659. });
  32660. this.checkChangeByUser = false;
  32661. this.checked = checked;
  32662. },
  32663. checkableData: function checkableData() {
  32664. this.updateAllChecked();
  32665. },
  32666. defaultChecked: {
  32667. immediate: true,
  32668. handler: function handler(val, oldVal) {
  32669. var _this2 = this;
  32670. if (oldVal && val.length === oldVal.length && val.every(function (item) {
  32671. return oldVal.indexOf(item) > -1;
  32672. })) return;
  32673. var checked = [];
  32674. var checkableDataKeys = this.checkableData.map(function (item) {
  32675. return item[_this2.keyProp];
  32676. });
  32677. val.forEach(function (item) {
  32678. if (checkableDataKeys.indexOf(item) > -1) {
  32679. checked.push(item);
  32680. }
  32681. });
  32682. this.checkChangeByUser = false;
  32683. this.checked = checked;
  32684. }
  32685. }
  32686. },
  32687. computed: {
  32688. filteredData: function filteredData() {
  32689. var _this3 = this;
  32690. return this.data.filter(function (item) {
  32691. if (typeof _this3.filterMethod === 'function') {
  32692. return _this3.filterMethod(_this3.query, item);
  32693. } else {
  32694. var label = item[_this3.labelProp] || item[_this3.keyProp].toString();
  32695. return label.toLowerCase().indexOf(_this3.query.toLowerCase()) > -1;
  32696. }
  32697. });
  32698. },
  32699. checkableData: function checkableData() {
  32700. var _this4 = this;
  32701. return this.filteredData.filter(function (item) {
  32702. return !item[_this4.disabledProp];
  32703. });
  32704. },
  32705. checkedSummary: function checkedSummary() {
  32706. var checkedLength = this.checked.length;
  32707. var dataLength = this.data.length;
  32708. var _format = this.format,
  32709. noChecked = _format.noChecked,
  32710. hasChecked = _format.hasChecked;
  32711. if (noChecked && hasChecked) {
  32712. return checkedLength > 0 ? hasChecked.replace(/\${checked}/g, checkedLength).replace(/\${total}/g, dataLength) : noChecked.replace(/\${total}/g, dataLength);
  32713. } else {
  32714. return checkedLength + '/' + dataLength;
  32715. }
  32716. },
  32717. isIndeterminate: function isIndeterminate() {
  32718. var checkedLength = this.checked.length;
  32719. return checkedLength > 0 && checkedLength < this.checkableData.length;
  32720. },
  32721. hasNoMatch: function hasNoMatch() {
  32722. return this.query.length > 0 && this.filteredData.length === 0;
  32723. },
  32724. inputIcon: function inputIcon() {
  32725. return this.query.length > 0 && this.inputHover ? 'circle-close' : 'search';
  32726. },
  32727. labelProp: function labelProp() {
  32728. return this.props.label || 'label';
  32729. },
  32730. keyProp: function keyProp() {
  32731. return this.props.key || 'key';
  32732. },
  32733. disabledProp: function disabledProp() {
  32734. return this.props.disabled || 'disabled';
  32735. },
  32736. hasFooter: function hasFooter() {
  32737. return !!this.$slots.default;
  32738. }
  32739. },
  32740. methods: {
  32741. updateAllChecked: function updateAllChecked() {
  32742. var _this5 = this;
  32743. var checkableDataKeys = this.checkableData.map(function (item) {
  32744. return item[_this5.keyProp];
  32745. });
  32746. this.allChecked = checkableDataKeys.length > 0 && checkableDataKeys.every(function (item) {
  32747. return _this5.checked.indexOf(item) > -1;
  32748. });
  32749. },
  32750. handleAllCheckedChange: function handleAllCheckedChange(value) {
  32751. var _this6 = this;
  32752. this.checked = value ? this.checkableData.map(function (item) {
  32753. return item[_this6.keyProp];
  32754. }) : [];
  32755. },
  32756. clearQuery: function clearQuery() {
  32757. if (this.inputIcon === 'circle-close') {
  32758. this.query = '';
  32759. }
  32760. }
  32761. }
  32762. });
  32763. // CONCATENATED MODULE: ./packages/transfer/src/transfer-panel.vue?vue&type=script&lang=js&
  32764. /* harmony default export */ var src_transfer_panelvue_type_script_lang_js_ = (transfer_panelvue_type_script_lang_js_);
  32765. // CONCATENATED MODULE: ./packages/transfer/src/transfer-panel.vue
  32766. /* normalize component */
  32767. var transfer_panel_component = normalizeComponent(
  32768. src_transfer_panelvue_type_script_lang_js_,
  32769. transfer_panelvue_type_template_id_2ddab8bd_render,
  32770. transfer_panelvue_type_template_id_2ddab8bd_staticRenderFns,
  32771. false,
  32772. null,
  32773. null,
  32774. null
  32775. )
  32776. /* hot reload */
  32777. if (false) { var transfer_panel_api; }
  32778. transfer_panel_component.options.__file = "packages/transfer/src/transfer-panel.vue"
  32779. /* harmony default export */ var transfer_panel = (transfer_panel_component.exports);
  32780. // 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&
  32781. //
  32782. //
  32783. //
  32784. //
  32785. //
  32786. //
  32787. //
  32788. //
  32789. //
  32790. //
  32791. //
  32792. //
  32793. //
  32794. //
  32795. //
  32796. //
  32797. //
  32798. //
  32799. //
  32800. //
  32801. //
  32802. //
  32803. //
  32804. //
  32805. //
  32806. //
  32807. //
  32808. //
  32809. //
  32810. //
  32811. //
  32812. //
  32813. //
  32814. //
  32815. //
  32816. //
  32817. //
  32818. //
  32819. //
  32820. //
  32821. //
  32822. //
  32823. //
  32824. /* harmony default export */ var transfer_src_mainvue_type_script_lang_js_ = ({
  32825. name: 'ElTransfer',
  32826. mixins: [emitter_default.a, locale_default.a, migrating_default.a],
  32827. components: {
  32828. TransferPanel: transfer_panel,
  32829. ElButton: button_default.a
  32830. },
  32831. props: {
  32832. data: {
  32833. type: Array,
  32834. default: function _default() {
  32835. return [];
  32836. }
  32837. },
  32838. titles: {
  32839. type: Array,
  32840. default: function _default() {
  32841. return [];
  32842. }
  32843. },
  32844. buttonTexts: {
  32845. type: Array,
  32846. default: function _default() {
  32847. return [];
  32848. }
  32849. },
  32850. filterPlaceholder: {
  32851. type: String,
  32852. default: ''
  32853. },
  32854. filterMethod: Function,
  32855. leftDefaultChecked: {
  32856. type: Array,
  32857. default: function _default() {
  32858. return [];
  32859. }
  32860. },
  32861. rightDefaultChecked: {
  32862. type: Array,
  32863. default: function _default() {
  32864. return [];
  32865. }
  32866. },
  32867. renderContent: Function,
  32868. value: {
  32869. type: Array,
  32870. default: function _default() {
  32871. return [];
  32872. }
  32873. },
  32874. format: {
  32875. type: Object,
  32876. default: function _default() {
  32877. return {};
  32878. }
  32879. },
  32880. filterable: Boolean,
  32881. props: {
  32882. type: Object,
  32883. default: function _default() {
  32884. return {
  32885. label: 'label',
  32886. key: 'key',
  32887. disabled: 'disabled'
  32888. };
  32889. }
  32890. },
  32891. targetOrder: {
  32892. type: String,
  32893. default: 'original'
  32894. }
  32895. },
  32896. data: function data() {
  32897. return {
  32898. leftChecked: [],
  32899. rightChecked: []
  32900. };
  32901. },
  32902. computed: {
  32903. dataObj: function dataObj() {
  32904. var key = this.props.key;
  32905. return this.data.reduce(function (o, cur) {
  32906. return (o[cur[key]] = cur) && o;
  32907. }, {});
  32908. },
  32909. sourceData: function sourceData() {
  32910. var _this = this;
  32911. return this.data.filter(function (item) {
  32912. return _this.value.indexOf(item[_this.props.key]) === -1;
  32913. });
  32914. },
  32915. targetData: function targetData() {
  32916. var _this2 = this;
  32917. if (this.targetOrder === 'original') {
  32918. return this.data.filter(function (item) {
  32919. return _this2.value.indexOf(item[_this2.props.key]) > -1;
  32920. });
  32921. } else {
  32922. return this.value.reduce(function (arr, cur) {
  32923. var val = _this2.dataObj[cur];
  32924. if (val) {
  32925. arr.push(val);
  32926. }
  32927. return arr;
  32928. }, []);
  32929. }
  32930. },
  32931. hasButtonTexts: function hasButtonTexts() {
  32932. return this.buttonTexts.length === 2;
  32933. }
  32934. },
  32935. watch: {
  32936. value: function value(val) {
  32937. this.dispatch('ElFormItem', 'el.form.change', val);
  32938. }
  32939. },
  32940. methods: {
  32941. getMigratingConfig: function getMigratingConfig() {
  32942. return {
  32943. props: {
  32944. 'footer-format': 'footer-format is renamed to format.'
  32945. }
  32946. };
  32947. },
  32948. onSourceCheckedChange: function onSourceCheckedChange(val, movedKeys) {
  32949. this.leftChecked = val;
  32950. if (movedKeys === undefined) return;
  32951. this.$emit('left-check-change', val, movedKeys);
  32952. },
  32953. onTargetCheckedChange: function onTargetCheckedChange(val, movedKeys) {
  32954. this.rightChecked = val;
  32955. if (movedKeys === undefined) return;
  32956. this.$emit('right-check-change', val, movedKeys);
  32957. },
  32958. addToLeft: function addToLeft() {
  32959. var currentValue = this.value.slice();
  32960. this.rightChecked.forEach(function (item) {
  32961. var index = currentValue.indexOf(item);
  32962. if (index > -1) {
  32963. currentValue.splice(index, 1);
  32964. }
  32965. });
  32966. this.$emit('input', currentValue);
  32967. this.$emit('change', currentValue, 'left', this.rightChecked);
  32968. },
  32969. addToRight: function addToRight() {
  32970. var _this3 = this;
  32971. var currentValue = this.value.slice();
  32972. var itemsToBeMoved = [];
  32973. var key = this.props.key;
  32974. this.data.forEach(function (item) {
  32975. var itemKey = item[key];
  32976. if (_this3.leftChecked.indexOf(itemKey) > -1 && _this3.value.indexOf(itemKey) === -1) {
  32977. itemsToBeMoved.push(itemKey);
  32978. }
  32979. });
  32980. currentValue = this.targetOrder === 'unshift' ? itemsToBeMoved.concat(currentValue) : currentValue.concat(itemsToBeMoved);
  32981. this.$emit('input', currentValue);
  32982. this.$emit('change', currentValue, 'right', this.leftChecked);
  32983. },
  32984. clearQuery: function clearQuery(which) {
  32985. if (which === 'left') {
  32986. this.$refs.leftPanel.query = '';
  32987. } else if (which === 'right') {
  32988. this.$refs.rightPanel.query = '';
  32989. }
  32990. }
  32991. }
  32992. });
  32993. // CONCATENATED MODULE: ./packages/transfer/src/main.vue?vue&type=script&lang=js&
  32994. /* harmony default export */ var packages_transfer_src_mainvue_type_script_lang_js_ = (transfer_src_mainvue_type_script_lang_js_);
  32995. // CONCATENATED MODULE: ./packages/transfer/src/main.vue
  32996. /* normalize component */
  32997. var transfer_src_main_component = normalizeComponent(
  32998. packages_transfer_src_mainvue_type_script_lang_js_,
  32999. mainvue_type_template_id_5c654dd8_render,
  33000. mainvue_type_template_id_5c654dd8_staticRenderFns,
  33001. false,
  33002. null,
  33003. null,
  33004. null
  33005. )
  33006. /* hot reload */
  33007. if (false) { var transfer_src_main_api; }
  33008. transfer_src_main_component.options.__file = "packages/transfer/src/main.vue"
  33009. /* harmony default export */ var transfer_src_main = (transfer_src_main_component.exports);
  33010. // CONCATENATED MODULE: ./packages/transfer/index.js
  33011. /* istanbul ignore next */
  33012. transfer_src_main.install = function (Vue) {
  33013. Vue.component(transfer_src_main.name, transfer_src_main);
  33014. };
  33015. /* harmony default export */ var transfer = (transfer_src_main);
  33016. // 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&
  33017. var mainvue_type_template_id_5bf181d4_render = function() {
  33018. var _vm = this
  33019. var _h = _vm.$createElement
  33020. var _c = _vm._self._c || _h
  33021. return _c(
  33022. "section",
  33023. { staticClass: "el-container", class: { "is-vertical": _vm.isVertical } },
  33024. [_vm._t("default")],
  33025. 2
  33026. )
  33027. }
  33028. var mainvue_type_template_id_5bf181d4_staticRenderFns = []
  33029. mainvue_type_template_id_5bf181d4_render._withStripped = true
  33030. // CONCATENATED MODULE: ./packages/container/src/main.vue?vue&type=template&id=5bf181d4&
  33031. // 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&
  33032. //
  33033. //
  33034. //
  33035. //
  33036. //
  33037. //
  33038. /* harmony default export */ var container_src_mainvue_type_script_lang_js_ = ({
  33039. name: 'ElContainer',
  33040. componentName: 'ElContainer',
  33041. props: {
  33042. direction: String
  33043. },
  33044. computed: {
  33045. isVertical: function isVertical() {
  33046. if (this.direction === 'vertical') {
  33047. return true;
  33048. } else if (this.direction === 'horizontal') {
  33049. return false;
  33050. }
  33051. return this.$slots && this.$slots.default ? this.$slots.default.some(function (vnode) {
  33052. var tag = vnode.componentOptions && vnode.componentOptions.tag;
  33053. return tag === 'el-header' || tag === 'el-footer';
  33054. }) : false;
  33055. }
  33056. }
  33057. });
  33058. // CONCATENATED MODULE: ./packages/container/src/main.vue?vue&type=script&lang=js&
  33059. /* harmony default export */ var packages_container_src_mainvue_type_script_lang_js_ = (container_src_mainvue_type_script_lang_js_);
  33060. // CONCATENATED MODULE: ./packages/container/src/main.vue
  33061. /* normalize component */
  33062. var container_src_main_component = normalizeComponent(
  33063. packages_container_src_mainvue_type_script_lang_js_,
  33064. mainvue_type_template_id_5bf181d4_render,
  33065. mainvue_type_template_id_5bf181d4_staticRenderFns,
  33066. false,
  33067. null,
  33068. null,
  33069. null
  33070. )
  33071. /* hot reload */
  33072. if (false) { var container_src_main_api; }
  33073. container_src_main_component.options.__file = "packages/container/src/main.vue"
  33074. /* harmony default export */ var container_src_main = (container_src_main_component.exports);
  33075. // CONCATENATED MODULE: ./packages/container/index.js
  33076. /* istanbul ignore next */
  33077. container_src_main.install = function (Vue) {
  33078. Vue.component(container_src_main.name, container_src_main);
  33079. };
  33080. /* harmony default export */ var packages_container = (container_src_main);
  33081. // 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&
  33082. var mainvue_type_template_id_2b296ab2_render = function() {
  33083. var _vm = this
  33084. var _h = _vm.$createElement
  33085. var _c = _vm._self._c || _h
  33086. return _c(
  33087. "header",
  33088. { staticClass: "el-header", style: { height: _vm.height } },
  33089. [_vm._t("default")],
  33090. 2
  33091. )
  33092. }
  33093. var mainvue_type_template_id_2b296ab2_staticRenderFns = []
  33094. mainvue_type_template_id_2b296ab2_render._withStripped = true
  33095. // CONCATENATED MODULE: ./packages/header/src/main.vue?vue&type=template&id=2b296ab2&
  33096. // 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&
  33097. //
  33098. //
  33099. //
  33100. //
  33101. //
  33102. //
  33103. /* harmony default export */ var header_src_mainvue_type_script_lang_js_ = ({
  33104. name: 'ElHeader',
  33105. componentName: 'ElHeader',
  33106. props: {
  33107. height: {
  33108. type: String,
  33109. default: '60px'
  33110. }
  33111. }
  33112. });
  33113. // CONCATENATED MODULE: ./packages/header/src/main.vue?vue&type=script&lang=js&
  33114. /* harmony default export */ var packages_header_src_mainvue_type_script_lang_js_ = (header_src_mainvue_type_script_lang_js_);
  33115. // CONCATENATED MODULE: ./packages/header/src/main.vue
  33116. /* normalize component */
  33117. var header_src_main_component = normalizeComponent(
  33118. packages_header_src_mainvue_type_script_lang_js_,
  33119. mainvue_type_template_id_2b296ab2_render,
  33120. mainvue_type_template_id_2b296ab2_staticRenderFns,
  33121. false,
  33122. null,
  33123. null,
  33124. null
  33125. )
  33126. /* hot reload */
  33127. if (false) { var header_src_main_api; }
  33128. header_src_main_component.options.__file = "packages/header/src/main.vue"
  33129. /* harmony default export */ var header_src_main = (header_src_main_component.exports);
  33130. // CONCATENATED MODULE: ./packages/header/index.js
  33131. /* istanbul ignore next */
  33132. header_src_main.install = function (Vue) {
  33133. Vue.component(header_src_main.name, header_src_main);
  33134. };
  33135. /* harmony default export */ var header = (header_src_main);
  33136. // 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&
  33137. var mainvue_type_template_id_03411dbf_render = function() {
  33138. var _vm = this
  33139. var _h = _vm.$createElement
  33140. var _c = _vm._self._c || _h
  33141. return _c(
  33142. "aside",
  33143. { staticClass: "el-aside", style: { width: _vm.width } },
  33144. [_vm._t("default")],
  33145. 2
  33146. )
  33147. }
  33148. var mainvue_type_template_id_03411dbf_staticRenderFns = []
  33149. mainvue_type_template_id_03411dbf_render._withStripped = true
  33150. // CONCATENATED MODULE: ./packages/aside/src/main.vue?vue&type=template&id=03411dbf&
  33151. // 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&
  33152. //
  33153. //
  33154. //
  33155. //
  33156. //
  33157. //
  33158. /* harmony default export */ var aside_src_mainvue_type_script_lang_js_ = ({
  33159. name: 'ElAside',
  33160. componentName: 'ElAside',
  33161. props: {
  33162. width: {
  33163. type: String,
  33164. default: '300px'
  33165. }
  33166. }
  33167. });
  33168. // CONCATENATED MODULE: ./packages/aside/src/main.vue?vue&type=script&lang=js&
  33169. /* harmony default export */ var packages_aside_src_mainvue_type_script_lang_js_ = (aside_src_mainvue_type_script_lang_js_);
  33170. // CONCATENATED MODULE: ./packages/aside/src/main.vue
  33171. /* normalize component */
  33172. var aside_src_main_component = normalizeComponent(
  33173. packages_aside_src_mainvue_type_script_lang_js_,
  33174. mainvue_type_template_id_03411dbf_render,
  33175. mainvue_type_template_id_03411dbf_staticRenderFns,
  33176. false,
  33177. null,
  33178. null,
  33179. null
  33180. )
  33181. /* hot reload */
  33182. if (false) { var aside_src_main_api; }
  33183. aside_src_main_component.options.__file = "packages/aside/src/main.vue"
  33184. /* harmony default export */ var aside_src_main = (aside_src_main_component.exports);
  33185. // CONCATENATED MODULE: ./packages/aside/index.js
  33186. /* istanbul ignore next */
  33187. aside_src_main.install = function (Vue) {
  33188. Vue.component(aside_src_main.name, aside_src_main);
  33189. };
  33190. /* harmony default export */ var aside = (aside_src_main);
  33191. // 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&
  33192. var mainvue_type_template_id_2a3a7406_render = function() {
  33193. var _vm = this
  33194. var _h = _vm.$createElement
  33195. var _c = _vm._self._c || _h
  33196. return _c("main", { staticClass: "el-main" }, [_vm._t("default")], 2)
  33197. }
  33198. var mainvue_type_template_id_2a3a7406_staticRenderFns = []
  33199. mainvue_type_template_id_2a3a7406_render._withStripped = true
  33200. // CONCATENATED MODULE: ./packages/main/src/main.vue?vue&type=template&id=2a3a7406&
  33201. // 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&
  33202. //
  33203. //
  33204. //
  33205. //
  33206. //
  33207. //
  33208. /* harmony default export */ var main_src_mainvue_type_script_lang_js_ = ({
  33209. name: 'ElMain',
  33210. componentName: 'ElMain'
  33211. });
  33212. // CONCATENATED MODULE: ./packages/main/src/main.vue?vue&type=script&lang=js&
  33213. /* harmony default export */ var packages_main_src_mainvue_type_script_lang_js_ = (main_src_mainvue_type_script_lang_js_);
  33214. // CONCATENATED MODULE: ./packages/main/src/main.vue
  33215. /* normalize component */
  33216. var main_src_main_component = normalizeComponent(
  33217. packages_main_src_mainvue_type_script_lang_js_,
  33218. mainvue_type_template_id_2a3a7406_render,
  33219. mainvue_type_template_id_2a3a7406_staticRenderFns,
  33220. false,
  33221. null,
  33222. null,
  33223. null
  33224. )
  33225. /* hot reload */
  33226. if (false) { var main_src_main_api; }
  33227. main_src_main_component.options.__file = "packages/main/src/main.vue"
  33228. /* harmony default export */ var main_src_main = (main_src_main_component.exports);
  33229. // CONCATENATED MODULE: ./packages/main/index.js
  33230. /* istanbul ignore next */
  33231. main_src_main.install = function (Vue) {
  33232. Vue.component(main_src_main.name, main_src_main);
  33233. };
  33234. /* harmony default export */ var packages_main = (main_src_main);
  33235. // 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&
  33236. var mainvue_type_template_id_80210338_render = function() {
  33237. var _vm = this
  33238. var _h = _vm.$createElement
  33239. var _c = _vm._self._c || _h
  33240. return _c(
  33241. "footer",
  33242. { staticClass: "el-footer", style: { height: _vm.height } },
  33243. [_vm._t("default")],
  33244. 2
  33245. )
  33246. }
  33247. var mainvue_type_template_id_80210338_staticRenderFns = []
  33248. mainvue_type_template_id_80210338_render._withStripped = true
  33249. // CONCATENATED MODULE: ./packages/footer/src/main.vue?vue&type=template&id=80210338&
  33250. // 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&
  33251. //
  33252. //
  33253. //
  33254. //
  33255. //
  33256. //
  33257. /* harmony default export */ var footer_src_mainvue_type_script_lang_js_ = ({
  33258. name: 'ElFooter',
  33259. componentName: 'ElFooter',
  33260. props: {
  33261. height: {
  33262. type: String,
  33263. default: '60px'
  33264. }
  33265. }
  33266. });
  33267. // CONCATENATED MODULE: ./packages/footer/src/main.vue?vue&type=script&lang=js&
  33268. /* harmony default export */ var packages_footer_src_mainvue_type_script_lang_js_ = (footer_src_mainvue_type_script_lang_js_);
  33269. // CONCATENATED MODULE: ./packages/footer/src/main.vue
  33270. /* normalize component */
  33271. var footer_src_main_component = normalizeComponent(
  33272. packages_footer_src_mainvue_type_script_lang_js_,
  33273. mainvue_type_template_id_80210338_render,
  33274. mainvue_type_template_id_80210338_staticRenderFns,
  33275. false,
  33276. null,
  33277. null,
  33278. null
  33279. )
  33280. /* hot reload */
  33281. if (false) { var footer_src_main_api; }
  33282. footer_src_main_component.options.__file = "packages/footer/src/main.vue"
  33283. /* harmony default export */ var footer_src_main = (footer_src_main_component.exports);
  33284. // CONCATENATED MODULE: ./packages/footer/index.js
  33285. /* istanbul ignore next */
  33286. footer_src_main.install = function (Vue) {
  33287. Vue.component(footer_src_main.name, footer_src_main);
  33288. };
  33289. /* harmony default export */ var footer = (footer_src_main);
  33290. // 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&
  33291. /* harmony default export */ var timeline_src_mainvue_type_script_lang_js_ = ({
  33292. name: 'ElTimeline',
  33293. props: {
  33294. reverse: {
  33295. type: Boolean,
  33296. default: false
  33297. }
  33298. },
  33299. provide: function provide() {
  33300. return {
  33301. timeline: this
  33302. };
  33303. },
  33304. render: function render() {
  33305. var h = arguments[0];
  33306. var reverse = this.reverse;
  33307. var classes = {
  33308. 'el-timeline': true,
  33309. 'is-reverse': reverse
  33310. };
  33311. var slots = this.$slots.default || [];
  33312. if (reverse) {
  33313. slots = slots.reverse();
  33314. }
  33315. return h(
  33316. 'ul',
  33317. { 'class': classes },
  33318. [slots]
  33319. );
  33320. }
  33321. });
  33322. // CONCATENATED MODULE: ./packages/timeline/src/main.vue?vue&type=script&lang=js&
  33323. /* harmony default export */ var packages_timeline_src_mainvue_type_script_lang_js_ = (timeline_src_mainvue_type_script_lang_js_);
  33324. // CONCATENATED MODULE: ./packages/timeline/src/main.vue
  33325. var main_render, main_staticRenderFns
  33326. /* normalize component */
  33327. var timeline_src_main_component = normalizeComponent(
  33328. packages_timeline_src_mainvue_type_script_lang_js_,
  33329. main_render,
  33330. main_staticRenderFns,
  33331. false,
  33332. null,
  33333. null,
  33334. null
  33335. )
  33336. /* hot reload */
  33337. if (false) { var timeline_src_main_api; }
  33338. timeline_src_main_component.options.__file = "packages/timeline/src/main.vue"
  33339. /* harmony default export */ var timeline_src_main = (timeline_src_main_component.exports);
  33340. // CONCATENATED MODULE: ./packages/timeline/index.js
  33341. /* istanbul ignore next */
  33342. timeline_src_main.install = function (Vue) {
  33343. Vue.component(timeline_src_main.name, timeline_src_main);
  33344. };
  33345. /* harmony default export */ var timeline = (timeline_src_main);
  33346. // 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&
  33347. var itemvue_type_template_id_61a69e50_render = function() {
  33348. var _vm = this
  33349. var _h = _vm.$createElement
  33350. var _c = _vm._self._c || _h
  33351. return _c("li", { staticClass: "el-timeline-item" }, [
  33352. _c("div", { staticClass: "el-timeline-item__tail" }),
  33353. !_vm.$slots.dot
  33354. ? _c(
  33355. "div",
  33356. {
  33357. staticClass: "el-timeline-item__node",
  33358. class: [
  33359. "el-timeline-item__node--" + (_vm.size || ""),
  33360. "el-timeline-item__node--" + (_vm.type || "")
  33361. ],
  33362. style: {
  33363. backgroundColor: _vm.color
  33364. }
  33365. },
  33366. [
  33367. _vm.icon
  33368. ? _c("i", {
  33369. staticClass: "el-timeline-item__icon",
  33370. class: _vm.icon
  33371. })
  33372. : _vm._e()
  33373. ]
  33374. )
  33375. : _vm._e(),
  33376. _vm.$slots.dot
  33377. ? _c("div", { staticClass: "el-timeline-item__dot" }, [_vm._t("dot")], 2)
  33378. : _vm._e(),
  33379. _c("div", { staticClass: "el-timeline-item__wrapper" }, [
  33380. !_vm.hideTimestamp && _vm.placement === "top"
  33381. ? _c("div", { staticClass: "el-timeline-item__timestamp is-top" }, [
  33382. _vm._v("\n " + _vm._s(_vm.timestamp) + "\n ")
  33383. ])
  33384. : _vm._e(),
  33385. _c(
  33386. "div",
  33387. { staticClass: "el-timeline-item__content" },
  33388. [_vm._t("default")],
  33389. 2
  33390. ),
  33391. !_vm.hideTimestamp && _vm.placement === "bottom"
  33392. ? _c("div", { staticClass: "el-timeline-item__timestamp is-bottom" }, [
  33393. _vm._v("\n " + _vm._s(_vm.timestamp) + "\n ")
  33394. ])
  33395. : _vm._e()
  33396. ])
  33397. ])
  33398. }
  33399. var itemvue_type_template_id_61a69e50_staticRenderFns = []
  33400. itemvue_type_template_id_61a69e50_render._withStripped = true
  33401. // CONCATENATED MODULE: ./packages/timeline/src/item.vue?vue&type=template&id=61a69e50&
  33402. // 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&
  33403. //
  33404. //
  33405. //
  33406. //
  33407. //
  33408. //
  33409. //
  33410. //
  33411. //
  33412. //
  33413. //
  33414. //
  33415. //
  33416. //
  33417. //
  33418. //
  33419. //
  33420. //
  33421. //
  33422. //
  33423. //
  33424. //
  33425. //
  33426. //
  33427. //
  33428. //
  33429. //
  33430. //
  33431. //
  33432. //
  33433. //
  33434. //
  33435. //
  33436. //
  33437. //
  33438. //
  33439. //
  33440. //
  33441. //
  33442. //
  33443. //
  33444. /* harmony default export */ var timeline_src_itemvue_type_script_lang_js_ = ({
  33445. name: 'ElTimelineItem',
  33446. inject: ['timeline'],
  33447. props: {
  33448. timestamp: String,
  33449. hideTimestamp: {
  33450. type: Boolean,
  33451. default: false
  33452. },
  33453. placement: {
  33454. type: String,
  33455. default: 'bottom'
  33456. },
  33457. type: String,
  33458. color: String,
  33459. size: {
  33460. type: String,
  33461. default: 'normal'
  33462. },
  33463. icon: String
  33464. }
  33465. });
  33466. // CONCATENATED MODULE: ./packages/timeline/src/item.vue?vue&type=script&lang=js&
  33467. /* harmony default export */ var packages_timeline_src_itemvue_type_script_lang_js_ = (timeline_src_itemvue_type_script_lang_js_);
  33468. // CONCATENATED MODULE: ./packages/timeline/src/item.vue
  33469. /* normalize component */
  33470. var src_item_component = normalizeComponent(
  33471. packages_timeline_src_itemvue_type_script_lang_js_,
  33472. itemvue_type_template_id_61a69e50_render,
  33473. itemvue_type_template_id_61a69e50_staticRenderFns,
  33474. false,
  33475. null,
  33476. null,
  33477. null
  33478. )
  33479. /* hot reload */
  33480. if (false) { var src_item_api; }
  33481. src_item_component.options.__file = "packages/timeline/src/item.vue"
  33482. /* harmony default export */ var timeline_src_item = (src_item_component.exports);
  33483. // CONCATENATED MODULE: ./packages/timeline-item/index.js
  33484. /* istanbul ignore next */
  33485. timeline_src_item.install = function (Vue) {
  33486. Vue.component(timeline_src_item.name, timeline_src_item);
  33487. };
  33488. /* harmony default export */ var timeline_item = (timeline_src_item);
  33489. // 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&
  33490. var mainvue_type_template_id_01cf3b65_render = function() {
  33491. var _vm = this
  33492. var _h = _vm.$createElement
  33493. var _c = _vm._self._c || _h
  33494. return _c(
  33495. "a",
  33496. _vm._b(
  33497. {
  33498. class: [
  33499. "el-link",
  33500. _vm.type ? "el-link--" + _vm.type : "",
  33501. _vm.disabled && "is-disabled",
  33502. _vm.underline && !_vm.disabled && "is-underline"
  33503. ],
  33504. attrs: { href: _vm.disabled ? null : _vm.href },
  33505. on: { click: _vm.handleClick }
  33506. },
  33507. "a",
  33508. _vm.$attrs,
  33509. false
  33510. ),
  33511. [
  33512. _vm.icon ? _c("i", { class: _vm.icon }) : _vm._e(),
  33513. _vm.$slots.default
  33514. ? _c("span", { staticClass: "el-link--inner" }, [_vm._t("default")], 2)
  33515. : _vm._e(),
  33516. _vm.$slots.icon ? [_vm.$slots.icon ? _vm._t("icon") : _vm._e()] : _vm._e()
  33517. ],
  33518. 2
  33519. )
  33520. }
  33521. var mainvue_type_template_id_01cf3b65_staticRenderFns = []
  33522. mainvue_type_template_id_01cf3b65_render._withStripped = true
  33523. // CONCATENATED MODULE: ./packages/link/src/main.vue?vue&type=template&id=01cf3b65&
  33524. // 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&
  33525. //
  33526. //
  33527. //
  33528. //
  33529. //
  33530. //
  33531. //
  33532. //
  33533. //
  33534. //
  33535. //
  33536. //
  33537. //
  33538. //
  33539. //
  33540. //
  33541. //
  33542. //
  33543. //
  33544. //
  33545. //
  33546. //
  33547. //
  33548. /* harmony default export */ var link_src_mainvue_type_script_lang_js_ = ({
  33549. name: 'ElLink',
  33550. props: {
  33551. type: {
  33552. type: String,
  33553. default: 'default'
  33554. },
  33555. underline: {
  33556. type: Boolean,
  33557. default: true
  33558. },
  33559. disabled: Boolean,
  33560. href: String,
  33561. icon: String
  33562. },
  33563. methods: {
  33564. handleClick: function handleClick(event) {
  33565. if (!this.disabled) {
  33566. if (!this.href) {
  33567. this.$emit('click', event);
  33568. }
  33569. }
  33570. }
  33571. }
  33572. });
  33573. // CONCATENATED MODULE: ./packages/link/src/main.vue?vue&type=script&lang=js&
  33574. /* harmony default export */ var packages_link_src_mainvue_type_script_lang_js_ = (link_src_mainvue_type_script_lang_js_);
  33575. // CONCATENATED MODULE: ./packages/link/src/main.vue
  33576. /* normalize component */
  33577. var link_src_main_component = normalizeComponent(
  33578. packages_link_src_mainvue_type_script_lang_js_,
  33579. mainvue_type_template_id_01cf3b65_render,
  33580. mainvue_type_template_id_01cf3b65_staticRenderFns,
  33581. false,
  33582. null,
  33583. null,
  33584. null
  33585. )
  33586. /* hot reload */
  33587. if (false) { var link_src_main_api; }
  33588. link_src_main_component.options.__file = "packages/link/src/main.vue"
  33589. /* harmony default export */ var link_src_main = (link_src_main_component.exports);
  33590. // CONCATENATED MODULE: ./packages/link/index.js
  33591. /* istanbul ignore next */
  33592. link_src_main.install = function (Vue) {
  33593. Vue.component(link_src_main.name, link_src_main);
  33594. };
  33595. /* harmony default export */ var packages_link = (link_src_main);
  33596. // 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&
  33597. var mainvue_type_template_id_7fa02a7e_functional_true_render = function(_h, _vm) {
  33598. var _c = _vm._c
  33599. return _c(
  33600. "div",
  33601. _vm._g(
  33602. _vm._b(
  33603. {
  33604. class: [
  33605. _vm.data.staticClass,
  33606. "el-divider",
  33607. "el-divider--" + _vm.props.direction
  33608. ]
  33609. },
  33610. "div",
  33611. _vm.data.attrs,
  33612. false
  33613. ),
  33614. _vm.listeners
  33615. ),
  33616. [
  33617. _vm.slots().default && _vm.props.direction !== "vertical"
  33618. ? _c(
  33619. "div",
  33620. { class: ["el-divider__text", "is-" + _vm.props.contentPosition] },
  33621. [_vm._t("default")],
  33622. 2
  33623. )
  33624. : _vm._e()
  33625. ]
  33626. )
  33627. }
  33628. var mainvue_type_template_id_7fa02a7e_functional_true_staticRenderFns = []
  33629. mainvue_type_template_id_7fa02a7e_functional_true_render._withStripped = true
  33630. // CONCATENATED MODULE: ./packages/divider/src/main.vue?vue&type=template&id=7fa02a7e&functional=true&
  33631. // 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&
  33632. //
  33633. //
  33634. //
  33635. //
  33636. //
  33637. //
  33638. //
  33639. //
  33640. //
  33641. //
  33642. //
  33643. //
  33644. //
  33645. //
  33646. //
  33647. /* harmony default export */ var divider_src_mainvue_type_script_lang_js_ = ({
  33648. name: 'ElDivider',
  33649. props: {
  33650. direction: {
  33651. type: String,
  33652. default: 'horizontal',
  33653. validator: function validator(val) {
  33654. return ['horizontal', 'vertical'].indexOf(val) !== -1;
  33655. }
  33656. },
  33657. contentPosition: {
  33658. type: String,
  33659. default: 'center',
  33660. validator: function validator(val) {
  33661. return ['left', 'center', 'right'].indexOf(val) !== -1;
  33662. }
  33663. }
  33664. }
  33665. });
  33666. // CONCATENATED MODULE: ./packages/divider/src/main.vue?vue&type=script&lang=js&
  33667. /* harmony default export */ var packages_divider_src_mainvue_type_script_lang_js_ = (divider_src_mainvue_type_script_lang_js_);
  33668. // CONCATENATED MODULE: ./packages/divider/src/main.vue
  33669. /* normalize component */
  33670. var divider_src_main_component = normalizeComponent(
  33671. packages_divider_src_mainvue_type_script_lang_js_,
  33672. mainvue_type_template_id_7fa02a7e_functional_true_render,
  33673. mainvue_type_template_id_7fa02a7e_functional_true_staticRenderFns,
  33674. true,
  33675. null,
  33676. null,
  33677. null
  33678. )
  33679. /* hot reload */
  33680. if (false) { var divider_src_main_api; }
  33681. divider_src_main_component.options.__file = "packages/divider/src/main.vue"
  33682. /* harmony default export */ var divider_src_main = (divider_src_main_component.exports);
  33683. // CONCATENATED MODULE: ./packages/divider/index.js
  33684. /* istanbul ignore next */
  33685. divider_src_main.install = function (Vue) {
  33686. Vue.component(divider_src_main.name, divider_src_main);
  33687. };
  33688. /* harmony default export */ var divider = (divider_src_main);
  33689. // 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&
  33690. var mainvue_type_template_id_44d84a7c_render = function() {
  33691. var _vm = this
  33692. var _h = _vm.$createElement
  33693. var _c = _vm._self._c || _h
  33694. return _c(
  33695. "div",
  33696. { staticClass: "el-image" },
  33697. [
  33698. _vm.loading
  33699. ? _vm._t("placeholder", [
  33700. _c("div", { staticClass: "el-image__placeholder" })
  33701. ])
  33702. : _vm.error
  33703. ? _vm._t("error", [
  33704. _c("div", { staticClass: "el-image__error" }, [
  33705. _vm._v(_vm._s(_vm.t("el.image.error")))
  33706. ])
  33707. ])
  33708. : _c(
  33709. "img",
  33710. _vm._g(
  33711. _vm._b(
  33712. {
  33713. staticClass: "el-image__inner",
  33714. class: {
  33715. "el-image__inner--center": _vm.alignCenter,
  33716. "el-image__preview": _vm.preview
  33717. },
  33718. style: _vm.imageStyle,
  33719. attrs: { src: _vm.src },
  33720. on: { click: _vm.clickHandler }
  33721. },
  33722. "img",
  33723. _vm.$attrs,
  33724. false
  33725. ),
  33726. _vm.$listeners
  33727. )
  33728. ),
  33729. _vm.preview
  33730. ? [
  33731. _vm.showViewer
  33732. ? _c("image-viewer", {
  33733. attrs: {
  33734. "z-index": _vm.zIndex,
  33735. "initial-index": _vm.imageIndex,
  33736. "on-close": _vm.closeViewer,
  33737. "url-list": _vm.previewSrcList
  33738. }
  33739. })
  33740. : _vm._e()
  33741. ]
  33742. : _vm._e()
  33743. ],
  33744. 2
  33745. )
  33746. }
  33747. var mainvue_type_template_id_44d84a7c_staticRenderFns = []
  33748. mainvue_type_template_id_44d84a7c_render._withStripped = true
  33749. // CONCATENATED MODULE: ./packages/image/src/main.vue?vue&type=template&id=44d84a7c&
  33750. // 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&
  33751. var image_viewervue_type_template_id_5e73b307_render = function() {
  33752. var _vm = this
  33753. var _h = _vm.$createElement
  33754. var _c = _vm._self._c || _h
  33755. return _c("transition", { attrs: { name: "viewer-fade" } }, [
  33756. _c(
  33757. "div",
  33758. {
  33759. ref: "el-image-viewer__wrapper",
  33760. staticClass: "el-image-viewer__wrapper",
  33761. style: { "z-index": _vm.viewerZIndex },
  33762. attrs: { tabindex: "-1" }
  33763. },
  33764. [
  33765. _c("div", {
  33766. staticClass: "el-image-viewer__mask",
  33767. on: {
  33768. click: function($event) {
  33769. if ($event.target !== $event.currentTarget) {
  33770. return null
  33771. }
  33772. return _vm.handleMaskClick($event)
  33773. }
  33774. }
  33775. }),
  33776. _c(
  33777. "span",
  33778. {
  33779. staticClass: "el-image-viewer__btn el-image-viewer__close",
  33780. on: { click: _vm.hide }
  33781. },
  33782. [_c("i", { staticClass: "el-icon-close" })]
  33783. ),
  33784. !_vm.isSingle
  33785. ? [
  33786. _c(
  33787. "span",
  33788. {
  33789. staticClass: "el-image-viewer__btn el-image-viewer__prev",
  33790. class: { "is-disabled": !_vm.infinite && _vm.isFirst },
  33791. on: { click: _vm.prev }
  33792. },
  33793. [_c("i", { staticClass: "el-icon-arrow-left" })]
  33794. ),
  33795. _c(
  33796. "span",
  33797. {
  33798. staticClass: "el-image-viewer__btn el-image-viewer__next",
  33799. class: { "is-disabled": !_vm.infinite && _vm.isLast },
  33800. on: { click: _vm.next }
  33801. },
  33802. [_c("i", { staticClass: "el-icon-arrow-right" })]
  33803. )
  33804. ]
  33805. : _vm._e(),
  33806. _c(
  33807. "div",
  33808. { staticClass: "el-image-viewer__btn el-image-viewer__actions" },
  33809. [
  33810. _c("div", { staticClass: "el-image-viewer__actions__inner" }, [
  33811. _c("i", {
  33812. staticClass: "el-icon-zoom-out",
  33813. on: {
  33814. click: function($event) {
  33815. _vm.handleActions("zoomOut")
  33816. }
  33817. }
  33818. }),
  33819. _c("i", {
  33820. staticClass: "el-icon-zoom-in",
  33821. on: {
  33822. click: function($event) {
  33823. _vm.handleActions("zoomIn")
  33824. }
  33825. }
  33826. }),
  33827. _c("i", { staticClass: "el-image-viewer__actions__divider" }),
  33828. _c("i", { class: _vm.mode.icon, on: { click: _vm.toggleMode } }),
  33829. _c("i", { staticClass: "el-image-viewer__actions__divider" }),
  33830. _c("i", {
  33831. staticClass: "el-icon-refresh-left",
  33832. on: {
  33833. click: function($event) {
  33834. _vm.handleActions("anticlocelise")
  33835. }
  33836. }
  33837. }),
  33838. _c("i", {
  33839. staticClass: "el-icon-refresh-right",
  33840. on: {
  33841. click: function($event) {
  33842. _vm.handleActions("clocelise")
  33843. }
  33844. }
  33845. })
  33846. ])
  33847. ]
  33848. ),
  33849. _c(
  33850. "div",
  33851. { staticClass: "el-image-viewer__canvas" },
  33852. _vm._l(_vm.urlList, function(url, i) {
  33853. return i === _vm.index
  33854. ? _c("img", {
  33855. key: url,
  33856. ref: "img",
  33857. refInFor: true,
  33858. staticClass: "el-image-viewer__img",
  33859. style: _vm.imgStyle,
  33860. attrs: { src: _vm.currentImg, referrerpolicy: "no-referrer" },
  33861. on: {
  33862. load: _vm.handleImgLoad,
  33863. error: _vm.handleImgError,
  33864. mousedown: _vm.handleMouseDown
  33865. }
  33866. })
  33867. : _vm._e()
  33868. }),
  33869. 0
  33870. )
  33871. ],
  33872. 2
  33873. )
  33874. ])
  33875. }
  33876. var image_viewervue_type_template_id_5e73b307_staticRenderFns = []
  33877. image_viewervue_type_template_id_5e73b307_render._withStripped = true
  33878. // CONCATENATED MODULE: ./packages/image/src/image-viewer.vue?vue&type=template&id=5e73b307&
  33879. // 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&
  33880. 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; };
  33881. //
  33882. //
  33883. //
  33884. //
  33885. //
  33886. //
  33887. //
  33888. //
  33889. //
  33890. //
  33891. //
  33892. //
  33893. //
  33894. //
  33895. //
  33896. //
  33897. //
  33898. //
  33899. //
  33900. //
  33901. //
  33902. //
  33903. //
  33904. //
  33905. //
  33906. //
  33907. //
  33908. //
  33909. //
  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. var Mode = {
  33936. CONTAIN: {
  33937. name: 'contain',
  33938. icon: 'el-icon-full-screen'
  33939. },
  33940. ORIGINAL: {
  33941. name: 'original',
  33942. icon: 'el-icon-c-scale-to-original'
  33943. }
  33944. };
  33945. var mousewheelEventName = Object(util_["isFirefox"])() ? 'DOMMouseScroll' : 'mousewheel';
  33946. /* harmony default export */ var image_viewervue_type_script_lang_js_ = ({
  33947. name: 'elImageViewer',
  33948. props: {
  33949. urlList: {
  33950. type: Array,
  33951. default: function _default() {
  33952. return [];
  33953. }
  33954. },
  33955. zIndex: {
  33956. type: Number,
  33957. default: 2000
  33958. },
  33959. onSwitch: {
  33960. type: Function,
  33961. default: function _default() {}
  33962. },
  33963. onClose: {
  33964. type: Function,
  33965. default: function _default() {}
  33966. },
  33967. initialIndex: {
  33968. type: Number,
  33969. default: 0
  33970. },
  33971. appendToBody: {
  33972. type: Boolean,
  33973. default: true
  33974. },
  33975. maskClosable: {
  33976. type: Boolean,
  33977. default: true
  33978. }
  33979. },
  33980. data: function data() {
  33981. return {
  33982. index: this.initialIndex,
  33983. isShow: false,
  33984. infinite: true,
  33985. loading: false,
  33986. mode: Mode.CONTAIN,
  33987. transform: {
  33988. scale: 1,
  33989. deg: 0,
  33990. offsetX: 0,
  33991. offsetY: 0,
  33992. enableTransition: false
  33993. }
  33994. };
  33995. },
  33996. computed: {
  33997. isSingle: function isSingle() {
  33998. return this.urlList.length <= 1;
  33999. },
  34000. isFirst: function isFirst() {
  34001. return this.index === 0;
  34002. },
  34003. isLast: function isLast() {
  34004. return this.index === this.urlList.length - 1;
  34005. },
  34006. currentImg: function currentImg() {
  34007. return this.urlList[this.index];
  34008. },
  34009. imgStyle: function imgStyle() {
  34010. var _transform = this.transform,
  34011. scale = _transform.scale,
  34012. deg = _transform.deg,
  34013. offsetX = _transform.offsetX,
  34014. offsetY = _transform.offsetY,
  34015. enableTransition = _transform.enableTransition;
  34016. var style = {
  34017. transform: 'scale(' + scale + ') rotate(' + deg + 'deg)',
  34018. transition: enableTransition ? 'transform .3s' : '',
  34019. 'margin-left': offsetX + 'px',
  34020. 'margin-top': offsetY + 'px'
  34021. };
  34022. if (this.mode === Mode.CONTAIN) {
  34023. style.maxWidth = style.maxHeight = '100%';
  34024. }
  34025. return style;
  34026. },
  34027. viewerZIndex: function viewerZIndex() {
  34028. var nextZIndex = popup_["PopupManager"].nextZIndex();
  34029. return this.zIndex > nextZIndex ? this.zIndex : nextZIndex;
  34030. }
  34031. },
  34032. watch: {
  34033. index: {
  34034. handler: function handler(val) {
  34035. this.reset();
  34036. this.onSwitch(val);
  34037. }
  34038. },
  34039. currentImg: function currentImg(val) {
  34040. var _this = this;
  34041. this.$nextTick(function (_) {
  34042. var $img = _this.$refs.img[0];
  34043. if (!$img.complete) {
  34044. _this.loading = true;
  34045. }
  34046. });
  34047. }
  34048. },
  34049. methods: {
  34050. hide: function hide() {
  34051. this.deviceSupportUninstall();
  34052. this.onClose();
  34053. },
  34054. deviceSupportInstall: function deviceSupportInstall() {
  34055. var _this2 = this;
  34056. this._keyDownHandler = function (e) {
  34057. e.stopPropagation();
  34058. var keyCode = e.keyCode;
  34059. switch (keyCode) {
  34060. // ESC
  34061. case 27:
  34062. _this2.hide();
  34063. break;
  34064. // SPACE
  34065. case 32:
  34066. _this2.toggleMode();
  34067. break;
  34068. // LEFT_ARROW
  34069. case 37:
  34070. _this2.prev();
  34071. break;
  34072. // UP_ARROW
  34073. case 38:
  34074. _this2.handleActions('zoomIn');
  34075. break;
  34076. // RIGHT_ARROW
  34077. case 39:
  34078. _this2.next();
  34079. break;
  34080. // DOWN_ARROW
  34081. case 40:
  34082. _this2.handleActions('zoomOut');
  34083. break;
  34084. }
  34085. };
  34086. this._mouseWheelHandler = Object(util_["rafThrottle"])(function (e) {
  34087. var delta = e.wheelDelta ? e.wheelDelta : -e.detail;
  34088. if (delta > 0) {
  34089. _this2.handleActions('zoomIn', {
  34090. zoomRate: 0.015,
  34091. enableTransition: false
  34092. });
  34093. } else {
  34094. _this2.handleActions('zoomOut', {
  34095. zoomRate: 0.015,
  34096. enableTransition: false
  34097. });
  34098. }
  34099. });
  34100. Object(dom_["on"])(document, 'keydown', this._keyDownHandler);
  34101. Object(dom_["on"])(document, mousewheelEventName, this._mouseWheelHandler);
  34102. },
  34103. deviceSupportUninstall: function deviceSupportUninstall() {
  34104. Object(dom_["off"])(document, 'keydown', this._keyDownHandler);
  34105. Object(dom_["off"])(document, mousewheelEventName, this._mouseWheelHandler);
  34106. this._keyDownHandler = null;
  34107. this._mouseWheelHandler = null;
  34108. },
  34109. handleImgLoad: function handleImgLoad(e) {
  34110. this.loading = false;
  34111. },
  34112. handleImgError: function handleImgError(e) {
  34113. this.loading = false;
  34114. e.target.alt = '加载失败';
  34115. },
  34116. handleMouseDown: function handleMouseDown(e) {
  34117. var _this3 = this;
  34118. if (this.loading || e.button !== 0) return;
  34119. var _transform2 = this.transform,
  34120. offsetX = _transform2.offsetX,
  34121. offsetY = _transform2.offsetY;
  34122. var startX = e.pageX;
  34123. var startY = e.pageY;
  34124. this._dragHandler = Object(util_["rafThrottle"])(function (ev) {
  34125. _this3.transform.offsetX = offsetX + ev.pageX - startX;
  34126. _this3.transform.offsetY = offsetY + ev.pageY - startY;
  34127. });
  34128. Object(dom_["on"])(document, 'mousemove', this._dragHandler);
  34129. Object(dom_["on"])(document, 'mouseup', function (ev) {
  34130. Object(dom_["off"])(document, 'mousemove', _this3._dragHandler);
  34131. });
  34132. e.preventDefault();
  34133. },
  34134. handleMaskClick: function handleMaskClick() {
  34135. if (this.maskClosable) {
  34136. this.hide();
  34137. }
  34138. },
  34139. reset: function reset() {
  34140. this.transform = {
  34141. scale: 1,
  34142. deg: 0,
  34143. offsetX: 0,
  34144. offsetY: 0,
  34145. enableTransition: false
  34146. };
  34147. },
  34148. toggleMode: function toggleMode() {
  34149. if (this.loading) return;
  34150. var modeNames = Object.keys(Mode);
  34151. var modeValues = Object.values(Mode);
  34152. var index = modeValues.indexOf(this.mode);
  34153. var nextIndex = (index + 1) % modeNames.length;
  34154. this.mode = Mode[modeNames[nextIndex]];
  34155. this.reset();
  34156. },
  34157. prev: function prev() {
  34158. if (this.isFirst && !this.infinite) return;
  34159. var len = this.urlList.length;
  34160. this.index = (this.index - 1 + len) % len;
  34161. },
  34162. next: function next() {
  34163. if (this.isLast && !this.infinite) return;
  34164. var len = this.urlList.length;
  34165. this.index = (this.index + 1) % len;
  34166. },
  34167. handleActions: function handleActions(action) {
  34168. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  34169. if (this.loading) return;
  34170. var _zoomRate$rotateDeg$e = image_viewervue_type_script_lang_js_extends({
  34171. zoomRate: 0.2,
  34172. rotateDeg: 90,
  34173. enableTransition: true
  34174. }, options),
  34175. zoomRate = _zoomRate$rotateDeg$e.zoomRate,
  34176. rotateDeg = _zoomRate$rotateDeg$e.rotateDeg,
  34177. enableTransition = _zoomRate$rotateDeg$e.enableTransition;
  34178. var transform = this.transform;
  34179. switch (action) {
  34180. case 'zoomOut':
  34181. if (transform.scale > 0.2) {
  34182. transform.scale = parseFloat((transform.scale - zoomRate).toFixed(3));
  34183. }
  34184. break;
  34185. case 'zoomIn':
  34186. transform.scale = parseFloat((transform.scale + zoomRate).toFixed(3));
  34187. break;
  34188. case 'clocelise':
  34189. transform.deg += rotateDeg;
  34190. break;
  34191. case 'anticlocelise':
  34192. transform.deg -= rotateDeg;
  34193. break;
  34194. }
  34195. transform.enableTransition = enableTransition;
  34196. }
  34197. },
  34198. mounted: function mounted() {
  34199. this.deviceSupportInstall();
  34200. if (this.appendToBody) {
  34201. document.body.appendChild(this.$el);
  34202. }
  34203. // add tabindex then wrapper can be focusable via Javascript
  34204. // focus wrapper so arrow key can't cause inner scroll behavior underneath
  34205. this.$refs['el-image-viewer__wrapper'].focus();
  34206. },
  34207. destroyed: function destroyed() {
  34208. // if appendToBody is true, remove DOM node after destroy
  34209. if (this.appendToBody && this.$el && this.$el.parentNode) {
  34210. this.$el.parentNode.removeChild(this.$el);
  34211. }
  34212. }
  34213. });
  34214. // CONCATENATED MODULE: ./packages/image/src/image-viewer.vue?vue&type=script&lang=js&
  34215. /* harmony default export */ var src_image_viewervue_type_script_lang_js_ = (image_viewervue_type_script_lang_js_);
  34216. // CONCATENATED MODULE: ./packages/image/src/image-viewer.vue
  34217. /* normalize component */
  34218. var image_viewer_component = normalizeComponent(
  34219. src_image_viewervue_type_script_lang_js_,
  34220. image_viewervue_type_template_id_5e73b307_render,
  34221. image_viewervue_type_template_id_5e73b307_staticRenderFns,
  34222. false,
  34223. null,
  34224. null,
  34225. null
  34226. )
  34227. /* hot reload */
  34228. if (false) { var image_viewer_api; }
  34229. image_viewer_component.options.__file = "packages/image/src/image-viewer.vue"
  34230. /* harmony default export */ var image_viewer = (image_viewer_component.exports);
  34231. // 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&
  34232. //
  34233. //
  34234. //
  34235. //
  34236. //
  34237. //
  34238. //
  34239. //
  34240. //
  34241. //
  34242. //
  34243. //
  34244. //
  34245. //
  34246. //
  34247. //
  34248. //
  34249. //
  34250. //
  34251. //
  34252. //
  34253. //
  34254. //
  34255. var isSupportObjectFit = function isSupportObjectFit() {
  34256. return document.documentElement.style.objectFit !== undefined;
  34257. };
  34258. var ObjectFit = {
  34259. NONE: 'none',
  34260. CONTAIN: 'contain',
  34261. COVER: 'cover',
  34262. FILL: 'fill',
  34263. SCALE_DOWN: 'scale-down'
  34264. };
  34265. var prevOverflow = '';
  34266. /* harmony default export */ var image_src_mainvue_type_script_lang_js_ = ({
  34267. name: 'ElImage',
  34268. mixins: [locale_default.a],
  34269. inheritAttrs: false,
  34270. components: {
  34271. ImageViewer: image_viewer
  34272. },
  34273. props: {
  34274. src: String,
  34275. fit: String,
  34276. lazy: Boolean,
  34277. scrollContainer: {},
  34278. previewSrcList: {
  34279. type: Array,
  34280. default: function _default() {
  34281. return [];
  34282. }
  34283. },
  34284. zIndex: {
  34285. type: Number,
  34286. default: 2000
  34287. },
  34288. initialIndex: Number
  34289. },
  34290. data: function data() {
  34291. return {
  34292. loading: true,
  34293. error: false,
  34294. show: !this.lazy,
  34295. imageWidth: 0,
  34296. imageHeight: 0,
  34297. showViewer: false
  34298. };
  34299. },
  34300. computed: {
  34301. imageStyle: function imageStyle() {
  34302. var fit = this.fit;
  34303. if (!this.$isServer && fit) {
  34304. return isSupportObjectFit() ? { 'object-fit': fit } : this.getImageStyle(fit);
  34305. }
  34306. return {};
  34307. },
  34308. alignCenter: function alignCenter() {
  34309. return !this.$isServer && !isSupportObjectFit() && this.fit !== ObjectFit.FILL;
  34310. },
  34311. preview: function preview() {
  34312. var previewSrcList = this.previewSrcList;
  34313. return Array.isArray(previewSrcList) && previewSrcList.length > 0;
  34314. },
  34315. imageIndex: function imageIndex() {
  34316. var previewIndex = 0;
  34317. var initialIndex = this.initialIndex;
  34318. if (initialIndex >= 0) {
  34319. previewIndex = initialIndex;
  34320. return previewIndex;
  34321. }
  34322. var srcIndex = this.previewSrcList.indexOf(this.src);
  34323. if (srcIndex >= 0) {
  34324. previewIndex = srcIndex;
  34325. return previewIndex;
  34326. }
  34327. return previewIndex;
  34328. }
  34329. },
  34330. watch: {
  34331. src: function src(val) {
  34332. this.show && this.loadImage();
  34333. },
  34334. show: function show(val) {
  34335. val && this.loadImage();
  34336. }
  34337. },
  34338. mounted: function mounted() {
  34339. if (this.lazy) {
  34340. this.addLazyLoadListener();
  34341. } else {
  34342. this.loadImage();
  34343. }
  34344. },
  34345. beforeDestroy: function beforeDestroy() {
  34346. this.lazy && this.removeLazyLoadListener();
  34347. },
  34348. methods: {
  34349. loadImage: function loadImage() {
  34350. var _this = this;
  34351. if (this.$isServer) return;
  34352. // reset status
  34353. this.loading = true;
  34354. this.error = false;
  34355. var img = new Image();
  34356. img.onload = function (e) {
  34357. return _this.handleLoad(e, img);
  34358. };
  34359. img.onerror = this.handleError.bind(this);
  34360. // bind html attrs
  34361. // so it can behave consistently
  34362. Object.keys(this.$attrs).forEach(function (key) {
  34363. var value = _this.$attrs[key];
  34364. img.setAttribute(key, value);
  34365. });
  34366. img.src = this.src;
  34367. },
  34368. handleLoad: function handleLoad(e, img) {
  34369. this.imageWidth = img.width;
  34370. this.imageHeight = img.height;
  34371. this.loading = false;
  34372. this.error = false;
  34373. },
  34374. handleError: function handleError(e) {
  34375. this.loading = false;
  34376. this.error = true;
  34377. this.$emit('error', e);
  34378. },
  34379. handleLazyLoad: function handleLazyLoad() {
  34380. if (Object(dom_["isInContainer"])(this.$el, this._scrollContainer)) {
  34381. this.show = true;
  34382. this.removeLazyLoadListener();
  34383. }
  34384. },
  34385. addLazyLoadListener: function addLazyLoadListener() {
  34386. if (this.$isServer) return;
  34387. var scrollContainer = this.scrollContainer;
  34388. var _scrollContainer = null;
  34389. if (Object(types_["isHtmlElement"])(scrollContainer)) {
  34390. _scrollContainer = scrollContainer;
  34391. } else if (Object(types_["isString"])(scrollContainer)) {
  34392. _scrollContainer = document.querySelector(scrollContainer);
  34393. } else {
  34394. _scrollContainer = Object(dom_["getScrollContainer"])(this.$el);
  34395. }
  34396. if (_scrollContainer) {
  34397. this._scrollContainer = _scrollContainer;
  34398. this._lazyLoadHandler = throttle_default()(200, this.handleLazyLoad);
  34399. Object(dom_["on"])(_scrollContainer, 'scroll', this._lazyLoadHandler);
  34400. this.handleLazyLoad();
  34401. }
  34402. },
  34403. removeLazyLoadListener: function removeLazyLoadListener() {
  34404. var _scrollContainer = this._scrollContainer,
  34405. _lazyLoadHandler = this._lazyLoadHandler;
  34406. if (this.$isServer || !_scrollContainer || !_lazyLoadHandler) return;
  34407. Object(dom_["off"])(_scrollContainer, 'scroll', _lazyLoadHandler);
  34408. this._scrollContainer = null;
  34409. this._lazyLoadHandler = null;
  34410. },
  34411. /**
  34412. * simulate object-fit behavior to compatible with IE11 and other browsers which not support object-fit
  34413. */
  34414. getImageStyle: function getImageStyle(fit) {
  34415. var imageWidth = this.imageWidth,
  34416. imageHeight = this.imageHeight;
  34417. var _$el = this.$el,
  34418. containerWidth = _$el.clientWidth,
  34419. containerHeight = _$el.clientHeight;
  34420. if (!imageWidth || !imageHeight || !containerWidth || !containerHeight) return {};
  34421. var imageAspectRatio = imageWidth / imageHeight;
  34422. var containerAspectRatio = containerWidth / containerHeight;
  34423. if (fit === ObjectFit.SCALE_DOWN) {
  34424. var isSmaller = imageWidth < containerWidth && imageHeight < containerHeight;
  34425. fit = isSmaller ? ObjectFit.NONE : ObjectFit.CONTAIN;
  34426. }
  34427. switch (fit) {
  34428. case ObjectFit.NONE:
  34429. return { width: 'auto', height: 'auto' };
  34430. case ObjectFit.CONTAIN:
  34431. return imageAspectRatio < containerAspectRatio ? { width: 'auto' } : { height: 'auto' };
  34432. case ObjectFit.COVER:
  34433. return imageAspectRatio < containerAspectRatio ? { height: 'auto' } : { width: 'auto' };
  34434. default:
  34435. return {};
  34436. }
  34437. },
  34438. clickHandler: function clickHandler() {
  34439. // don't show viewer when preview is false
  34440. if (!this.preview) {
  34441. return;
  34442. }
  34443. // prevent body scroll
  34444. prevOverflow = document.body.style.overflow;
  34445. document.body.style.overflow = 'hidden';
  34446. this.showViewer = true;
  34447. },
  34448. closeViewer: function closeViewer() {
  34449. document.body.style.overflow = prevOverflow;
  34450. this.showViewer = false;
  34451. }
  34452. }
  34453. });
  34454. // CONCATENATED MODULE: ./packages/image/src/main.vue?vue&type=script&lang=js&
  34455. /* harmony default export */ var packages_image_src_mainvue_type_script_lang_js_ = (image_src_mainvue_type_script_lang_js_);
  34456. // CONCATENATED MODULE: ./packages/image/src/main.vue
  34457. /* normalize component */
  34458. var image_src_main_component = normalizeComponent(
  34459. packages_image_src_mainvue_type_script_lang_js_,
  34460. mainvue_type_template_id_44d84a7c_render,
  34461. mainvue_type_template_id_44d84a7c_staticRenderFns,
  34462. false,
  34463. null,
  34464. null,
  34465. null
  34466. )
  34467. /* hot reload */
  34468. if (false) { var image_src_main_api; }
  34469. image_src_main_component.options.__file = "packages/image/src/main.vue"
  34470. /* harmony default export */ var image_src_main = (image_src_main_component.exports);
  34471. // CONCATENATED MODULE: ./packages/image/index.js
  34472. /* istanbul ignore next */
  34473. image_src_main.install = function (Vue) {
  34474. Vue.component(image_src_main.name, image_src_main);
  34475. };
  34476. /* harmony default export */ var packages_image = (image_src_main);
  34477. // 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&
  34478. var mainvue_type_template_id_6d9756be_render = function() {
  34479. var _vm = this
  34480. var _h = _vm.$createElement
  34481. var _c = _vm._self._c || _h
  34482. return _c("div", { staticClass: "el-calendar" }, [
  34483. _c("div", { staticClass: "el-calendar__header" }, [
  34484. _c("div", { staticClass: "el-calendar__title" }, [
  34485. _vm._v("\n " + _vm._s(_vm.i18nDate) + "\n ")
  34486. ]),
  34487. _vm.validatedRange.length === 0
  34488. ? _c(
  34489. "div",
  34490. { staticClass: "el-calendar__button-group" },
  34491. [
  34492. _c(
  34493. "el-button-group",
  34494. [
  34495. _c(
  34496. "el-button",
  34497. {
  34498. attrs: { type: "plain", size: "mini" },
  34499. on: {
  34500. click: function($event) {
  34501. _vm.selectDate("prev-month")
  34502. }
  34503. }
  34504. },
  34505. [
  34506. _vm._v(
  34507. "\n " +
  34508. _vm._s(_vm.t("el.datepicker.prevMonth")) +
  34509. "\n "
  34510. )
  34511. ]
  34512. ),
  34513. _c(
  34514. "el-button",
  34515. {
  34516. attrs: { type: "plain", size: "mini" },
  34517. on: {
  34518. click: function($event) {
  34519. _vm.selectDate("today")
  34520. }
  34521. }
  34522. },
  34523. [
  34524. _vm._v(
  34525. "\n " +
  34526. _vm._s(_vm.t("el.datepicker.today")) +
  34527. "\n "
  34528. )
  34529. ]
  34530. ),
  34531. _c(
  34532. "el-button",
  34533. {
  34534. attrs: { type: "plain", size: "mini" },
  34535. on: {
  34536. click: function($event) {
  34537. _vm.selectDate("next-month")
  34538. }
  34539. }
  34540. },
  34541. [
  34542. _vm._v(
  34543. "\n " +
  34544. _vm._s(_vm.t("el.datepicker.nextMonth")) +
  34545. "\n "
  34546. )
  34547. ]
  34548. )
  34549. ],
  34550. 1
  34551. )
  34552. ],
  34553. 1
  34554. )
  34555. : _vm._e()
  34556. ]),
  34557. _vm.validatedRange.length === 0
  34558. ? _c(
  34559. "div",
  34560. { key: "no-range", staticClass: "el-calendar__body" },
  34561. [
  34562. _c("date-table", {
  34563. attrs: {
  34564. date: _vm.date,
  34565. "selected-day": _vm.realSelectedDay,
  34566. "first-day-of-week": _vm.realFirstDayOfWeek
  34567. },
  34568. on: { pick: _vm.pickDay }
  34569. })
  34570. ],
  34571. 1
  34572. )
  34573. : _c(
  34574. "div",
  34575. { key: "has-range", staticClass: "el-calendar__body" },
  34576. _vm._l(_vm.validatedRange, function(range, index) {
  34577. return _c("date-table", {
  34578. key: index,
  34579. attrs: {
  34580. date: range[0],
  34581. "selected-day": _vm.realSelectedDay,
  34582. range: range,
  34583. "hide-header": index !== 0,
  34584. "first-day-of-week": _vm.realFirstDayOfWeek
  34585. },
  34586. on: { pick: _vm.pickDay }
  34587. })
  34588. }),
  34589. 1
  34590. )
  34591. ])
  34592. }
  34593. var mainvue_type_template_id_6d9756be_staticRenderFns = []
  34594. mainvue_type_template_id_6d9756be_render._withStripped = true
  34595. // CONCATENATED MODULE: ./packages/calendar/src/main.vue?vue&type=template&id=6d9756be&
  34596. // EXTERNAL MODULE: external "element-ui/lib/utils/date"
  34597. var date_ = __webpack_require__(20);
  34598. var date_default = /*#__PURE__*/__webpack_require__.n(date_);
  34599. // 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&
  34600. /* harmony default export */ var src_date_tablevue_type_script_lang_js_ = ({
  34601. props: {
  34602. selectedDay: String, // formated date yyyy-MM-dd
  34603. range: {
  34604. type: Array,
  34605. validator: function validator(val) {
  34606. if (!(val && val.length)) return true;
  34607. var start = val[0],
  34608. end = val[1];
  34609. return Object(date_util_["validateRangeInOneMonth"])(start, end);
  34610. }
  34611. },
  34612. date: Date,
  34613. hideHeader: Boolean,
  34614. firstDayOfWeek: Number
  34615. },
  34616. inject: ['elCalendar'],
  34617. methods: {
  34618. toNestedArr: function toNestedArr(days) {
  34619. return Object(date_util_["range"])(days.length / 7).map(function (_, index) {
  34620. var start = index * 7;
  34621. return days.slice(start, start + 7);
  34622. });
  34623. },
  34624. getFormateDate: function getFormateDate(day, type) {
  34625. if (!day || ['prev', 'current', 'next'].indexOf(type) === -1) {
  34626. throw new Error('invalid day or type');
  34627. }
  34628. var prefix = this.curMonthDatePrefix;
  34629. if (type === 'prev') {
  34630. prefix = this.prevMonthDatePrefix;
  34631. } else if (type === 'next') {
  34632. prefix = this.nextMonthDatePrefix;
  34633. }
  34634. day = ('00' + day).slice(-2);
  34635. return prefix + '-' + day;
  34636. },
  34637. getCellClass: function getCellClass(_ref) {
  34638. var text = _ref.text,
  34639. type = _ref.type;
  34640. var classes = [type];
  34641. if (type === 'current') {
  34642. var date = this.getFormateDate(text, type);
  34643. if (date === this.selectedDay) {
  34644. classes.push('is-selected');
  34645. }
  34646. if (date === this.formatedToday) {
  34647. classes.push('is-today');
  34648. }
  34649. }
  34650. return classes;
  34651. },
  34652. pickDay: function pickDay(_ref2) {
  34653. var text = _ref2.text,
  34654. type = _ref2.type;
  34655. var date = this.getFormateDate(text, type);
  34656. this.$emit('pick', date);
  34657. },
  34658. cellRenderProxy: function cellRenderProxy(_ref3) {
  34659. var text = _ref3.text,
  34660. type = _ref3.type;
  34661. var h = this.$createElement;
  34662. var render = this.elCalendar.$scopedSlots.dateCell;
  34663. if (!render) return h('span', [text]);
  34664. var day = this.getFormateDate(text, type);
  34665. var date = new Date(day);
  34666. var data = {
  34667. isSelected: this.selectedDay === day,
  34668. type: type + '-month',
  34669. day: day
  34670. };
  34671. return render({ date: date, data: data });
  34672. }
  34673. },
  34674. computed: {
  34675. WEEK_DAYS: function WEEK_DAYS() {
  34676. return Object(date_util_["getI18nSettings"])().dayNames;
  34677. },
  34678. prevMonthDatePrefix: function prevMonthDatePrefix() {
  34679. var temp = new Date(this.date.getTime());
  34680. temp.setDate(0);
  34681. return date_default.a.format(temp, 'yyyy-MM');
  34682. },
  34683. curMonthDatePrefix: function curMonthDatePrefix() {
  34684. return date_default.a.format(this.date, 'yyyy-MM');
  34685. },
  34686. nextMonthDatePrefix: function nextMonthDatePrefix() {
  34687. var temp = new Date(this.date.getFullYear(), this.date.getMonth() + 1, 1);
  34688. return date_default.a.format(temp, 'yyyy-MM');
  34689. },
  34690. formatedToday: function formatedToday() {
  34691. return this.elCalendar.formatedToday;
  34692. },
  34693. isInRange: function isInRange() {
  34694. return this.range && this.range.length;
  34695. },
  34696. rows: function rows() {
  34697. var days = [];
  34698. // if range exists, should render days in range.
  34699. if (this.isInRange) {
  34700. var _range = this.range,
  34701. start = _range[0],
  34702. end = _range[1];
  34703. var currentMonthRange = Object(date_util_["range"])(end.getDate() - start.getDate() + 1).map(function (_, index) {
  34704. return {
  34705. text: start.getDate() + index,
  34706. type: 'current'
  34707. };
  34708. });
  34709. var remaining = currentMonthRange.length % 7;
  34710. remaining = remaining === 0 ? 0 : 7 - remaining;
  34711. var nextMonthRange = Object(date_util_["range"])(remaining).map(function (_, index) {
  34712. return {
  34713. text: index + 1,
  34714. type: 'next'
  34715. };
  34716. });
  34717. days = currentMonthRange.concat(nextMonthRange);
  34718. } else {
  34719. var date = this.date;
  34720. var firstDay = Object(date_util_["getFirstDayOfMonth"])(date);
  34721. firstDay = firstDay === 0 ? 7 : firstDay;
  34722. var firstDayOfWeek = typeof this.firstDayOfWeek === 'number' ? this.firstDayOfWeek : 1;
  34723. var offset = (7 + firstDay - firstDayOfWeek) % 7;
  34724. var prevMonthDays = Object(date_util_["getPrevMonthLastDays"])(date, offset).map(function (day) {
  34725. return {
  34726. text: day,
  34727. type: 'prev'
  34728. };
  34729. });
  34730. var currentMonthDays = Object(date_util_["getMonthDays"])(date).map(function (day) {
  34731. return {
  34732. text: day,
  34733. type: 'current'
  34734. };
  34735. });
  34736. days = [].concat(prevMonthDays, currentMonthDays);
  34737. var nextMonthDays = Object(date_util_["range"])(42 - days.length).map(function (_, index) {
  34738. return {
  34739. text: index + 1,
  34740. type: 'next'
  34741. };
  34742. });
  34743. days = days.concat(nextMonthDays);
  34744. }
  34745. return this.toNestedArr(days);
  34746. },
  34747. weekDays: function weekDays() {
  34748. var start = this.firstDayOfWeek;
  34749. var WEEK_DAYS = this.WEEK_DAYS;
  34750. if (typeof start !== 'number' || start === 0) {
  34751. return WEEK_DAYS.slice();
  34752. } else {
  34753. return WEEK_DAYS.slice(start).concat(WEEK_DAYS.slice(0, start));
  34754. }
  34755. }
  34756. },
  34757. render: function render() {
  34758. var _this = this;
  34759. var h = arguments[0];
  34760. var thead = this.hideHeader ? null : h('thead', [this.weekDays.map(function (day) {
  34761. return h(
  34762. 'th',
  34763. { key: day },
  34764. [day]
  34765. );
  34766. })]);
  34767. return h(
  34768. 'table',
  34769. {
  34770. 'class': {
  34771. 'el-calendar-table': true,
  34772. 'is-range': this.isInRange
  34773. },
  34774. attrs: { cellspacing: '0',
  34775. cellpadding: '0' }
  34776. },
  34777. [thead, h('tbody', [this.rows.map(function (row, index) {
  34778. return h(
  34779. 'tr',
  34780. {
  34781. 'class': {
  34782. 'el-calendar-table__row': true,
  34783. 'el-calendar-table__row--hide-border': index === 0 && _this.hideHeader
  34784. },
  34785. key: index },
  34786. [row.map(function (cell, key) {
  34787. return h(
  34788. 'td',
  34789. { key: key,
  34790. 'class': _this.getCellClass(cell),
  34791. on: {
  34792. 'click': _this.pickDay.bind(_this, cell)
  34793. }
  34794. },
  34795. [h(
  34796. 'div',
  34797. { 'class': 'el-calendar-day' },
  34798. [_this.cellRenderProxy(cell)]
  34799. )]
  34800. );
  34801. })]
  34802. );
  34803. })])]
  34804. );
  34805. }
  34806. });
  34807. // CONCATENATED MODULE: ./packages/calendar/src/date-table.vue?vue&type=script&lang=js&
  34808. /* harmony default export */ var calendar_src_date_tablevue_type_script_lang_js_ = (src_date_tablevue_type_script_lang_js_);
  34809. // CONCATENATED MODULE: ./packages/calendar/src/date-table.vue
  34810. var date_table_render, date_table_staticRenderFns
  34811. /* normalize component */
  34812. var src_date_table_component = normalizeComponent(
  34813. calendar_src_date_tablevue_type_script_lang_js_,
  34814. date_table_render,
  34815. date_table_staticRenderFns,
  34816. false,
  34817. null,
  34818. null,
  34819. null
  34820. )
  34821. /* hot reload */
  34822. if (false) { var src_date_table_api; }
  34823. src_date_table_component.options.__file = "packages/calendar/src/date-table.vue"
  34824. /* harmony default export */ var src_date_table = (src_date_table_component.exports);
  34825. // 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&
  34826. //
  34827. //
  34828. //
  34829. //
  34830. //
  34831. //
  34832. //
  34833. //
  34834. //
  34835. //
  34836. //
  34837. //
  34838. //
  34839. //
  34840. //
  34841. //
  34842. //
  34843. //
  34844. //
  34845. //
  34846. //
  34847. //
  34848. //
  34849. //
  34850. //
  34851. //
  34852. //
  34853. //
  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. var validTypes = ['prev-month', 'today', 'next-month'];
  34885. var weekDays = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
  34886. var oneDay = 86400000;
  34887. /* harmony default export */ var calendar_src_mainvue_type_script_lang_js_ = ({
  34888. name: 'ElCalendar',
  34889. mixins: [locale_default.a],
  34890. components: {
  34891. DateTable: src_date_table,
  34892. ElButton: button_default.a,
  34893. ElButtonGroup: button_group_default.a
  34894. },
  34895. props: {
  34896. value: [Date, String, Number],
  34897. range: {
  34898. type: Array,
  34899. validator: function validator(range) {
  34900. if (Array.isArray(range)) {
  34901. return range.length === 2 && range.every(function (item) {
  34902. return typeof item === 'string' || typeof item === 'number' || item instanceof Date;
  34903. });
  34904. } else {
  34905. return true;
  34906. }
  34907. }
  34908. },
  34909. firstDayOfWeek: {
  34910. type: Number,
  34911. default: 1
  34912. }
  34913. },
  34914. provide: function provide() {
  34915. return {
  34916. elCalendar: this
  34917. };
  34918. },
  34919. methods: {
  34920. pickDay: function pickDay(day) {
  34921. this.realSelectedDay = day;
  34922. },
  34923. selectDate: function selectDate(type) {
  34924. if (validTypes.indexOf(type) === -1) {
  34925. throw new Error('invalid type ' + type);
  34926. }
  34927. var day = '';
  34928. if (type === 'prev-month') {
  34929. day = this.prevMonthDatePrefix + '-01';
  34930. } else if (type === 'next-month') {
  34931. day = this.nextMonthDatePrefix + '-01';
  34932. } else {
  34933. day = this.formatedToday;
  34934. }
  34935. if (day === this.formatedDate) return;
  34936. this.pickDay(day);
  34937. },
  34938. toDate: function toDate(val) {
  34939. if (!val) {
  34940. throw new Error('invalid val');
  34941. }
  34942. return val instanceof Date ? val : new Date(val);
  34943. },
  34944. rangeValidator: function rangeValidator(date, isStart) {
  34945. var firstDayOfWeek = this.realFirstDayOfWeek;
  34946. var expected = isStart ? firstDayOfWeek : firstDayOfWeek === 0 ? 6 : firstDayOfWeek - 1;
  34947. var message = (isStart ? 'start' : 'end') + ' of range should be ' + weekDays[expected] + '.';
  34948. if (date.getDay() !== expected) {
  34949. console.warn('[ElementCalendar]', message, 'Invalid range will be ignored.');
  34950. return false;
  34951. }
  34952. return true;
  34953. }
  34954. },
  34955. computed: {
  34956. prevMonthDatePrefix: function prevMonthDatePrefix() {
  34957. var temp = new Date(this.date.getTime());
  34958. temp.setDate(0);
  34959. return date_default.a.format(temp, 'yyyy-MM');
  34960. },
  34961. curMonthDatePrefix: function curMonthDatePrefix() {
  34962. return date_default.a.format(this.date, 'yyyy-MM');
  34963. },
  34964. nextMonthDatePrefix: function nextMonthDatePrefix() {
  34965. var temp = new Date(this.date.getFullYear(), this.date.getMonth() + 1, 1);
  34966. return date_default.a.format(temp, 'yyyy-MM');
  34967. },
  34968. formatedDate: function formatedDate() {
  34969. return date_default.a.format(this.date, 'yyyy-MM-dd');
  34970. },
  34971. i18nDate: function i18nDate() {
  34972. var year = this.date.getFullYear();
  34973. var month = this.date.getMonth() + 1;
  34974. return year + ' ' + this.t('el.datepicker.year') + ' ' + this.t('el.datepicker.month' + month);
  34975. },
  34976. formatedToday: function formatedToday() {
  34977. return date_default.a.format(this.now, 'yyyy-MM-dd');
  34978. },
  34979. realSelectedDay: {
  34980. get: function get() {
  34981. if (!this.value) return this.selectedDay;
  34982. return this.formatedDate;
  34983. },
  34984. set: function set(val) {
  34985. this.selectedDay = val;
  34986. var date = new Date(val);
  34987. this.$emit('input', date);
  34988. }
  34989. },
  34990. date: function date() {
  34991. if (!this.value) {
  34992. if (this.realSelectedDay) {
  34993. var d = this.selectedDay.split('-');
  34994. return new Date(d[0], d[1] - 1, d[2]);
  34995. } else if (this.validatedRange.length) {
  34996. return this.validatedRange[0][0];
  34997. }
  34998. return this.now;
  34999. } else {
  35000. return this.toDate(this.value);
  35001. }
  35002. },
  35003. // if range is valid, we get a two-digit array
  35004. validatedRange: function validatedRange() {
  35005. var _this = this;
  35006. var range = this.range;
  35007. if (!range) return [];
  35008. range = range.reduce(function (prev, val, index) {
  35009. var date = _this.toDate(val);
  35010. if (_this.rangeValidator(date, index === 0)) {
  35011. prev = prev.concat(date);
  35012. }
  35013. return prev;
  35014. }, []);
  35015. if (range.length === 2) {
  35016. var _range = range,
  35017. start = _range[0],
  35018. end = _range[1];
  35019. if (start > end) {
  35020. console.warn('[ElementCalendar]end time should be greater than start time');
  35021. return [];
  35022. }
  35023. // start time and end time in one month
  35024. if (Object(date_util_["validateRangeInOneMonth"])(start, end)) {
  35025. return [[start, end]];
  35026. }
  35027. var data = [];
  35028. var startDay = new Date(start.getFullYear(), start.getMonth() + 1, 1);
  35029. var lastDay = this.toDate(startDay.getTime() - oneDay);
  35030. if (!Object(date_util_["validateRangeInOneMonth"])(startDay, end)) {
  35031. console.warn('[ElementCalendar]start time and end time interval must not exceed two months');
  35032. return [];
  35033. }
  35034. // 第一个月的时间范围
  35035. data.push([start, lastDay]);
  35036. // 下一月的时间范围,需要计算一下该月的第一个周起始日
  35037. var firstDayOfWeek = this.realFirstDayOfWeek;
  35038. var nextMontFirstDay = startDay.getDay();
  35039. var interval = 0;
  35040. if (nextMontFirstDay !== firstDayOfWeek) {
  35041. if (firstDayOfWeek === 0) {
  35042. interval = 7 - nextMontFirstDay;
  35043. } else {
  35044. interval = firstDayOfWeek - nextMontFirstDay;
  35045. interval = interval > 0 ? interval : 7 + interval;
  35046. }
  35047. }
  35048. startDay = this.toDate(startDay.getTime() + interval * oneDay);
  35049. if (startDay.getDate() < end.getDate()) {
  35050. data.push([startDay, end]);
  35051. }
  35052. return data;
  35053. }
  35054. return [];
  35055. },
  35056. realFirstDayOfWeek: function realFirstDayOfWeek() {
  35057. if (this.firstDayOfWeek < 1 || this.firstDayOfWeek > 6) {
  35058. return 0;
  35059. }
  35060. return Math.floor(this.firstDayOfWeek);
  35061. }
  35062. },
  35063. data: function data() {
  35064. return {
  35065. selectedDay: '',
  35066. now: new Date()
  35067. };
  35068. }
  35069. });
  35070. // CONCATENATED MODULE: ./packages/calendar/src/main.vue?vue&type=script&lang=js&
  35071. /* harmony default export */ var packages_calendar_src_mainvue_type_script_lang_js_ = (calendar_src_mainvue_type_script_lang_js_);
  35072. // CONCATENATED MODULE: ./packages/calendar/src/main.vue
  35073. /* normalize component */
  35074. var calendar_src_main_component = normalizeComponent(
  35075. packages_calendar_src_mainvue_type_script_lang_js_,
  35076. mainvue_type_template_id_6d9756be_render,
  35077. mainvue_type_template_id_6d9756be_staticRenderFns,
  35078. false,
  35079. null,
  35080. null,
  35081. null
  35082. )
  35083. /* hot reload */
  35084. if (false) { var calendar_src_main_api; }
  35085. calendar_src_main_component.options.__file = "packages/calendar/src/main.vue"
  35086. /* harmony default export */ var calendar_src_main = (calendar_src_main_component.exports);
  35087. // CONCATENATED MODULE: ./packages/calendar/index.js
  35088. /* istanbul ignore next */
  35089. calendar_src_main.install = function (Vue) {
  35090. Vue.component(calendar_src_main.name, calendar_src_main);
  35091. };
  35092. /* harmony default export */ var calendar = (calendar_src_main);
  35093. // 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&
  35094. var mainvue_type_template_id_257dd4a9_render = function() {
  35095. var _vm = this
  35096. var _h = _vm.$createElement
  35097. var _c = _vm._self._c || _h
  35098. return _c("transition", { attrs: { name: "el-fade-in" } }, [
  35099. _vm.visible
  35100. ? _c(
  35101. "div",
  35102. {
  35103. staticClass: "el-backtop",
  35104. style: {
  35105. right: _vm.styleRight,
  35106. bottom: _vm.styleBottom
  35107. },
  35108. on: {
  35109. click: function($event) {
  35110. $event.stopPropagation()
  35111. return _vm.handleClick($event)
  35112. }
  35113. }
  35114. },
  35115. [
  35116. _vm._t("default", [_c("el-icon", { attrs: { name: "caret-top" } })])
  35117. ],
  35118. 2
  35119. )
  35120. : _vm._e()
  35121. ])
  35122. }
  35123. var mainvue_type_template_id_257dd4a9_staticRenderFns = []
  35124. mainvue_type_template_id_257dd4a9_render._withStripped = true
  35125. // CONCATENATED MODULE: ./packages/backtop/src/main.vue?vue&type=template&id=257dd4a9&
  35126. // 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&
  35127. //
  35128. //
  35129. //
  35130. //
  35131. //
  35132. //
  35133. //
  35134. //
  35135. //
  35136. //
  35137. //
  35138. //
  35139. //
  35140. //
  35141. //
  35142. //
  35143. //
  35144. var cubic = function cubic(value) {
  35145. return Math.pow(value, 3);
  35146. };
  35147. var easeInOutCubic = function easeInOutCubic(value) {
  35148. return value < 0.5 ? cubic(value * 2) / 2 : 1 - cubic((1 - value) * 2) / 2;
  35149. };
  35150. /* harmony default export */ var backtop_src_mainvue_type_script_lang_js_ = ({
  35151. name: 'ElBacktop',
  35152. props: {
  35153. visibilityHeight: {
  35154. type: Number,
  35155. default: 200
  35156. },
  35157. target: [String],
  35158. right: {
  35159. type: Number,
  35160. default: 40
  35161. },
  35162. bottom: {
  35163. type: Number,
  35164. default: 40
  35165. }
  35166. },
  35167. data: function data() {
  35168. return {
  35169. el: null,
  35170. container: null,
  35171. visible: false
  35172. };
  35173. },
  35174. computed: {
  35175. styleBottom: function styleBottom() {
  35176. return this.bottom + 'px';
  35177. },
  35178. styleRight: function styleRight() {
  35179. return this.right + 'px';
  35180. }
  35181. },
  35182. mounted: function mounted() {
  35183. this.init();
  35184. this.throttledScrollHandler = throttle_default()(300, this.onScroll);
  35185. this.container.addEventListener('scroll', this.throttledScrollHandler);
  35186. },
  35187. methods: {
  35188. init: function init() {
  35189. this.container = document;
  35190. this.el = document.documentElement;
  35191. if (this.target) {
  35192. this.el = document.querySelector(this.target);
  35193. if (!this.el) {
  35194. throw new Error('target is not existed: ' + this.target);
  35195. }
  35196. this.container = this.el;
  35197. }
  35198. },
  35199. onScroll: function onScroll() {
  35200. var scrollTop = this.el.scrollTop;
  35201. this.visible = scrollTop >= this.visibilityHeight;
  35202. },
  35203. handleClick: function handleClick(e) {
  35204. this.scrollToTop();
  35205. this.$emit('click', e);
  35206. },
  35207. scrollToTop: function scrollToTop() {
  35208. var el = this.el;
  35209. var beginTime = Date.now();
  35210. var beginValue = el.scrollTop;
  35211. var rAF = window.requestAnimationFrame || function (func) {
  35212. return setTimeout(func, 16);
  35213. };
  35214. var frameFunc = function frameFunc() {
  35215. var progress = (Date.now() - beginTime) / 500;
  35216. if (progress < 1) {
  35217. el.scrollTop = beginValue * (1 - easeInOutCubic(progress));
  35218. rAF(frameFunc);
  35219. } else {
  35220. el.scrollTop = 0;
  35221. }
  35222. };
  35223. rAF(frameFunc);
  35224. }
  35225. },
  35226. beforeDestroy: function beforeDestroy() {
  35227. this.container.removeEventListener('scroll', this.throttledScrollHandler);
  35228. }
  35229. });
  35230. // CONCATENATED MODULE: ./packages/backtop/src/main.vue?vue&type=script&lang=js&
  35231. /* harmony default export */ var packages_backtop_src_mainvue_type_script_lang_js_ = (backtop_src_mainvue_type_script_lang_js_);
  35232. // CONCATENATED MODULE: ./packages/backtop/src/main.vue
  35233. /* normalize component */
  35234. var backtop_src_main_component = normalizeComponent(
  35235. packages_backtop_src_mainvue_type_script_lang_js_,
  35236. mainvue_type_template_id_257dd4a9_render,
  35237. mainvue_type_template_id_257dd4a9_staticRenderFns,
  35238. false,
  35239. null,
  35240. null,
  35241. null
  35242. )
  35243. /* hot reload */
  35244. if (false) { var backtop_src_main_api; }
  35245. backtop_src_main_component.options.__file = "packages/backtop/src/main.vue"
  35246. /* harmony default export */ var backtop_src_main = (backtop_src_main_component.exports);
  35247. // CONCATENATED MODULE: ./packages/backtop/index.js
  35248. /* istanbul ignore next */
  35249. backtop_src_main.install = function (Vue) {
  35250. Vue.component(backtop_src_main.name, backtop_src_main);
  35251. };
  35252. /* harmony default export */ var backtop = (backtop_src_main);
  35253. // CONCATENATED MODULE: ./packages/infinite-scroll/src/main.js
  35254. var getStyleComputedProperty = function getStyleComputedProperty(element, property) {
  35255. if (element === window) {
  35256. element = document.documentElement;
  35257. }
  35258. if (element.nodeType !== 1) {
  35259. return [];
  35260. }
  35261. // NOTE: 1 DOM access here
  35262. var css = window.getComputedStyle(element, null);
  35263. return property ? css[property] : css;
  35264. };
  35265. var entries = function entries(obj) {
  35266. return Object.keys(obj || {}).map(function (key) {
  35267. return [key, obj[key]];
  35268. });
  35269. };
  35270. var getPositionSize = function getPositionSize(el, prop) {
  35271. return el === window || el === document ? document.documentElement[prop] : el[prop];
  35272. };
  35273. var getOffsetHeight = function getOffsetHeight(el) {
  35274. return getPositionSize(el, 'offsetHeight');
  35275. };
  35276. var getClientHeight = function getClientHeight(el) {
  35277. return getPositionSize(el, 'clientHeight');
  35278. };
  35279. var scope = 'ElInfiniteScroll';
  35280. var attributes = {
  35281. delay: {
  35282. type: Number,
  35283. default: 200
  35284. },
  35285. distance: {
  35286. type: Number,
  35287. default: 0
  35288. },
  35289. disabled: {
  35290. type: Boolean,
  35291. default: false
  35292. },
  35293. immediate: {
  35294. type: Boolean,
  35295. default: true
  35296. }
  35297. };
  35298. var main_getScrollOptions = function getScrollOptions(el, vm) {
  35299. if (!Object(types_["isHtmlElement"])(el)) return {};
  35300. return entries(attributes).reduce(function (map, _ref) {
  35301. var key = _ref[0],
  35302. option = _ref[1];
  35303. var type = option.type,
  35304. defaultValue = option.default;
  35305. var value = el.getAttribute('infinite-scroll-' + key);
  35306. value = Object(types_["isUndefined"])(vm[value]) ? value : vm[value];
  35307. switch (type) {
  35308. case Number:
  35309. value = Number(value);
  35310. value = Number.isNaN(value) ? defaultValue : value;
  35311. break;
  35312. case Boolean:
  35313. value = Object(types_["isDefined"])(value) ? value === 'false' ? false : Boolean(value) : defaultValue;
  35314. break;
  35315. default:
  35316. value = type(value);
  35317. }
  35318. map[key] = value;
  35319. return map;
  35320. }, {});
  35321. };
  35322. var getElementTop = function getElementTop(el) {
  35323. return el.getBoundingClientRect().top;
  35324. };
  35325. var main_handleScroll = function handleScroll(cb) {
  35326. var _scope = this[scope],
  35327. el = _scope.el,
  35328. vm = _scope.vm,
  35329. container = _scope.container,
  35330. observer = _scope.observer;
  35331. var _getScrollOptions = main_getScrollOptions(el, vm),
  35332. distance = _getScrollOptions.distance,
  35333. disabled = _getScrollOptions.disabled;
  35334. if (disabled) return;
  35335. var containerInfo = container.getBoundingClientRect();
  35336. if (!containerInfo.width && !containerInfo.height) return;
  35337. var shouldTrigger = false;
  35338. if (container === el) {
  35339. // be aware of difference between clientHeight & offsetHeight & window.getComputedStyle().height
  35340. var scrollBottom = container.scrollTop + getClientHeight(container);
  35341. shouldTrigger = container.scrollHeight - scrollBottom <= distance;
  35342. } else {
  35343. var heightBelowTop = getOffsetHeight(el) + getElementTop(el) - getElementTop(container);
  35344. var offsetHeight = getOffsetHeight(container);
  35345. var borderBottom = Number.parseFloat(getStyleComputedProperty(container, 'borderBottomWidth'));
  35346. shouldTrigger = heightBelowTop - offsetHeight + borderBottom <= distance;
  35347. }
  35348. if (shouldTrigger && Object(types_["isFunction"])(cb)) {
  35349. cb.call(vm);
  35350. } else if (observer) {
  35351. observer.disconnect();
  35352. this[scope].observer = null;
  35353. }
  35354. };
  35355. /* harmony default export */ var infinite_scroll_src_main = ({
  35356. name: 'InfiniteScroll',
  35357. inserted: function inserted(el, binding, vnode) {
  35358. var cb = binding.value;
  35359. var vm = vnode.context;
  35360. // only include vertical scroll
  35361. var container = Object(dom_["getScrollContainer"])(el, true);
  35362. var _getScrollOptions2 = main_getScrollOptions(el, vm),
  35363. delay = _getScrollOptions2.delay,
  35364. immediate = _getScrollOptions2.immediate;
  35365. var onScroll = debounce_default()(delay, main_handleScroll.bind(el, cb));
  35366. el[scope] = { el: el, vm: vm, container: container, onScroll: onScroll };
  35367. if (container) {
  35368. container.addEventListener('scroll', onScroll);
  35369. if (immediate) {
  35370. var observer = el[scope].observer = new MutationObserver(onScroll);
  35371. observer.observe(container, { childList: true, subtree: true });
  35372. onScroll();
  35373. }
  35374. }
  35375. },
  35376. unbind: function unbind(el) {
  35377. var _el$scope = el[scope],
  35378. container = _el$scope.container,
  35379. onScroll = _el$scope.onScroll;
  35380. if (container) {
  35381. container.removeEventListener('scroll', onScroll);
  35382. }
  35383. }
  35384. });
  35385. // CONCATENATED MODULE: ./packages/infinite-scroll/index.js
  35386. /* istanbul ignore next */
  35387. infinite_scroll_src_main.install = function (Vue) {
  35388. Vue.directive(infinite_scroll_src_main.name, infinite_scroll_src_main);
  35389. };
  35390. /* harmony default export */ var infinite_scroll = (infinite_scroll_src_main);
  35391. // 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&
  35392. var mainvue_type_template_id_5070954c_render = function() {
  35393. var _vm = this
  35394. var _h = _vm.$createElement
  35395. var _c = _vm._self._c || _h
  35396. return _c("div", { staticClass: "el-page-header" }, [
  35397. _c(
  35398. "div",
  35399. {
  35400. staticClass: "el-page-header__left",
  35401. on: {
  35402. click: function($event) {
  35403. _vm.$emit("back")
  35404. }
  35405. }
  35406. },
  35407. [
  35408. _c("i", { staticClass: "el-icon-back" }),
  35409. _c(
  35410. "div",
  35411. { staticClass: "el-page-header__title" },
  35412. [_vm._t("title", [_vm._v(_vm._s(_vm.title))])],
  35413. 2
  35414. )
  35415. ]
  35416. ),
  35417. _c(
  35418. "div",
  35419. { staticClass: "el-page-header__content" },
  35420. [_vm._t("content", [_vm._v(_vm._s(_vm.content))])],
  35421. 2
  35422. )
  35423. ])
  35424. }
  35425. var mainvue_type_template_id_5070954c_staticRenderFns = []
  35426. mainvue_type_template_id_5070954c_render._withStripped = true
  35427. // CONCATENATED MODULE: ./packages/page-header/src/main.vue?vue&type=template&id=5070954c&
  35428. // 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&
  35429. //
  35430. //
  35431. //
  35432. //
  35433. //
  35434. //
  35435. //
  35436. //
  35437. //
  35438. //
  35439. //
  35440. //
  35441. //
  35442. //
  35443. /* harmony default export */ var page_header_src_mainvue_type_script_lang_js_ = ({
  35444. name: 'ElPageHeader',
  35445. props: {
  35446. title: {
  35447. type: String,
  35448. default: function _default() {
  35449. return Object(lib_locale_["t"])('el.pageHeader.title');
  35450. }
  35451. },
  35452. content: String
  35453. }
  35454. });
  35455. // CONCATENATED MODULE: ./packages/page-header/src/main.vue?vue&type=script&lang=js&
  35456. /* harmony default export */ var packages_page_header_src_mainvue_type_script_lang_js_ = (page_header_src_mainvue_type_script_lang_js_);
  35457. // CONCATENATED MODULE: ./packages/page-header/src/main.vue
  35458. /* normalize component */
  35459. var page_header_src_main_component = normalizeComponent(
  35460. packages_page_header_src_mainvue_type_script_lang_js_,
  35461. mainvue_type_template_id_5070954c_render,
  35462. mainvue_type_template_id_5070954c_staticRenderFns,
  35463. false,
  35464. null,
  35465. null,
  35466. null
  35467. )
  35468. /* hot reload */
  35469. if (false) { var page_header_src_main_api; }
  35470. page_header_src_main_component.options.__file = "packages/page-header/src/main.vue"
  35471. /* harmony default export */ var page_header_src_main = (page_header_src_main_component.exports);
  35472. // CONCATENATED MODULE: ./packages/page-header/index.js
  35473. /* istanbul ignore next */
  35474. page_header_src_main.install = function (Vue) {
  35475. Vue.component(page_header_src_main.name, page_header_src_main);
  35476. };
  35477. /* harmony default export */ var page_header = (page_header_src_main);
  35478. // 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&
  35479. var cascader_panelvue_type_template_id_34932346_render = function() {
  35480. var _vm = this
  35481. var _h = _vm.$createElement
  35482. var _c = _vm._self._c || _h
  35483. return _c(
  35484. "div",
  35485. {
  35486. class: ["el-cascader-panel", _vm.border && "is-bordered"],
  35487. on: { keydown: _vm.handleKeyDown }
  35488. },
  35489. _vm._l(_vm.menus, function(menu, index) {
  35490. return _c("cascader-menu", {
  35491. key: index,
  35492. ref: "menu",
  35493. refInFor: true,
  35494. attrs: { index: index, nodes: menu }
  35495. })
  35496. }),
  35497. 1
  35498. )
  35499. }
  35500. var cascader_panelvue_type_template_id_34932346_staticRenderFns = []
  35501. cascader_panelvue_type_template_id_34932346_render._withStripped = true
  35502. // CONCATENATED MODULE: ./packages/cascader-panel/src/cascader-panel.vue?vue&type=template&id=34932346&
  35503. // EXTERNAL MODULE: external "element-ui/lib/radio"
  35504. var radio_ = __webpack_require__(44);
  35505. var radio_default = /*#__PURE__*/__webpack_require__.n(radio_);
  35506. // 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&
  35507. var stopPropagation = function stopPropagation(e) {
  35508. return e.stopPropagation();
  35509. };
  35510. /* harmony default export */ var cascader_nodevue_type_script_lang_js_ = ({
  35511. inject: ['panel'],
  35512. components: {
  35513. ElCheckbox: checkbox_default.a,
  35514. ElRadio: radio_default.a
  35515. },
  35516. props: {
  35517. node: {
  35518. required: true
  35519. },
  35520. nodeId: String
  35521. },
  35522. computed: {
  35523. config: function config() {
  35524. return this.panel.config;
  35525. },
  35526. isLeaf: function isLeaf() {
  35527. return this.node.isLeaf;
  35528. },
  35529. isDisabled: function isDisabled() {
  35530. return this.node.isDisabled;
  35531. },
  35532. checkedValue: function checkedValue() {
  35533. return this.panel.checkedValue;
  35534. },
  35535. isChecked: function isChecked() {
  35536. return this.node.isSameNode(this.checkedValue);
  35537. },
  35538. inActivePath: function inActivePath() {
  35539. return this.isInPath(this.panel.activePath);
  35540. },
  35541. inCheckedPath: function inCheckedPath() {
  35542. var _this = this;
  35543. if (!this.config.checkStrictly) return false;
  35544. return this.panel.checkedNodePaths.some(function (checkedPath) {
  35545. return _this.isInPath(checkedPath);
  35546. });
  35547. },
  35548. value: function value() {
  35549. return this.node.getValueByOption();
  35550. }
  35551. },
  35552. methods: {
  35553. handleExpand: function handleExpand() {
  35554. var _this2 = this;
  35555. var panel = this.panel,
  35556. node = this.node,
  35557. isDisabled = this.isDisabled,
  35558. config = this.config;
  35559. var multiple = config.multiple,
  35560. checkStrictly = config.checkStrictly;
  35561. if (!checkStrictly && isDisabled || node.loading) return;
  35562. if (config.lazy && !node.loaded) {
  35563. panel.lazyLoad(node, function () {
  35564. // do not use cached leaf value here, invoke this.isLeaf to get new value.
  35565. var isLeaf = _this2.isLeaf;
  35566. if (!isLeaf) _this2.handleExpand();
  35567. if (multiple) {
  35568. // if leaf sync checked state, else clear checked state
  35569. var checked = isLeaf ? node.checked : false;
  35570. _this2.handleMultiCheckChange(checked);
  35571. }
  35572. });
  35573. } else {
  35574. panel.handleExpand(node);
  35575. }
  35576. },
  35577. handleCheckChange: function handleCheckChange() {
  35578. var panel = this.panel,
  35579. value = this.value,
  35580. node = this.node;
  35581. panel.handleCheckChange(value);
  35582. panel.handleExpand(node);
  35583. },
  35584. handleMultiCheckChange: function handleMultiCheckChange(checked) {
  35585. this.node.doCheck(checked);
  35586. this.panel.calculateMultiCheckedValue();
  35587. },
  35588. isInPath: function isInPath(pathNodes) {
  35589. var node = this.node;
  35590. var selectedPathNode = pathNodes[node.level - 1] || {};
  35591. return selectedPathNode.uid === node.uid;
  35592. },
  35593. renderPrefix: function renderPrefix(h) {
  35594. var isLeaf = this.isLeaf,
  35595. isChecked = this.isChecked,
  35596. config = this.config;
  35597. var checkStrictly = config.checkStrictly,
  35598. multiple = config.multiple;
  35599. if (multiple) {
  35600. return this.renderCheckbox(h);
  35601. } else if (checkStrictly) {
  35602. return this.renderRadio(h);
  35603. } else if (isLeaf && isChecked) {
  35604. return this.renderCheckIcon(h);
  35605. }
  35606. return null;
  35607. },
  35608. renderPostfix: function renderPostfix(h) {
  35609. var node = this.node,
  35610. isLeaf = this.isLeaf;
  35611. if (node.loading) {
  35612. return this.renderLoadingIcon(h);
  35613. } else if (!isLeaf) {
  35614. return this.renderExpandIcon(h);
  35615. }
  35616. return null;
  35617. },
  35618. renderCheckbox: function renderCheckbox(h) {
  35619. var node = this.node,
  35620. config = this.config,
  35621. isDisabled = this.isDisabled;
  35622. var events = {
  35623. on: { change: this.handleMultiCheckChange },
  35624. nativeOn: {}
  35625. };
  35626. if (config.checkStrictly) {
  35627. // when every node is selectable, click event should not trigger expand event.
  35628. events.nativeOn.click = stopPropagation;
  35629. }
  35630. return h('el-checkbox', external_babel_helper_vue_jsx_merge_props_default()([{
  35631. attrs: {
  35632. value: node.checked,
  35633. indeterminate: node.indeterminate,
  35634. disabled: isDisabled
  35635. }
  35636. }, events]));
  35637. },
  35638. renderRadio: function renderRadio(h) {
  35639. var checkedValue = this.checkedValue,
  35640. value = this.value,
  35641. isDisabled = this.isDisabled;
  35642. // to keep same reference if value cause radio's checked state is calculated by reference comparision;
  35643. if (Object(util_["isEqual"])(value, checkedValue)) {
  35644. value = checkedValue;
  35645. }
  35646. return h(
  35647. 'el-radio',
  35648. {
  35649. attrs: {
  35650. value: checkedValue,
  35651. label: value,
  35652. disabled: isDisabled
  35653. },
  35654. on: {
  35655. 'change': this.handleCheckChange
  35656. },
  35657. nativeOn: {
  35658. 'click': stopPropagation
  35659. }
  35660. },
  35661. [h('span')]
  35662. );
  35663. },
  35664. renderCheckIcon: function renderCheckIcon(h) {
  35665. return h('i', { 'class': 'el-icon-check el-cascader-node__prefix' });
  35666. },
  35667. renderLoadingIcon: function renderLoadingIcon(h) {
  35668. return h('i', { 'class': 'el-icon-loading el-cascader-node__postfix' });
  35669. },
  35670. renderExpandIcon: function renderExpandIcon(h) {
  35671. return h('i', { 'class': 'el-icon-arrow-right el-cascader-node__postfix' });
  35672. },
  35673. renderContent: function renderContent(h) {
  35674. var panel = this.panel,
  35675. node = this.node;
  35676. var render = panel.renderLabelFn;
  35677. var vnode = render ? render({ node: node, data: node.data }) : null;
  35678. return h(
  35679. 'span',
  35680. { 'class': 'el-cascader-node__label' },
  35681. [vnode || node.label]
  35682. );
  35683. }
  35684. },
  35685. render: function render(h) {
  35686. var _this3 = this;
  35687. var inActivePath = this.inActivePath,
  35688. inCheckedPath = this.inCheckedPath,
  35689. isChecked = this.isChecked,
  35690. isLeaf = this.isLeaf,
  35691. isDisabled = this.isDisabled,
  35692. config = this.config,
  35693. nodeId = this.nodeId;
  35694. var expandTrigger = config.expandTrigger,
  35695. checkStrictly = config.checkStrictly,
  35696. multiple = config.multiple;
  35697. var disabled = !checkStrictly && isDisabled;
  35698. var events = { on: {} };
  35699. if (expandTrigger === 'click') {
  35700. events.on.click = this.handleExpand;
  35701. } else {
  35702. events.on.mouseenter = function (e) {
  35703. _this3.handleExpand();
  35704. _this3.$emit('expand', e);
  35705. };
  35706. events.on.focus = function (e) {
  35707. _this3.handleExpand();
  35708. _this3.$emit('expand', e);
  35709. };
  35710. }
  35711. if (isLeaf && !isDisabled && !checkStrictly && !multiple) {
  35712. events.on.click = this.handleCheckChange;
  35713. }
  35714. return h(
  35715. 'li',
  35716. external_babel_helper_vue_jsx_merge_props_default()([{
  35717. attrs: {
  35718. role: 'menuitem',
  35719. id: nodeId,
  35720. 'aria-expanded': inActivePath,
  35721. tabindex: disabled ? null : -1
  35722. },
  35723. 'class': {
  35724. 'el-cascader-node': true,
  35725. 'is-selectable': checkStrictly,
  35726. 'in-active-path': inActivePath,
  35727. 'in-checked-path': inCheckedPath,
  35728. 'is-active': isChecked,
  35729. 'is-disabled': disabled
  35730. }
  35731. }, events]),
  35732. [this.renderPrefix(h), this.renderContent(h), this.renderPostfix(h)]
  35733. );
  35734. }
  35735. });
  35736. // CONCATENATED MODULE: ./packages/cascader-panel/src/cascader-node.vue?vue&type=script&lang=js&
  35737. /* harmony default export */ var src_cascader_nodevue_type_script_lang_js_ = (cascader_nodevue_type_script_lang_js_);
  35738. // CONCATENATED MODULE: ./packages/cascader-panel/src/cascader-node.vue
  35739. var cascader_node_render, cascader_node_staticRenderFns
  35740. /* normalize component */
  35741. var cascader_node_component = normalizeComponent(
  35742. src_cascader_nodevue_type_script_lang_js_,
  35743. cascader_node_render,
  35744. cascader_node_staticRenderFns,
  35745. false,
  35746. null,
  35747. null,
  35748. null
  35749. )
  35750. /* hot reload */
  35751. if (false) { var cascader_node_api; }
  35752. cascader_node_component.options.__file = "packages/cascader-panel/src/cascader-node.vue"
  35753. /* harmony default export */ var cascader_node = (cascader_node_component.exports);
  35754. // 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&
  35755. /* harmony default export */ var cascader_menuvue_type_script_lang_js_ = ({
  35756. name: 'ElCascaderMenu',
  35757. mixins: [locale_default.a],
  35758. inject: ['panel'],
  35759. components: {
  35760. ElScrollbar: scrollbar_default.a,
  35761. CascaderNode: cascader_node
  35762. },
  35763. props: {
  35764. nodes: {
  35765. type: Array,
  35766. required: true
  35767. },
  35768. index: Number
  35769. },
  35770. data: function data() {
  35771. return {
  35772. activeNode: null,
  35773. hoverTimer: null,
  35774. id: Object(util_["generateId"])()
  35775. };
  35776. },
  35777. computed: {
  35778. isEmpty: function isEmpty() {
  35779. return !this.nodes.length;
  35780. },
  35781. menuId: function menuId() {
  35782. return 'cascader-menu-' + this.id + '-' + this.index;
  35783. }
  35784. },
  35785. methods: {
  35786. handleExpand: function handleExpand(e) {
  35787. this.activeNode = e.target;
  35788. },
  35789. handleMouseMove: function handleMouseMove(e) {
  35790. var activeNode = this.activeNode,
  35791. hoverTimer = this.hoverTimer;
  35792. var hoverZone = this.$refs.hoverZone;
  35793. if (!activeNode || !hoverZone) return;
  35794. if (activeNode.contains(e.target)) {
  35795. clearTimeout(hoverTimer);
  35796. var _$el$getBoundingClien = this.$el.getBoundingClientRect(),
  35797. left = _$el$getBoundingClien.left;
  35798. var startX = e.clientX - left;
  35799. var _$el = this.$el,
  35800. offsetWidth = _$el.offsetWidth,
  35801. offsetHeight = _$el.offsetHeight;
  35802. var top = activeNode.offsetTop;
  35803. var bottom = top + activeNode.offsetHeight;
  35804. 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 ';
  35805. } else if (!hoverTimer) {
  35806. this.hoverTimer = setTimeout(this.clearHoverZone, this.panel.config.hoverThreshold);
  35807. }
  35808. },
  35809. clearHoverZone: function clearHoverZone() {
  35810. var hoverZone = this.$refs.hoverZone;
  35811. if (!hoverZone) return;
  35812. hoverZone.innerHTML = '';
  35813. },
  35814. renderEmptyText: function renderEmptyText(h) {
  35815. return h(
  35816. 'div',
  35817. { 'class': 'el-cascader-menu__empty-text' },
  35818. [this.t('el.cascader.noData')]
  35819. );
  35820. },
  35821. renderNodeList: function renderNodeList(h) {
  35822. var menuId = this.menuId;
  35823. var isHoverMenu = this.panel.isHoverMenu;
  35824. var events = { on: {} };
  35825. if (isHoverMenu) {
  35826. events.on.expand = this.handleExpand;
  35827. }
  35828. var nodes = this.nodes.map(function (node, index) {
  35829. var hasChildren = node.hasChildren;
  35830. return h('cascader-node', external_babel_helper_vue_jsx_merge_props_default()([{
  35831. key: node.uid,
  35832. attrs: { node: node,
  35833. 'node-id': menuId + '-' + index,
  35834. 'aria-haspopup': hasChildren,
  35835. 'aria-owns': hasChildren ? menuId : null
  35836. }
  35837. }, events]));
  35838. });
  35839. return [].concat(nodes, [isHoverMenu ? h('svg', { ref: 'hoverZone', 'class': 'el-cascader-menu__hover-zone' }) : null]);
  35840. }
  35841. },
  35842. render: function render(h) {
  35843. var isEmpty = this.isEmpty,
  35844. menuId = this.menuId;
  35845. var events = { nativeOn: {} };
  35846. // optimize hover to expand experience (#8010)
  35847. if (this.panel.isHoverMenu) {
  35848. events.nativeOn.mousemove = this.handleMouseMove;
  35849. // events.nativeOn.mouseleave = this.clearHoverZone;
  35850. }
  35851. return h(
  35852. 'el-scrollbar',
  35853. external_babel_helper_vue_jsx_merge_props_default()([{
  35854. attrs: {
  35855. tag: 'ul',
  35856. role: 'menu',
  35857. id: menuId,
  35858. 'wrap-class': 'el-cascader-menu__wrap',
  35859. 'view-class': {
  35860. 'el-cascader-menu__list': true,
  35861. 'is-empty': isEmpty
  35862. }
  35863. },
  35864. 'class': 'el-cascader-menu' }, events]),
  35865. [isEmpty ? this.renderEmptyText(h) : this.renderNodeList(h)]
  35866. );
  35867. }
  35868. });
  35869. // CONCATENATED MODULE: ./packages/cascader-panel/src/cascader-menu.vue?vue&type=script&lang=js&
  35870. /* harmony default export */ var src_cascader_menuvue_type_script_lang_js_ = (cascader_menuvue_type_script_lang_js_);
  35871. // CONCATENATED MODULE: ./packages/cascader-panel/src/cascader-menu.vue
  35872. var cascader_menu_render, cascader_menu_staticRenderFns
  35873. /* normalize component */
  35874. var cascader_menu_component = normalizeComponent(
  35875. src_cascader_menuvue_type_script_lang_js_,
  35876. cascader_menu_render,
  35877. cascader_menu_staticRenderFns,
  35878. false,
  35879. null,
  35880. null,
  35881. null
  35882. )
  35883. /* hot reload */
  35884. if (false) { var cascader_menu_api; }
  35885. cascader_menu_component.options.__file = "packages/cascader-panel/src/cascader-menu.vue"
  35886. /* harmony default export */ var cascader_menu = (cascader_menu_component.exports);
  35887. // CONCATENATED MODULE: ./packages/cascader-panel/src/node.js
  35888. 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; }; }();
  35889. function src_node_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35890. var uid = 0;
  35891. var src_node_Node = function () {
  35892. function Node(data, config, parentNode) {
  35893. src_node_classCallCheck(this, Node);
  35894. this.data = data;
  35895. this.config = config;
  35896. this.parent = parentNode || null;
  35897. this.level = !this.parent ? 1 : this.parent.level + 1;
  35898. this.uid = uid++;
  35899. this.initState();
  35900. this.initChildren();
  35901. }
  35902. Node.prototype.initState = function initState() {
  35903. var _config = this.config,
  35904. valueKey = _config.value,
  35905. labelKey = _config.label;
  35906. this.value = this.data[valueKey];
  35907. this.label = this.data[labelKey];
  35908. this.pathNodes = this.calculatePathNodes();
  35909. this.path = this.pathNodes.map(function (node) {
  35910. return node.value;
  35911. });
  35912. this.pathLabels = this.pathNodes.map(function (node) {
  35913. return node.label;
  35914. });
  35915. // lazy load
  35916. this.loading = false;
  35917. this.loaded = false;
  35918. };
  35919. Node.prototype.initChildren = function initChildren() {
  35920. var _this = this;
  35921. var config = this.config;
  35922. var childrenKey = config.children;
  35923. var childrenData = this.data[childrenKey];
  35924. this.hasChildren = Array.isArray(childrenData);
  35925. this.children = (childrenData || []).map(function (child) {
  35926. return new Node(child, config, _this);
  35927. });
  35928. };
  35929. Node.prototype.calculatePathNodes = function calculatePathNodes() {
  35930. var nodes = [this];
  35931. var parent = this.parent;
  35932. while (parent) {
  35933. nodes.unshift(parent);
  35934. parent = parent.parent;
  35935. }
  35936. return nodes;
  35937. };
  35938. Node.prototype.getPath = function getPath() {
  35939. return this.path;
  35940. };
  35941. Node.prototype.getValue = function getValue() {
  35942. return this.value;
  35943. };
  35944. Node.prototype.getValueByOption = function getValueByOption() {
  35945. return this.config.emitPath ? this.getPath() : this.getValue();
  35946. };
  35947. Node.prototype.getText = function getText(allLevels, separator) {
  35948. return allLevels ? this.pathLabels.join(separator) : this.label;
  35949. };
  35950. Node.prototype.isSameNode = function isSameNode(checkedValue) {
  35951. var value = this.getValueByOption();
  35952. return this.config.multiple && Array.isArray(checkedValue) ? checkedValue.some(function (val) {
  35953. return Object(util_["isEqual"])(val, value);
  35954. }) : Object(util_["isEqual"])(checkedValue, value);
  35955. };
  35956. Node.prototype.broadcast = function broadcast(event) {
  35957. for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  35958. args[_key - 1] = arguments[_key];
  35959. }
  35960. var handlerName = 'onParent' + Object(util_["capitalize"])(event);
  35961. this.children.forEach(function (child) {
  35962. if (child) {
  35963. // bottom up
  35964. child.broadcast.apply(child, [event].concat(args));
  35965. child[handlerName] && child[handlerName].apply(child, args);
  35966. }
  35967. });
  35968. };
  35969. Node.prototype.emit = function emit(event) {
  35970. var parent = this.parent;
  35971. var handlerName = 'onChild' + Object(util_["capitalize"])(event);
  35972. if (parent) {
  35973. for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
  35974. args[_key2 - 1] = arguments[_key2];
  35975. }
  35976. parent[handlerName] && parent[handlerName].apply(parent, args);
  35977. parent.emit.apply(parent, [event].concat(args));
  35978. }
  35979. };
  35980. Node.prototype.onParentCheck = function onParentCheck(checked) {
  35981. if (!this.isDisabled) {
  35982. this.setCheckState(checked);
  35983. }
  35984. };
  35985. Node.prototype.onChildCheck = function onChildCheck() {
  35986. var children = this.children;
  35987. var validChildren = children.filter(function (child) {
  35988. return !child.isDisabled;
  35989. });
  35990. var checked = validChildren.length ? validChildren.every(function (child) {
  35991. return child.checked;
  35992. }) : false;
  35993. this.setCheckState(checked);
  35994. };
  35995. Node.prototype.setCheckState = function setCheckState(checked) {
  35996. var totalNum = this.children.length;
  35997. var checkedNum = this.children.reduce(function (c, p) {
  35998. var num = p.checked ? 1 : p.indeterminate ? 0.5 : 0;
  35999. return c + num;
  36000. }, 0);
  36001. this.checked = checked;
  36002. this.indeterminate = checkedNum !== totalNum && checkedNum > 0;
  36003. };
  36004. Node.prototype.syncCheckState = function syncCheckState(checkedValue) {
  36005. var value = this.getValueByOption();
  36006. var checked = this.isSameNode(checkedValue, value);
  36007. this.doCheck(checked);
  36008. };
  36009. Node.prototype.doCheck = function doCheck(checked) {
  36010. if (this.checked !== checked) {
  36011. if (this.config.checkStrictly) {
  36012. this.checked = checked;
  36013. } else {
  36014. // bottom up to unify the calculation of the indeterminate state
  36015. this.broadcast('check', checked);
  36016. this.setCheckState(checked);
  36017. this.emit('check');
  36018. }
  36019. }
  36020. };
  36021. node_createClass(Node, [{
  36022. key: 'isDisabled',
  36023. get: function get() {
  36024. var data = this.data,
  36025. parent = this.parent,
  36026. config = this.config;
  36027. var disabledKey = config.disabled;
  36028. var checkStrictly = config.checkStrictly;
  36029. return data[disabledKey] || !checkStrictly && parent && parent.isDisabled;
  36030. }
  36031. }, {
  36032. key: 'isLeaf',
  36033. get: function get() {
  36034. var data = this.data,
  36035. loaded = this.loaded,
  36036. hasChildren = this.hasChildren,
  36037. children = this.children;
  36038. var _config2 = this.config,
  36039. lazy = _config2.lazy,
  36040. leafKey = _config2.leaf;
  36041. if (lazy) {
  36042. var isLeaf = Object(shared_["isDef"])(data[leafKey]) ? data[leafKey] : loaded ? !children.length : false;
  36043. this.hasChildren = !isLeaf;
  36044. return isLeaf;
  36045. }
  36046. return !hasChildren;
  36047. }
  36048. }]);
  36049. return Node;
  36050. }();
  36051. /* harmony default export */ var src_node = (src_node_Node);
  36052. // CONCATENATED MODULE: ./packages/cascader-panel/src/store.js
  36053. function store_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36054. var flatNodes = function flatNodes(data, leafOnly) {
  36055. return data.reduce(function (res, node) {
  36056. if (node.isLeaf) {
  36057. res.push(node);
  36058. } else {
  36059. !leafOnly && res.push(node);
  36060. res = res.concat(flatNodes(node.children, leafOnly));
  36061. }
  36062. return res;
  36063. }, []);
  36064. };
  36065. var store_Store = function () {
  36066. function Store(data, config) {
  36067. store_classCallCheck(this, Store);
  36068. this.config = config;
  36069. this.initNodes(data);
  36070. }
  36071. Store.prototype.initNodes = function initNodes(data) {
  36072. var _this = this;
  36073. data = Object(util_["coerceTruthyValueToArray"])(data);
  36074. this.nodes = data.map(function (nodeData) {
  36075. return new src_node(nodeData, _this.config);
  36076. });
  36077. this.flattedNodes = this.getFlattedNodes(false, false);
  36078. this.leafNodes = this.getFlattedNodes(true, false);
  36079. };
  36080. Store.prototype.appendNode = function appendNode(nodeData, parentNode) {
  36081. var node = new src_node(nodeData, this.config, parentNode);
  36082. var children = parentNode ? parentNode.children : this.nodes;
  36083. children.push(node);
  36084. };
  36085. Store.prototype.appendNodes = function appendNodes(nodeDataList, parentNode) {
  36086. var _this2 = this;
  36087. nodeDataList = Object(util_["coerceTruthyValueToArray"])(nodeDataList);
  36088. nodeDataList.forEach(function (nodeData) {
  36089. return _this2.appendNode(nodeData, parentNode);
  36090. });
  36091. };
  36092. Store.prototype.getNodes = function getNodes() {
  36093. return this.nodes;
  36094. };
  36095. Store.prototype.getFlattedNodes = function getFlattedNodes(leafOnly) {
  36096. var cached = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  36097. var cachedNodes = leafOnly ? this.leafNodes : this.flattedNodes;
  36098. return cached ? cachedNodes : flatNodes(this.nodes, leafOnly);
  36099. };
  36100. Store.prototype.getNodeByValue = function getNodeByValue(value) {
  36101. var nodes = this.getFlattedNodes(false, !this.config.lazy).filter(function (node) {
  36102. return Object(util_["valueEquals"])(node.path, value) || node.value === value;
  36103. });
  36104. return nodes && nodes.length ? nodes[0] : null;
  36105. };
  36106. return Store;
  36107. }();
  36108. /* harmony default export */ var cascader_panel_src_store = (store_Store);
  36109. // 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&
  36110. 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; };
  36111. //
  36112. //
  36113. //
  36114. //
  36115. //
  36116. //
  36117. //
  36118. //
  36119. //
  36120. //
  36121. //
  36122. //
  36123. //
  36124. //
  36125. //
  36126. //
  36127. var cascader_panelvue_type_script_lang_js_KeyCode = aria_utils_default.a.keys;
  36128. var DefaultProps = {
  36129. expandTrigger: 'click', // or hover
  36130. multiple: false,
  36131. checkStrictly: false, // whether all nodes can be selected
  36132. emitPath: true, // wether to emit an array of all levels value in which node is located
  36133. lazy: false,
  36134. lazyLoad: util_["noop"],
  36135. value: 'value',
  36136. label: 'label',
  36137. children: 'children',
  36138. leaf: 'leaf',
  36139. disabled: 'disabled',
  36140. hoverThreshold: 500
  36141. };
  36142. var cascader_panelvue_type_script_lang_js_isLeaf = function isLeaf(el) {
  36143. return !el.getAttribute('aria-owns');
  36144. };
  36145. var getSibling = function getSibling(el, distance) {
  36146. var parentNode = el.parentNode;
  36147. if (parentNode) {
  36148. var siblings = parentNode.querySelectorAll('.el-cascader-node[tabindex="-1"]');
  36149. var index = Array.prototype.indexOf.call(siblings, el);
  36150. return siblings[index + distance] || null;
  36151. }
  36152. return null;
  36153. };
  36154. var getMenuIndex = function getMenuIndex(el, distance) {
  36155. if (!el) return;
  36156. var pieces = el.id.split('-');
  36157. return Number(pieces[pieces.length - 2]);
  36158. };
  36159. var focusNode = function focusNode(el) {
  36160. if (!el) return;
  36161. el.focus();
  36162. !cascader_panelvue_type_script_lang_js_isLeaf(el) && el.click();
  36163. };
  36164. var checkNode = function checkNode(el) {
  36165. if (!el) return;
  36166. var input = el.querySelector('input');
  36167. if (input) {
  36168. input.click();
  36169. } else if (cascader_panelvue_type_script_lang_js_isLeaf(el)) {
  36170. el.click();
  36171. }
  36172. };
  36173. /* harmony default export */ var cascader_panelvue_type_script_lang_js_ = ({
  36174. name: 'ElCascaderPanel',
  36175. components: {
  36176. CascaderMenu: cascader_menu
  36177. },
  36178. props: {
  36179. value: {},
  36180. options: Array,
  36181. props: Object,
  36182. border: {
  36183. type: Boolean,
  36184. default: true
  36185. },
  36186. renderLabel: Function
  36187. },
  36188. provide: function provide() {
  36189. return {
  36190. panel: this
  36191. };
  36192. },
  36193. data: function data() {
  36194. return {
  36195. checkedValue: null,
  36196. checkedNodePaths: [],
  36197. store: [],
  36198. menus: [],
  36199. activePath: [],
  36200. loadCount: 0
  36201. };
  36202. },
  36203. computed: {
  36204. config: function config() {
  36205. return merge_default()(cascader_panelvue_type_script_lang_js_extends({}, DefaultProps), this.props || {});
  36206. },
  36207. multiple: function multiple() {
  36208. return this.config.multiple;
  36209. },
  36210. checkStrictly: function checkStrictly() {
  36211. return this.config.checkStrictly;
  36212. },
  36213. leafOnly: function leafOnly() {
  36214. return !this.checkStrictly;
  36215. },
  36216. isHoverMenu: function isHoverMenu() {
  36217. return this.config.expandTrigger === 'hover';
  36218. },
  36219. renderLabelFn: function renderLabelFn() {
  36220. return this.renderLabel || this.$scopedSlots.default;
  36221. }
  36222. },
  36223. watch: {
  36224. value: function value() {
  36225. this.syncCheckedValue();
  36226. this.checkStrictly && this.calculateCheckedNodePaths();
  36227. },
  36228. options: {
  36229. handler: function handler() {
  36230. this.initStore();
  36231. },
  36232. immediate: true,
  36233. deep: true
  36234. },
  36235. checkedValue: function checkedValue(val) {
  36236. if (!Object(util_["isEqual"])(val, this.value)) {
  36237. this.checkStrictly && this.calculateCheckedNodePaths();
  36238. this.$emit('input', val);
  36239. this.$emit('change', val);
  36240. }
  36241. }
  36242. },
  36243. mounted: function mounted() {
  36244. if (!this.isEmptyValue(this.value)) {
  36245. this.syncCheckedValue();
  36246. }
  36247. },
  36248. methods: {
  36249. initStore: function initStore() {
  36250. var config = this.config,
  36251. options = this.options;
  36252. if (config.lazy && Object(util_["isEmpty"])(options)) {
  36253. this.lazyLoad();
  36254. } else {
  36255. this.store = new cascader_panel_src_store(options, config);
  36256. this.menus = [this.store.getNodes()];
  36257. this.syncMenuState();
  36258. }
  36259. },
  36260. syncCheckedValue: function syncCheckedValue() {
  36261. var value = this.value,
  36262. checkedValue = this.checkedValue;
  36263. if (!Object(util_["isEqual"])(value, checkedValue)) {
  36264. this.activePath = [];
  36265. this.checkedValue = value;
  36266. this.syncMenuState();
  36267. }
  36268. },
  36269. syncMenuState: function syncMenuState() {
  36270. var multiple = this.multiple,
  36271. checkStrictly = this.checkStrictly;
  36272. this.syncActivePath();
  36273. multiple && this.syncMultiCheckState();
  36274. checkStrictly && this.calculateCheckedNodePaths();
  36275. this.$nextTick(this.scrollIntoView);
  36276. },
  36277. syncMultiCheckState: function syncMultiCheckState() {
  36278. var _this = this;
  36279. var nodes = this.getFlattedNodes(this.leafOnly);
  36280. nodes.forEach(function (node) {
  36281. node.syncCheckState(_this.checkedValue);
  36282. });
  36283. },
  36284. isEmptyValue: function isEmptyValue(val) {
  36285. var multiple = this.multiple,
  36286. config = this.config;
  36287. var emitPath = config.emitPath;
  36288. if (multiple || emitPath) {
  36289. return Object(util_["isEmpty"])(val);
  36290. }
  36291. return false;
  36292. },
  36293. syncActivePath: function syncActivePath() {
  36294. var _this2 = this;
  36295. var store = this.store,
  36296. multiple = this.multiple,
  36297. activePath = this.activePath,
  36298. checkedValue = this.checkedValue;
  36299. if (!Object(util_["isEmpty"])(activePath)) {
  36300. var nodes = activePath.map(function (node) {
  36301. return _this2.getNodeByValue(node.getValue());
  36302. });
  36303. this.expandNodes(nodes);
  36304. } else if (!this.isEmptyValue(checkedValue)) {
  36305. var value = multiple ? checkedValue[0] : checkedValue;
  36306. var checkedNode = this.getNodeByValue(value) || {};
  36307. var _nodes = (checkedNode.pathNodes || []).slice(0, -1);
  36308. this.expandNodes(_nodes);
  36309. } else {
  36310. this.activePath = [];
  36311. this.menus = [store.getNodes()];
  36312. }
  36313. },
  36314. expandNodes: function expandNodes(nodes) {
  36315. var _this3 = this;
  36316. nodes.forEach(function (node) {
  36317. return _this3.handleExpand(node, true /* silent */);
  36318. });
  36319. },
  36320. calculateCheckedNodePaths: function calculateCheckedNodePaths() {
  36321. var _this4 = this;
  36322. var checkedValue = this.checkedValue,
  36323. multiple = this.multiple;
  36324. var checkedValues = multiple ? Object(util_["coerceTruthyValueToArray"])(checkedValue) : [checkedValue];
  36325. this.checkedNodePaths = checkedValues.map(function (v) {
  36326. var checkedNode = _this4.getNodeByValue(v);
  36327. return checkedNode ? checkedNode.pathNodes : [];
  36328. });
  36329. },
  36330. handleKeyDown: function handleKeyDown(e) {
  36331. var target = e.target,
  36332. keyCode = e.keyCode;
  36333. switch (keyCode) {
  36334. case cascader_panelvue_type_script_lang_js_KeyCode.up:
  36335. var prev = getSibling(target, -1);
  36336. focusNode(prev);
  36337. break;
  36338. case cascader_panelvue_type_script_lang_js_KeyCode.down:
  36339. var next = getSibling(target, 1);
  36340. focusNode(next);
  36341. break;
  36342. case cascader_panelvue_type_script_lang_js_KeyCode.left:
  36343. var preMenu = this.$refs.menu[getMenuIndex(target) - 1];
  36344. if (preMenu) {
  36345. var expandedNode = preMenu.$el.querySelector('.el-cascader-node[aria-expanded="true"]');
  36346. focusNode(expandedNode);
  36347. }
  36348. break;
  36349. case cascader_panelvue_type_script_lang_js_KeyCode.right:
  36350. var nextMenu = this.$refs.menu[getMenuIndex(target) + 1];
  36351. if (nextMenu) {
  36352. var firstNode = nextMenu.$el.querySelector('.el-cascader-node[tabindex="-1"]');
  36353. focusNode(firstNode);
  36354. }
  36355. break;
  36356. case cascader_panelvue_type_script_lang_js_KeyCode.enter:
  36357. checkNode(target);
  36358. break;
  36359. case cascader_panelvue_type_script_lang_js_KeyCode.esc:
  36360. case cascader_panelvue_type_script_lang_js_KeyCode.tab:
  36361. this.$emit('close');
  36362. break;
  36363. default:
  36364. return;
  36365. }
  36366. },
  36367. handleExpand: function handleExpand(node, silent) {
  36368. var activePath = this.activePath;
  36369. var level = node.level;
  36370. var path = activePath.slice(0, level - 1);
  36371. var menus = this.menus.slice(0, level);
  36372. if (!node.isLeaf) {
  36373. path.push(node);
  36374. menus.push(node.children);
  36375. }
  36376. this.activePath = path;
  36377. this.menus = menus;
  36378. if (!silent) {
  36379. var pathValues = path.map(function (node) {
  36380. return node.getValue();
  36381. });
  36382. var activePathValues = activePath.map(function (node) {
  36383. return node.getValue();
  36384. });
  36385. if (!Object(util_["valueEquals"])(pathValues, activePathValues)) {
  36386. this.$emit('active-item-change', pathValues); // Deprecated
  36387. this.$emit('expand-change', pathValues);
  36388. }
  36389. }
  36390. },
  36391. handleCheckChange: function handleCheckChange(value) {
  36392. this.checkedValue = value;
  36393. },
  36394. lazyLoad: function lazyLoad(node, onFullfiled) {
  36395. var _this5 = this;
  36396. var config = this.config;
  36397. if (!node) {
  36398. node = node || { root: true, level: 0 };
  36399. this.store = new cascader_panel_src_store([], config);
  36400. this.menus = [this.store.getNodes()];
  36401. }
  36402. node.loading = true;
  36403. var resolve = function resolve(dataList) {
  36404. var parent = node.root ? null : node;
  36405. dataList && dataList.length && _this5.store.appendNodes(dataList, parent);
  36406. node.loading = false;
  36407. node.loaded = true;
  36408. // dispose default value on lazy load mode
  36409. if (Array.isArray(_this5.checkedValue)) {
  36410. var nodeValue = _this5.checkedValue[_this5.loadCount++];
  36411. var valueKey = _this5.config.value;
  36412. var leafKey = _this5.config.leaf;
  36413. if (Array.isArray(dataList) && dataList.filter(function (item) {
  36414. return item[valueKey] === nodeValue;
  36415. }).length > 0) {
  36416. var checkedNode = _this5.store.getNodeByValue(nodeValue);
  36417. if (!checkedNode.data[leafKey]) {
  36418. _this5.lazyLoad(checkedNode, function () {
  36419. _this5.handleExpand(checkedNode);
  36420. });
  36421. }
  36422. if (_this5.loadCount === _this5.checkedValue.length) {
  36423. _this5.$parent.computePresentText();
  36424. }
  36425. }
  36426. }
  36427. onFullfiled && onFullfiled(dataList);
  36428. };
  36429. config.lazyLoad(node, resolve);
  36430. },
  36431. /**
  36432. * public methods
  36433. */
  36434. calculateMultiCheckedValue: function calculateMultiCheckedValue() {
  36435. this.checkedValue = this.getCheckedNodes(this.leafOnly).map(function (node) {
  36436. return node.getValueByOption();
  36437. });
  36438. },
  36439. scrollIntoView: function scrollIntoView() {
  36440. if (this.$isServer) return;
  36441. var menus = this.$refs.menu || [];
  36442. menus.forEach(function (menu) {
  36443. var menuElement = menu.$el;
  36444. if (menuElement) {
  36445. var container = menuElement.querySelector('.el-scrollbar__wrap');
  36446. var activeNode = menuElement.querySelector('.el-cascader-node.is-active') || menuElement.querySelector('.el-cascader-node.in-active-path');
  36447. scroll_into_view_default()(container, activeNode);
  36448. }
  36449. });
  36450. },
  36451. getNodeByValue: function getNodeByValue(val) {
  36452. return this.store.getNodeByValue(val);
  36453. },
  36454. getFlattedNodes: function getFlattedNodes(leafOnly) {
  36455. var cached = !this.config.lazy;
  36456. return this.store.getFlattedNodes(leafOnly, cached);
  36457. },
  36458. getCheckedNodes: function getCheckedNodes(leafOnly) {
  36459. var checkedValue = this.checkedValue,
  36460. multiple = this.multiple;
  36461. if (multiple) {
  36462. var nodes = this.getFlattedNodes(leafOnly);
  36463. return nodes.filter(function (node) {
  36464. return node.checked;
  36465. });
  36466. } else {
  36467. return this.isEmptyValue(checkedValue) ? [] : [this.getNodeByValue(checkedValue)];
  36468. }
  36469. },
  36470. clearCheckedNodes: function clearCheckedNodes() {
  36471. var config = this.config,
  36472. leafOnly = this.leafOnly;
  36473. var multiple = config.multiple,
  36474. emitPath = config.emitPath;
  36475. if (multiple) {
  36476. this.getCheckedNodes(leafOnly).filter(function (node) {
  36477. return !node.isDisabled;
  36478. }).forEach(function (node) {
  36479. return node.doCheck(false);
  36480. });
  36481. this.calculateMultiCheckedValue();
  36482. } else {
  36483. this.checkedValue = emitPath ? [] : null;
  36484. }
  36485. }
  36486. }
  36487. });
  36488. // CONCATENATED MODULE: ./packages/cascader-panel/src/cascader-panel.vue?vue&type=script&lang=js&
  36489. /* harmony default export */ var src_cascader_panelvue_type_script_lang_js_ = (cascader_panelvue_type_script_lang_js_);
  36490. // CONCATENATED MODULE: ./packages/cascader-panel/src/cascader-panel.vue
  36491. /* normalize component */
  36492. var cascader_panel_component = normalizeComponent(
  36493. src_cascader_panelvue_type_script_lang_js_,
  36494. cascader_panelvue_type_template_id_34932346_render,
  36495. cascader_panelvue_type_template_id_34932346_staticRenderFns,
  36496. false,
  36497. null,
  36498. null,
  36499. null
  36500. )
  36501. /* hot reload */
  36502. if (false) { var cascader_panel_api; }
  36503. cascader_panel_component.options.__file = "packages/cascader-panel/src/cascader-panel.vue"
  36504. /* harmony default export */ var cascader_panel = (cascader_panel_component.exports);
  36505. // CONCATENATED MODULE: ./packages/cascader-panel/index.js
  36506. /* istanbul ignore next */
  36507. cascader_panel.install = function (Vue) {
  36508. Vue.component(cascader_panel.name, cascader_panel);
  36509. };
  36510. /* harmony default export */ var packages_cascader_panel = (cascader_panel);
  36511. // 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&
  36512. /* harmony default export */ var avatar_src_mainvue_type_script_lang_js_ = ({
  36513. name: 'ElAvatar',
  36514. props: {
  36515. size: {
  36516. type: [Number, String],
  36517. validator: function validator(val) {
  36518. if (typeof val === 'string') {
  36519. return ['large', 'medium', 'small'].includes(val);
  36520. }
  36521. return typeof val === 'number';
  36522. }
  36523. },
  36524. shape: {
  36525. type: String,
  36526. default: 'circle',
  36527. validator: function validator(val) {
  36528. return ['circle', 'square'].includes(val);
  36529. }
  36530. },
  36531. icon: String,
  36532. src: String,
  36533. alt: String,
  36534. srcSet: String,
  36535. error: Function,
  36536. fit: {
  36537. type: String,
  36538. default: 'cover'
  36539. }
  36540. },
  36541. data: function data() {
  36542. return {
  36543. isImageExist: true
  36544. };
  36545. },
  36546. computed: {
  36547. avatarClass: function avatarClass() {
  36548. var size = this.size,
  36549. icon = this.icon,
  36550. shape = this.shape;
  36551. var classList = ['el-avatar'];
  36552. if (size && typeof size === 'string') {
  36553. classList.push('el-avatar--' + size);
  36554. }
  36555. if (icon) {
  36556. classList.push('el-avatar--icon');
  36557. }
  36558. if (shape) {
  36559. classList.push('el-avatar--' + shape);
  36560. }
  36561. return classList.join(' ');
  36562. }
  36563. },
  36564. methods: {
  36565. handleError: function handleError() {
  36566. var error = this.error;
  36567. var errorFlag = error ? error() : undefined;
  36568. if (errorFlag !== false) {
  36569. this.isImageExist = false;
  36570. }
  36571. },
  36572. renderAvatar: function renderAvatar() {
  36573. var h = this.$createElement;
  36574. var icon = this.icon,
  36575. src = this.src,
  36576. alt = this.alt,
  36577. isImageExist = this.isImageExist,
  36578. srcSet = this.srcSet,
  36579. fit = this.fit;
  36580. if (isImageExist && src) {
  36581. return h('img', {
  36582. attrs: {
  36583. src: src,
  36584. alt: alt,
  36585. srcSet: srcSet
  36586. },
  36587. on: {
  36588. 'error': this.handleError
  36589. },
  36590. style: { 'object-fit': fit } });
  36591. }
  36592. if (icon) {
  36593. return h('i', { 'class': icon });
  36594. }
  36595. return this.$slots.default;
  36596. }
  36597. },
  36598. render: function render() {
  36599. var h = arguments[0];
  36600. var avatarClass = this.avatarClass,
  36601. size = this.size;
  36602. var sizeStyle = typeof size === 'number' ? {
  36603. height: size + 'px',
  36604. width: size + 'px',
  36605. lineHeight: size + 'px'
  36606. } : {};
  36607. return h(
  36608. 'span',
  36609. { 'class': avatarClass, style: sizeStyle },
  36610. [this.renderAvatar()]
  36611. );
  36612. }
  36613. });
  36614. // CONCATENATED MODULE: ./packages/avatar/src/main.vue?vue&type=script&lang=js&
  36615. /* harmony default export */ var packages_avatar_src_mainvue_type_script_lang_js_ = (avatar_src_mainvue_type_script_lang_js_);
  36616. // CONCATENATED MODULE: ./packages/avatar/src/main.vue
  36617. var src_main_render, src_main_staticRenderFns
  36618. /* normalize component */
  36619. var avatar_src_main_component = normalizeComponent(
  36620. packages_avatar_src_mainvue_type_script_lang_js_,
  36621. src_main_render,
  36622. src_main_staticRenderFns,
  36623. false,
  36624. null,
  36625. null,
  36626. null
  36627. )
  36628. /* hot reload */
  36629. if (false) { var avatar_src_main_api; }
  36630. avatar_src_main_component.options.__file = "packages/avatar/src/main.vue"
  36631. /* harmony default export */ var avatar_src_main = (avatar_src_main_component.exports);
  36632. // CONCATENATED MODULE: ./packages/avatar/index.js
  36633. /* istanbul ignore next */
  36634. avatar_src_main.install = function (Vue) {
  36635. Vue.component(avatar_src_main.name, avatar_src_main);
  36636. };
  36637. /* harmony default export */ var avatar = (avatar_src_main);
  36638. // 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&
  36639. var mainvue_type_template_id_a4885264_render = function() {
  36640. var _vm = this
  36641. var _h = _vm.$createElement
  36642. var _c = _vm._self._c || _h
  36643. return _c(
  36644. "transition",
  36645. {
  36646. attrs: { name: "el-drawer-fade" },
  36647. on: { "after-enter": _vm.afterEnter, "after-leave": _vm.afterLeave }
  36648. },
  36649. [
  36650. _c(
  36651. "div",
  36652. {
  36653. directives: [
  36654. {
  36655. name: "show",
  36656. rawName: "v-show",
  36657. value: _vm.visible,
  36658. expression: "visible"
  36659. }
  36660. ],
  36661. staticClass: "el-drawer__wrapper",
  36662. attrs: { tabindex: "-1" }
  36663. },
  36664. [
  36665. _c(
  36666. "div",
  36667. {
  36668. staticClass: "el-drawer__container",
  36669. class: _vm.visible && "el-drawer__open",
  36670. attrs: { role: "document", tabindex: "-1" },
  36671. on: {
  36672. click: function($event) {
  36673. if ($event.target !== $event.currentTarget) {
  36674. return null
  36675. }
  36676. return _vm.handleWrapperClick($event)
  36677. }
  36678. }
  36679. },
  36680. [
  36681. _c(
  36682. "div",
  36683. {
  36684. ref: "drawer",
  36685. staticClass: "el-drawer",
  36686. class: [_vm.direction, _vm.customClass],
  36687. style: _vm.isHorizontal
  36688. ? "width: " + _vm.drawerSize
  36689. : "height: " + _vm.drawerSize,
  36690. attrs: {
  36691. "aria-modal": "true",
  36692. "aria-labelledby": "el-drawer__title",
  36693. "aria-label": _vm.title,
  36694. role: "dialog",
  36695. tabindex: "-1"
  36696. }
  36697. },
  36698. [
  36699. _vm.withHeader
  36700. ? _c(
  36701. "header",
  36702. {
  36703. staticClass: "el-drawer__header",
  36704. attrs: { id: "el-drawer__title" }
  36705. },
  36706. [
  36707. _vm._t("title", [
  36708. _c(
  36709. "span",
  36710. { attrs: { role: "heading", title: _vm.title } },
  36711. [_vm._v(_vm._s(_vm.title))]
  36712. )
  36713. ]),
  36714. _vm.showClose
  36715. ? _c(
  36716. "button",
  36717. {
  36718. staticClass: "el-drawer__close-btn",
  36719. attrs: {
  36720. "aria-label":
  36721. "close " + (_vm.title || "drawer"),
  36722. type: "button"
  36723. },
  36724. on: { click: _vm.closeDrawer }
  36725. },
  36726. [
  36727. _c("i", {
  36728. staticClass:
  36729. "el-dialog__close el-icon el-icon-close"
  36730. })
  36731. ]
  36732. )
  36733. : _vm._e()
  36734. ],
  36735. 2
  36736. )
  36737. : _vm._e(),
  36738. _vm.rendered
  36739. ? _c(
  36740. "section",
  36741. { staticClass: "el-drawer__body" },
  36742. [_vm._t("default")],
  36743. 2
  36744. )
  36745. : _vm._e()
  36746. ]
  36747. )
  36748. ]
  36749. )
  36750. ]
  36751. )
  36752. ]
  36753. )
  36754. }
  36755. var mainvue_type_template_id_a4885264_staticRenderFns = []
  36756. mainvue_type_template_id_a4885264_render._withStripped = true
  36757. // CONCATENATED MODULE: ./packages/drawer/src/main.vue?vue&type=template&id=a4885264&
  36758. // 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&
  36759. //
  36760. //
  36761. //
  36762. //
  36763. //
  36764. //
  36765. //
  36766. //
  36767. //
  36768. //
  36769. //
  36770. //
  36771. //
  36772. //
  36773. //
  36774. //
  36775. //
  36776. //
  36777. //
  36778. //
  36779. //
  36780. //
  36781. //
  36782. //
  36783. //
  36784. //
  36785. //
  36786. //
  36787. //
  36788. //
  36789. //
  36790. //
  36791. //
  36792. //
  36793. //
  36794. //
  36795. //
  36796. //
  36797. //
  36798. //
  36799. //
  36800. //
  36801. //
  36802. //
  36803. //
  36804. //
  36805. //
  36806. //
  36807. /* harmony default export */ var drawer_src_mainvue_type_script_lang_js_ = ({
  36808. name: 'ElDrawer',
  36809. mixins: [popup_default.a, emitter_default.a],
  36810. props: {
  36811. appendToBody: {
  36812. type: Boolean,
  36813. default: false
  36814. },
  36815. beforeClose: {
  36816. type: Function
  36817. },
  36818. customClass: {
  36819. type: String,
  36820. default: ''
  36821. },
  36822. closeOnPressEscape: {
  36823. type: Boolean,
  36824. default: true
  36825. },
  36826. destroyOnClose: {
  36827. type: Boolean,
  36828. default: false
  36829. },
  36830. modal: {
  36831. type: Boolean,
  36832. default: true
  36833. },
  36834. direction: {
  36835. type: String,
  36836. default: 'rtl',
  36837. validator: function validator(val) {
  36838. return ['ltr', 'rtl', 'ttb', 'btt'].indexOf(val) !== -1;
  36839. }
  36840. },
  36841. modalAppendToBody: {
  36842. type: Boolean,
  36843. default: true
  36844. },
  36845. showClose: {
  36846. type: Boolean,
  36847. default: true
  36848. },
  36849. size: {
  36850. type: [Number, String],
  36851. default: '30%'
  36852. },
  36853. title: {
  36854. type: String,
  36855. default: ''
  36856. },
  36857. visible: {
  36858. type: Boolean
  36859. },
  36860. wrapperClosable: {
  36861. type: Boolean,
  36862. default: true
  36863. },
  36864. withHeader: {
  36865. type: Boolean,
  36866. default: true
  36867. }
  36868. },
  36869. computed: {
  36870. isHorizontal: function isHorizontal() {
  36871. return this.direction === 'rtl' || this.direction === 'ltr';
  36872. },
  36873. drawerSize: function drawerSize() {
  36874. return typeof this.size === 'number' ? this.size + 'px' : this.size;
  36875. }
  36876. },
  36877. data: function data() {
  36878. return {
  36879. closed: false,
  36880. prevActiveElement: null
  36881. };
  36882. },
  36883. watch: {
  36884. visible: function visible(val) {
  36885. var _this = this;
  36886. if (val) {
  36887. this.closed = false;
  36888. this.$emit('open');
  36889. if (this.appendToBody) {
  36890. document.body.appendChild(this.$el);
  36891. }
  36892. this.prevActiveElement = document.activeElement;
  36893. } else {
  36894. if (!this.closed) {
  36895. this.$emit('close');
  36896. if (this.destroyOnClose === true) {
  36897. this.rendered = false;
  36898. }
  36899. }
  36900. this.$nextTick(function () {
  36901. if (_this.prevActiveElement) {
  36902. _this.prevActiveElement.focus();
  36903. }
  36904. });
  36905. }
  36906. }
  36907. },
  36908. methods: {
  36909. afterEnter: function afterEnter() {
  36910. this.$emit('opened');
  36911. },
  36912. afterLeave: function afterLeave() {
  36913. this.$emit('closed');
  36914. },
  36915. hide: function hide(cancel) {
  36916. if (cancel !== false) {
  36917. this.$emit('update:visible', false);
  36918. this.$emit('close');
  36919. if (this.destroyOnClose === true) {
  36920. this.rendered = false;
  36921. }
  36922. this.closed = true;
  36923. }
  36924. },
  36925. handleWrapperClick: function handleWrapperClick() {
  36926. if (this.wrapperClosable) {
  36927. this.closeDrawer();
  36928. }
  36929. },
  36930. closeDrawer: function closeDrawer() {
  36931. if (typeof this.beforeClose === 'function') {
  36932. this.beforeClose(this.hide);
  36933. } else {
  36934. this.hide();
  36935. }
  36936. },
  36937. handleClose: function handleClose() {
  36938. // This method here will be called by PopupManger, when the `closeOnPressEscape` was set to true
  36939. // pressing `ESC` will call this method, and also close the drawer.
  36940. // This method also calls `beforeClose` if there was one.
  36941. this.closeDrawer();
  36942. }
  36943. },
  36944. mounted: function mounted() {
  36945. if (this.visible) {
  36946. this.rendered = true;
  36947. this.open();
  36948. if (this.appendToBody) {
  36949. document.body.appendChild(this.$el);
  36950. }
  36951. }
  36952. },
  36953. destroyed: function destroyed() {
  36954. // if appendToBody is true, remove DOM node after destroy
  36955. if (this.appendToBody && this.$el && this.$el.parentNode) {
  36956. this.$el.parentNode.removeChild(this.$el);
  36957. }
  36958. }
  36959. });
  36960. // CONCATENATED MODULE: ./packages/drawer/src/main.vue?vue&type=script&lang=js&
  36961. /* harmony default export */ var packages_drawer_src_mainvue_type_script_lang_js_ = (drawer_src_mainvue_type_script_lang_js_);
  36962. // CONCATENATED MODULE: ./packages/drawer/src/main.vue
  36963. /* normalize component */
  36964. var drawer_src_main_component = normalizeComponent(
  36965. packages_drawer_src_mainvue_type_script_lang_js_,
  36966. mainvue_type_template_id_a4885264_render,
  36967. mainvue_type_template_id_a4885264_staticRenderFns,
  36968. false,
  36969. null,
  36970. null,
  36971. null
  36972. )
  36973. /* hot reload */
  36974. if (false) { var drawer_src_main_api; }
  36975. drawer_src_main_component.options.__file = "packages/drawer/src/main.vue"
  36976. /* harmony default export */ var drawer_src_main = (drawer_src_main_component.exports);
  36977. // CONCATENATED MODULE: ./packages/drawer/index.js
  36978. /* istanbul ignore next */
  36979. drawer_src_main.install = function (Vue) {
  36980. Vue.component(drawer_src_main.name, drawer_src_main);
  36981. };
  36982. /* harmony default export */ var drawer = (drawer_src_main);
  36983. // 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&
  36984. var mainvue_type_template_id_76339aa7_render = function() {
  36985. var _vm = this
  36986. var _h = _vm.$createElement
  36987. var _c = _vm._self._c || _h
  36988. return _c("div", { staticClass: "el-statistic" }, [
  36989. _vm.title || _vm.$slots.title
  36990. ? _c(
  36991. "div",
  36992. { staticClass: "head" },
  36993. [
  36994. _vm._t("title", [
  36995. _c("span", { staticClass: "title" }, [
  36996. _vm._v("\n " + _vm._s(_vm.title) + "\n ")
  36997. ])
  36998. ])
  36999. ],
  37000. 2
  37001. )
  37002. : _vm._e(),
  37003. _c("div", { staticClass: "con" }, [
  37004. _vm.prefix || _vm.$slots.prefix
  37005. ? _c(
  37006. "span",
  37007. { staticClass: "prefix" },
  37008. [
  37009. _vm._t("prefix", [
  37010. _vm._v("\n " + _vm._s(_vm.prefix) + "\n ")
  37011. ])
  37012. ],
  37013. 2
  37014. )
  37015. : _vm._e(),
  37016. _c(
  37017. "span",
  37018. { staticClass: "number", style: _vm.valueStyle },
  37019. [_vm._t("formatter", [_vm._v(" " + _vm._s(_vm.disposeValue))])],
  37020. 2
  37021. ),
  37022. _vm.suffix || _vm.$slots.suffix
  37023. ? _c(
  37024. "span",
  37025. { staticClass: "suffix" },
  37026. [
  37027. _vm._t("suffix", [
  37028. _vm._v("\n " + _vm._s(_vm.suffix) + "\n ")
  37029. ])
  37030. ],
  37031. 2
  37032. )
  37033. : _vm._e()
  37034. ])
  37035. ])
  37036. }
  37037. var mainvue_type_template_id_76339aa7_staticRenderFns = []
  37038. mainvue_type_template_id_76339aa7_render._withStripped = true
  37039. // CONCATENATED MODULE: ./packages/statistic/src/main.vue?vue&type=template&id=76339aa7&
  37040. // EXTERNAL MODULE: external "element-ui/lib/utils/lodash"
  37041. var lodash_ = __webpack_require__(28);
  37042. // 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&
  37043. //
  37044. //
  37045. //
  37046. //
  37047. //
  37048. //
  37049. //
  37050. //
  37051. //
  37052. //
  37053. //
  37054. //
  37055. //
  37056. //
  37057. //
  37058. //
  37059. //
  37060. //
  37061. //
  37062. //
  37063. //
  37064. //
  37065. //
  37066. //
  37067. //
  37068. //
  37069. //
  37070. /* harmony default export */ var statistic_src_mainvue_type_script_lang_js_ = ({
  37071. name: 'ElStatistic',
  37072. data: function data() {
  37073. return {
  37074. disposeValue: '',
  37075. timeTask: null,
  37076. REFRESH_INTERVAL: 1000 / 30
  37077. };
  37078. },
  37079. props: {
  37080. decimalSeparator: {
  37081. type: String,
  37082. default: '.'
  37083. },
  37084. groupSeparator: {
  37085. type: String,
  37086. default: ''
  37087. },
  37088. precision: {
  37089. type: Number,
  37090. default: null
  37091. },
  37092. value: {
  37093. type: [String, Number],
  37094. default: ''
  37095. },
  37096. prefix: {
  37097. type: String,
  37098. default: ''
  37099. },
  37100. suffix: {
  37101. type: String,
  37102. default: ''
  37103. },
  37104. title: {
  37105. type: [String, Number],
  37106. default: ''
  37107. },
  37108. timeIndices: {
  37109. type: Boolean,
  37110. default: false
  37111. },
  37112. valueStyle: {
  37113. type: Object,
  37114. default: function _default() {
  37115. return {};
  37116. }
  37117. },
  37118. format: {
  37119. type: String,
  37120. default: 'HH:mm:ss:SSS'
  37121. },
  37122. rate: {
  37123. type: Number,
  37124. default: 1000
  37125. }
  37126. },
  37127. created: function created() {
  37128. this.branch();
  37129. },
  37130. watch: {
  37131. value: function value() {
  37132. this.branch();
  37133. }
  37134. },
  37135. methods: {
  37136. branch: function branch() {
  37137. var timeIndices = this.timeIndices,
  37138. countDown = this.countDown,
  37139. dispose = this.dispose;
  37140. timeIndices ? countDown() : dispose();
  37141. },
  37142. magnification: function magnification(num) {
  37143. var mulriple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;
  37144. var groupSeparator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ',';
  37145. // magnification factor
  37146. var level = String(mulriple).length - 1;
  37147. var reg = new RegExp('\\d{1,' + level + '}(?=(\\d{' + level + '})+$)', 'g');
  37148. var result = String(num).replace(reg, '$&,').split(',').join(groupSeparator);
  37149. return result;
  37150. },
  37151. dispose: function dispose() {
  37152. var value = this.value,
  37153. precision = this.precision,
  37154. groupSeparator = this.groupSeparator,
  37155. rate = this.rate;
  37156. if (!Object(lodash_["isNumber"])(value)) return false;
  37157. var _String$split = String(value).split('.'),
  37158. integer = _String$split[0],
  37159. decimal = _String$split[1];
  37160. if (precision) {
  37161. decimal = '' + (decimal || '') + 1 .toFixed(precision).replace('.', '').slice(1);
  37162. decimal = decimal.slice(0, precision);
  37163. }
  37164. var result = 0;
  37165. // 1000 multiplying power
  37166. if (groupSeparator) {
  37167. integer = this.magnification(integer, rate, groupSeparator);
  37168. }
  37169. result = [integer, decimal].join(decimal ? this.decimalSeparator : '');
  37170. this.disposeValue = result;
  37171. return result;
  37172. },
  37173. diffDate: function diffDate(minuend, subtrahend) {
  37174. return Math.max(minuend - subtrahend, 0);
  37175. },
  37176. suspend: function suspend(isStop) {
  37177. if (isStop) {
  37178. if (this.timeTask) {
  37179. clearInterval(this.timeTask);
  37180. this.timeTask = null;
  37181. }
  37182. } else {
  37183. this.branch();
  37184. }
  37185. return this.disposeValue;
  37186. },
  37187. formatTimeStr: function formatTimeStr(time) {
  37188. var format = this.format;
  37189. var escapeRegex = /\[[^\]]*]/g;
  37190. var keepList = (format.match(escapeRegex) || []).map(function (str) {
  37191. return str.slice(1, -1);
  37192. });
  37193. var timeUnits = [['Y', 1000 * 60 * 60 * 24 * 365], // years
  37194. ['M', 1000 * 60 * 60 * 24 * 30], // months
  37195. ['D', 1000 * 60 * 60 * 24], // days
  37196. ['H', 1000 * 60 * 60], // hours
  37197. ['m', 1000 * 60], // minutes
  37198. ['s', 1000], // seconds
  37199. ['S', 1] // million seconds
  37200. ];
  37201. var formatText = Object(lodash_["reduce"])(timeUnits, function (con, item) {
  37202. var name = item[0];
  37203. return con.replace(new RegExp(name + '+', 'g'), function (match) {
  37204. var sum = Object(lodash_["chain"])(time).divide(item[1]).floor(0).value();
  37205. time -= Object(lodash_["multiply"])(sum, item[1]);
  37206. return Object(lodash_["padStart"])(String(sum), String(match).length, 0);
  37207. });
  37208. }, format);
  37209. var index = 0;
  37210. return formatText.replace(escapeRegex, function () {
  37211. var match = keepList[index];
  37212. index += 1;
  37213. return match;
  37214. });
  37215. },
  37216. stopTime: function stopTime(time) {
  37217. var result = true; // stop
  37218. if (time) {
  37219. this.$emit('change', time);
  37220. result = false;
  37221. } else {
  37222. result = true;
  37223. this.suspend(true);
  37224. this.$emit('finish', true);
  37225. }
  37226. return result;
  37227. },
  37228. countDown: function countDown() {
  37229. var REFRESH_INTERVAL = this.REFRESH_INTERVAL,
  37230. timeTask = this.timeTask,
  37231. diffDate = this.diffDate,
  37232. formatTimeStr = this.formatTimeStr,
  37233. stopTime = this.stopTime,
  37234. suspend = this.suspend;
  37235. if (timeTask) return;
  37236. var than = this;
  37237. this.timeTask = setInterval(function () {
  37238. var diffTiem = diffDate(than.value, Date.now());
  37239. than.disposeValue = formatTimeStr(diffTiem);
  37240. stopTime(diffTiem);
  37241. }, REFRESH_INTERVAL);
  37242. this.$once('hook:beforeDestroy', function () {
  37243. suspend(true);
  37244. });
  37245. }
  37246. }
  37247. });
  37248. // CONCATENATED MODULE: ./packages/statistic/src/main.vue?vue&type=script&lang=js&
  37249. /* harmony default export */ var packages_statistic_src_mainvue_type_script_lang_js_ = (statistic_src_mainvue_type_script_lang_js_);
  37250. // CONCATENATED MODULE: ./packages/statistic/src/main.vue
  37251. /* normalize component */
  37252. var statistic_src_main_component = normalizeComponent(
  37253. packages_statistic_src_mainvue_type_script_lang_js_,
  37254. mainvue_type_template_id_76339aa7_render,
  37255. mainvue_type_template_id_76339aa7_staticRenderFns,
  37256. false,
  37257. null,
  37258. null,
  37259. null
  37260. )
  37261. /* hot reload */
  37262. if (false) { var statistic_src_main_api; }
  37263. statistic_src_main_component.options.__file = "packages/statistic/src/main.vue"
  37264. /* harmony default export */ var statistic_src_main = (statistic_src_main_component.exports);
  37265. // CONCATENATED MODULE: ./packages/statistic/index.js
  37266. /* istanbul ignore next */
  37267. statistic_src_main.install = function (Vue) {
  37268. Vue.component(statistic_src_main.name, statistic_src_main);
  37269. };
  37270. /* harmony default export */ var statistic = (statistic_src_main);
  37271. // 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&
  37272. var mainvue_type_template_id_048de730_render = function() {
  37273. var _vm = this
  37274. var _h = _vm.$createElement
  37275. var _c = _vm._self._c || _h
  37276. return _c(
  37277. "el-popover",
  37278. _vm._b(
  37279. {
  37280. attrs: { trigger: "click" },
  37281. model: {
  37282. value: _vm.visible,
  37283. callback: function($$v) {
  37284. _vm.visible = $$v
  37285. },
  37286. expression: "visible"
  37287. }
  37288. },
  37289. "el-popover",
  37290. _vm.$attrs,
  37291. false
  37292. ),
  37293. [
  37294. _c("div", { staticClass: "el-popconfirm" }, [
  37295. _c("p", { staticClass: "el-popconfirm__main" }, [
  37296. !_vm.hideIcon
  37297. ? _c("i", {
  37298. staticClass: "el-popconfirm__icon",
  37299. class: _vm.icon,
  37300. style: { color: _vm.iconColor }
  37301. })
  37302. : _vm._e(),
  37303. _vm._v("\n " + _vm._s(_vm.title) + "\n ")
  37304. ]),
  37305. _c(
  37306. "div",
  37307. { staticClass: "el-popconfirm__action" },
  37308. [
  37309. _c(
  37310. "el-button",
  37311. {
  37312. attrs: { size: "mini", type: _vm.cancelButtonType },
  37313. on: { click: _vm.cancel }
  37314. },
  37315. [
  37316. _vm._v(
  37317. "\n " +
  37318. _vm._s(_vm.displayCancelButtonText) +
  37319. "\n "
  37320. )
  37321. ]
  37322. ),
  37323. _c(
  37324. "el-button",
  37325. {
  37326. attrs: { size: "mini", type: _vm.confirmButtonType },
  37327. on: { click: _vm.confirm }
  37328. },
  37329. [
  37330. _vm._v(
  37331. "\n " +
  37332. _vm._s(_vm.displayConfirmButtonText) +
  37333. "\n "
  37334. )
  37335. ]
  37336. )
  37337. ],
  37338. 1
  37339. )
  37340. ]),
  37341. _vm._t("reference", null, { slot: "reference" })
  37342. ],
  37343. 2
  37344. )
  37345. }
  37346. var mainvue_type_template_id_048de730_staticRenderFns = []
  37347. mainvue_type_template_id_048de730_render._withStripped = true
  37348. // CONCATENATED MODULE: ./packages/popconfirm/src/main.vue?vue&type=template&id=048de730&
  37349. // EXTERNAL MODULE: external "element-ui/lib/popover"
  37350. var popover_ = __webpack_require__(45);
  37351. var popover_default = /*#__PURE__*/__webpack_require__.n(popover_);
  37352. // 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&
  37353. //
  37354. //
  37355. //
  37356. //
  37357. //
  37358. //
  37359. //
  37360. //
  37361. //
  37362. //
  37363. //
  37364. //
  37365. //
  37366. //
  37367. //
  37368. //
  37369. //
  37370. //
  37371. //
  37372. //
  37373. //
  37374. //
  37375. //
  37376. //
  37377. //
  37378. //
  37379. //
  37380. //
  37381. //
  37382. //
  37383. //
  37384. //
  37385. //
  37386. //
  37387. //
  37388. //
  37389. //
  37390. /* harmony default export */ var popconfirm_src_mainvue_type_script_lang_js_ = ({
  37391. name: 'ElPopconfirm',
  37392. props: {
  37393. title: {
  37394. type: String
  37395. },
  37396. confirmButtonText: {
  37397. type: String
  37398. },
  37399. cancelButtonText: {
  37400. type: String
  37401. },
  37402. confirmButtonType: {
  37403. type: String,
  37404. default: 'primary'
  37405. },
  37406. cancelButtonType: {
  37407. type: String,
  37408. default: 'text'
  37409. },
  37410. icon: {
  37411. type: String,
  37412. default: 'el-icon-question'
  37413. },
  37414. iconColor: {
  37415. type: String,
  37416. default: '#f90'
  37417. },
  37418. hideIcon: {
  37419. type: Boolean,
  37420. default: false
  37421. }
  37422. },
  37423. components: {
  37424. ElPopover: popover_default.a,
  37425. ElButton: button_default.a
  37426. },
  37427. data: function data() {
  37428. return {
  37429. visible: false
  37430. };
  37431. },
  37432. computed: {
  37433. displayConfirmButtonText: function displayConfirmButtonText() {
  37434. return this.confirmButtonText || Object(lib_locale_["t"])('el.popconfirm.confirmButtonText');
  37435. },
  37436. displayCancelButtonText: function displayCancelButtonText() {
  37437. return this.cancelButtonText || Object(lib_locale_["t"])('el.popconfirm.cancelButtonText');
  37438. }
  37439. },
  37440. methods: {
  37441. confirm: function confirm() {
  37442. this.visible = false;
  37443. this.$emit('confirm');
  37444. },
  37445. cancel: function cancel() {
  37446. this.visible = false;
  37447. this.$emit('cancel');
  37448. }
  37449. }
  37450. });
  37451. // CONCATENATED MODULE: ./packages/popconfirm/src/main.vue?vue&type=script&lang=js&
  37452. /* harmony default export */ var packages_popconfirm_src_mainvue_type_script_lang_js_ = (popconfirm_src_mainvue_type_script_lang_js_);
  37453. // CONCATENATED MODULE: ./packages/popconfirm/src/main.vue
  37454. /* normalize component */
  37455. var popconfirm_src_main_component = normalizeComponent(
  37456. packages_popconfirm_src_mainvue_type_script_lang_js_,
  37457. mainvue_type_template_id_048de730_render,
  37458. mainvue_type_template_id_048de730_staticRenderFns,
  37459. false,
  37460. null,
  37461. null,
  37462. null
  37463. )
  37464. /* hot reload */
  37465. if (false) { var popconfirm_src_main_api; }
  37466. popconfirm_src_main_component.options.__file = "packages/popconfirm/src/main.vue"
  37467. /* harmony default export */ var popconfirm_src_main = (popconfirm_src_main_component.exports);
  37468. // CONCATENATED MODULE: ./packages/popconfirm/index.js
  37469. /* istanbul ignore next */
  37470. popconfirm_src_main.install = function (Vue) {
  37471. Vue.component(popconfirm_src_main.name, popconfirm_src_main);
  37472. };
  37473. /* harmony default export */ var popconfirm = (popconfirm_src_main);
  37474. // 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&
  37475. var srcvue_type_template_id_7f659269_render = function() {
  37476. var _vm = this
  37477. var _h = _vm.$createElement
  37478. var _c = _vm._self._c || _h
  37479. return _c(
  37480. "div",
  37481. [
  37482. _vm.uiLoading
  37483. ? [
  37484. _c(
  37485. "div",
  37486. _vm._b(
  37487. { class: ["el-skeleton", _vm.animated ? "is-animated" : ""] },
  37488. "div",
  37489. _vm.$attrs,
  37490. false
  37491. ),
  37492. [
  37493. _vm._l(_vm.count, function(i) {
  37494. return [
  37495. _vm.loading
  37496. ? _vm._t(
  37497. "template",
  37498. _vm._l(_vm.rows, function(item) {
  37499. return _c("el-skeleton-item", {
  37500. key: i + "-" + item,
  37501. class: {
  37502. "el-skeleton__paragraph": item !== 1,
  37503. "is-first": item === 1,
  37504. "is-last": item === _vm.rows && _vm.rows > 1
  37505. },
  37506. attrs: { variant: "p" }
  37507. })
  37508. })
  37509. )
  37510. : _vm._e()
  37511. ]
  37512. })
  37513. ],
  37514. 2
  37515. )
  37516. ]
  37517. : [_vm._t("default", null, null, _vm.$attrs)]
  37518. ],
  37519. 2
  37520. )
  37521. }
  37522. var srcvue_type_template_id_7f659269_staticRenderFns = []
  37523. srcvue_type_template_id_7f659269_render._withStripped = true
  37524. // CONCATENATED MODULE: ./packages/skeleton/src/index.vue?vue&type=template&id=7f659269&
  37525. // 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&
  37526. //
  37527. //
  37528. //
  37529. //
  37530. //
  37531. //
  37532. //
  37533. //
  37534. //
  37535. //
  37536. //
  37537. //
  37538. //
  37539. //
  37540. //
  37541. //
  37542. //
  37543. //
  37544. //
  37545. //
  37546. //
  37547. //
  37548. //
  37549. //
  37550. //
  37551. /* harmony default export */ var skeleton_srcvue_type_script_lang_js_ = ({
  37552. name: 'ElSkeleton',
  37553. props: {
  37554. animated: {
  37555. type: Boolean,
  37556. default: false
  37557. },
  37558. count: {
  37559. type: Number,
  37560. default: 1
  37561. },
  37562. rows: {
  37563. type: Number,
  37564. default: 4
  37565. },
  37566. loading: {
  37567. type: Boolean,
  37568. default: true
  37569. },
  37570. throttle: {
  37571. type: Number,
  37572. default: 0
  37573. }
  37574. },
  37575. watch: {
  37576. loading: {
  37577. handler: function handler(loading) {
  37578. var _this = this;
  37579. if (this.throttle <= 0) {
  37580. this.uiLoading = loading;
  37581. return;
  37582. }
  37583. if (loading) {
  37584. clearTimeout(this.timeoutHandle);
  37585. this.timeoutHandle = setTimeout(function () {
  37586. _this.uiLoading = _this.loading;
  37587. }, this.throttle);
  37588. } else {
  37589. this.uiLoading = loading;
  37590. }
  37591. },
  37592. immediate: true
  37593. }
  37594. },
  37595. data: function data() {
  37596. return {
  37597. uiLoading: this.throttle <= 0 ? this.loading : false
  37598. };
  37599. }
  37600. });
  37601. // CONCATENATED MODULE: ./packages/skeleton/src/index.vue?vue&type=script&lang=js&
  37602. /* harmony default export */ var packages_skeleton_srcvue_type_script_lang_js_ = (skeleton_srcvue_type_script_lang_js_);
  37603. // CONCATENATED MODULE: ./packages/skeleton/src/index.vue
  37604. /* normalize component */
  37605. var skeleton_src_component = normalizeComponent(
  37606. packages_skeleton_srcvue_type_script_lang_js_,
  37607. srcvue_type_template_id_7f659269_render,
  37608. srcvue_type_template_id_7f659269_staticRenderFns,
  37609. false,
  37610. null,
  37611. null,
  37612. null
  37613. )
  37614. /* hot reload */
  37615. if (false) { var skeleton_src_api; }
  37616. skeleton_src_component.options.__file = "packages/skeleton/src/index.vue"
  37617. /* harmony default export */ var skeleton_src = (skeleton_src_component.exports);
  37618. // CONCATENATED MODULE: ./packages/skeleton/index.js
  37619. /* istanbul ignore next */
  37620. skeleton_src.install = function (Vue) {
  37621. Vue.component(skeleton_src.name, skeleton_src);
  37622. };
  37623. /* harmony default export */ var skeleton = (skeleton_src);
  37624. // 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&
  37625. var itemvue_type_template_id_4bc8804c_render = function() {
  37626. var _vm = this
  37627. var _h = _vm.$createElement
  37628. var _c = _vm._self._c || _h
  37629. return _c(
  37630. "div",
  37631. { class: ["el-skeleton__item", "el-skeleton__" + _vm.variant] },
  37632. [_vm.variant === "image" ? _c("img-placeholder") : _vm._e()],
  37633. 1
  37634. )
  37635. }
  37636. var itemvue_type_template_id_4bc8804c_staticRenderFns = []
  37637. itemvue_type_template_id_4bc8804c_render._withStripped = true
  37638. // CONCATENATED MODULE: ./packages/skeleton/src/item.vue?vue&type=template&id=4bc8804c&
  37639. // 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&
  37640. var img_placeholdervue_type_template_id_1b2cb5c0_render = function() {
  37641. var _vm = this
  37642. var _h = _vm.$createElement
  37643. var _c = _vm._self._c || _h
  37644. return _c(
  37645. "svg",
  37646. {
  37647. attrs: { viewBox: "0 0 1024 1024", xmlns: "http://www.w3.org/2000/svg" }
  37648. },
  37649. [
  37650. _c("path", {
  37651. attrs: {
  37652. d:
  37653. "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"
  37654. }
  37655. })
  37656. ]
  37657. )
  37658. }
  37659. var img_placeholdervue_type_template_id_1b2cb5c0_staticRenderFns = []
  37660. img_placeholdervue_type_template_id_1b2cb5c0_render._withStripped = true
  37661. // CONCATENATED MODULE: ./packages/skeleton/src/img-placeholder.vue?vue&type=template&id=1b2cb5c0&
  37662. // 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&
  37663. //
  37664. //
  37665. //
  37666. //
  37667. //
  37668. //
  37669. //
  37670. //
  37671. //
  37672. //
  37673. //
  37674. /* harmony default export */ var img_placeholdervue_type_script_lang_js_ = ({
  37675. name: 'ImgPlaceholder'
  37676. });
  37677. // CONCATENATED MODULE: ./packages/skeleton/src/img-placeholder.vue?vue&type=script&lang=js&
  37678. /* harmony default export */ var src_img_placeholdervue_type_script_lang_js_ = (img_placeholdervue_type_script_lang_js_);
  37679. // CONCATENATED MODULE: ./packages/skeleton/src/img-placeholder.vue
  37680. /* normalize component */
  37681. var img_placeholder_component = normalizeComponent(
  37682. src_img_placeholdervue_type_script_lang_js_,
  37683. img_placeholdervue_type_template_id_1b2cb5c0_render,
  37684. img_placeholdervue_type_template_id_1b2cb5c0_staticRenderFns,
  37685. false,
  37686. null,
  37687. null,
  37688. null
  37689. )
  37690. /* hot reload */
  37691. if (false) { var img_placeholder_api; }
  37692. img_placeholder_component.options.__file = "packages/skeleton/src/img-placeholder.vue"
  37693. /* harmony default export */ var img_placeholder = (img_placeholder_component.exports);
  37694. // 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&
  37695. var _components;
  37696. //
  37697. //
  37698. //
  37699. //
  37700. //
  37701. //
  37702. /* harmony default export */ var skeleton_src_itemvue_type_script_lang_js_ = ({
  37703. name: 'ElSkeletonItem',
  37704. props: {
  37705. variant: {
  37706. type: String,
  37707. default: 'text'
  37708. }
  37709. },
  37710. components: (_components = {}, _components[img_placeholder.name] = img_placeholder, _components)
  37711. });
  37712. // CONCATENATED MODULE: ./packages/skeleton/src/item.vue?vue&type=script&lang=js&
  37713. /* harmony default export */ var packages_skeleton_src_itemvue_type_script_lang_js_ = (skeleton_src_itemvue_type_script_lang_js_);
  37714. // CONCATENATED MODULE: ./packages/skeleton/src/item.vue
  37715. /* normalize component */
  37716. var skeleton_src_item_component = normalizeComponent(
  37717. packages_skeleton_src_itemvue_type_script_lang_js_,
  37718. itemvue_type_template_id_4bc8804c_render,
  37719. itemvue_type_template_id_4bc8804c_staticRenderFns,
  37720. false,
  37721. null,
  37722. null,
  37723. null
  37724. )
  37725. /* hot reload */
  37726. if (false) { var skeleton_src_item_api; }
  37727. skeleton_src_item_component.options.__file = "packages/skeleton/src/item.vue"
  37728. /* harmony default export */ var skeleton_src_item = (skeleton_src_item_component.exports);
  37729. // CONCATENATED MODULE: ./packages/skeleton-item/index.js
  37730. /* istanbul ignore next */
  37731. skeleton_src_item.install = function (Vue) {
  37732. Vue.component(skeleton_src_item.name, skeleton_src_item);
  37733. };
  37734. /* harmony default export */ var skeleton_item = (skeleton_src_item);
  37735. // 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&
  37736. var srcvue_type_template_id_347ced91_render = function() {
  37737. var _vm = this
  37738. var _h = _vm.$createElement
  37739. var _c = _vm._self._c || _h
  37740. return _c("div", { staticClass: "el-empty" }, [
  37741. _c(
  37742. "div",
  37743. { staticClass: "el-empty__image", style: _vm.imageStyle },
  37744. [
  37745. _vm.image
  37746. ? _c("img", {
  37747. attrs: { src: _vm.image, ondragstart: "return false" }
  37748. })
  37749. : _vm._t("image", [_c("img-empty")])
  37750. ],
  37751. 2
  37752. ),
  37753. _c(
  37754. "div",
  37755. { staticClass: "el-empty__description" },
  37756. [
  37757. _vm.$slots.description
  37758. ? _vm._t("description")
  37759. : _c("p", [_vm._v(_vm._s(_vm.emptyDescription))])
  37760. ],
  37761. 2
  37762. ),
  37763. _vm.$slots.default
  37764. ? _c("div", { staticClass: "el-empty__bottom" }, [_vm._t("default")], 2)
  37765. : _vm._e()
  37766. ])
  37767. }
  37768. var srcvue_type_template_id_347ced91_staticRenderFns = []
  37769. srcvue_type_template_id_347ced91_render._withStripped = true
  37770. // CONCATENATED MODULE: ./packages/empty/src/index.vue?vue&type=template&id=347ced91&
  37771. // 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&
  37772. var img_emptyvue_type_template_id_42918b82_render = function() {
  37773. var _vm = this
  37774. var _h = _vm.$createElement
  37775. var _c = _vm._self._c || _h
  37776. return _c(
  37777. "svg",
  37778. {
  37779. attrs: {
  37780. viewBox: "0 0 79 86",
  37781. version: "1.1",
  37782. xmlns: "http://www.w3.org/2000/svg",
  37783. "xmlns:xlink": "http://www.w3.org/1999/xlink"
  37784. }
  37785. },
  37786. [
  37787. _c(
  37788. "defs",
  37789. [
  37790. _c(
  37791. "linearGradient",
  37792. {
  37793. attrs: {
  37794. id: "linearGradient-1-" + _vm.id,
  37795. x1: "38.8503086%",
  37796. y1: "0%",
  37797. x2: "61.1496914%",
  37798. y2: "100%"
  37799. }
  37800. },
  37801. [
  37802. _c("stop", { attrs: { "stop-color": "#FCFCFD", offset: "0%" } }),
  37803. _c("stop", { attrs: { "stop-color": "#EEEFF3", offset: "100%" } })
  37804. ],
  37805. 1
  37806. ),
  37807. _c(
  37808. "linearGradient",
  37809. {
  37810. attrs: {
  37811. id: "linearGradient-2-" + _vm.id,
  37812. x1: "0%",
  37813. y1: "9.5%",
  37814. x2: "100%",
  37815. y2: "90.5%"
  37816. }
  37817. },
  37818. [
  37819. _c("stop", { attrs: { "stop-color": "#FCFCFD", offset: "0%" } }),
  37820. _c("stop", { attrs: { "stop-color": "#E9EBEF", offset: "100%" } })
  37821. ],
  37822. 1
  37823. ),
  37824. _c("rect", {
  37825. attrs: {
  37826. id: "path-3-" + _vm.id,
  37827. x: "0",
  37828. y: "0",
  37829. width: "17",
  37830. height: "36"
  37831. }
  37832. })
  37833. ],
  37834. 1
  37835. ),
  37836. _c(
  37837. "g",
  37838. {
  37839. attrs: {
  37840. id: "Illustrations",
  37841. stroke: "none",
  37842. "stroke-width": "1",
  37843. fill: "none",
  37844. "fill-rule": "evenodd"
  37845. }
  37846. },
  37847. [
  37848. _c(
  37849. "g",
  37850. {
  37851. attrs: {
  37852. id: "B-type",
  37853. transform: "translate(-1268.000000, -535.000000)"
  37854. }
  37855. },
  37856. [
  37857. _c(
  37858. "g",
  37859. {
  37860. attrs: {
  37861. id: "Group-2",
  37862. transform: "translate(1268.000000, 535.000000)"
  37863. }
  37864. },
  37865. [
  37866. _c("path", {
  37867. attrs: {
  37868. id: "Oval-Copy-2",
  37869. d:
  37870. "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",
  37871. fill: "#F7F8FC"
  37872. }
  37873. }),
  37874. _c("polygon", {
  37875. attrs: {
  37876. id: "Rectangle-Copy-14",
  37877. fill: "#E5E7E9",
  37878. transform:
  37879. "translate(27.500000, 51.500000) scale(1, -1) translate(-27.500000, -51.500000) ",
  37880. points: "13 58 53 58 42 45 2 45"
  37881. }
  37882. }),
  37883. _c(
  37884. "g",
  37885. {
  37886. attrs: {
  37887. id: "Group-Copy",
  37888. transform:
  37889. "translate(34.500000, 31.500000) scale(-1, 1) rotate(-25.000000) translate(-34.500000, -31.500000) translate(7.000000, 10.000000)"
  37890. }
  37891. },
  37892. [
  37893. _c("polygon", {
  37894. attrs: {
  37895. id: "Rectangle-Copy-10",
  37896. fill: "#E5E7E9",
  37897. transform:
  37898. "translate(11.500000, 5.000000) scale(1, -1) translate(-11.500000, -5.000000) ",
  37899. points: "2.84078316e-14 3 18 3 23 7 5 7"
  37900. }
  37901. }),
  37902. _c("polygon", {
  37903. attrs: {
  37904. id: "Rectangle-Copy-11",
  37905. fill: "#EDEEF2",
  37906. points:
  37907. "-3.69149156e-15 7 38 7 38 43 -3.69149156e-15 43"
  37908. }
  37909. }),
  37910. _c("rect", {
  37911. attrs: {
  37912. id: "Rectangle-Copy-12",
  37913. fill: "url(#linearGradient-1-" + _vm.id + ")",
  37914. transform:
  37915. "translate(46.500000, 25.000000) scale(-1, 1) translate(-46.500000, -25.000000) ",
  37916. x: "38",
  37917. y: "7",
  37918. width: "17",
  37919. height: "36"
  37920. }
  37921. }),
  37922. _c("polygon", {
  37923. attrs: {
  37924. id: "Rectangle-Copy-13",
  37925. fill: "#F8F9FB",
  37926. transform:
  37927. "translate(39.500000, 3.500000) scale(-1, 1) translate(-39.500000, -3.500000) ",
  37928. points:
  37929. "24 7 41 7 55 -3.63806207e-12 38 -3.63806207e-12"
  37930. }
  37931. })
  37932. ]
  37933. ),
  37934. _c("rect", {
  37935. attrs: {
  37936. id: "Rectangle-Copy-15",
  37937. fill: "url(#linearGradient-2-" + _vm.id + ")",
  37938. x: "13",
  37939. y: "45",
  37940. width: "40",
  37941. height: "36"
  37942. }
  37943. }),
  37944. _c(
  37945. "g",
  37946. {
  37947. attrs: {
  37948. id: "Rectangle-Copy-17",
  37949. transform: "translate(53.000000, 45.000000)"
  37950. }
  37951. },
  37952. [
  37953. _c(
  37954. "mask",
  37955. { attrs: { id: "mask-4-" + _vm.id, fill: "white" } },
  37956. [
  37957. _c("use", {
  37958. attrs: { "xlink:href": "#path-3-" + _vm.id }
  37959. })
  37960. ]
  37961. ),
  37962. _c("use", {
  37963. attrs: {
  37964. id: "Mask",
  37965. fill: "#E0E3E9",
  37966. transform:
  37967. "translate(8.500000, 18.000000) scale(-1, 1) translate(-8.500000, -18.000000) ",
  37968. "xlink:href": "#path-3-" + _vm.id
  37969. }
  37970. }),
  37971. _c("polygon", {
  37972. attrs: {
  37973. id: "Rectangle-Copy",
  37974. fill: "#D5D7DE",
  37975. mask: "url(#mask-4-" + _vm.id + ")",
  37976. transform:
  37977. "translate(12.000000, 9.000000) scale(-1, 1) translate(-12.000000, -9.000000) ",
  37978. points: "7 0 24 0 20 18 -1.70530257e-13 16"
  37979. }
  37980. })
  37981. ]
  37982. ),
  37983. _c("polygon", {
  37984. attrs: {
  37985. id: "Rectangle-Copy-18",
  37986. fill: "#F8F9FB",
  37987. transform:
  37988. "translate(66.000000, 51.500000) scale(-1, 1) translate(-66.000000, -51.500000) ",
  37989. points: "62 45 79 45 70 58 53 58"
  37990. }
  37991. })
  37992. ]
  37993. )
  37994. ]
  37995. )
  37996. ]
  37997. )
  37998. ]
  37999. )
  38000. }
  38001. var img_emptyvue_type_template_id_42918b82_staticRenderFns = []
  38002. img_emptyvue_type_template_id_42918b82_render._withStripped = true
  38003. // CONCATENATED MODULE: ./packages/empty/src/img-empty.vue?vue&type=template&id=42918b82&
  38004. // 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&
  38005. //
  38006. //
  38007. //
  38008. //
  38009. //
  38010. //
  38011. //
  38012. //
  38013. //
  38014. //
  38015. //
  38016. //
  38017. //
  38018. //
  38019. //
  38020. //
  38021. //
  38022. //
  38023. //
  38024. //
  38025. //
  38026. //
  38027. //
  38028. //
  38029. //
  38030. //
  38031. //
  38032. //
  38033. //
  38034. //
  38035. //
  38036. //
  38037. //
  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. var img_emptyvue_type_script_lang_js_id = 0;
  38127. /* harmony default export */ var img_emptyvue_type_script_lang_js_ = ({
  38128. name: 'ImgEmpty',
  38129. data: function data() {
  38130. return {
  38131. id: ++img_emptyvue_type_script_lang_js_id
  38132. };
  38133. }
  38134. });
  38135. // CONCATENATED MODULE: ./packages/empty/src/img-empty.vue?vue&type=script&lang=js&
  38136. /* harmony default export */ var src_img_emptyvue_type_script_lang_js_ = (img_emptyvue_type_script_lang_js_);
  38137. // CONCATENATED MODULE: ./packages/empty/src/img-empty.vue
  38138. /* normalize component */
  38139. var img_empty_component = normalizeComponent(
  38140. src_img_emptyvue_type_script_lang_js_,
  38141. img_emptyvue_type_template_id_42918b82_render,
  38142. img_emptyvue_type_template_id_42918b82_staticRenderFns,
  38143. false,
  38144. null,
  38145. null,
  38146. null
  38147. )
  38148. /* hot reload */
  38149. if (false) { var img_empty_api; }
  38150. img_empty_component.options.__file = "packages/empty/src/img-empty.vue"
  38151. /* harmony default export */ var img_empty = (img_empty_component.exports);
  38152. // 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&
  38153. var srcvue_type_script_lang_js_components;
  38154. //
  38155. //
  38156. //
  38157. //
  38158. //
  38159. //
  38160. //
  38161. //
  38162. //
  38163. //
  38164. //
  38165. //
  38166. //
  38167. //
  38168. //
  38169. //
  38170. //
  38171. //
  38172. /* harmony default export */ var empty_srcvue_type_script_lang_js_ = ({
  38173. name: 'ElEmpty',
  38174. components: (srcvue_type_script_lang_js_components = {}, srcvue_type_script_lang_js_components[img_empty.name] = img_empty, srcvue_type_script_lang_js_components),
  38175. props: {
  38176. image: {
  38177. type: String,
  38178. default: ''
  38179. },
  38180. imageSize: Number,
  38181. description: {
  38182. type: String,
  38183. default: ''
  38184. }
  38185. },
  38186. computed: {
  38187. emptyDescription: function emptyDescription() {
  38188. return this.description || Object(lib_locale_["t"])('el.empty.description');
  38189. },
  38190. imageStyle: function imageStyle() {
  38191. return {
  38192. width: this.imageSize ? this.imageSize + 'px' : ''
  38193. };
  38194. }
  38195. }
  38196. });
  38197. // CONCATENATED MODULE: ./packages/empty/src/index.vue?vue&type=script&lang=js&
  38198. /* harmony default export */ var packages_empty_srcvue_type_script_lang_js_ = (empty_srcvue_type_script_lang_js_);
  38199. // CONCATENATED MODULE: ./packages/empty/src/index.vue
  38200. /* normalize component */
  38201. var empty_src_component = normalizeComponent(
  38202. packages_empty_srcvue_type_script_lang_js_,
  38203. srcvue_type_template_id_347ced91_render,
  38204. srcvue_type_template_id_347ced91_staticRenderFns,
  38205. false,
  38206. null,
  38207. null,
  38208. null
  38209. )
  38210. /* hot reload */
  38211. if (false) { var empty_src_api; }
  38212. empty_src_component.options.__file = "packages/empty/src/index.vue"
  38213. /* harmony default export */ var empty_src = (empty_src_component.exports);
  38214. // CONCATENATED MODULE: ./packages/empty/index.js
  38215. empty_src.install = function (Vue) {
  38216. Vue.component(empty_src.name, empty_src);
  38217. };
  38218. /* harmony default export */ var empty = (empty_src);
  38219. // CONCATENATED MODULE: ./packages/descriptions/src/descriptions-row.js
  38220. 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; };
  38221. /* harmony default export */ var descriptions_row = ({
  38222. name: 'ElDescriptionsRow',
  38223. props: {
  38224. row: {
  38225. type: Array
  38226. }
  38227. },
  38228. inject: ['elDescriptions'],
  38229. render: function render(h) {
  38230. var elDescriptions = this.elDescriptions;
  38231. var row = (this.row || []).map(function (item) {
  38232. return descriptions_row_extends({}, item, {
  38233. label: item.slots.label || item.props.label
  38234. }, ['labelClassName', 'contentClassName', 'labelStyle', 'contentStyle'].reduce(function (res, key) {
  38235. res[key] = item.props[key] || elDescriptions[key];
  38236. return res;
  38237. }, {}));
  38238. });
  38239. if (elDescriptions.direction === 'vertical') {
  38240. return h('tbody', [h(
  38241. 'tr',
  38242. { 'class': 'el-descriptions-row' },
  38243. [row.map(function (item) {
  38244. var _ref;
  38245. return h(
  38246. 'th',
  38247. {
  38248. 'class': (_ref = {
  38249. 'el-descriptions-item__cell': true,
  38250. 'el-descriptions-item__label': true,
  38251. 'has-colon': elDescriptions.border ? false : elDescriptions.colon,
  38252. 'is-bordered-label': elDescriptions.border
  38253. }, _ref[item.labelClassName] = true, _ref),
  38254. style: item.labelStyle,
  38255. attrs: { colSpan: item.props.span
  38256. }
  38257. },
  38258. [item.label]
  38259. );
  38260. })]
  38261. ), h(
  38262. 'tr',
  38263. { 'class': 'el-descriptions-row' },
  38264. [row.map(function (item) {
  38265. return h(
  38266. 'td',
  38267. {
  38268. 'class': ['el-descriptions-item__cell', 'el-descriptions-item__content', item.contentClassName],
  38269. style: item.contentStyle,
  38270. attrs: { colSpan: item.props.span
  38271. }
  38272. },
  38273. [item.slots.default]
  38274. );
  38275. })]
  38276. )]);
  38277. }
  38278. if (elDescriptions.border) {
  38279. return h('tbody', [h(
  38280. 'tr',
  38281. { 'class': 'el-descriptions-row' },
  38282. [row.map(function (item) {
  38283. var _ref2;
  38284. return [h(
  38285. 'th',
  38286. {
  38287. 'class': (_ref2 = {
  38288. 'el-descriptions-item__cell': true,
  38289. 'el-descriptions-item__label': true,
  38290. 'is-bordered-label': elDescriptions.border
  38291. }, _ref2[item.labelClassName] = true, _ref2),
  38292. style: item.labelStyle,
  38293. attrs: { colSpan: '1'
  38294. }
  38295. },
  38296. [item.label]
  38297. ), h(
  38298. 'td',
  38299. {
  38300. 'class': ['el-descriptions-item__cell', 'el-descriptions-item__content', item.contentClassName],
  38301. style: item.contentStyle,
  38302. attrs: { colSpan: item.props.span * 2 - 1
  38303. }
  38304. },
  38305. [item.slots.default]
  38306. )];
  38307. })]
  38308. )]);
  38309. }
  38310. return h('tbody', [h(
  38311. 'tr',
  38312. { 'class': 'el-descriptions-row' },
  38313. [row.map(function (item) {
  38314. var _ref3;
  38315. return h(
  38316. 'td',
  38317. { 'class': 'el-descriptions-item el-descriptions-item__cell', attrs: { colSpan: item.props.span }
  38318. },
  38319. [h(
  38320. 'div',
  38321. { 'class': 'el-descriptions-item__container' },
  38322. [h(
  38323. 'span',
  38324. {
  38325. 'class': (_ref3 = {
  38326. 'el-descriptions-item__label': true,
  38327. 'has-colon': elDescriptions.colon
  38328. }, _ref3[item.labelClassName] = true, _ref3),
  38329. style: item.labelStyle
  38330. },
  38331. [item.label]
  38332. ), h(
  38333. 'span',
  38334. {
  38335. 'class': ['el-descriptions-item__content', item.contentClassName],
  38336. style: item.contentStyle
  38337. },
  38338. [item.slots.default]
  38339. )]
  38340. )]
  38341. );
  38342. })]
  38343. )]);
  38344. }
  38345. });
  38346. // CONCATENATED MODULE: ./packages/descriptions/src/index.js
  38347. 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; };
  38348. var src_components;
  38349. /* harmony default export */ var descriptions_src = ({
  38350. name: 'ElDescriptions',
  38351. components: (src_components = {}, src_components[descriptions_row.name] = descriptions_row, src_components),
  38352. props: {
  38353. border: {
  38354. type: Boolean,
  38355. default: false
  38356. },
  38357. column: {
  38358. type: Number,
  38359. default: 3
  38360. },
  38361. direction: {
  38362. type: String,
  38363. default: 'horizontal'
  38364. },
  38365. size: {
  38366. type: String
  38367. // validator: isValidComponentSize,
  38368. },
  38369. title: {
  38370. type: String,
  38371. default: ''
  38372. },
  38373. extra: {
  38374. type: String,
  38375. default: ''
  38376. },
  38377. labelStyle: {
  38378. type: Object
  38379. },
  38380. contentStyle: {
  38381. type: Object
  38382. },
  38383. labelClassName: {
  38384. type: String,
  38385. default: ''
  38386. },
  38387. contentClassName: {
  38388. type: String,
  38389. default: ''
  38390. },
  38391. colon: {
  38392. type: Boolean,
  38393. default: true
  38394. }
  38395. },
  38396. computed: {
  38397. descriptionsSize: function descriptionsSize() {
  38398. return this.size || (this.$ELEMENT || {}).size;
  38399. }
  38400. },
  38401. provide: function provide() {
  38402. return {
  38403. elDescriptions: this
  38404. };
  38405. },
  38406. methods: {
  38407. getOptionProps: function getOptionProps(vnode) {
  38408. if (vnode.componentOptions) {
  38409. var componentOptions = vnode.componentOptions;
  38410. var _componentOptions$pro = componentOptions.propsData,
  38411. propsData = _componentOptions$pro === undefined ? {} : _componentOptions$pro,
  38412. _componentOptions$Cto = componentOptions.Ctor,
  38413. Ctor = _componentOptions$Cto === undefined ? {} : _componentOptions$Cto;
  38414. var props = (Ctor.options || {}).props || {};
  38415. var res = {};
  38416. for (var k in props) {
  38417. var v = props[k];
  38418. var defaultValue = v.default;
  38419. if (defaultValue !== undefined) {
  38420. res[k] = Object(types_["isFunction"])(defaultValue) ? defaultValue.call(vnode) : defaultValue;
  38421. }
  38422. }
  38423. return src_extends({}, res, propsData);
  38424. }
  38425. return {};
  38426. },
  38427. getSlots: function getSlots(vnode) {
  38428. var _this = this;
  38429. var componentOptions = vnode.componentOptions || {};
  38430. var children = vnode.children || componentOptions.children || [];
  38431. var slots = {};
  38432. children.forEach(function (child) {
  38433. if (!_this.isEmptyElement(child)) {
  38434. var name = child.data && child.data.slot || 'default';
  38435. slots[name] = slots[name] || [];
  38436. if (child.tag === 'template') {
  38437. slots[name].push(child.children);
  38438. } else {
  38439. slots[name].push(child);
  38440. }
  38441. }
  38442. });
  38443. return src_extends({}, slots);
  38444. },
  38445. isEmptyElement: function isEmptyElement(c) {
  38446. return !(c.tag || c.text && c.text.trim() !== '');
  38447. },
  38448. filledNode: function filledNode(node, span, count) {
  38449. var isLast = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  38450. if (!node.props) {
  38451. node.props = {};
  38452. }
  38453. if (span > count) {
  38454. node.props.span = count;
  38455. }
  38456. if (isLast) {
  38457. // set the max span, cause of the last td
  38458. node.props.span = count;
  38459. }
  38460. return node;
  38461. },
  38462. getRows: function getRows() {
  38463. var _this2 = this;
  38464. var children = (this.$slots.default || []).filter(function (vnode) {
  38465. return vnode.tag && vnode.componentOptions && vnode.componentOptions.Ctor.options.name === 'ElDescriptionsItem';
  38466. });
  38467. var nodes = children.map(function (vnode) {
  38468. return {
  38469. props: _this2.getOptionProps(vnode),
  38470. slots: _this2.getSlots(vnode),
  38471. vnode: vnode
  38472. };
  38473. });
  38474. var rows = [];
  38475. var temp = [];
  38476. var count = this.column;
  38477. nodes.forEach(function (node, index) {
  38478. var span = node.props.span || 1;
  38479. if (index === children.length - 1) {
  38480. temp.push(_this2.filledNode(node, span, count, true));
  38481. rows.push(temp);
  38482. return;
  38483. }
  38484. if (span < count) {
  38485. count -= span;
  38486. temp.push(node);
  38487. } else {
  38488. temp.push(_this2.filledNode(node, span, count));
  38489. rows.push(temp);
  38490. count = _this2.column;
  38491. temp = [];
  38492. }
  38493. });
  38494. return rows;
  38495. }
  38496. },
  38497. render: function render() {
  38498. var h = arguments[0];
  38499. var title = this.title,
  38500. extra = this.extra,
  38501. border = this.border,
  38502. descriptionsSize = this.descriptionsSize,
  38503. $slots = this.$slots;
  38504. var rows = this.getRows();
  38505. return h(
  38506. 'div',
  38507. { 'class': 'el-descriptions' },
  38508. [title || extra || $slots.title || $slots.extra ? h(
  38509. 'div',
  38510. { 'class': 'el-descriptions__header' },
  38511. [h(
  38512. 'div',
  38513. { 'class': 'el-descriptions__title' },
  38514. [$slots.title ? $slots.title : title]
  38515. ), h(
  38516. 'div',
  38517. { 'class': 'el-descriptions__extra' },
  38518. [$slots.extra ? $slots.extra : extra]
  38519. )]
  38520. ) : null, h(
  38521. 'div',
  38522. { 'class': 'el-descriptions__body' },
  38523. [h(
  38524. 'table',
  38525. { 'class': ['el-descriptions__table', { 'is-bordered': border }, descriptionsSize ? 'el-descriptions--' + descriptionsSize : ''] },
  38526. [rows.map(function (row) {
  38527. return h(descriptions_row, {
  38528. attrs: { row: row }
  38529. });
  38530. })]
  38531. )]
  38532. )]
  38533. );
  38534. }
  38535. });
  38536. // CONCATENATED MODULE: ./packages/descriptions/index.js
  38537. /* istanbul ignore next */
  38538. descriptions_src.install = function install(Vue) {
  38539. Vue.component(descriptions_src.name, descriptions_src);
  38540. };
  38541. /* harmony default export */ var descriptions = (descriptions_src);
  38542. // CONCATENATED MODULE: ./packages/descriptions/src/descriptions-item.js
  38543. /* harmony default export */ var descriptions_item = ({
  38544. name: 'ElDescriptionsItem',
  38545. props: {
  38546. label: {
  38547. type: String,
  38548. default: ''
  38549. },
  38550. span: {
  38551. type: Number,
  38552. default: 1
  38553. },
  38554. contentClassName: {
  38555. type: String,
  38556. default: ''
  38557. },
  38558. contentStyle: {
  38559. type: Object
  38560. },
  38561. labelClassName: {
  38562. type: String,
  38563. default: ''
  38564. },
  38565. labelStyle: {
  38566. type: Object
  38567. }
  38568. },
  38569. render: function render() {
  38570. return null;
  38571. }
  38572. });
  38573. // CONCATENATED MODULE: ./packages/descriptions-item/index.js
  38574. /* istanbul ignore next */
  38575. descriptions_item.install = function install(Vue) {
  38576. Vue.component(descriptions_item.name, descriptions_item);
  38577. };
  38578. /* harmony default export */ var packages_descriptions_item = (descriptions_item);
  38579. // 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&
  38580. var srcvue_type_template_id_3408b139_render = function() {
  38581. var _vm = this
  38582. var _h = _vm.$createElement
  38583. var _c = _vm._self._c || _h
  38584. return _c("div", { staticClass: "el-result" }, [
  38585. _c(
  38586. "div",
  38587. { staticClass: "el-result__icon" },
  38588. [
  38589. _vm._t("icon", [
  38590. _c(_vm.iconElement, { tag: "component", class: _vm.iconElement })
  38591. ])
  38592. ],
  38593. 2
  38594. ),
  38595. _vm.title || _vm.$slots.title
  38596. ? _c(
  38597. "div",
  38598. { staticClass: "el-result__title" },
  38599. [_vm._t("title", [_c("p", [_vm._v(_vm._s(_vm.title))])])],
  38600. 2
  38601. )
  38602. : _vm._e(),
  38603. _vm.subTitle || _vm.$slots.subTitle
  38604. ? _c(
  38605. "div",
  38606. { staticClass: "el-result__subtitle" },
  38607. [_vm._t("subTitle", [_c("p", [_vm._v(_vm._s(_vm.subTitle))])])],
  38608. 2
  38609. )
  38610. : _vm._e(),
  38611. _vm.$slots.extra
  38612. ? _c("div", { staticClass: "el-result__extra" }, [_vm._t("extra")], 2)
  38613. : _vm._e()
  38614. ])
  38615. }
  38616. var srcvue_type_template_id_3408b139_staticRenderFns = []
  38617. srcvue_type_template_id_3408b139_render._withStripped = true
  38618. // CONCATENATED MODULE: ./packages/result/src/index.vue?vue&type=template&id=3408b139&
  38619. // 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&
  38620. var icon_successvue_type_template_id_18119418_render = function() {
  38621. var _vm = this
  38622. var _h = _vm.$createElement
  38623. var _c = _vm._self._c || _h
  38624. return _c(
  38625. "svg",
  38626. { attrs: { viewBox: "0 0 48 48", xmlns: "http://www.w3.org/2000/svg" } },
  38627. [
  38628. _c("path", {
  38629. attrs: {
  38630. d:
  38631. "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"
  38632. }
  38633. })
  38634. ]
  38635. )
  38636. }
  38637. var icon_successvue_type_template_id_18119418_staticRenderFns = []
  38638. icon_successvue_type_template_id_18119418_render._withStripped = true
  38639. // CONCATENATED MODULE: ./packages/result/src/icon-success.vue?vue&type=template&id=18119418&
  38640. // 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&
  38641. //
  38642. //
  38643. //
  38644. //
  38645. //
  38646. //
  38647. //
  38648. //
  38649. /* harmony default export */ var icon_successvue_type_script_lang_js_ = ({
  38650. name: 'IconSuccess'
  38651. });
  38652. // CONCATENATED MODULE: ./packages/result/src/icon-success.vue?vue&type=script&lang=js&
  38653. /* harmony default export */ var src_icon_successvue_type_script_lang_js_ = (icon_successvue_type_script_lang_js_);
  38654. // CONCATENATED MODULE: ./packages/result/src/icon-success.vue
  38655. /* normalize component */
  38656. var icon_success_component = normalizeComponent(
  38657. src_icon_successvue_type_script_lang_js_,
  38658. icon_successvue_type_template_id_18119418_render,
  38659. icon_successvue_type_template_id_18119418_staticRenderFns,
  38660. false,
  38661. null,
  38662. null,
  38663. null
  38664. )
  38665. /* hot reload */
  38666. if (false) { var icon_success_api; }
  38667. icon_success_component.options.__file = "packages/result/src/icon-success.vue"
  38668. /* harmony default export */ var icon_success = (icon_success_component.exports);
  38669. // 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&
  38670. var icon_errorvue_type_template_id_21199246_render = function() {
  38671. var _vm = this
  38672. var _h = _vm.$createElement
  38673. var _c = _vm._self._c || _h
  38674. return _c(
  38675. "svg",
  38676. { attrs: { viewBox: "0 0 48 48", xmlns: "http://www.w3.org/2000/svg" } },
  38677. [
  38678. _c("path", {
  38679. attrs: {
  38680. d:
  38681. "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"
  38682. }
  38683. })
  38684. ]
  38685. )
  38686. }
  38687. var icon_errorvue_type_template_id_21199246_staticRenderFns = []
  38688. icon_errorvue_type_template_id_21199246_render._withStripped = true
  38689. // CONCATENATED MODULE: ./packages/result/src/icon-error.vue?vue&type=template&id=21199246&
  38690. // 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&
  38691. //
  38692. //
  38693. //
  38694. //
  38695. //
  38696. //
  38697. //
  38698. //
  38699. /* harmony default export */ var icon_errorvue_type_script_lang_js_ = ({
  38700. name: 'IconError'
  38701. });
  38702. // CONCATENATED MODULE: ./packages/result/src/icon-error.vue?vue&type=script&lang=js&
  38703. /* harmony default export */ var src_icon_errorvue_type_script_lang_js_ = (icon_errorvue_type_script_lang_js_);
  38704. // CONCATENATED MODULE: ./packages/result/src/icon-error.vue
  38705. /* normalize component */
  38706. var icon_error_component = normalizeComponent(
  38707. src_icon_errorvue_type_script_lang_js_,
  38708. icon_errorvue_type_template_id_21199246_render,
  38709. icon_errorvue_type_template_id_21199246_staticRenderFns,
  38710. false,
  38711. null,
  38712. null,
  38713. null
  38714. )
  38715. /* hot reload */
  38716. if (false) { var icon_error_api; }
  38717. icon_error_component.options.__file = "packages/result/src/icon-error.vue"
  38718. /* harmony default export */ var icon_error = (icon_error_component.exports);
  38719. // 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&
  38720. var icon_warningvue_type_template_id_46fe8f31_render = function() {
  38721. var _vm = this
  38722. var _h = _vm.$createElement
  38723. var _c = _vm._self._c || _h
  38724. return _c(
  38725. "svg",
  38726. { attrs: { viewBox: "0 0 48 48", xmlns: "http://www.w3.org/2000/svg" } },
  38727. [
  38728. _c("path", {
  38729. attrs: {
  38730. d:
  38731. "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"
  38732. }
  38733. })
  38734. ]
  38735. )
  38736. }
  38737. var icon_warningvue_type_template_id_46fe8f31_staticRenderFns = []
  38738. icon_warningvue_type_template_id_46fe8f31_render._withStripped = true
  38739. // CONCATENATED MODULE: ./packages/result/src/icon-warning.vue?vue&type=template&id=46fe8f31&
  38740. // CONCATENATED MODULE: ./node_modules/vue-loader/lib??vue-loader-options!./packages/result/src/icon-warning.vue?vue&type=script&lang=ts&
  38741. /* harmony default export */ var icon_warningvue_type_script_lang_ts_ = ({
  38742. name: 'IconWarning'
  38743. });
  38744. // CONCATENATED MODULE: ./packages/result/src/icon-warning.vue?vue&type=script&lang=ts&
  38745. /* harmony default export */ var src_icon_warningvue_type_script_lang_ts_ = (icon_warningvue_type_script_lang_ts_);
  38746. // CONCATENATED MODULE: ./packages/result/src/icon-warning.vue
  38747. /* normalize component */
  38748. var icon_warning_component = normalizeComponent(
  38749. src_icon_warningvue_type_script_lang_ts_,
  38750. icon_warningvue_type_template_id_46fe8f31_render,
  38751. icon_warningvue_type_template_id_46fe8f31_staticRenderFns,
  38752. false,
  38753. null,
  38754. null,
  38755. null
  38756. )
  38757. /* hot reload */
  38758. if (false) { var icon_warning_api; }
  38759. icon_warning_component.options.__file = "packages/result/src/icon-warning.vue"
  38760. /* harmony default export */ var icon_warning = (icon_warning_component.exports);
  38761. // 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&
  38762. var icon_infovue_type_template_id_19e3de69_render = function() {
  38763. var _vm = this
  38764. var _h = _vm.$createElement
  38765. var _c = _vm._self._c || _h
  38766. return _c(
  38767. "svg",
  38768. { attrs: { viewBox: "0 0 48 48", xmlns: "http://www.w3.org/2000/svg" } },
  38769. [
  38770. _c("path", {
  38771. attrs: {
  38772. d:
  38773. "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"
  38774. }
  38775. })
  38776. ]
  38777. )
  38778. }
  38779. var icon_infovue_type_template_id_19e3de69_staticRenderFns = []
  38780. icon_infovue_type_template_id_19e3de69_render._withStripped = true
  38781. // CONCATENATED MODULE: ./packages/result/src/icon-info.vue?vue&type=template&id=19e3de69&
  38782. // CONCATENATED MODULE: ./node_modules/vue-loader/lib??vue-loader-options!./packages/result/src/icon-info.vue?vue&type=script&lang=ts&
  38783. /* harmony default export */ var icon_infovue_type_script_lang_ts_ = ({
  38784. name: 'IconInfo'
  38785. });
  38786. // CONCATENATED MODULE: ./packages/result/src/icon-info.vue?vue&type=script&lang=ts&
  38787. /* harmony default export */ var src_icon_infovue_type_script_lang_ts_ = (icon_infovue_type_script_lang_ts_);
  38788. // CONCATENATED MODULE: ./packages/result/src/icon-info.vue
  38789. /* normalize component */
  38790. var icon_info_component = normalizeComponent(
  38791. src_icon_infovue_type_script_lang_ts_,
  38792. icon_infovue_type_template_id_19e3de69_render,
  38793. icon_infovue_type_template_id_19e3de69_staticRenderFns,
  38794. false,
  38795. null,
  38796. null,
  38797. null
  38798. )
  38799. /* hot reload */
  38800. if (false) { var icon_info_api; }
  38801. icon_info_component.options.__file = "packages/result/src/icon-info.vue"
  38802. /* harmony default export */ var icon_info = (icon_info_component.exports);
  38803. // 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&
  38804. var result_srcvue_type_script_lang_js_components;
  38805. //
  38806. //
  38807. //
  38808. //
  38809. //
  38810. //
  38811. //
  38812. //
  38813. //
  38814. //
  38815. //
  38816. //
  38817. //
  38818. //
  38819. //
  38820. //
  38821. //
  38822. //
  38823. //
  38824. //
  38825. //
  38826. //
  38827. var IconMap = {
  38828. success: 'icon-success',
  38829. warning: 'icon-warning',
  38830. error: 'icon-error',
  38831. info: 'icon-info'
  38832. };
  38833. /* harmony default export */ var result_srcvue_type_script_lang_js_ = ({
  38834. name: 'ElResult',
  38835. 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),
  38836. props: {
  38837. title: {
  38838. type: String,
  38839. default: ''
  38840. },
  38841. subTitle: {
  38842. type: String,
  38843. default: ''
  38844. },
  38845. icon: {
  38846. type: String,
  38847. default: 'info'
  38848. }
  38849. },
  38850. computed: {
  38851. iconElement: function iconElement() {
  38852. var icon = this.icon;
  38853. return icon && IconMap[icon] ? IconMap[icon] : 'icon-info';
  38854. }
  38855. }
  38856. });
  38857. // CONCATENATED MODULE: ./packages/result/src/index.vue?vue&type=script&lang=js&
  38858. /* harmony default export */ var packages_result_srcvue_type_script_lang_js_ = (result_srcvue_type_script_lang_js_);
  38859. // CONCATENATED MODULE: ./packages/result/src/index.vue
  38860. /* normalize component */
  38861. var result_src_component = normalizeComponent(
  38862. packages_result_srcvue_type_script_lang_js_,
  38863. srcvue_type_template_id_3408b139_render,
  38864. srcvue_type_template_id_3408b139_staticRenderFns,
  38865. false,
  38866. null,
  38867. null,
  38868. null
  38869. )
  38870. /* hot reload */
  38871. if (false) { var result_src_api; }
  38872. result_src_component.options.__file = "packages/result/src/index.vue"
  38873. /* harmony default export */ var result_src = (result_src_component.exports);
  38874. // CONCATENATED MODULE: ./packages/result/index.js
  38875. /* istanbul ignore next */
  38876. result_src.install = function (Vue) {
  38877. Vue.component(result_src.name, result_src);
  38878. };
  38879. /* harmony default export */ var packages_result = (result_src);
  38880. // CONCATENATED MODULE: ./src/index.js
  38881. /* Automatically generated by './build/bin/build-entry.js' */
  38882. 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];
  38883. var src_install = function install(Vue) {
  38884. var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  38885. lib_locale_default.a.use(opts.locale);
  38886. lib_locale_default.a.i18n(opts.i18n);
  38887. components.forEach(function (component) {
  38888. Vue.component(component.name, component);
  38889. });
  38890. Vue.use(infinite_scroll);
  38891. Vue.use(packages_loading.directive);
  38892. Vue.prototype.$ELEMENT = {
  38893. size: opts.size || '',
  38894. zIndex: opts.zIndex || 2000
  38895. };
  38896. Vue.prototype.$loading = packages_loading.service;
  38897. Vue.prototype.$msgbox = message_box;
  38898. Vue.prototype.$alert = message_box.alert;
  38899. Vue.prototype.$confirm = message_box.confirm;
  38900. Vue.prototype.$prompt = message_box.prompt;
  38901. Vue.prototype.$notify = notification;
  38902. Vue.prototype.$message = packages_message;
  38903. };
  38904. /* istanbul ignore if */
  38905. if (typeof window !== 'undefined' && window.Vue) {
  38906. src_install(window.Vue);
  38907. }
  38908. /* harmony default export */ var src_0 = __webpack_exports__["default"] = ({
  38909. version: '2.15.13',
  38910. locale: lib_locale_default.a.use,
  38911. i18n: lib_locale_default.a.i18n,
  38912. install: src_install,
  38913. CollapseTransition: collapse_transition_default.a,
  38914. Loading: packages_loading,
  38915. Pagination: packages_pagination,
  38916. Dialog: dialog,
  38917. Autocomplete: packages_autocomplete,
  38918. Dropdown: packages_dropdown,
  38919. DropdownMenu: packages_dropdown_menu,
  38920. DropdownItem: packages_dropdown_item,
  38921. Menu: packages_menu,
  38922. Submenu: packages_submenu,
  38923. MenuItem: packages_menu_item,
  38924. MenuItemGroup: packages_menu_item_group,
  38925. Input: packages_input,
  38926. InputNumber: packages_input_number,
  38927. Radio: packages_radio,
  38928. RadioGroup: packages_radio_group,
  38929. RadioButton: packages_radio_button,
  38930. Checkbox: packages_checkbox,
  38931. CheckboxButton: packages_checkbox_button,
  38932. CheckboxGroup: packages_checkbox_group,
  38933. Switch: packages_switch,
  38934. Select: packages_select,
  38935. Option: packages_option,
  38936. OptionGroup: packages_option_group,
  38937. Button: packages_button,
  38938. ButtonGroup: packages_button_group,
  38939. Table: packages_table,
  38940. TableColumn: packages_table_column,
  38941. DatePicker: packages_date_picker,
  38942. TimeSelect: packages_time_select,
  38943. TimePicker: packages_time_picker,
  38944. Popover: popover,
  38945. Tooltip: packages_tooltip,
  38946. MessageBox: message_box,
  38947. Breadcrumb: packages_breadcrumb,
  38948. BreadcrumbItem: packages_breadcrumb_item,
  38949. Form: packages_form,
  38950. FormItem: packages_form_item,
  38951. Tabs: packages_tabs,
  38952. TabPane: packages_tab_pane,
  38953. Tag: packages_tag,
  38954. Tree: packages_tree,
  38955. Alert: packages_alert,
  38956. Notification: notification,
  38957. Slider: slider,
  38958. Icon: packages_icon,
  38959. Row: packages_row,
  38960. Col: packages_col,
  38961. Upload: packages_upload,
  38962. Progress: packages_progress,
  38963. Spinner: packages_spinner,
  38964. Message: packages_message,
  38965. Badge: badge,
  38966. Card: card,
  38967. Rate: packages_rate,
  38968. Steps: packages_steps,
  38969. Step: packages_step,
  38970. Carousel: carousel,
  38971. Scrollbar: scrollbar,
  38972. CarouselItem: carousel_item,
  38973. Collapse: packages_collapse,
  38974. CollapseItem: packages_collapse_item,
  38975. Cascader: packages_cascader,
  38976. ColorPicker: color_picker,
  38977. Transfer: transfer,
  38978. Container: packages_container,
  38979. Header: header,
  38980. Aside: aside,
  38981. Main: packages_main,
  38982. Footer: footer,
  38983. Timeline: timeline,
  38984. TimelineItem: timeline_item,
  38985. Link: packages_link,
  38986. Divider: divider,
  38987. Image: packages_image,
  38988. Calendar: calendar,
  38989. Backtop: backtop,
  38990. InfiniteScroll: infinite_scroll,
  38991. PageHeader: page_header,
  38992. CascaderPanel: packages_cascader_panel,
  38993. Avatar: avatar,
  38994. Drawer: drawer,
  38995. Statistic: statistic,
  38996. Popconfirm: popconfirm,
  38997. Skeleton: skeleton,
  38998. SkeletonItem: skeleton_item,
  38999. Empty: empty,
  39000. Descriptions: descriptions,
  39001. DescriptionsItem: packages_descriptions_item,
  39002. Result: packages_result
  39003. });
  39004. /***/ })
  39005. /******/ ])["default"];